Advertisement
MigasRocha

FissileFuel/DynamicTank Regulator/Computer ID:39

Dec 26th, 2024
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.26 KB | Gaming | 0 0
  1. sleep(10)
  2.  
  3. modem = peripheral.find("modem")
  4.  
  5. tank = peripheral.wrap("back")
  6.  
  7. capacity = tank.getFilledPercentage()*100
  8.  
  9. formattedCapacity = string.format("%.2f", capacity)
  10.  
  11. --Extracting Information from table--
  12.  
  13. --for key, value in pairs(tank.getStored()) do
  14.   -- if key == "name" or type(value) == "number" then
  15.     --   print(key .. ":" ,, tostring(value))
  16.   -- end
  17. --end
  18.  
  19. -------------------------------------
  20.  
  21.  
  22. --Formatting the names----
  23.  
  24. --while true do
  25.  
  26.     --for key, value in pairs(tank.getStored()) do
  27.         --if key == "name" or type(value) == "number" then
  28.            -- if type(value) == "string" and value:find(":") then
  29.               --  local name = string.match(value,"([^:]+)$")
  30.               --  local formattedName = string.gsub(name, "(%w)(%w*)",function(firstLetter,rest)
  31.              --   return string.upper(firstLetter) .. string.lower(rest) end)
  32.                
  33.             --    print(key .. ":" .. formattedName)
  34.                
  35.               --  else
  36.                
  37.                   --  print(key .. ":" .. tostring(value))
  38.                  --   end
  39.               --  end
  40.            -- end
  41.            
  42. modem.open(1)
  43.  
  44. while true do
  45.  
  46. modem.transmit(1, 1, formattedCapacity)
  47.  
  48. sleep(0.1)
  49.  
  50. end
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement