Advertisement
RTS_Dmitriy

Lift control

Feb 10th, 2024 (edited)
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.48 KB | Gaming | 0 0
  1. CURRENT_FLOOR = 1
  2. SECRET = 'first'
  3.  
  4. rednet.open('back')
  5.  
  6. while true do
  7.     print('Which floor do you need?')
  8.     write('Enter the number: ')
  9.     floor = read()
  10.     floor = tonumber(floor)
  11.  
  12.     if floor == CURRENT_FLOOR then
  13.         print('You are already at this floor')
  14.     elseif floor == nil or floor < 0 or floor > 3 then
  15.         print('Wrong input, try again')
  16.     else
  17.         print('Activating teleporter...')
  18.         rednet.broadcast(floor, SECRET)
  19.     end
  20. end
  21.  
Tags: RTS
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement