1548 posts
Location
That dark shadow under your bed...
Posted 22 October 2012 - 12:50 PM
Hey pro people, I am busy making a screen logger and resumer for a project of mine. everything is working fine except it will not take the term.scroll function into account.
I apologise that it is such a long code, the scroll modifier starts at line 104 but you may need to read the top part to understand how the record works, here is the pastebin:
http://pastebin.com/JMUMUgULThanks for the help
1548 posts
Location
That dark shadow under your bed...
Posted 22 October 2012 - 09:20 PM
no ideas guys? I added comments to the code to make it a little easier to understand, in order to fully understand it you need to understand metatables, before I understood them I tried Google and found an amazing article. in case you need it
here is a link
2005 posts
Posted 22 October 2012 - 09:47 PM
Sorry, I'm fixing my code to get rid of ipairs (and do other stuff). This function still successfully calls the oterm.scroll, right? It just doesn't log correctly all the information you're trying to save. Which…are you trying to save the entire screen?
1548 posts
Location
That dark shadow under your bed...
Posted 23 October 2012 - 12:25 AM
exactly. as you write to your screen it writes to my log. it works perfectly except it doesn't scroll
2217 posts
Location
3232235883
Posted 23 October 2012 - 12:41 AM
mine just attaches perimeter hooks to all the term functions :3
2005 posts
Posted 23 October 2012 - 01:00 AM
Why are you trying to save the whole screen? The log already contains all the output information, you just need to log that the screen scrolled, not reiterate everything that was on the screen when it scrolled.
1548 posts
Location
That dark shadow under your bed...
Posted 23 October 2012 - 04:09 PM
I am moving everything up one in the log. it doesn't need everything ever entered, just what is currently on the screen
2005 posts
Posted 23 October 2012 - 05:27 PM
Looks more complicated than necessary. I have to let my brain recover a while before tackling it.
8543 posts
Posted 23 October 2012 - 05:42 PM
You are doing this the hard way, you know. Why not just use a redirect target that updates a buffer table before calling the main term functions?
1548 posts
Location
That dark shadow under your bed...
Posted 23 October 2012 - 06:13 PM
I'm not sure how that works… anyways thanks for the help. I'll take a look
8543 posts
Posted 23 October 2012 - 07:49 PM
An example of this would be found near the top of this file:
https://github.com/lyqyd/LyqydOS/blob/master/windowThat may be a useful reference or source of inspiration.
1548 posts
Location
That dark shadow under your bed...
Posted 24 October 2012 - 05:24 AM
Thanks, I am looking through it. the thing is I cannot find one instance of you actually calling the function new(). trying to figure out the syntax for target. guess I'll just look up the full code
but great code hey
EDIT: found it, I was thinking of doing it this way. I tried it in the past and made a mess of it. oh well, back to the drawing board ^_^/>/> time for an overhaul. thanks for the help Lyqyd, you too ChunLing. much appreciated
1548 posts
Location
That dark shadow under your bed...
Posted 24 October 2012 - 06:39 AM
lol still not working. I have a question. term.native.write ignores redirects right?