Need some help with some coding and more

  • Please make sure you are posting in the correct place. Server ads go here and modpack bugs go here
  • FTB will be shutting down this forum by the end of July. To participate in our community discussions, please join our Discord! https://ftb.team/discord

Punker180

New Member
Jul 29, 2019
3
0
0
First off I play on a private server with some close friends and I wanna set up a few nice things.
First things first i was looking for a computercraft code for a mob farm to make the turtle attack what's in front of them and deposit its loot in a chest directly behind it. I heard its simple but im not a coder AT ALL.
Next i would like a way to make gregtech easier? on our private server i combined every single mod pack ftb has and removed advanced solars and kept compact solars. and nobody like the difficulty that hard gregtech offers (considering we only play on weekends). Next I was wondering whats the best BC start engine? we usually start with either the hobbyist steam engine or the steam engine from thermal. whats the best route to go?
 

ILoveGregTech

New Member
Jul 29, 2019
788
0
0
Look up computer craft forums in google
There are literally thousands of people who wrote down the code they created
Secondly for gregtech HardMode you need to go into config options
Lastly I like hobbyist
 

nevakanezah

New Member
Jul 29, 2019
177
0
0
There's a config file to revert most of the gregtech changes. It's on the FTB forum, but i haven't got the link handy. You'd need to have everyone apply the new config, and do it on the server as well.

I think the best engine is TE's steam engine, but dont know why for sure.

I'll see what i can do for turtle code. one sec.
 

Neirin

New Member
Jul 29, 2019
590
0
0
For GT, look through GregTech.cfg and Recipes.cfg. Pay particular attention to the cheaperrecipes section of Recipes.cfg.

For the turtle, it's much easier if you have it deposit in a chest above or below it because then it doesn't need to turn around. However, the scrip with the chest behind isn't too difficult and would look something like this:

Code:
while true do
    turtle.attack()
    turtle.turnRight()
    turtle.turnRight()
    turtle.drop()
    turtle.turnRight()
    turtle.turnRight()
end

With the chest above:

Code:
while true do
    turtle.attack()
    turtle.dropUp()
end

These can be written better than that, but I just mocked up something quick and dirty.
 

nevakanezah

New Member
Jul 29, 2019
177
0
0
Code:
while true do
  turtle.attack()
  if (turtle.getItemCount(0) > 16) then
    for i=0,16 do
      turtle.dropDown(i)
    end
  end
end
Should drop everything when stack 1 gets 16 items or more. Not tested though, so could have a runtime error or two.
 

Silent_007

New Member
Jul 29, 2019
302
0
0
Also, if you want any of that code to be running at all times (rather than needing to restart the programs manually whenever the turtles get reloaded) you should do an "edit startup" and save one of three above programs into there. Then just reboot the turtle and it should be good to go forever.

EDIT: Also, it wouldn't be a bad idea to insert a line like "turtle.sleep(0.5)" somewhere into each of those programs. You probably don't need the while loop to repeat immediately, and if you have a bunch of turtles that may begin to be a contributor to lag...
 

Punker180

New Member
Jul 29, 2019
3
0
0
thanks for all the help guys! ill try out the code you guys gave me and figure out the best one you guys are very helpful thanks!