Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Version 0.0.2
- --------LISCENCE--------
- --This code is owned by kd8lvt, and all APIs are owned by their respective creators, listed next to their 'os.loadAPI'-s
- --This code is liscensed under a custom liscence that is as follows:
- --You may:
- -- 1.Look at and use portions of the code, with credit.
- -- 2.Learn from this code
- -- 3.Include this code in your "Computecraft OS", with credit, and without modification.
- --You may NOT:
- -- 1.Claim this code as your own
- -- 2.Re-host this code (use the original pastebin!)
- -- 3.Put this code behind a adwall/paywall (ad.fly etc)
- --------HOW TO INSTALL--------
- --1. Install the APIs (they are on the ComputerCraft forums in the APIs section as CCEnder and Touchpoint)
- --2. Install this program
- --3. Install CCEnder and the turtle program on your turtle that has a pickaxe and a sword.
- --4. Configure both devices to the same "channel" in the below "CONFIGURATION" section
- --------CONFIGURATION--------
- channel = "put your uuid here"
- --------ACTUAL CODE--------
- os.loadAPI("ender") --Created by Sxw on the Computercraft Forums
- os.loadAPI("touchpoint") --Created by Lyqyd on the Computercraft Forums
- main = touchpoint.new()
- inv = touchpoint.new()
- local t
- function mainMenu()
- t = main
- end
- function invMenu()
- t = inv
- end
- function tellTurtle(command)
- ender.send(channel,command)
- end
- --Main Movement/Digging--
- main:add("^",function() tellTurtle("forward") end,10,2,12,3,colors.green,colors.lime)
- main:add("<",function() tellTurtle("left") end,8,5,10,6,colors.green,colors.lime)
- main:add(">",function() tellTurtle("right") end,12,5,14,6,colors.green,colors.lime)
- main:add("Up",function() tellTurtle("up") end,20,2,25,3,colors.green,colors.lime)
- main:add("Down",function() tellTurtle("down") end,20,6,25,7,colors.green,colors.lime)
- main:add("Attack",function() tellTurtle("attack") end,2,12,10,13,colors.green,colors.lime)
- main:add("Mine",function() tellTurtle("mine") end,2,15,10,16,colors.green,colors.lime)
- main:add("Mine Up",function() tellTurtle("mine up") end,12,15,20,16,colors.green,colors.lime)
- main:add("Mine Down",function() tellTurtle("mine down") end,2,18,20,19,colors.green,colors.lime)
- main:add("Inv.",function() invMenu() end,12,12,20,13,colors.green,colors.lime)
- --Inventory--
- inv:add("1",function() tellTurtle("select1") end,1,2,4,5,colors.green,colors.lime)
- inv:add("2",function() tellTurtle("select2") end,5,2,8,5,colors.green,colors.lime)
- inv:add("3",function() tellTurtle("select3") end,9,2,12,5,colors.green,colors.lime)
- inv:add("4",function() tellTurtle("select4") end,13,2,16,5,colors.green,colors.lime)
- inv:add("5",function() tellTurtle("select5") end,1,6,4,8,colors.green,colors.lime)
- inv:add("6",function() tellTurtle("select6") end,5,6,8,8,colors.green,colors.lime)
- inv:add("7",function() tellTurtle("select7") end,9,6,12,8,colors.green,colors.lime)
- inv:add("8",function() tellTurtle("select8") end,13,6,16,8,colors.green,colors.lime)
- inv:add("9",function() tellTurtle("select9") end,1,9,5,11,colors.green,colors.lime)
- inv:add("10",function() tellTurtle("select10") end,6,9,9,11,colors.green,colors.lime)
- inv:add("11",function() tellTurtle("select11") end,10,9,13,11,colors.green,colors.lime)
- inv:add("12",function() tellTurtle("select12") end,14,9,17,11,colors.green,colors.lime)
- inv:add("13",function() tellTurtle("select13") end,1,12,4,12,colors.green,colors.lime)
- inv:add("14",function() tellTurtle("select14") end,5,12,8,12,colors.green,colors.lime)
- inv:add("15",function() tellTurtle("select15") end,9,12,12,12,colors.green,colors.lime)
- inv:add("16",function() tellTurtle("select16") end,13,12,16,12,colors.green,colors.lime)
- inv:add("Place",function() tellTurtle("place") end,1,14,25,15,colors.green,colors.lime)
- inv:add("Place Up",function() tellTurtle("place up") end,1,17,12,19,colors.green,colors.lime)
- inv:add("Place Down",function() tellTurtle("place down") end,14,17,25,19,colors.green,colors.lime)
- inv:add("Main",function() mainMenu() end,18,2,23,4,colors.green,colors.lime)
- mainMenu()
- while true do
- t:draw()
- local event, p1 = t:handleEvents(os.pullEvent())
- if event == "button_click" then
- t.buttonList[p1].func()
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement