Cardwell

Enkeltimer

Apr 9th, 2021 (edited)
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. --Timer
  2. local starttimer = "1"
  3. local stoptimer = "2"
  4.  
  5. local timerstatus = ""
  6. local spawner = 14
  7.  
  8. rednet.open("left")
  9. while true do
  10. term.clear()
  11. term.setCursorPos(1,1)
  12. print("1. For å åpne system for autocrafting")
  13. print("2. For å lukke system")
  14. print("Åpem/lukket: ")
  15. print(timerstatus)
  16. term.setCursorPos(1,5)
  17. write("Kjør program: ")
  18.  
  19. pw = read()
  20.  
  21. if timerstatus == 1 then
  22. rednet.broadcast("spawnwither")
  23. sleep(spawner)
  24. end
  25.  
  26. if timerstatus == 0 then
  27. sleep(1)
  28. end
  29.  
  30. if pw == starttimer then
  31. timerstatus = 1
  32. end
  33.  
  34. if pw == stoptimer then
  35. timerstatus = 0
  36. end
  37. end
  38.  
  39.  
  40.  
Add Comment
Please, Sign In to add comment