_Finn_

main

Jul 26th, 2015
273
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.80 KB | None | 0 0
  1. os.loadAPI("System/API/context")
  2.  
  3. local CommandBlock = peripheral.wrap ("bottom")
  4.  
  5. local function cb(command)
  6.   CommandBlock.setCommand(command)
  7.   CommandBlock.runCommand()
  8. end
  9.  
  10. local function tp(x,y,z)
  11.   cb("/tp..x..y..z")
  12. end
  13.  
  14. term.clear()
  15.  
  16. while true do
  17.   local event,button,x,y = os.pullEvent()
  18.   if event == "mouse_click" then
  19.     if button == 2 and y > 1 then
  20.       local action = context.menu(x,y,{"Home",false},{"Cave",false},{"M.Forest",false},{"Lava",false},"Auras",{"1",false},{"2",false},{"3",false},{"4",false},{"5",false},{"6",false},{"7",false},{"8",false},{"9",false},{"10",false},"-",{"Clear screen",false},"-",{"Exit",false})
  21.       if action == "Home" then
  22.         cb("/tp 169 79 133")
  23.       elseif action == "Cave" then
  24.         cb("/tp 261 53 389")
  25.       elseif action == "M.Forest" then
  26.         cb("/tp 133 63 539")
  27.       elseif action == "Lava" then
  28.         cb("/tp 221 12 389")
  29.       elseif action == "1" then
  30.         cb("/tp 335 75 147")
  31.       elseif action == "2" then
  32.         cb("/tp 157 63 36")
  33.       elseif action == "3" then
  34.         cb("/tp 377 63 384")
  35.       elseif action == "4" then
  36.         cb("/tp 357 74 449")
  37.       elseif action == "5" then
  38.         cb("/tp 492 69 668")
  39.       elseif action == "6" then
  40.         cb("/tp 426 64 984")
  41.       elseif action == "7" then
  42.         cb("/tp 178 63 318")
  43.       elseif action == "8" then
  44.         cb("/tp 201 67 274")
  45.       elseif action == "9" then
  46.         cb("/tp 198 69 0")
  47.       elseif action == "10" then
  48.         cb("/tp 8 71 606")
  49.       elseif action == "Clear screen" then
  50.         term.clear()
  51.       elseif action == "Exit" then
  52.         term.setBackgroundColor(colors.black)
  53.         term.setTextColor(colors.white)
  54.         term.setCursorPos(1,1)
  55.         term.clear()
  56.         break
  57.       end
  58.     end
  59.   end
  60. end
Advertisement
Add Comment
Please, Sign In to add comment