Advertisement
Guest User

turbine.lua

a guest
Dec 11th, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.63 KB | None | 0 0
  1. turbine = peripheral.wrap("back")
  2. modem = peripheral.wrap("top")
  3.  
  4. running = true
  5. compteur = 0
  6.  
  7. function network()
  8.     rotorSpeed = turbine.getRotorSpeed()
  9.     energy = turbine.getEnergyProducedLastTick()
  10.     active = turbine.getActive()
  11.     status = "Désactivée"
  12.     if(active) then
  13.         status = "Activée"
  14.     end
  15.     tr = rotorSpeed .. " / " .. energy .. " / " .. status .. "*"
  16.    
  17.     modem.transmit(2, 1, tr)
  18.    
  19.     term.setCursorPos(1, 1)
  20.     term.clear()
  21.     print("(" .. compteur .. ") : " .. tr)
  22. end
  23.  
  24. while(true) do
  25.    network()
  26.    compteur = compteur + 1
  27.    sleep(0.000000000000000000000000000001)
  28. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement