Orginalet

trash

Mar 7th, 2014
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.68 KB | None | 0 0
  1. -- ### Some silly global variables ### --
  2. auth = "Orginalet"
  3. head = "Lumberjack"
  4. menuItem = {
  5. "Start",
  6. "Refuel",
  7. "Reboot"
  8. }
  9.  
  10. customString = {
  11. "Please add fuel in slot:",
  12. "---------------------------------------",
  13. "|||||||||||||",
  14. "[1] - ",
  15. "[2] - ",
  16. "[3] - ",
  17. "Fuel: ",
  18. "by"
  19. }
  20. fuelSlot = 16
  21.  
  22. API1 = "meny"
  23. API2 = "lumberjack"
  24.  
  25. --[[*
  26. * API loader
  27. *
  28. *
  29. *]]
  30.  
  31. local function APILoader(...)
  32. param = {...}
  33. for i = 1, #param do
  34. if not os.loadAPI(param[i]) then
  35. error("Could not load API: "..tostring(param[i]))
  36. end
  37. end
  38. end
  39.  
  40.  
  41. --[[*
  42. * Renders the "GUI" main menu
  43. *
  44. *]]
  45.  
  46. function menuRenderer()
  47.  
  48. term.clear()
  49. APITable[1].centerText(1,customString[2])
  50. APITable[1].centerText(2,customString[3].." "..head.." "..customString[3])
  51. APITable[1].centerText(3,customString[2])
  52. APITable[1].centerText(6,customString[4]..menuItem[1])
  53. APITable[1].centerText(7,customString[5]..menuItem[2])
  54. APITable[1].centerText(8,customString[6]..menuItem[3])
  55. APITable[1].centerText(11,customString[2])
  56. APITable[1].leftTextAlign(12,customString[7].."["..APITable[1].getFuelLvl().."]")
  57. APITable[1].rightTextAlign(12,customString[8].." "..auth)
  58. APITable[1].centerText(13,customString[2])
  59. end
  60.  
  61. --[[*
  62. * Main function for interacting with the turtle.
  63. * Reads user input from keypresses.
  64. *
  65. *]]
  66.  
  67. function inputListener(side)
  68. while true do
  69. if redstone.getInput(side) then
  70. lumberAPI.lumberjack()
  71. lumberAPI.dump("1","2")
  72. os.reboot()
  73. end
  74. end
  75. end
  76.  
  77. -- ### Execute ### --
  78. APILoader(API1, API2)
  79. --menuRenderer()
  80. --inputListener()
  81.  
  82. API1.nope()
Advertisement
Add Comment
Please, Sign In to add comment