AnD4D
Sure you can, even though its kinda similar to what you do but it might be a little more simple.
So we need the following:
connect with WEBSOCKET [x]
A GLOBAL text CHAT = ""
A TextBox (to show the chat message)
SUB EVENT: Websocket, on message
-ACTION: System -> Set CHAT -> Replace replace(WebSocket.MessageText,"@","!")
^ This simply just replace EVERY "@" received with a "!" , which sounds really odd without a explanation, but it simply lets us seperate the USERNAME from all the rest of the text. Since a normal websocket would looks as the following:
:crudetower!crudetower@crudetower.tmi.twitch.tv PRIVMSG #thecrudecastle :Hello world
It will then become the following:
:crudetower!crudetower!crudetower.tmi.twitch.tv PRIVMSG #thecrudecastle :Hello world
Which allow us to do this as a complete command:
SUB EVENT: Websocket, on message
-ACTION: System -> Set CHAT -> replace(WebSocket.MessageText,"@","!")
-ACTION: System -> Set text -> tokenat(Chat_Current_Message,1,"!")&newline&tokenat(Chat_Current_Message,1,"#"&USERNAME&" :")
It first sepate the text at the FIRST apperance of a "! and get the VALUE and stops when the next apperance happens.
it then makes a NEWLINE
finally it makes the last seperator which happens at #USERNAME, and this gives us the following message in our CHATBOX:
"crudetower
:Hello World"
Sooo to actually explain your question (after that long ranting) I simply control if the USER is "crudetower" (my bot) and what it says, here its keywords like you do:
SUB EVENT: System -> Find(Chat_Current_Message,"crudetower") NOT EQUAL -1
Find(find(Chat_Current_Message,"knight") NOT EQUAL -1
This is for my followers, So if its anyone ELSE then crudetower that says knight then nothing will happen, but if it is crudetower saying knight the event will trigger.