Guest User

startup

a guest
Apr 15th, 2023
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.77 KB | None | 0 0
  1. rednet.open('back')
  2. status = nil
  3.  
  4. while true do
  5.   if status == nil then
  6.     print("Send status to #148")
  7.     rednet.send(148, "status")
  8.     local res1, res2 = rednet.receive()
  9.     status = res2
  10.     print("Received status: "..tostring(status).."\nReload..")
  11.     sleep(4)
  12.   end
  13.  
  14.   if status then
  15.     term.clear()
  16.     term.setCursorPos(1, 1)
  17.     print("CLICCA UN TASTO PER PARTIRE!")
  18.     os.pullEvent('key')
  19.     rednet.send(148, "down")
  20.     print("\nL'ascensore sta scendendo...")
  21.     rednet.receive()
  22.     status = false
  23.   else
  24.     term.clear()
  25.     term.setCursorPos(1, 1)
  26.     print("CLICCA UN TASTO PER CHIAMARE")
  27.     os.pullEvent('key')
  28.     rednet.send(148, "up")
  29.     print("\nL'ascensore sta salendo...")
  30.     rednet.receive()
  31.     status = true
  32.   end
  33. end
Advertisement
Add Comment
Please, Sign In to add comment