Wardes

enderfarm_spawner

Apr 20th, 2021 (edited)
419
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. --By Wardes
  2. shell.run("label set Spawner")
  3. shell.run("clear")
  4. print("Start enderfarm_spawner")
  5.  
  6. redstoneSide = "top"
  7. mPort = 1
  8. mModem = peripheral.find("modem")
  9.  
  10. while true do
  11.   if mModem.isOpen(mPort) then
  12.     event, side, channel, replyChannel, message, distance = os.pullEvent("modem_message")
  13.     if message == "turnOnSpawner" then
  14.       redstone.setOutput(redstoneSide, true)
  15.       term.setTextColor (colors.green)
  16.       print("Turn On spawner")
  17.     elseif message == "turnOffSpawner" then
  18.       redstone.setOutput(redstoneSide, false)
  19.       term.setTextColor (colors.red)
  20.       print("Turn Off spawner")
  21.     elseif message == "reboot" then
  22.       shell.run("reboot")
  23.     end
  24.   else
  25.     mModem.open(mPort)
  26.   end
  27. end
  28.  
RAW Paste Data