Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- on the receive Computer
- --Ouverture des ports du modem
- modem.open(1001) -- energie de la batterie sur terre
- modem.open(1002) -- energie de la batterie spatiale
- --Main
- local function onModem(_,_,from,port,_,IDcode,message)
- if IDcode == "espace" then
- energie_espace = serialization.unserialize(message)
- afflevel(2,28,61,energie_espace,"SPATIALE")
- elseif IDcode == "terre" then
- energie_terre = serialization.unserialize(message)
- afflevel(2,32,61,energie_terre,"TERIENNE")
- end
- end
- local function onModem(_,_,from,port,_,IDcode,message)
- if IDcode == "terre" then
- energie_terre = serialization.unserialize(message)
- afflevel(2,32,61,energie_terre,"TERIENNE")
- end
- end
- on the send computer 1
- IDcode = "terre"
- modem.broadcast(port, IDcode, "data")
- on the send computer 2
- IDcode = "espace"
- modem.broadcast(port, IDcode, "data")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement