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

Openperipheral: Redirect Terminal To Terminal Glasses!

Started by Hazrock, 30 August 2013 - 08:01 PM
Hazrock #1
Posted 30 August 2013 - 10:01 PM
[attachment=1324:2013-08-30_20.42.08.gif]

This program redirects the terminal to a terminal glasses bridge. (default back side)
  • Full color support!
  • Works flawlessly in singleplayer (you may experience image ghosting in multiplayer, re-equip glasses to fix)
  • Complete control of your computer, remotely!
    • Run a command starting with $$ (e.g. "$$rom/programs/secret/alongtimeago\n") to "type" that on the terminal
    • escape codes for various key combinations:
      • \n simulates a press of the enter key
      • \b for backspace
      • \t \r \s for Ctrl + T, Ctrl + R, Ctrl + S
  • Very configurable! Size & position of screen, even individual color codes and background opacity!
  • To download, simply run "pastebin get MCjPAhyz CcGlasses". Then run it at startup via your favorite method (renaming it to "startup", placing a shell.run() in startup, etc.)
Note: Written for ComputerCraft 1.53 and OpenPeripheral 0.1.9. May work on newer and older versions, not tested.

It works by running term.redirect() against a fake monitor object. With a little bit of work, you could redirect to the object at will, and manipulate it as a standard monitor. Note also that while there is a mon.setTextScale() method implemented, it is completely untested, as term does not make use of it.
Lyqyd #2
Posted 30 August 2013 - 10:53 PM
An advisory: it would be unwise to use this in an SMP server without prior approval from the admins, as the terminal glasses have a tendency to cause significant load and/or noticeable lag.
Zudo #3
Posted 01 September 2013 - 10:04 AM
Very nice!
Mikeemoo #4
Posted 01 September 2013 - 10:26 AM
An advisory: it would be unwise to use this in an SMP server without prior approval from the admins, as the terminal glasses have a tendency to cause significant load and/or noticeable lag.

I've not had any bug reports relating to that, except of course, when people try to render images to their screen and crazy stuff like that, which is purely client-side lag.

Have I missed something?

(Very cool Hazrock! Seen Gopher and some others do similar before. It's an awesome idea)
Lyqyd #5
Posted 01 September 2013 - 03:51 PM
At one point, I used nsh over it, which was enough to cause some minor but noticeable lag. Gopher mentioned seeing someone get banned from a server for causing lag specifically by using the terminal glasses. I don't have good reproduction instructions, but there are/were definitely a few lag-related issues with them.
Rougeminner #6
Posted 14 September 2013 - 01:23 AM
[attachment=1324:2013-08-30_20.42.08.gif]

This program redirects the terminal to a terminal glasses bridge. (default back side)
  • Full color support!
  • Works flawlessly in singleplayer (you may experience image ghosting in multiplayer, re-equip glasses to fix)
  • Complete control of your computer, remotely!
    • Run a command starting with $$ (e.g. "$$rom/programs/secret/alongtimeago\n") to "type" that on the terminal
    • escape codes for various key combinations:
      • \n simulates a press of the enter key
      • \b for backspace
      • \t \r \s for Ctrl + T, Ctrl + R, Ctrl + S
  • Very configurable! Size & position of screen, even individual color codes and background opacity!
  • To download, simply run "pastebin get MCjPAhyz CcGlasses". Then run it at startup via your favorite method (renaming it to "startup", placing a shell.run() in startup, etc.)
Note: Written for ComputerCraft 1.53 and OpenPeripheral 0.1.9. May work on newer and older versions, not tested.

It works by running term.redirect() against a fake monitor object. With a little bit of work, you could redirect to the object at will, and manipulate it as a standard monitor. Note also that while there is a mon.setTextScale() method implemented, it is completely untested, as term does not make use of it.

Now that is truly amazing
ZEKROM67 #7
Posted 21 September 2013 - 08:47 AM
Epic. I'll try this one.
willwac #8
Posted 22 September 2013 - 01:25 PM
pretty cool!

I'll probably use it forever :D/>

How do I press CTRL?
BenjiButton #9
Posted 05 December 2013 - 08:33 AM
where is the code I can't find it?

Edit: oops found it now
pastebin get MCjPAhyz
Edited on 05 December 2013 - 10:51 AM
Lyqyd #10
Posted 05 December 2013 - 10:47 AM
Try slowing down and actually reading the original post.
DarkHearted1 #11
Posted 02 November 2014 - 01:33 AM
I would like to use this for my main base comp, but when I try to, it gives me this error:

startup:25:attempt to index ? (a nil value)

which I'd assume is being caused by "mon.box.setZIndex(-1)", probably because I'm trying to use it in CC 1.63.

If this is why, and it can't really be fixed, that's fine. I just figured I'd see if anyone who knows a little more than I do might know a way to fix it.