Advertisement
nauseant

CC network remote

May 11th, 2024 (edited)
758
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.64 KB | None | 0 0
  1. MASTER_CHANNEL = 5452
  2. ELEVATOR_CHANNEL = 47883
  3.  
  4. modem = peripheral.find("modem") or error("No modem attached", 0)
  5. args = {...}
  6. recentChannel = 0
  7.  
  8. function jobSelect()
  9.     if args[1] == nil then
  10.         print("No valid job selected!")
  11.         print("'remote [job] [task] [label]'")
  12.         print("E.G. remote elevator call windmill")
  13.     elseif args[1] == "elevator" then
  14.         local transmission = args[2].." "..args[3]
  15.         modem.transmit(ELEVATOR_CHANNEL, MASTER_CHANNEL, transmission)
  16.         print("Task signal sent: "..transmission)
  17.         recentChannel = ELEVATOR_CHANNEL
  18.     end
  19.  
  20. end
  21. modem.open(MASTER_CHANNEL)
  22. jobSelect()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement