DeanReid

Item Get Program

Aug 10th, 2013 (edited)
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.03 KB | None | 0 0
  1. a = {}
  2. a[1] = "redstone"
  3. a[2] = "iron"
  4. a[3] = "tin"
  5. a[4] = "copper"
  6. a[5] = "silver"
  7. a[6] = "gold"
  8. a[7] = "diamond"
  9. a[8] = "redmatter"
  10. a[9] = "darkmatter"
  11. a[10] = "ciruit"
  12. a[11] = "coal"
  13. a[12] = "food"
  14. a[13] = "glasswire"
  15. a[14] = "copperwire"
  16. a[15] = "refinediron"
  17. a[16] = "nikolite"
  18. while true do
  19.  user = ""
  20.  print("-------------------MENU(WIP)-------------------")
  21.  print("1. List")
  22.  print("2. Call")
  23.  user = io.read()
  24.   if user == "1" then
  25.    for i = 1, 16 do
  26.     write(a[i])
  27.     write(", ")
  28.    end
  29.   elseif user == "2" then
  30.    item = ""
  31.    amount = ""
  32.    print("Item:")
  33.    item = io.read()
  34.    print("Amount:")
  35.    amount = io.read()
  36.     for i = 1, 16 do
  37.      if a[i] == item then
  38.       for c = 1, amount do
  39.        rs.setBundledOutput("back", 2^(i-1))
  40.        sleep(0.2)
  41.        rs.setBundledOutput("back", 0)
  42.        sleep(0.2)
  43.       end
  44.       i = 16
  45.      end
  46.     end
  47.     term.clear()
  48.     term.setCursorPos(1, 1)
  49.   else
  50.    write("Not an option")
  51.    term.clear()
  52.    term.setCursorPos(1, 1)
  53.   end
  54.  end
Add Comment
Please, Sign In to add comment