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

Make terminal output scrollable?

Started by CreeperGoBoom, 16 December 2019 - 10:48 PM
CreeperGoBoom #1
Posted 16 December 2019 - 11:48 PM
Is this possible? Say if someone used either their mouse wheel or keyboard up down buttons?

also can I then get the click location of said scrollable terminal screen?
Edited on 16 December 2019 - 10:49 PM
Lupus590 #2
Posted 17 December 2019 - 08:18 AM
You might want to look at mbs and advanced computers

http://www.computercraft.info/forums2/index.php?/topic/29253-mildly-better-shell-various-extensions-to-the-default-shell/

https://www.computercraft.info/wiki/Advanced_Computer
CreeperGoBoom #3
Posted 17 December 2019 - 08:30 AM
For the sake of code releasing. Would everyone else who gets my code also need to download and install mbs?

Thanks ill look more into the advanced computer. That might just be what I'm after.
CreeperGoBoom #4
Posted 17 December 2019 - 08:49 AM
Sorry for bump but google isn't coming up with anything.

What i want to be able to do i manually scroll through items that have been hidden, or should I say… pushed up out of view.

And mbs isnt installing for me so yeah..

How would I make it so that the text that got pushed up is scrollable other than maybe pulling scrolling/key events and using term.scroll?
Lupus590 #5
Posted 17 December 2019 - 09:25 AM
You don't need to install mbs, just look at its code and how it does it's scrolling feature (might be called scroll back)


What do you mean by scrollable? As in it moves everything up when it gets to the bottom (that's built in) or people can go back to look at what they typed in which scrolled off the top of the screen (mbs does this)?

Looking around the mbs code, what you want is this https://github.com/SquidDev-CC/mbs/blob/master/lib/scroll_window.lua you can find a example of its uses in the shell https://github.com/SquidDev-CC/mbs/blob/bf7d55154d7157b8f8d20e7d0b5856d8fc6027df/bin/shell.lua#L542 look for all the uses of the redirect variable