Advertisement
Guest User

startup

a guest
Oct 31st, 2014
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.22 KB | None | 0 0
  1. --Fill this table with the names of mobs
  2. local inputs = {"Chicken","Cow",}
  3. --The ID of the turtle with the safari nets                            
  4. local turtle = 11
  5. --The side your modem is on
  6. rednet.open("back")
  7. local modem = peripheral.wrap("back")
  8.  
  9. local function options()
  10.   term.clear()
  11.   term.setCursorPos(1, 1)
  12.   term.setTextColor(colors.lime)
  13.   print("Available Mobs:")
  14.   term.setTextColor(colors.white)
  15.   write("\t")
  16.  
  17.   local count = 0
  18.   for n in pairs(inputs) do
  19.     write(inputs[n]..", ")
  20.     count = count + 1
  21.     if count == 5 then
  22.       write("\n\t")
  23.       count = 0
  24.     end
  25.   end
  26.      
  27.   write("\n")
  28.   term.setTextColor(colors.lime)
  29.   write("Please select one: ")
  30.   term.setTextColor(colors.white)
  31. end
  32.  
  33.  
  34. while true do
  35. local loop = true
  36. local uservar = nil
  37. local z = nil
  38.   while loop do
  39.     options()
  40.     uservar = string.lower(read())
  41.       z = 1
  42.       for w in pairs(inputs) do
  43.         if uservar == string.lower(inputs[z]) then
  44.           loop = false
  45.         else
  46.           z = z+1
  47.         end
  48.       end
  49.   end
  50. modem.transmit(10,11,z)
  51.  
  52.  
  53. term.clear()
  54. term.setCursorPos(1, 1)
  55. print("Loading: "..uservar)
  56. write("Push Enter when finished ")
  57. read()
  58. modem.transmit(10,11,17)
  59. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement