uepyon

turtle_status.lua

Apr 16th, 2024 (edited)
292
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. mon = peripheral.wrap("top")
  2. rednet.open("left")
  3. mon.clear()
  4. mon.setCursorPos(21, 1)
  5. mon.write("id:"..os.getComputerID())
  6. mon.setCursorPos(21, 2)
  7. mon.write("fuel:"..turtle.getFuelLevel())
  8.  
  9. while true do
  10.   local sid, msg, dis = rednet.receive()
  11.   tnum = tonumber(string.sub(msg, 1, 2))
  12.   if tnum % 2 == 1 then
  13.     cx = 1
  14.     cy = tonumber(tnum / 2) + 3
  15.   else
  16.     cx = 11
  17.     cy = tonumber(tnum / 2) + 2
  18.   end
  19.   mon.setCursorPos(cx, cy)
  20.   mon.write(msg)
  21. end
  22.  
  23.  
Tags: ccTweaked
Advertisement
Add Comment
Please, Sign In to add comment