Advertisement
SythsGod

Wither Receive Program

Jan 29th, 2015
207
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. rednet.close("left")
  2. rednet.open("left")
  3.  
  4. local inputSide = "back"
  5. local blue = 2048
  6.  
  7. function SwitchColor(switch)
  8.   if switch then
  9.     term.setTextColor(colors.white)
  10.   else
  11.     term.setTextColor(colors.red)
  12.   end
  13. end
  14.  
  15. function Move()
  16.   SwitchColor(true)
  17.   print("-- BUILDING --")
  18.   rednet.send(40, "BUILD", "UPDATE")
  19.   sleep(.1)
  20.   shell.run("move")
  21. end
  22.  
  23. function Redst()
  24.   SwitchColor(false)
  25.   print("-- KILLING --")
  26.   rednet.send(40, "REDST", "UPDATE")
  27.   sleep(.1)
  28.   shell.run("redstone")
  29. end
  30.  
  31. function Test()
  32.   SwitchColor(true)
  33.   print("-- DEPOSITING --")
  34.   shell.run("test")
  35. end
  36.  
  37. function Execute()
  38.   Move()
  39.   sleep(.1)
  40.   Redst()
  41.   sleep(2)
  42.   Test()
  43.   sleep(.1)
  44. end
  45.  
  46. while true do
  47.   os.pullEvent("redstone")
  48.   local signal = rs.getBundledInput(inputSide)
  49.   if signal == blue then
  50.     SwitchColor(false)
  51.     print("-- INITIATING --")
  52.     Execute()
  53.     rednet.send(40, "END", "UPDATE")
  54.   end
  55.   SwitchColor(false)
  56.   print("-- LOOPING --")
  57.   SwitchColor(true)
  58.   print("-------------")
  59.   sleep(1)
  60. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement