Posted 19 December 2012 - 04:48 AM
Hey guys, I'm making my own kinda OS/Program, which has a cool menu and so on… the problem is, I want my header, which is takes 2 lines, to always be visible. tried first
Everything I wrote looked all messy and stuff, which I didn't want. I realised it was because print uses write which uses term.getCursorPos, which would give something completely oftrack. It gave 2 lines of space inbetween each row.
So I tried
which really, just gave me 1 more line of space inbetween every line.
So I added 1 more function:
So now I'm out of ideas. My code is currently 266 lines long, so i would avoid posting it, and I dont think the code makes this, since it worked before these functions.
Problem now fixed!
here is fixed code, for everyone to learn from ^^
if true then
local sneaky = term.setCursorPos
function term.setCursorPos(x,y)
sneaky(x,y+2)
end
end
which didn't work.Everything I wrote looked all messy and stuff, which I didn't want. I realised it was because print uses write which uses term.getCursorPos, which would give something completely oftrack. It gave 2 lines of space inbetween each row.
So I tried
if true then
local sneaky2 = term.getCursorPos
function term.getCursorPos()
x,y = sneaky2()
return x,y+2
end
local sneaky = term.setCursorPos
function term.setCursorPos(x,y)
sneaky(x,y+2)
end
end
which really, just gave me 1 more line of space inbetween every line.
So I added 1 more function:
if true then
local sneaky3 = term.getSize
function term.getSize()
w,h = sneaky3()
return w,h-2
end
local sneaky2 = term.getCursorPos
function term.getCursorPos()
x,y = sneaky2()
return x,y+2
end
local sneaky = term.setCursorPos
function term.setCursorPos(x,y)
sneaky(x,y+2)
end
end
and now, really messed up linesSo now I'm out of ideas. My code is currently 266 lines long, so i would avoid posting it, and I dont think the code makes this, since it worked before these functions.
Problem now fixed!
here is fixed code, for everyone to learn from ^^
if true then
local sneaky3 = term.getSize
function term.getSize()
w,h = sneaky3()
return w,h-2
end
local sneaky2 = term.getCursorPos
function term.getCursorPos()
x,y = sneaky2()
return x,y-2
end
local sneaky = term.setCursorPos
function term.setCursorPos(x,y)
sneaky(x,y+2)
end
end