LUA OpenComputers Computronics Minecraft Speech Box Queue

504 Views Asked by At

I had a problem with coding in OpenOS system of the OpenComputers mod for Speech Box of the Computronics mod. I can’t say phrases in a certain order. It seems to me that all the phrases that I launch during the work of the speech box are ignored. I would like to make a queue for say command but I don't how I can do that. This is my second day of coding in lua. Moreover, I don't know a lot of patterns, architectures and mechanisms. I still have not figured out the events in lua. Thanks in advance for any help.

component.getPrimary("speech_box").isProcessing() -- returns boolean
component.getPrimary("speech_box").say(string)

Problem code fragment:

function readMessage(text)
    local tts = component.getPrimary("speech_box")
    tts.setVolume(100)
    tts.say(text)
end

for index,value in pairs(data.body) do
    readMessage(data.body[index])
end
0

There are 0 best solutions below