Advertisement
Guest User

startup

a guest
May 22nd, 2015
202
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.64 KB | None | 0 0
  1. local mdp = ""
  2. local ok = false
  3. local modem = peripheral.wrap("bottom")
  4.  
  5. modem.open(42)
  6. while not ok do
  7.   term.clear()
  8.   term.setCursorPos(1,1)
  9.   print("Demarrage/Arret :")
  10.   mdp = read("*")
  11.   modem.transmit(42, 42, mdp)
  12.   event, side, sendC, replyC, message, dist = os.pullEvent()
  13.   if event == "modem_message" then
  14.     if side == "bottom" then
  15.       if sendC == 42 then
  16.         if replyC == 42 then
  17.           print(message)
  18.           sleep(5)
  19.         end
  20.       end
  21.     end
  22.   end
  23.   print("Energy Cube : ",modem.callRemote("Ultimate Energy Cube_0","getStored")," / ",modem.callRemote("Ultimate Energy Cube_0","getMaxEnergy"))
  24. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement