Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local components = "\n"
- for add, mod in component.list() do components = components..' '..add..' '..mod..'\n' if mod ~= 'computer' then pcall(load(mod..' = component.proxy(component.list(\"'..mod..'\")())')) end end
- if modem ~= nil then modem.open(port) broadcast = modem.broadcast modem.setWakeMessage('_start') else if tunnel == nil then computer.beep(1000,0.5) computer.shutdown() end modem = {} end
- function send(a,b) if broadcast ~= nil then broadcast(a,b) else tunnel.send(b) end end
- function os.sleep(time) local e = {computer.pullSignal(time)} if e[1] == "modem_message" and e[6] == 'exit' then os.exit() end end
- while true do
- local e = {computer.pullSignal(1)}
- if (e[1] == "modem_message") and (e[6] ~= nil) then
- local aa,bb = e[6]:find("components")
- if aa ~= nil and aa < 4 then
- txt = "\n"
- if pcall(load('for a,b in pairs('..e[6]:sub(bb+2)..') do txt = txt.." "..a.."(..):"..type(b):gsub("function","func")..",\\n" end')) then
- send(port+1,txt:gsub(",","")..'\n '..txt:gsub("\n ",""):gsub("%.%.",""))
- else
- send(port+1,components)
- end
- aa,bb,txt = nil
- else
- local runProgramma = e[6]
- while tostring(e[7]) == '_echo' do
- e = {computer.pullSignal(1)}
- if tostring(e[1]) == "modem_message" then runProgramma = runProgramma..e[6] end
- end
- local _,errorText = pcall(load(runProgramma))
- if errorText ~= nil then
- if drone ~= nil then
- oldColor = drone.getLightColor()
- drone.setLightColor(0xff0000)
- end
- send(port+1," Error: "..errorText)
- computer.beep(1000,0.5)
- if drone ~= nil then drone.setLightColor(oldColor) end
- else
- send(port+1,nil)
- end
- end
- end
- end
Add Comment
Please, Sign In to add comment