SquidDev

BobCat

Jun 3rd, 2014
925
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.60 KB | None | 0 0
  1. term.clear()
  2.  
  3. if not BobCatAPI then
  4.     os.loadAPI(fs.combine(fs.getDir(shell.getRunningProgram()), "BobCatAPI"))
  5. end
  6.  
  7. local Nav = BobCatAPI.Navigation:new()
  8. local Gui = Nav.Gui
  9.  
  10. Gui:draw()
  11.  
  12. while true do
  13.     local eArgs = {os.pullEventRaw()}
  14.     local event = eArgs[1]
  15.  
  16.     if event == "mouse_scroll" then
  17.         Gui:setY(Gui.y+eArgs[2])
  18.         Gui:draw()
  19.     elseif event == "mouse_click" then
  20.         Gui:click(eArgs[3], eArgs[4])
  21.         Gui:draw()
  22.     elseif event == "terminate" then
  23.         term.clear()
  24.         term.setCursorPos(1,1)
  25.         term.setBackgroundColour(colours.black)
  26.         term.setTextColour(colours.white)
  27.         break
  28.     end
  29. end
Advertisement
Add Comment
Please, Sign In to add comment