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

Wireless Redirect concept

Started by Inumel, 18 April 2015 - 04:15 PM
Inumel #1
Posted 18 April 2015 - 06:15 PM
I have no code, I don't even know if this is possible, so hear I ask.

Is it possible to redirect the terminal via a wireless modem?

basically remote access for a computer from a pocket computer
I have not even begun testing as I don't think its possible, but I would like to hear it from the pro's.
Dragon53535 #2
Posted 18 April 2015 - 06:20 PM
Yes it is possible, just very difficult
Creator #3
Posted 18 April 2015 - 06:32 PM
It is not so difficult at all. This is how it works: The sender overrides all of the term functions with arguments to send the invoked function to the reciever. The reciever then executes those functions. Be sure to ask me if I was not clear. ;)/>

For example:
newTerm.write = function(arg) term.write(arg) rednet.send(id,"term.write("..arg..")")

of course back up the original functions.

The reciever looks like this:

_,data = rednet.receive()

local func = loadstring(data)
setfenv(dfunc,_G)
func()
Edited on 18 April 2015 - 04:36 PM
Lyqyd #4
Posted 18 April 2015 - 06:53 PM
Yes, Terminal Redirection over Rednet is possible, and has been used in programs before.

And no, it does not look anything like the post above.
Creator #5
Posted 18 April 2015 - 06:56 PM
Well, but that is the basic idea.
Inumel #6
Posted 18 April 2015 - 07:32 PM
Thank you Lyqyd.
And Creator, for giving me some interesting ideas.
Creator #7
Posted 18 April 2015 - 07:36 PM
You are welcome. One thing that makes me curios is that you gave dragon a +1 for telling you it is difficult to make ;)/>
Dragon53535 #8
Posted 18 April 2015 - 11:52 PM
Creator, it may not of been him to of +1'd me. And even if he did, that is not a noteworthy thing to do. My statement is sound, to create something such as the TROR is difficult. Depending on what you do it can be barely difficult, just getting a semi working shell, or quite difficult, such that you send every event over rednet so that both sides can interact with the same machine.
Creator #9
Posted 18 April 2015 - 11:54 PM
It just amused me, that's all ;)/>
Dragon53535 #10
Posted 18 April 2015 - 11:55 PM
Also there is of course the problem of pocket computers having a different height and width of the computers.
Inumel #11
Posted 19 April 2015 - 12:25 AM
It just amused me, that's all ;)/>

Sorry I've been hard at work in game testing some things, I simply +1'd him because he was the first person to answer the post, is all. Nothing special :P/>