Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- bridge = peripheral.wrap("top")
- modemr = peripheral.wrap("back")
- while 1==1 do
- modemr.open(1310)
- _,_,_,_,cxymsg = os.pullEvent()
- modemr.close(1310)
- cxymsgunser = textutils.unserialize(cxymsg)
- numtotal = ((#cxymsgunser)/3)
- bridge.addBox(10,10,48,48,0x000000)
- for m=1,numtotal do
- cor = cxymsgunser[((m*3)-2)]
- xdot = tonumber(cxymsgunser[((m*3)-1)])
- ydot = tonumber(cxymsgunser[(m*3)])
- if cor == "w" then hcor = 0xF0F0F0
- elseif cor == "r" then hcor = 0xB3312C
- elseif cor == "o" then hcor = 0xFFFF55
- elseif cor == "g" then hcor = 0x3B511A
- end
- bridge.addBox(xdot+10,ydot+10,2,2,hcor)
- end
- sleep(0.25)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement