Advertisement
SythsGod

Wither Send Program

Jan 29th, 2015
203
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.01 KB | None | 0 0
  1. rednet.close("left")
  2. rednet.open("left")
  3.  
  4. function Execute()
  5.   term.setTextColor(colors.lime)  
  6.  
  7.   rs.setOutput("bottom", true)
  8.   sleep(.5)
  9.   rs.setOutput("bottom", false)
  10.  
  11.   repeat
  12.     local sndrId, msg, dist, prot = rednet.receive("UPDATE")
  13.     if msg == "BUILD" then
  14.       print("Currently building Teh Wither...")
  15.     elseif msg == "REDST" then
  16.       print("Currently killing Teh Wither...")
  17.     elseif msg == "END" then
  18.       print("Killed Teh Wither...")
  19.       print("---------------------------")
  20.     end
  21.   until msg == "END"
  22. end
  23.  
  24. function clear()
  25.   term.clear()
  26.   term.setCursorPos(1,1)
  27. end
  28.  
  29. clear()
  30.  
  31. while true do
  32.   term.setTextColor(colors.white)
  33.   local input = read()
  34.   if input == "kill" then
  35.     clear()
  36.     Execute()
  37.   elseif tonumber(input) ~= nil then
  38.     clear()
  39.     for i = 0, tonumber(input) do
  40.       print("Running for the #"..input.." time..")
  41.       Execute()
  42.     end
  43.   else
  44.     clear()
  45.     print("Either specify an amount or type 'KILL'")
  46.   end
  47.  
  48.   sleep(1)
  49. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement