Posted 04 November 2012 - 02:45 AM
Hello :)/>/>
I am going to make my own GPS program in ComputerCraft. :)/>/>
Here is the code so far for the Client: :)/>/>
I need to be able to wait for 20 seconds and receive all the replies and save them to a table.
1. How do I receive rednet messages and wait at the same time?
2. How do I save messages to a table with a- Distance(part of rednet) b- Location (in message) c- ID of sender (rednet)
If this is too confusing to understand please say :D/>/>
Thanks In Advance!
waffles05 :)/>/>
I am going to make my own GPS program in ComputerCraft. :)/>/>
Here is the code so far for the Client: :)/>/>
print("Finding Distances...")
print("|")
write("+-- Activating Modem..")
rednet.open("top") -- Opens Top Modem
print(" Done.")
print("|")
write("+-- Broadcasting Distance Request..")
rednet.broadcast("$DistanceRequest") -- Sends to all GPSs Systems a distance request
write(" Done.")
print("|")
print("+-- Waiting For Reply..")
seconds = 20
print(" |")
while seconds > 0 do
-- Code For Recieving and Waiting
end
I need to be able to wait for 20 seconds and receive all the replies and save them to a table.
1. How do I receive rednet messages and wait at the same time?
2. How do I save messages to a table with a- Distance(part of rednet) b- Location (in message) c- ID of sender (rednet)
If this is too confusing to understand please say :D/>/>
Thanks In Advance!
waffles05 :)/>/>