This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
steffen03's profile picture

how to run a farming program from a computer?

Started by steffen03, 03 November 2014 - 07:38 PM
steffen03 #1
Posted 03 November 2014 - 08:38 PM
hello, i'm really new to this whole computercraft thing, i cant write code myself, but i have found a super nice farming program that i have modified a littel (only the wait time).
my question is, i use the same program on about 10 different turtles, and i belive there is a way to activate all of them at the same time so i dont have to go to every turtle and run the program, it's called farm.
this is the program

http://pastebin.com/qQdAcBYY

if somone can tell me exatly what to type in the computer and the turtles do make it so i only have to type the word farm in the computer and they all start farming it wueld help alot! i have been serching for tutorials for a while but havent found any that show how i can run a program from pastebin on multiple turtles by just using a computer:(

and tell me exactly what to type, cause i'm really stupid at this stuff :P/>
KingofGamesYami #2
Posted 03 November 2014 - 09:30 PM
Use this as the startup program on the turtles

while true do
  local id, msg = rednet.recieve()
  if id == 9 and msg == "start" then --#insert id of main computer where 9 is
    shell.run( "farm" )
  end
end

Use this as the program to start them on the main computer

rednet.broadcast( "start" )
steffen03 #3
Posted 03 November 2014 - 10:30 PM
it's not working, when i reboot the turtle it says
startup:2: attempt to call nil

and the computer is saying

no such program
metron80 #4
Posted 04 November 2014 - 03:46 AM
it's not working, when i reboot the turtle it says
startup:2: attempt to call nil
Did you type it in correctly?

and the computer is saying

no such program
You have to run "lua" then type this in:

rednet.broadcast( "start" )
Bomb Bloke #5
Posted 04 November 2014 - 03:51 AM
Did you type it in correctly?

To be clear on this, line two should read:

local id, msg = rednet.receive()

It'd pay to stick this in at the top of the startup script, too:

rednet.open("right")

… at least I think the modem'll be on the right…
Edited on 04 November 2014 - 02:52 AM
steffen03 #6
Posted 04 November 2014 - 01:42 PM
thanks alot guys, you all helped alot, it works now :)/>
metron80 #7
Posted 04 November 2014 - 02:23 PM
It'd pay to stick this in at the top of the startup script, too:

rednet.open("right")

… at least I think the modem'll be on the right…

Just put whatever side your wireless modem will be on in the quotes of rednet.open.