Jump to content




Mirror Utility Program - Contents Of Computer Screen On Monitor. v2

utility

36 replies to this topic

#1 Wojbie

  • Members
  • 631 posts
  • LocationKinda lost

Posted 08 November 2013 - 02:49 PM

Mirror Utility Program - Contents of Computer Screen On Monitor. v2.1

Mirror program allows you to copy contents of standard computer onto nearby screen. This allows for easy access to screen while having big monitor showing you exactly whats happening. Original version was created from standard monitor program. Since then it had many transformations.

Download Here: http://pastebin.com/DW3LCC3L
Or ingame by using command:
pastebin get DW3LCC3L mirror
(requires http-api to be active)

Features List:
  • Duplicates contents of screen in perfect fashion onto monitor
  • All monitor_touch event get transformed into mouse_click 1 events with translated coordinates.
  • Nice border to mark where screen ends. Also unused sides are nicely grayed out.
  • Handles term.redirect()!!! Attempts to resize mirror screen to fit new term target size. If not get as close as it can. Also if term.target is a monitor reacts to resizing of that monitor too.
  • Reacts to resizes of mirror monitor and attempts to keep it operational
  • For more that one mirror you can chain program. Command
    mirror monitor_0 mirror monitor_1 test
    
    Will mirror contents of terminal on both monitor_0 and monitor_1. They can be completely different sizes.
Screenshots:
Spoiler

This program is perfect when you want to show something to group of people and don't want them to mess with console.


Change-log:
Spoiler


Future Plans:
Spoiler

Old version:
Spoiler

Any Comment and Suggestions how to improve Code are appreciated.

Edited by wojbie, 19 October 2015 - 10:34 AM.


#2 Bomb Bloke

    Hobbyist Coder

  • Moderators
  • 7,099 posts
  • LocationTasmania (AU)

Posted 09 November 2013 - 08:34 PM

Pretty impressive. I'd been considering coding something like this functionality into the Tetris game itself - this handily saves me the trouble, and then some! :)/>

Things get a bit screwy if you try to resize a monitor while in use - though it would be difficult to counter that completely, at a glance I think it's supposed to at least clear the display before continueing, and in my tests it just used whatever the called script had set for the background colour to do that.

It crashes outright if it loses the monitor, and it seems it doesn't clear the monitor when you're done with it (or at least the border stays there)?

I wonder if you could rig this to direct the output to a computer (via rednet or whatever) instead of a monitor. That computer would forward it on to an actual monitor, and accept "redirects" from multiple computers at once (switching between the one it actually shows at random, or on redstone events etc). Having a large display in an arcade that alternates between what's happening on the different computers in the area would be pretty cool.

Edited by Bomb Bloke, 09 November 2013 - 08:36 PM.


#3 Wojbie

  • Members
  • 631 posts
  • LocationKinda lost

Posted 09 November 2013 - 08:48 PM

As for monitor loosing crash i will add fix to it in later version. Resizing is giving me a bit of problems at the moment cause it needs to wait until next yeld before resizing in current code - i plan to fix that in next version. Your program is great testbed for it with that Awesome self-resizing code ;p

As you can see i started from Monitor code and have a bits and parts leftover from that (like all coroutine code)
I need to rework it so term.redirect and term.recover yield program and then resize contents.

As for directing output to computer via rednet that would require me to write whole new term api with virtual screen storage and stuff. Good idea but not possible with direction I am going with this program right now.

This program got written when i started working on arcade on server i play on - idea is that there will be bricked computers locked in games and this mirror will duplicate contents of said games on screens over booths - so each booth has 3x4 or 2x3 screen showing current game and one computer to play said game. and all that wired using modem cables to main comuputer allowing me to turn booths on and off.

#4 Bomb Bloke

    Hobbyist Coder

  • Moderators
  • 7,099 posts
  • LocationTasmania (AU)

Posted 09 November 2013 - 11:58 PM

Thought of this, forgot it, then remembered it again:

Your script automatically resizes the monitor's text scale up to the largest it can while still fitting in the whole terminal display. You've probably noticed that my Tetris script does the exact same thing, but because it "knows" it only needs 50 columns (as opposed to the 51 available to the terminal) it'll scale up the text on a 5x3 monitor, whereas your mirroring tool waits for at least a 5x4 setup before enlarging.

It's probably a moot point for scripts that don't try to center themselves, but you might consider adding additional command line parameters to allow users to specify exactly how many columns/rows need to remain visible.

Edited by Bomb Bloke, 10 November 2013 - 12:00 AM.


#5 Wojbie

  • Members
  • 631 posts
  • LocationKinda lost

Posted 10 November 2013 - 07:31 AM

Finished polishing term.redirect() handling. Now it should work in all situations. I want to thank yo Bomb Bloke. That tetris code proved to be great test bed for all capabilities of my program!

View PostBomb Bloke, on 09 November 2013 - 11:58 PM, said:

It's probably a moot point for scripts that don't try to center themselves, but you might consider adding additional command line parameters to allow users to specify exactly how many columns/rows need to remain visible.

Idea of Mirror is to show whole screen - not a cut off part - while good idea by itself it don't fit what i tried to achieve here.

#6 Molinko

  • Members
  • 54 posts

Posted 06 December 2013 - 09:37 PM

I have a handy suggestion if you think you'd like it I'd be hapy to see it!!
The program could have a cmd line flag like '-keyboard' or something.. that will bring up a touchscreen keyboard ether on the redirected monitor or on a second monitor just for input to the redirected program. Other than my HARSH JUDGEMENT ON YOU AS A PROGRAMMER, great job, looks very handy as is and well coded too :).
p.s. PLZ take my suggestion if you have time to burn.. thanks

#7 Zambonie

  • Members
  • 477 posts
  • LocationSpring Hill, Fl

Posted 06 December 2013 - 11:20 PM

Seems very impressive! Ive been trying to figure out a way to do something like this for my program, and boom :D. There you are. I will check it out tomorrow.

#8 Wojbie

  • Members
  • 631 posts
  • LocationKinda lost

Posted 07 December 2013 - 04:22 AM

View PostMolinko, on 06 December 2013 - 09:37 PM, said:

I have a handy suggestion if you think you'd like it I'd be hapy to see it!!
The program could have a cmd line flag like '-keyboard' or something.. that will bring up a touchscreen keyboard ether on the redirected monitor or on a second monitor just for input to the redirected program. Other than my HARSH JUDGEMENT ON YOU AS A PROGRAMMER, great job, looks very handy as is and well coded too :).
p.s. PLZ take my suggestion if you have time to burn.. thanks

Hmm i could add this. It would require monitor to be bit bigger for keyboard to fin under the frame. Will think on it.

View PostTroll., on 06 December 2013 - 11:20 PM, said:

Seems very impressive! Ive been trying to figure out a way to do something like this for my program, and boom :D. There you are. I will check it out tomorrow.

Hope you like it. Any feedback is welcome.

#9 comp500

  • Members
  • 66 posts

Posted 23 December 2013 - 05:55 AM

Would it be possible to run one application on 2 monitors and use the Parallel api to run another on the main terminal? In my example I am making a cinema with 1 large monitor mirrored with a small monitor, and the main computer used to control everything. Would this be available as an API so that it can be easily incorporated into my program?

#10 Wojbie

  • Members
  • 631 posts
  • LocationKinda lost

Posted 23 December 2013 - 04:22 PM

hmm i wrote it a long time ago when i wanted to copy monitor program functionality. There are some parts of code that would not translate correctly in api form (i know i was young and idiot in lua ways, ) I never considered making a api from this thing. While i think it can be done i also for-see problems with term.redirect causing a mess ;p Sadly i don't have a lot of time those day to fit this program up and make something like api from that. Anyone is welcome to try it ;p i might get on it when i have some free time.

Edited by wojbie, 23 December 2013 - 04:23 PM.


#11 comp500

  • Members
  • 66 posts

Posted 24 December 2013 - 04:29 AM

View Postwojbie, on 23 December 2013 - 04:22 PM, said:

hmm i wrote it a long time ago when i wanted to copy monitor program functionality. There are some parts of code that would not translate correctly in api form (i know i was young and idiot in lua ways, ) I never considered making a api from this thing. While i think it can be done i also for-see problems with term.redirect causing a mess ;p Sadly i don't have a lot of time those day to fit this program up and make something like api from that. Anyone is welcome to try it ;p i might get on it when i have some free time.
Thanks! I currently have it set up with monitor and mirror together outputting one program to 2 monitors but i need to be able to control the terminal itself.

#12 trajing

  • Members
  • 10 posts

Posted 24 December 2013 - 02:05 PM

Wow, this is amazing! I use it for my advanced monitor billboard.

#13 comp500

  • Members
  • 66 posts

Posted 28 December 2013 - 11:55 AM

View Postcomp500, on 24 December 2013 - 04:29 AM, said:

View Postwojbie, on 23 December 2013 - 04:22 PM, said:

hmm i wrote it a long time ago when i wanted to copy monitor program functionality. There are some parts of code that would not translate correctly in api form (i know i was young and idiot in lua ways, ) I never considered making a api from this thing. While i think it can be done i also for-see problems with term.redirect causing a mess ;p Sadly i don't have a lot of time those day to fit this program up and make something like api from that. Anyone is welcome to try it ;p i might get on it when i have some free time.
Thanks! I currently have it set up with monitor and mirror together outputting one program to 2 monitors but i need to be able to control the terminal itself.
nvm - I found http://www.computerc...1117#entry41117 and managed to achieve what I wanted. Thanks anyway!

#14 Mr_Programmer

  • Members
  • 95 posts
  • LocationA CPU some where in Bolton, UK

Posted 09 January 2014 - 11:53 PM

how would i get this to work using wired modems hooked up to a computer and a monitor?

scratch that last comment i found it out and i cant get the display to go bigger as im using a 7x5 monitor and its only using like 5x4 :(

#15 Lyqyd

    Lua Liquidator

  • Moderators
  • 8,450 posts

Posted 10 January 2014 - 12:32 AM

You could try adjusting the text scale. Check the wiki for more information.

#16 Wojbie

  • Members
  • 631 posts
  • LocationKinda lost

Posted 10 January 2014 - 01:52 AM

View PostMr_Programmer, on 09 January 2014 - 11:53 PM, said:

how would i get this to work using wired modems hooked up to a computer and a monitor?

scratch that last comment i found it out and i cant get the display to go bigger as im using a 7x5 monitor and its only using like 5x4 :(

View PostLyqyd, on 10 January 2014 - 12:32 AM, said:

You could try adjusting the text scale. Check the wiki for more information.

That would not work - program scales monitor on its own depending on needed size. Also its made for 100% perfect duplication of terminal - so it will leave empty space on sides when it finds best scale simply cause thats the best one it detected.

#17 The5heep

  • Members
  • 13 posts

Posted 08 May 2014 - 04:26 AM

This will not work in the 1.6 update. It has a problem with multishell and gives me an error 60% of the time. Please fix this it was sooooooo good when it worked!

#18 Wojbie

  • Members
  • 631 posts
  • LocationKinda lost

Posted 08 May 2014 - 06:55 AM

Yes i realize its not working correctly in 1.6 due to the changes in redirection mechanisms. I am working on new improved version but its a little bit in future because of lack of time to code right now. Will update as soon as its ready. :D

#19 The5heep

  • Members
  • 13 posts

Posted 08 May 2014 - 07:41 PM

Yay!

When will the new version be out do you suppose?

#20 SquidDev

    Frickin' laser beams

  • Members
  • 1,402 posts
  • LocationDoes anyone put something serious here?

Posted 08 May 2014 - 08:28 PM

View PostBomb Bloke, on 09 November 2013 - 08:34 PM, said:

I wonder if you could rig this to direct the output to a computer (via rednet or whatever) instead of a monitor. That computer would forward it on to an actual monitor, and accept "redirects" from multiple computers at once (switching between the one it actually shows at random, or on redstone events etc). Having a large display in an arcade that alternates between what's happening on the different computers in the area would be pretty cool.

View Postwojbie, on 09 November 2013 - 08:48 PM, said:

As for directing output to computer via rednet that would require me to write whole new term api with virtual screen storage and stuff. Good idea but not possible with direction I am going with this program right now.
You could have a look at NSH (mostly the Framebuffer API). I think this uses term.redirect to achieve most of its functionality.





2 user(s) are reading this topic

0 members, 2 guests, 0 anonymous users