Advertisement
Guest User

Untitled

a guest
Apr 8th, 2020
179
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.91 KB | None | 0 0
  1. commands = {
  2.   Input = {
  3.     name = 'Auto Input',
  4.     key = 'i',
  5.     value = false,
  6.     color = 1
  7.   },
  8.   Output = {
  9.     name = 'Auto Output',
  10.     key = 'o',
  11.     value = true,
  12.     color = 16384
  13.   }
  14. }
  15.  
  16.  
  17. local function toggleValue(key)
  18.   commands[key].value = not commands[key].value
  19. end
  20.  
  21. local function getActiveColors()
  22.   active = 0
  23.  
  24.   for k, v in pairs(commands) do
  25.     local value = v["value"]
  26.    
  27.     if value then
  28.       print("Value is true for ", k)
  29.       active = active + v["color"]
  30.     end
  31.   end
  32.   return active
  33. end
  34.  
  35. local function printMenu()
  36.   print('===========================')
  37.   print('Auto Smelt 3000 - By Stouty')
  38.   print('===========================')
  39.  
  40.   for k, v in pairs(commands) do
  41.     toggle = v['value'] and 'ON' or 'OFF'
  42.     print('[' .. v['key']:upper() .. '] ' .. v['name'] .. ' -> ' .. toggle)
  43.   end
  44.  
  45.   print('===========================')
  46.   print('')
  47. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement