Advertisement
Guest User

WitherFarmRD

a guest
Apr 24th, 2015
197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.08 KB | None | 0 0
  1. mon = peripheral.wrap("top")
  2. starting = false
  3. if starting == false then
  4.   mon.clear()
  5.   monW = mon.getSize()
  6.   mon.setCursorPos(monW/2 - (31/2),1)
  7.   mon.setTextScale(.5)
  8.   mon.setTextColor(colors.orange)
  9.   starting = true
  10. end
  11.  
  12. function main()
  13. term.clear()
  14. term.setTextColor(colors.lime)
  15. print("Do Not Request More Than 64 Nether Stars!")
  16. write("# of Nether Stars Wanted : ")
  17.  
  18. request = tonumber(read())
  19. if not request then
  20.   term.clear()
  21.   term.setCursorPos(1,1)
  22.   term.setTextColor(colors.red)
  23.   print("Invalid Input")
  24.   term.setTextColor(colors.white)
  25.   os.sleep(2)
  26.   main()
  27. else -- "request" == Integer
  28.   if request > 64 then
  29.     term.clear()
  30.     term.setCursorPos(1,1)
  31.     term.setTextColor(colors.red)
  32.     print("Amount Exceeds 64...")
  33.     term.setTextColor(colors.white)
  34.     os.sleep(2)
  35.     main()
  36.   end
  37. end
  38.  
  39. orderDone = false
  40. time = request + 9
  41.  
  42. while orderDone == false do
  43.   os.sleep(.5)
  44.   requestLeft = request
  45.  
  46.   mon.clear()
  47.   mon.setCursorPos(1,1)
  48.  
  49.   mon.setTextScale(.5)
  50.  
  51.   local monW = mon.getSize()
  52.   mon.setCursorPos(monW/2 - (31/2),1)
  53.   mon.setTextColor(colors.orange)
  54.   mon.write("Wither Farm v1.0 by RoughDragon")
  55.  
  56.   mon.setTextColor(colors.lime)
  57.   mon.setCursorPos(1,3)
  58.   mon.write("Approximate Time Left : " .. time .. " Seconds")
  59.   mon.setCursorPos(1,4)
  60.   mon.write("Wither Bosses Remaining : " .. requestLeft)
  61.  
  62.   -- Wither Spawning Here
  63.   if request ~= 0 then
  64.     redstone.setOutput("back", true)
  65.     request = request - 1
  66.   end
  67.  
  68.   if time ~= 0 then
  69.     time = time - 1
  70.   end
  71.  
  72.   if time == 0 then
  73.     orderDone = true
  74.     term.clear()
  75.    
  76.     mon.clear()
  77.     local monW = mon.getSize()
  78.     local orderdoneText =  "ORDER COMPLETE! TAKE STARS FROM ENDER CHEST"
  79.     mon.setCursorPos(monW/2 - (#orderdoneText/2),6)
  80.     mon.setTextColor(colors.yellow)
  81.     mon.write(orderdoneText)
  82.     os.sleep(5)
  83.     mon.clear()
  84.     term.clear()
  85.     os.reboot()
  86.   end
  87.  
  88.   os.sleep(.5)
  89.   redstone.setOutput("back", false)
  90. end
  91.  
  92. end -- Closes Function "main()"
  93.  
  94. mon.write("Wither Farm v1.0 by RoughDragon")
  95. main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement