I am trying to make a computer system/network on Tekkit using computercraft.
Computecraft is a Lua based modification which runs within Minecraft/Tekkit and other modification packages.
Basically, I am currently using a wireless router to perform this:
rednet.open('top') -- Open Connection to the wireless router
print ("test")
input = read()
rednet.receive() -- Listen for messages send/broadcasted
if message then
print (message)
end
I am trying to perform a change to all my systems which is something like this:
rednet.open ('top')
-- Do all normal stuff
rednet.receive()
if message == "Lock202" then
os.pullEvent = os.pullEventRaw
term.clear()
term.setCursorPos(1,1)
print ("Alert In Progress, Terminal Locked")
end
by do all normal stuff, I want the user to be able to navigate and use the functionality of the computer. But when calling rednet.receive()
it freezes and awaits an incoming message.
I want this to run in the background and only act when a message is received.
I have tried looking at the documentation, helpsites. and thought to bring this question over to SO because due to the range of Lua Coders available.