Posted 02 April 2013 - 05:34 AM
Hey, i've been writing an auto - book - enchanting program using a XP - Turtle.
It waits till it's 30 and then picks a book and so on and so on.
It's all working fine, but now i wanted to hook up a monitor so it can display the levels if it's not level 30 yet.
Here's the code (the monitor is on the top of the turtle) :
My problem now it that it's not running endless, it stops after the first run and is not showing the level.
I would love to see the problem fixed, please help me out. :)/>
This was my first post, i hope i did everything right and don't look that dumb,
sincerely,
Skampi.
It waits till it's 30 and then picks a book and so on and so on.
It's all working fine, but now i wanted to hook up a monitor so it can display the levels if it's not level 30 yet.
Here's the code (the monitor is on the top of the turtle) :
m = peripheral.wrap("right")
monitor = peripheral.wrap("top")
local o = 0
local x = 0
m.setAutoCollect(true)
x = 1
while x == 1 do
if m.getLevels() > 29 then
turtle.select(1)
turtle.suck()
turtle.drop(turtle.getItemCount(1)-1)
m.enchant(30)
turtle.drop()
else
m.getLevels(o)
monitor.setCursorPos(2, 2)
monitor.write(o)
sleep(10)
end
end
My problem now it that it's not running endless, it stops after the first run and is not showing the level.
I would love to see the problem fixed, please help me out. :)/>
This was my first post, i hope i did everything right and don't look that dumb,
sincerely,
Skampi.