Advanced Peripherals

Advanced Peripherals

29M Downloads

Chat Box only sends 1 message at a time

Synthetic-Dev opened this issue ยท 8 comments

commented

Describe

Running multiple sendMessage calls one after another only results in the first message being sent into the chat.

Steps to reproduce

  1. Place computer with a chat box peripheral
  2. Run code like below:
local chatBox = peripheral.find("chatBox")

chatbox.sendMessage("Hello world!")
chatbox.sendMessage("I am dave", "Dave")
  1. See that only "Hello world!" appears in chat

Multiplayer?

No

Version

1.18.2-0.7.22r (Latest 1.18)

Minecraft, Forge and maybe other related mods versions

Forge 40.1.76 Minecraft 1.18.2

Screenshots or Videos

No response

Crashlog/log

No response

commented

Does the second attempt return anything? The method returns either true or false with a error message

commented

It should return cooldown notification, because AP have cooldowns for sending chat messages.

commented

Thank you edvin
I completely forget that

commented

Ah awesome! I'm actually in the middle of overhauling the AP docs for you so I'll make sure to add this to them.

commented

That sounds interesting

commented

If you want to send a message to a player, you need to use sendMessageToPlayer

commented

I know that, the issue is that 2 or more sendMessage one after another (like above) doesn't work. Only the first message is sent to chat, the second is ignored.

Expected:

[AP] Hello world!
[Dave] I am dave

Reality:

[AP] Hello world!
commented

Oh sorry, my fault. I thought Dave is a player, I forgot that the prefix argument exists