Posted 26 July 2013 - 01:17 AM
It's an enchanting program, using the misc peripherals enchanting turtle with a sword attached as well. It's used for a mob farm, hence the 'dropDown' 1 - 14 to drop loot. Anyway, I'm trying to add functionality so that I may turn off autocollect and get the XP from the room, for anvils and such. It's giving me the error whenever I press space (57) parallel:22:startup:11 attempt to concatenate string and boolean
xp = peripheral.wrap("right")
autcollect = xp.setAutoCollect()
print(autocollect)
function toggleAutocollect()
while true do
local event, key = os.pullEvent("key")
if key == 57 then
autocollect = not autocollect
print("Auto collect is now :"..autocollect)
xp.setAutoCollect(autocollect)
end
end
end
function xpTurtleThings()
while true do
lvl = xp.getLevels()
turtle.attack()
for i = 1, 14 do
turtle.select(i)
os.sleep(.1)
turtle.dropDown()
end
print("I have "..lvl.." levels.")
if turtle.getItemCount(16) > 0 then
turtle.select(16)
xp.enchant(30)
end
end
end
parallel.waitForAny(toggleAutocollect, xpTurtleThings)
Not sure what to do :/