Nikkune

Tanks Minecraft modded World

Oct 21st, 2020 (edited)
2,259
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.76 KB | None | 0 0
  1. local modem = peripheral.wrap("right")
  2. local channel = 42
  3. local channelbps = 43
  4. local numtank = 1
  5.  
  6. while true do
  7.     local tank = peripheral.wrap("back").getTanks()[1]
  8.     local capacity = tank.capacity
  9.     local amount = tank.amount
  10.     local percent = math.floor(amount/capacity*100)
  11.     local bOne = math.floor(amount/1000)
  12.     sleep(1)
  13.     local amount2 = peripheral.wrap("back").getTanks()[1].amount
  14.     local bTwo = math.floor(amount2/1000)
  15.     local bps = bTwo - bOne
  16.     modem.transmit(channel,numtank, percent)
  17.     print("Send on :"..channel.."  I'm :"..numtank.."  Value:"..percent.."%")
  18.     modem.transmit(channelbps,numtank, bps)
  19.     print("Send on :"..channelbps.."  I'm :"..numtank.."  Value:"..string.sub(tostring(bps), 0,4).." bps")
  20. end
  21.  
Add Comment
Please, Sign In to add comment