Posted 30 March 2013 - 01:07 PM
how do I use them? my code:
shell.run("clear")
rednet.open("right")
turtle.select(1)
tArgs = { ... }
lvl = #tArgs --sets the variable lvl to number entered
print("Enchanting at "..lvl)
m = peripheral.wrap("left") --wraps the enchanting table as a periperal
function getLevel() -- creates the function getLevel
if m.getLevels() < lvl then --checks if the turtle has the levels required
sleep(5)
getLevel()
else
m.enchant(lvl)
end
end
--calls said function
function pull()
if turtle.getItemCount(1) < 1 then
turtle.suckDown()
return true
else
return true
end
end
if pull() == true then
getLevel()
print("Ejecting item into Chest")
turtle.dropDown()
sleep(2)
shell.run("clear")
end
the goal is to make the turtle enchant somthing-shovel of the earthmover, anyone?-at the level specified in the argument, and be able to do it via enderchest and enchanting terminal, note: I have miscperipherals