csmit195

Auto TNT Placer

Sep 30th, 2018
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.38 KB | None | 0 0
  1. local tntTimer
  2.  
  3. function init()
  4.     tntTimer = os.startTimer(300)
  5.     placeBlock()
  6.     while true do
  7.       local event, timerID = os.pullEvent("timer")
  8.       if ( event == "timer" and timerID == tntTimer ) then
  9.         placeBlock()
  10.         tntTimer = os.startTimer(300)
  11.       end
  12.     end
  13. end
  14.  
  15. function placeBlock()
  16.     rs.setOutput('back', true)
  17.     sleep(0.5)
  18.     rs.setOutput('back', false)
  19. end
  20.  
  21. init()
Advertisement
Add Comment
Please, Sign In to add comment