Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- args = tonumber(...)
- component = require("component")
- computer = require("computer")
- m = component.proxy(component.list("modem")())
- m.open(2412)
- while true do
- local evt,_,_,_,_,cmd = computer.pullSignal()
- if evt == "modem_message" then
- local count = 1
- --find if it has multiple
- --local hasMultiple = 0
- --if cmd:find("%g+%s%g+") then
- -- hasMultiple = 1
- --end
- for word in cmd:gmatch("%g+") do
- if count == args then
- --io.write(cmd)
- --io.write(" ")
- --print(hasMultiple)
- load(word)()
- end
- count = count + 1
- end
- elseif evt == "key_up" then
- break
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement