Posted 08 October 2013 - 12:50 PM
Trying to make a "walkie Talkie"
So I'm making a little program for me and my friends to use as a sort of secondary chat system… I have the basics set out, but I want it to keep the text until it receives the next input.
As of now, it takes 5 seconds for the message to be cleared, then you can put a new one in, but as stated above, that's not what I want. Anything helps, especially the function that waits for a chat command to do things.
Thanks, C1
P.S.I snagged the peripheral finding system form "Plastic Beta[WIP], along with anything else I didn't understand.
So I'm making a little program for me and my friends to use as a sort of secondary chat system… I have the basics set out, but I want it to keep the text until it receives the next input.
for k,v in pairs(rs.getSides()) do
if (peripheral.getType(v) == "terminal_glasses_bridge") or (peripheral.getType(v) == "glassesbridge") then
p = peripheral.wrap(v)
break
elseif (peripheral.getType(v) == "sensor") and (not worldSensor) then
worldSensor = sensor.wrap(v)
if not (worldSensor.getSensorName() == "worldCard") then
worldSensor = false
end
end
end
while true do
p.clear()
--reads $$words and text
local msg = os.pullEvent("chat_command")
local wide = getStringLength(msg)
--sets the message usable
local say = msg
p.addGradientBox(0, 0, wide+2, 10, 0xaaaaaa, 1, 0xffffff, .5, 1)
--displays text
p.addText(1, 2, say, 0x000000)
os.sleep(5)
end
As of now, it takes 5 seconds for the message to be cleared, then you can put a new one in, but as stated above, that's not what I want. Anything helps, especially the function that waits for a chat command to do things.
Thanks, C1
P.S.I snagged the peripheral finding system form "Plastic Beta[WIP], along with anything else I didn't understand.