Posted 30 July 2013 - 03:15 PM
I've made an enchanting program, and I'm trying to use the turtle.transferTo(16, 1) command to keep the enchantment slot filled with one item (book specifically) at any given time. It's giving me the error at line 33, 'then expected'
x = true
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 :"..tostring(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 and lvl <= 30 then
turtle.select(16)
xp.enchant(30)
turtle.dropDown()
end
if turtle.getItemCount(16) < 0 and turtle.getItemCount(15) => 1 then -- Line 33
turtle.select(15)
turtle.transferTo(16, 1)
end
end
end
parallel.waitForAny(toggleAutocollect, xpTurtleThings)
I can't seem to figure out what's wrong with this.