Advertisement
Guest User

Snakes_Eyes Roblox

a guest
Jan 22nd, 2020
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. -- CompDCoreMon
  2.  
  3. rednetHostname = "compCore"
  4. rednet.open("back")
  5. rednetProtocol = "core"
  6. rednetTimeout = 40
  7. rednet.host(rednetProtocol,rednetHostname)
  8.  
  9. hostnameCMD = "cmdCore"
  10.  
  11. m = peripheral.wrap("bottom")
  12.  
  13. function Draw(v)
  14.     -- v = {totalEnergy,MaxEnergy,tickPerS)
  15.     m.clear()
  16.     m.setBackgroundColor(colors.lightblue)
  17.     m.setCursorPos(1,1)
  18.     m.setTextColor(colors.black)
  19.     m.write("Total charge : ")
  20.     m.setCursorPos(16,1)
  21.     if (v[1] > 0 ) then
  22.         m.setTextColor(colors.green)
  23.     else
  24.         m.setTextColor(colors.red)
  25.     end
  26.     m.write(v[1])
  27.     m.setTextColor(colors.black)
  28.     m.setCursorPos(1,2)
  29.     m.write("[")
  30.     local nbGreen = (v[1] * 100) / v[2]
  31.     m.setTextColor(colors.lime)
  32.     for i=0,nbGreen,+1 do
  33.         m.write("I")
  34.     end
  35.     m.setTextColor(colors.black)
  36.     for j=0,(27-nbGreen),+1 do,
  37.         m.write('-')
  38.     end
  39.     m.write("]")
  40.     m.setCursorPos(1,4)
  41.     m.write("Rf/tick = "
  42.     m.setCursorPos(12,4)
  43.     if v[3] > 0 then
  44.         m.setTextColor(colors.green)
  45.     else
  46.         m.setTextColor(colors.red)
  47.     end
  48.     m.write(v[3])
  49. end
  50.  
  51. while true do
  52.     id, msg, p, d = rednet.receive(rednetProtocol)
  53.     Draw(v)
  54. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement