Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local m=component.proxy(component.list("modem")())
- local g=component.proxy(component.list("geolyzer")())
- local id = "001"
- local pCMD
- local pRTS
- m.open(1231)
- function handling(x)
- if string.match(load(x),"^function") == "function" then
- return(true)
- else
- m.broadcast("DNT "..load(x))
- return(false)
- end
- end
- function logistics(y)
- if string.match(y,"^"..id)==id then
- return(true)
- else
- if y ~= pCMD then
- m.boradcast(y)
- pCMD = y
- end
- return(false)
- end
- end
- function execute(z)
- local purpose = string.sub(z,5)
- purpose()
- m.broadcast("RTS: roger wilco")
- end
- while true do
- local _,_,_,_,_,cmd = computer.pullSignal()
- if string.match(cmd,"^RTS")=="RTS" then
- if cmd ~= pRTS then
- m.broadcast(cmd)
- pRTS = cmd
- end
- else
- if string.match(cmd,"^DNT")~="DNT" then
- if handling(cmd) == true then
- if logistics(cmd) == true then
- execute(cmd)
- end
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement