Jump to content




help making a screenlogger


4 replies to this topic

#1 louitzie

  • Members
  • 50 posts

Posted 10 May 2012 - 07:52 PM

i want to make a screenlogger API so i can get whats on the screen when i want

this is the code in logger

local native = term.native
local term = {}

term.write = function (text)
native.write(text)
end

term.clear = function ()
native.clear()
end

term.clearLine = function ()
native.clearLine()
end

term.getCursorPos = function ()
native.getCursorPos()
end

term.setCursorPos = function (x,y)
xpos=x
ypos=y
native.setCursorPos(x,y)
end

term.setCursorBlink = function (:)/>/>
native.setCursorBlink(:)/>/>
end

term.getSize = function ()
native.getSize()
end

term.scroll = function (n)
native.scroll(n)
end

function getLogger()
return term
end

but when i do this
os.loadAPI("logger")
term.redirect(logger.getLogger())
i get an error
bios:67 attempt to compare __lt on nil and number

#2 MysticT

    Lua Wizard

  • Members
  • 1,597 posts

Posted 10 May 2012 - 09:22 PM

You forgot the return in your functions:
term.getSize = function ()
  native.getSize()
end
should be:
term.getSize = function ()
  return native.getSize()
end
Same with getCursorPos.

#3 louitzie

  • Members
  • 50 posts

Posted 11 May 2012 - 06:01 AM

thanks it worked

now set some standard text in write()
and you have a annoying virus

#4 KaoS

    Diabolical Coder

  • Members
  • 1,510 posts
  • LocationThat dark shadow under your bed...

Posted 16 November 2012 - 06:57 AM

man you are making an epic program right there. why turn it into a virus that irritates people? I can understand snooping etc cuz it's useful and hard to do. irritating people is just uncool

also: viruses are banned on these forums

#5 Lyqyd

    Lua Liquidator

  • Moderators
  • 8,465 posts

Posted 16 November 2012 - 09:19 AM

Nothing in that post justified dragging the topic back up all the way from May. Let's let things die, shall we?





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users