This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Doyle3694's profile picture

[Question] term.scroll()?

Started by Doyle3694, 07 January 2013 - 01:17 AM
Doyle3694 #1
Posted 07 January 2013 - 02:17 AM
Hello everyone! In my header making adventures, I have successfully rewritten getSize(), getCursorPos(), term.clear() and setCursorPos() to be compatible with my header.

However, I've struck into a problem. While I know and knew how all those functions work, I have no experience in term.scroll whatsoever. I have no idea what the code for it is, and dont know what to override and modify it with to make it work with a 2 line header. Ideas anyone? I checked through the file of term APi and there was nothing helping to be found :(/>
Also, as you might've guessed, I'm fairly advanced ar lua, so wont need explanations on everything, would probably be able to understand the code if you just provide me a working code snippet.
Cloudy #2
Posted 07 January 2013 - 02:56 AM
The code is simple. It removes the top x lines (where x is the number specified, 1 if none specified) and shifts all lines up. Probably best you call the actual function then just redraw your header.
Doyle3694 #3
Posted 07 January 2013 - 03:01 AM
Hmmm, OK. I guess thats the route I'm forced to go. I was just thinking for example the edit program will be abit hurt from that. Though I will probably never use it so I should be fine. Implementing changes right now, will return if any eventual problems appear. Thanks! :)/>

EDIT: Tested and works fine :)/> Edit program didn't do what I expected, it actually worked like it's suppposed to do. So I guess all is fine :)/> Thanks cloudy, you're the best! ;)/>