Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- ### Some silly global variables ### --
- auth = "Orginalet"
- head = "Lumberjack"
- menuItem = {
- "Start",
- "Refuel",
- "Reboot"
- }
- customString = {
- "Please add fuel in slot:",
- "---------------------------------------",
- "|||||||||||||",
- "[1] - ",
- "[2] - ",
- "[3] - ",
- "Fuel: ",
- "by"
- }
- fuelSlot = 16
- API1 = "meny"
- API2 = "lumberjack"
- --[[*
- * API loader
- *
- *
- *]]
- local function APILoader(...)
- param = {...}
- for i = 1, #param do
- if not os.loadAPI(param[i]) then
- error("Could not load API: "..tostring(param[i]))
- end
- end
- end
- --[[*
- * Renders the "GUI" main menu
- *
- *]]
- function menuRenderer()
- term.clear()
- APITable[1].centerText(1,customString[2])
- APITable[1].centerText(2,customString[3].." "..head.." "..customString[3])
- APITable[1].centerText(3,customString[2])
- APITable[1].centerText(6,customString[4]..menuItem[1])
- APITable[1].centerText(7,customString[5]..menuItem[2])
- APITable[1].centerText(8,customString[6]..menuItem[3])
- APITable[1].centerText(11,customString[2])
- APITable[1].leftTextAlign(12,customString[7].."["..APITable[1].getFuelLvl().."]")
- APITable[1].rightTextAlign(12,customString[8].." "..auth)
- APITable[1].centerText(13,customString[2])
- end
- --[[*
- * Main function for interacting with the turtle.
- * Reads user input from keypresses.
- *
- *]]
- function inputListener(side)
- while true do
- if redstone.getInput(side) then
- lumberAPI.lumberjack()
- lumberAPI.dump("1","2")
- os.reboot()
- end
- end
- end
- -- ### Execute ### --
- APILoader(API1, API2)
- --menuRenderer()
- --inputListener()
- API1.nope()
Advertisement
Add Comment
Please, Sign In to add comment