Advertisement
Guest User

parkur

a guest
Oct 1st, 2014
190
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.71 KB | None | 0 0
  1. --Variables
  2. local ex = peripheral.wrap("left")
  3. bel = 1
  4. ora = 2
  5. mag = 4
  6. lblu = 8
  7. yel = 16
  8. lim = 32
  9. pin = 64
  10. gre = 128
  11. lgre = 256
  12. local steps = {bel,ora,mag,lblu,yel,lim,pin,gre,lgre}
  13.  
  14. --Functions
  15.  
  16.  
  17. --Code
  18. term.clear()
  19. term.setCursorPos(1,1)
  20. ex.setOutput(0)
  21. term.setTextColor(colors.lime)
  22. print("Working")
  23. while true do
  24.  ev, p1 = os.pullEvent()
  25.  
  26.   if ev =="redstone" then
  27.    while true do
  28.     r = math.random(1,9)
  29.     m = math.random(1,9)
  30.     k = math.random(1,9)
  31.     t = math.random(1,9)
  32.     ex.setOutput(steps[r]+steps[m]+steps[k]+steps[t])
  33.     sleep(1.0)
  34.     ex.setOutput(0)
  35.     sleep(1.0)
  36.    end
  37.   end
  38.   if (ev == "key") and (p1 == 16) then
  39.    ex.setOutput(0)
  40.    break
  41.   end  
  42. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement