Talk:Monitor (ComputerCraft)/@comment-89.186.180.15-20121121230549

Plz help!

---[[

function run

t = os.StartTimer(0,5)

repeat

local event,p1 = os.pullEvent

if event == "timer" and p1 == t then

tick

end

until event == "char" and p1 == "x"

end

local xpos = wm/2

local ypos = hm/2

local xvel = 1

local yvel = 1

function tick

t = os.startTimer(0,5)

monitor.clear

monitor.setCursorPos(xpos,ypos)

if xpos >= wm or xpos <= 1 then

xvel = xvel * -1

end

if ypos >= hm or ypos <= 1 then

yvel = yvel * -1

end

xpos = xpos+xvel

ypos = ypos+yvel

monitor.write("o")

end

run

monitor.clear

term.clear

term.setCursorPos(1,1)

end

--]]