Advertisement
Guest User

credo.lua

a guest
Aug 20th, 2019
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.04 KB | None | 0 0
  1. local component = require"component"
  2. local event = require"event"
  3. local serialization = require"serialization"
  4. local controller = component.me_controller
  5. local term = require"term"
  6. local component = require"component"
  7. local gpu = component.gpu
  8.  
  9. local sections = {}
  10.  
  11. function coinCount()
  12.   cointable=controller.getItemsInNetwork()
  13.   term.clear()
  14.  
  15.   penny=0
  16.   nickel=0
  17.   quarter=0
  18.   dollar=0
  19.  
  20.   for i=1,#cointable do
  21.     item=cointable[i]
  22.     if item.name == "contenttweaker:omnicoin" then
  23.       penny=item.size;
  24.     end
  25.     if item.name == "contenttweaker:omnicoin5" then
  26.       nickel=item.size;
  27.     end
  28.     if item.name == "contenttweaker:omnicoin25" then
  29.       quarter=item.size;
  30.     end
  31.     if item.name == "contenttweaker:omnicoin100" then
  32.       dollar=item.size;
  33.     end
  34.   end
  35.  
  36.   print("Pennies  " .. penny)
  37.   print("Nickels  " .. nickel)
  38.   print("Quarters " .. quarter)
  39.   print("Dollars  " .. dollar)
  40.   print("Total Value " .. (penny+nickel*5+quarter*25+dollar*100))
  41. end
  42.  
  43. component.gpu.setResolution(25,6)
  44.  
  45. --coinCount()
  46. event.timer(2, coinCount, math.huge)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement