Posted 05 May 2013 - 07:56 AM
Hello, I have made an xp farm where I have a turtle that picks up xp and enchants books for me and i'm trying to hook up a monitor to it. The problem is that I don't know how to center the text and remove the .0 after the level from the monitor, here is the code I have right now.
I searched the forum for help before posting but I didn't get the problem solved since I've never coded before.
m = peripheral.wrap("right")
monitor = peripheral.wrap("top")
local o = nil
m.setAutoCollect(true)
while true do
if m.getLevels() > 29 then
turtle.select(1)
turtle.suck()
turtle.drop(turtle.getItemCount(1)-1)
m.enchant(30)
turtle.drop()
else
o = m.getLevels()
monitor.setCursorPos(1.5, 1.5)
monitor.setTextScale(2.5)
monitor.write(o)
sleep(10)
end
end
I searched the forum for help before posting but I didn't get the problem solved since I've never coded before.