Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function attempt(func,args)
- return func(args)
- end
- function translate(input)
- local c = {} --commands lookup table, in lieu of a switch statement
- c["forward"] = turtle.forward
- c["up"] = turtle.up
- c["down"] = turtle.down
- c["back"] = turtle.back
- c["turnRight"] = turtle.turnRight
- c["turnLeft"] = turtle.turnLeft
- c["select"] = turtle.select
- c["getSelectedSlot"] = turtle.getSelectedSlot
- c["getItemCount"] = turtle.getItemCount
- c["getItemSpace"] = turtle.getItemSpace
- c["getItemDetail"] = turtle.getItemDetail
- c["equipLeft"] = turtle.equipLeft
- c["equipRight"] = turtle.equipRight
- c["attack"] = turtle.attack
- c["attackUp"] = turtle.attackUp
- c["attackDown"] = turtle.attackDown
- c["dig"] = turtle.dig
- c["digUp"] = turtle.digUp
- c["digDown"] = turtle.digDown
- c["place"] = turtle.place
- c["placeUp"] = turtle.placeUp
- c["placeDown"] = turtle.placeDown
- c["detect"] = turtle.detect
- c["detectDown"] = turtle.detectDown
- c["detectUp"] = turtle.detectup
- c["inspect"] = turtle.inspect
- c["inspectUp"] = turtle.inspectUp
- c["inspectDown"] = turtle.inspectDown
- c["compare"] = turtle.compare
- c["compareUp"] = turtle.compareUp
- c["compareDown"] = turtle.compareDown
- c["compareTo"] = turtle.compareTo
- c["drop"] = turtle.drop
- c["dropUp"] = turtle.dropUp
- c["dropDown"] = turtle.dropDown
- c["suck"] = turtle.suck
- c["suckUp"] = turtle.suckUp
- c["suckDown"] = turtle.suckDown
- c["refuel"] = turtle.refuel
- c["getFuelLevel"] = turtle.getFuelLevel
- c["getFuelLimit"] = turtle.getFuelLimit
- c["transferTo"] = turtle.transferTo
- if c[input] == nil then
- return false
- end
- return c[input]
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement