Advertisement
gpochy

inoculator

Oct 23rd, 2013
37
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.66 KB | None | 0 0
  1. p = peripheral.wrap("front")
  2. m = peripheral.wrap("top")
  3. m.clear()
  4. cas = 50
  5. function serum()
  6. s = p.getStackInSlot(15)
  7.   if s then
  8.     while s.dmg < 14 do
  9.     sleep(5)
  10.     m.clear()
  11.     s = p.getStackInSlot(15)
  12.     m.setCursorPos(1,1)
  13.     m.write(s.name)
  14.     m.setCursorPos(1,2)
  15.     m.write("Nabito na "..s.dmg)
  16.     m.setCursorPos(1,5)
  17.     cas = cas - 5
  18.     m.write(tostring(cas))
  19.     if cas = 0 then
  20.       cas = 50
  21.     end
  22.     end
  23.   m.write("Hotovo ...")
  24.   p.pushIntoSlot("north",15,1,1)
  25.   rs.setOutput("left", true)
  26.   sleep(1)
  27.   rs.setOutput("left", false)
  28.   end
  29. m.clear()
  30. m.write("dalsi kontrola >")
  31. end
  32.  
  33. while true do
  34. serum()
  35. sleep(5)
  36. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement