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

[1.3] Turtle Autoboot

Started by vvenaya, 25 February 2012 - 10:12 AM
vvenaya #1
Posted 25 February 2012 - 11:12 AM
DESCRIPTION
place this code inside a computer's startup code to have a turtle next to it reboot whenever A) the computer gets a redstone signal or :P/>/> Turtle is created next to the computer

USES
I use this code to autoload a turtle with software (from a drive underneath the turtle)


STARTUP

local function nz(c,r) if c then return c else return (r or "") end end

term.clear()
term.setCursorPos(1,1)

print("Turtle autoBoot v1")
print("===================")

local fSize=""

while true do
  event,param,p2,p3 = os.pullEvent()
  if event=="peripheral" then
	fSide=param
	peripheral.wrap(fSide).reboot()
	print("BOT created, Autolaunching")
  elseif event=="redstone" then
	if rs.getInput("back") then
	  peripheral.wrap(fSide).reboot()
	  print("BOT on pad, REBOOT.")
	end
  end
end

Mikeyjd25 #2
Posted 05 September 2012 - 05:21 AM
thanks for the code, very helpful :D/>/>