Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --v0.1 by GraySloth 2013-Mar-03 For the miscperipherals mod with the XP Upgrade, Still experimental, your magical results may vary.
- local tArgs = { ... }
- --variables
- local sCommand = tArgs[1]
- local sNumber = tonumber( tArgs[2] )
- local drop = true
- local dropTo = "up"
- local suckFrom = "forward"
- xp = peripheral.wrap("right")
- if #tArgs < 1 then
- print("Type: xp help")
- return
- end
- --functions
- function vacuum()
- if suckFrom == "forward" then
- print(xp.get())
- elseif suckFrom == "up" then
- print(xp.getUp())
- elseif suckFrom == "down" then
- print(xp.getDown())
- end
- end
- function pipe()
- if drop then
- if dropTo == "up" then
- turtle.dropUp()
- elseif dropTo == "down" then
- turtle.dropDown()
- end
- end
- end
- function lvl()
- print("Level: "..xp.getLevels())
- end
- function clear()
- term.clear()
- term.setCursorPos(1,1)
- end
- local input = nil
- sEnchant = false
- if sCommand == "kill" then
- xp.setAutoCollect(true)
- while true do
- clear()
- lvl()
- turtle.attack()
- os.sleep(.1)
- xp.collect()
- pipe()
- end
- elseif sCommand == "add" then
- turtle.select(sNumber)
- print("Added "..xp.add().." XP to turtle")
- lvl()
- elseif sCommand == "level" then
- lvl()
- elseif sCommand == "collect" then
- while true do
- clear()
- print("collecting xp press ctrl+t to stop ")
- lvl()
- xp.collect()
- os.sleep(0.5)
- end
- elseif sCommand == "enchant" then
- turtle.select(sNumber)
- clear()
- while (input == nil) or (sEnchant == false) do
- print("I have "..xp.getLevels().." levels, how many do you want to use?\n")
- write("Max lvl 30: ")
- input = tonumber(read())
- if (input == nil) or (input < 1) then
- clear()
- print("Try again, but this time enter a NUMBER that makes sense or hold ctrl+t to exit.\n")
- elseif input > 30 then
- clear()
- print("What are you nuts? 30 is the max unless you are trying to destroy the fabric of reality.")
- print("Try again or hold ctrl+t to exit.\n")
- elseif input > 0 then
- clear()
- textutils.slowWrite( "Mekka Lekka Hi Mekka Hiney Ho! \n" )
- if xp.enchant(input) then
- sEnchant = true
- print("The wish is granted, long live ComputerCraft.\n")
- lvl()
- else
- clear()
- print("The enchantmet failed, and you call yourself a wizard.")
- print("Try again, or hold ctrl+t to exit.\n")
- end
- end
- end
- elseif sCommand == "suck" then
- while true do
- clear()
- vacuum()
- lvl()
- pipe()
- os.sleep(1)
- end
- else
- clear()
- print("xp kill: attacks and collects XP and loot from mobs, needs weapon or tool\n")
- print("*press any key to continue*")
- os.pullEvent("key")
- clear()
- print("xp add <#slot>: Adds all XP from XP bottles or monster eggs, Returns the amount of XP added.\n")
- print("*press any key to continue*")
- os.pullEvent("key")
- clear()
- print("xp level: Returns the Level on the turtle.\n")
- print("*press any key to continue*")
- os.pullEvent("key")
- clear()
- print("xp collect: Collects XP from XP orbs on the ground in a 2 block radius around the turtle.\n")
- print("*press any key to continue*")
- os.pullEvent("key")
- clear()
- print("xp enchant <#slot>: Enchants the item in the selected slot using to be specified levels.\n")
- print("*press any key to continue*")
- os.pullEvent("key")
- clear()
- print("xp suck: sucks XP out of ONLY vanilla furnaces and can put the item into other inventorys but NOT pipes or tubes, for best results set local drop to false to keep contents in turtle or true to send out.\n")
- print("*press any key to continue*")
- os.pullEvent("key")
- clear()
- end
Advertisement
Add Comment
Please, Sign In to add comment