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

Remote computer help

Started by Joseph_Stalin, 20 May 2014 - 01:01 AM
Joseph_Stalin #1
Posted 20 May 2014 - 03:01 AM
Hello, would anyone mind lending me a hand. I seem to be stumped. I have created a bit of code(although I am still terrible with all the coding but I think I am getting there :P/> ) for a general touch screen device within my friend and I's home base. The only problem is I have so many wires, pipes, conduits, and cables in the walls that I no long have room for more cables without redirecting around the entire base. So I attempted to combine the rednet with the touchscreen(this is where I am running into issues). I have the code for both the main computer and the receiving computer but the receiving computer is not executing the command given. Could someone take a look at my code and tell me what I am doing horribly wrong? I would honestly appreciate the help as I am still trying to grasp the concept of coding. Thanks in advance for any replies.

Main comp- http://pastebin.com/g97FpGe4
Receiving comp- http://pastebin.com/TBntBU5U

Please I know that my code is probably not "good" but please accept the fact that I made an attempt.
Cranium #2
Posted 20 May 2014 - 06:34 AM
I split your topic into its own. For future reference, make sure if you have a question about your code, to post it here, in Ask A Pro. That way, you can get the most help from our community.
CometWolf #3
Posted 20 May 2014 - 08:59 AM

message = rednet.receive()
if message == SU then do
rednet receive returns the id as the first variable, the message would be the second one.
Also, SU is an undefined variable on your receiving computer, so comparing your message to that is the same as comparing it to nil. Im guessing you forgot the quotation marks to make it a string.
Also, you don't need a do after an if statement. This is why your program wouldn't run without an extra end aswell.
Joseph_Stalin #4
Posted 20 May 2014 - 05:20 PM
Thanks for the help and I was able to get the receiving computer to output a signal, but now I need to get the receiving computer to execute the command continuesly until the main computer is toggled off.

This is my code now
Receiving comp- http://pastebin.com/GmisZ1LF
Main comp- http://pastebin.com/zHRD7Skk

The SU function is the function I am executing on the main computer.