Posted 09 August 2013 - 08:08 PM
Hello I need help with the new modem api
I am trying to make is if the message is 1234 it launches the missile
Here is my code
Server
Another question is how would I write a message to send
So I would have to write the message and then it would send that message to the server
Client
In case you guys don't understand what I am trying to do with my code.
On the client side- You type the launch code if it is wrong a message comes up that says WRONG and something blows up. If it is write then the client send the command to the server to launch the missile.
Server Side
If it recieves the command it launches the missile
Or
Client Side
You type in launch code to send. Sends it and server receives message
Server side
If message is right it launches missiles
If wrong sends a command back to client that will make the area surrounding it blow up
What I don't Understand:
I do not understand how to make the server read a message that is sent from the client.
I do not understand how to make the server check the client message versus the right answer.
I am trying to make is if the message is 1234 it launches the missile
Here is my code
Server
local modem = peripheral.wrap("right")
icbm = peripheral.wrap("left")
modem.open(3)
if modem_message == "1234" then
icbm.launch()
end
end
Another question is how would I write a message to send
So I would have to write the message and then it would send that message to the server
Client
local modem = peripheral.wrap("right")
modem.transmit(3, 1, "1234")
In case you guys don't understand what I am trying to do with my code.
On the client side- You type the launch code if it is wrong a message comes up that says WRONG and something blows up. If it is write then the client send the command to the server to launch the missile.
Server Side
If it recieves the command it launches the missile
Or
Client Side
You type in launch code to send. Sends it and server receives message
Server side
If message is right it launches missiles
If wrong sends a command back to client that will make the area surrounding it blow up
What I don't Understand:
I do not understand how to make the server read a message that is sent from the client.
I do not understand how to make the server check the client message versus the right answer.