Posted 23 June 2014 - 12:38 PM
Hello there,
This is the setting: i have a code listening for rednet messages incoming.
(like this):
while true do
–print("Ready for RednetInput")
local id, message, distance = rednet.receive()
local splitMessage = Split(message, " ")
if splitMessage[1] == "pa" then
if splitMessage[2] == "setup" then
if splitMessage[3] == "locate" then
rednet.send(id, "pa setup masterHere")
worker[wtblin] = id
wtblin = wtblin + 1
print("Worker" .. wtblin .. " listed")
print("Has id " .. tonumber(worker[wtblin-1]))
end
elseif splitMessage[2] == "job" then
if splitMessage[3] == "request" then
local job = GetJobForTurtle()
print("Turtle " .. id .. " now has job " .. job)
if SendAndGetResponse(id, "pa job do " .. job) ~= "pa job confirm" then
jobNumber = jobNumber - 1
print("JobRequestReceived - but not confirmed!!!")
end
end
end
end
end
end
It is embedded in an endless loop, so you cant access the console of the computer to type in anything.
And now the question: is it possible to get input by the player with e.g. the read() commmand while the computer is performing the rednet listener?
This is the setting: i have a code listening for rednet messages incoming.
(like this):
Spoiler
function RednetListener()while true do
–print("Ready for RednetInput")
local id, message, distance = rednet.receive()
local splitMessage = Split(message, " ")
if splitMessage[1] == "pa" then
if splitMessage[2] == "setup" then
if splitMessage[3] == "locate" then
rednet.send(id, "pa setup masterHere")
worker[wtblin] = id
wtblin = wtblin + 1
print("Worker" .. wtblin .. " listed")
print("Has id " .. tonumber(worker[wtblin-1]))
end
elseif splitMessage[2] == "job" then
if splitMessage[3] == "request" then
local job = GetJobForTurtle()
print("Turtle " .. id .. " now has job " .. job)
if SendAndGetResponse(id, "pa job do " .. job) ~= "pa job confirm" then
jobNumber = jobNumber - 1
print("JobRequestReceived - but not confirmed!!!")
end
end
end
end
end
end
It is embedded in an endless loop, so you cant access the console of the computer to type in anything.
And now the question: is it possible to get input by the player with e.g. the read() commmand while the computer is performing the rednet listener?
Edited on 23 June 2014 - 11:03 AM