Advertisement
funnyzocker

HVCount

Feb 24th, 2017
37
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.54 KB | None | 0 0
  1. mon = peripheral.wrap("left")
  2. mon.clear()
  3. mon.setCursorPos(1,1)
  4.  
  5. function read()
  6.   local f = fs.open("stats", "r")
  7.   local HV
  8.   if f then
  9.     HV = f.readLine()
  10.     f.close()
  11.      if HV ~= nil then
  12.        return HV
  13.      else
  14.        HV = 0
  15.        return HV
  16.      end
  17.   else
  18.     HV = 0
  19.     return HV
  20.   end
  21. end
  22.  
  23. local hv = read()
  24. mon.setCursorPos(1,1)
  25. mon.write("Aktuelle HV's")
  26. mon.setCursorPos(17,1)
  27. mon.write(tostring(hv))
  28. mon.setCursorPos(1,2)
  29. mon.write("HV's bis 2 AE's")
  30. mon.setCursorPos(17,2)
  31. mon.write(tostring(256-hv))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement