turn on/off turtle

  • Please make sure you are posting in the correct place. Server ads go here and modpack bugs go here
  • The FTB Forum is now read-only, and is here as an archive. To participate in our community discussions, please join our Discord! https://ftb.team/discord

schmru

New Member
Jul 29, 2019
36
0
1
Hello!

Can anyone tell me if it is possible to turn turtles (and computers) on with redstone signal or any other way without having to be next to them?

I need this because i'm creating a mobfarm and would be realy nice if i could turn on and off melle turtles and control computer on the farm.

Thanks for any help
 

Peragore

New Member
Jul 29, 2019
2
0
0
I think it is something like redstone.getInput("(side)"), with (side) being Left, Right, etc. You can then just do something like

while true do
if redstone.getInput("Back") do
turtle.attack()
end
end
 

schmru

New Member
Jul 29, 2019
36
0
1
i know that, but i would like to turn it on after it would be shut down, so that it wouldn't run all the time, only when i would need it
 

Poppycocks

New Member
Jul 29, 2019
1,914
0
0
I think it is something like redstone.getInput("(side)"), with (side) being Left, Right, etc. You can then just do something like

while true do
if redstone.getInput("Back") do
turtle.attack()
end
end
No you can't, you'll get a "too long without yealding" I think...


The commonly used method for waiting for a rs signal is
Code:
while true do
while true do
os.pullEvent("redstone")
if redstone.getInput("left") then break end
sleep(1)
end
turtle.attack()
end
[DOUBLEPOST=1360869404][/DOUBLEPOST]
i know that, but i would like to turn it on after it would be shut down, so that it wouldn't run all the time, only when i would need it
No can't do.

You need a program that runs constantly, even after reloading the world, the common method is naming the program "startup". Then just make sure it actually does something after you give it the signal.
 

ThemsAllTook

New Member
Jul 29, 2019
386
0
0
You could have your script sleep and occasionally poll for redstone signal to resume its work. Better yet, use a modem and rednet.receive() to block until it gets a command to do something from a nearby computer.
 

Peragore

New Member
Jul 29, 2019
2
0
0
Yeah. Only problem is that is would still be running. I know of no way to actually tell it to turn on on command. Someone write a plugin!
 

schmru

New Member
Jul 29, 2019
36
0
1
No don't need a plugin, thanks any way, just want too use pure direwolf20 pack, will just make it to run all the time waiting for wireles signal or as i have it right now attacking constantly

Just hope it dosen't create to much work for server
 

ThemsAllTook

New Member
Jul 29, 2019
386
0
0
Sleeping or blocking on a call like rednet.receive() should theoretically use little to no CPU time on the server, though I don't know the implementation details of Computercraft. Attacking continuously would likely use more since it needs to check for entities in front of itself on every attack.