Peripherals++

Peripherals++

359k Downloads

Chatmsg through Speaker returns outofboundexception after running once

MichaelRoesner opened this issue ยท 3 comments

commented

while running this script:

//
chatbox = peripheral.wrap("left")
speaker = peripheral.wrap("right")

while true do
event, player, message = os.pullEvent("chat")
if message ~= nil then
speaker.speak(message, 100, "en")

end
end
//

it runs one time, outputs a chatmsg via speakers and then show the following error:

Java Exception Thrown:
java.lang.ArrayIndexOutOfBoundsException: 3

commented

So it actually says the full message?
Can you also mention CC and p++ versions?

commented

Sorry I forgot:
CC 1.7.10-1.73
p++ 1.7.10-1.2.4

Yes, it does the full chatmsg via speaker output, then returns the error.

commented

Okay, I know what's wrong (derp on my part). Until the fix is released, replacing the "speaker.speak(message, 100, "en")" line with "speaker.speak(message, 100, "en", false)" should work.