Posted 27 March 2013 - 06:40 AM
Hey, guys! I have a new XP farm that I'm trying out and rather than punching mobs to death I've decided to use XP Melee Turtles.
My system looks like this:
The idea is for the mobs to fall in the 1x1 hole and get chopped up by the turtles who will not only pick up the mobs drops and xp but also drop the items into the chests below from which the items will be sorted and to also enchant books upon reaching 30 levels. For some reason though, I keep getting this error:
This is what my code looks like:
So yeah. Like I said, I would like the turtles to kill away, drop their items down below (except for the unenchanted books), and enchant books, but this doesn't seem to work. From this, though, I see two problems with the over all idea: how do I get the turtle to drop the enchanted books? and how do I keep a supply of books inside the turtle?
One more thing, if this renders somewhat hard or impossible to do, I'd be willing to conjure up some RedPower2 managers and throw them beneath the turtles. In theory, these would automatically pull anything out of the turtle by themselves that isn't in the manager's list of items to keep, that is saying if managers even cooperate with turtles.
Anyways, take into account that I am no Lua expert. I only know a little bit of C++ and even that I'm not a pro at. Any help would be much appreciated. :)/>
My system looks like this:
Spoiler
The idea is for the mobs to fall in the 1x1 hole and get chopped up by the turtles who will not only pick up the mobs drops and xp but also drop the items into the chests below from which the items will be sorted and to also enchant books upon reaching 30 levels. For some reason though, I keep getting this error:
startup:2: attemtp to index ? (a nil value)
This is what my code looks like:
m=peripheral.wrap("right")
mPeripheral.setAutoCollect(true)
while true do
if turtle.attack()==false then
for i=1,12 do
if turtle.getItemCount(i)>0 then
turtle.select(i)
turtle.dropDown()
else
break
end
end
end
if mPeripheral.getLevels()>=30 then
for i=13,16 do
turtle.select(i)
mPeripheral.enchant(30)
end
end
turtle.select(1)
end
So yeah. Like I said, I would like the turtles to kill away, drop their items down below (except for the unenchanted books), and enchant books, but this doesn't seem to work. From this, though, I see two problems with the over all idea: how do I get the turtle to drop the enchanted books? and how do I keep a supply of books inside the turtle?
One more thing, if this renders somewhat hard or impossible to do, I'd be willing to conjure up some RedPower2 managers and throw them beneath the turtles. In theory, these would automatically pull anything out of the turtle by themselves that isn't in the manager's list of items to keep, that is saying if managers even cooperate with turtles.
Anyways, take into account that I am no Lua expert. I only know a little bit of C++ and even that I'm not a pro at. Any help would be much appreciated. :)/>