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

Computercraft "Goto My PC" Via Rednet.

Started by 873Project, 30 October 2012 - 03:17 PM
873Project #1
Posted 30 October 2012 - 04:17 PM
Hi guys I would like to know if it is possible to make a program In computercraft that would act like things like "Goto My PC". What I would like the program to do is once the computer you would like to use receives a certain message it will type whatever you type, run the programs you want and so you know what you are doing it will recreate the screen and message it to you in the form of a rednet message. It would update every few seconds to avoid lag.

If this is possible guys I'd really appreciate if you could tell me or if you have done something like it the could you show me it. Thanks for reading this and I think it would be fun to try make!
remiX #2
Posted 30 October 2012 - 05:08 PM
Hmm. That should be possible but could be tricky. Try looking around for codes and show us what you can do - we won't code all of it for you from scratch :P/>/>
873Project #3
Posted 30 October 2012 - 06:04 PM
Yeah it would be tricky, it would be good for a team of people to do though. It would be a good task for the "Pro Coders" to get together and do or I would have to spend around a week writing the code in notepad or something similar and it wouldn't be very stable.
zekesonxx #4
Posted 30 October 2012 - 06:09 PM
It is very possible, but would be very hard. You would have to make a screen capturing program, recode all the default programs to accept keypresses and mouse presses from the client computer, and make some kind of wrapper to automatically recode non-default programs to accept keypresses and mouse hits from the client computer.

It would take at least a week, probably more. It would be a lot easier to code a program to remotely do whatever you are trying to do (Like print), or to just walk to the other computer.
KaoS #5
Posted 30 October 2012 - 06:11 PM
well basically you have to do a term redirect that modifies the term api to run as normal but any time it is called to also send the command and parameters to the remote PC, the remote PC then executes them
the remote PC also constantly listens for events and sends all char and key events through rednet in a serialized table. on arrival they are queued as normal with the os.queueEvent command.

the redirecting part is the main problem here
ChunLing #6
Posted 30 October 2012 - 06:26 PM
Why not just use a simple rednet FTP program? I mean, just how complex an environment do you have installed on the computer you want to access?
Lyqyd #7
Posted 30 October 2012 - 06:42 PM
Why not just use a simple rednet FTP program? I mean, just how complex an environment do you have installed on the computer you want to access?

FTP and remote shell access serve very different roles.

The net shell client/server for LyqydNet uses terminal redirection to transmit the screen updates from one computer to another. Events transmission from client to server is planned, but not currently implemented.
873Project #8
Posted 30 October 2012 - 07:18 PM
well basically you have to do a term redirect that modifies the term api to run as normal but any time it is called to also send the command and parameters to the remote PC, the remote PC then executes them
the remote PC also constantly listens for events and sends all char and key events through rednet in a serialized table. on arrival they are queued as normal with the os.queueEvent command.
Yeah you would have to make a program that reads all of the "blocks" on the screen and write them. The only hard bit is the code that can read what is where and how to write it which is really annoying because otherwise it would be moderately easy to make.
ChunLing #9
Posted 30 October 2012 - 07:19 PM
Well, you have a complex enough environment for it to make sense. But not everyone else does. I don't.
873Project #10
Posted 31 October 2012 - 04:57 PM
Hi guys somone called a ardera has made somthing similar to this but it's two separate programs here is the URL for the forum page:

http://www.computercraft.info/forums2/index.php?/topic/3414-screen-capture-v-02-now-with-player-and-remote-computer-control/

With a few tweaks to his screen capture program so it sends what it captures over rednet and then we would have to combine it with his wireless computer control program and then we have it!
KaoS #11
Posted 31 October 2012 - 05:13 PM
Hi guys somone called a ardera has made somthing similar to this but it's two separate programs here is the URL for the forum page:

http://www.computerc...mputer-control/

With a few tweaks to his screen capture program so it sends what it captures over rednet and then we would have to combine it with his wireless computer control program and then we have it!

however there are 3 problems with that suggestion

these 2 aren't really problems. just irksome
1: we must ask for permission to rip his code
2: we must give him full credit in the file

the problem:
3: we would be using code that we do not understand fully or we would have just written it
Lyqyd #12
Posted 31 October 2012 - 05:51 PM
the problem:
3: we would be using code that we do not understand fully or we would have just written it

Contrary to popular belief, this is not really a problem. Out in the real programming world, people re-use other people's code all the time in the form of libraries or APIs. A well-written, well-documented library isn't something you necessarily need to understand fully. One does not always need to entirely write their own code from scratch, especially if someone else has provided code that does part of the task well and has made it readily available for use by others.
873Project #13
Posted 31 October 2012 - 06:07 PM
the problem:
3: we would be using code that we do not understand fully or we would have just written it

Contrary to popular belief, this is not really a problem. Out in the real programming world, people re-use other people's code all the time in the form of libraries or APIs. A well-written, well-documented library isn't something you necessarily need to understand fully. One does not always need to entirely write their own code from scratch, especially if someone else has provided code that does part of the task well and has made it readily available for use by others.
Yeah but I would still ask for his permission to "publish it" and give him a lot of credit for the program. It should should be fairly easy to understand after a bit.
KaoS #14
Posted 01 November 2012 - 10:02 PM
I'm not sure why but using code that I don't understand bugs me. I find it unprofessional. I know I'm not being very realistic but I still couldn't do it
ChunLing #15
Posted 02 November 2012 - 11:59 AM
I'll run code I don't understand, but when I know it works I try to figure out how. No point banging your head against a code without knowing whether or not it does anything useful.