Posted 13 December 2013 - 10:38 AM
Heyo,
I finally got my login program finished (thanks to the person who gave me the code I needed to start off with :)/> ), and I got everything else set up, but I'm having some trouble turning on the lights in my cellar.
This is the code the client receives:
And this is the code the server sends:
I double-checked that the client's ID is 25, before trying, so it has to be something else.
Any help is much appreciated.
(P.S. Sorry if the code looks ugly. I'm used to languages like Java and C# :rolleyes:/> )
I finally got my login program finished (thanks to the person who gave me the code I needed to start off with :)/> ), and I got everything else set up, but I'm having some trouble turning on the lights in my cellar.
This is the code the client receives:
-- Program can be terminated!
print("Opening rednet port...")
rednet.open("top")
print("Waiting for rednet signal....")
msg = rednet.receive()
print("Signal received.")
print("Processing signal. Please wait...")
if msg == "TurnOn" then
print("Turning lights on!")
-- Possible todo; add cool blink effect
redstone.setOutput("front", true)
sleep(1)
redstone.setOutput("front", false)
sleep(0.8)
redstone.setOutput("front", true)
sleep(2)
redstone.setOutput("front", false)
sleep(1)
redstone.setOutput("front", true)
end
-- The rest loops for a rednet signal in the same way as above, to detect when to turn the lights off.
And this is the code the server sends:
print("Please wait...")
rednet.open("left")
on = "TurnOn"
off = "TurnOff"
print("Sending request...")
rednet.send(25, on)
print("Lights are turning on. Enjoy.")
I double-checked that the client's ID is 25, before trying, so it has to be something else.
Any help is much appreciated.
(P.S. Sorry if the code looks ugly. I'm used to languages like Java and C# :rolleyes:/> )