mIRC Homepage
Posted By: DevilBeach On Join not working - 16/04/16 01:35 AM
I am creating a twitch bot for my friend, I have the "on text" function working properly but the following code doesn't execute when a new user joins the chat

On !*:Join:#:{
msg $nick Hey There $nick ! Welcome To $chan !
}

This is the first time I've used this language so I'm not 100% familiar with the syntax. Any tips and help would be greatly appreciated!
Posted By: Netct25 Re: On Join not working - 16/04/16 09:34 AM
Hi Devil,

Try using this script. Compare both and you will see the difference in my syntax and yours. If you have any questions feel free to ask me. smile Hope this fixes your issue. Just a couple of run downs of what each identifier does. # means channel, $nick the username who activated the command or in your case triggered it. In yours you had msg $nick in this case, $nick cannot be messaged, $nick can only be messaged through chat which is why we do $chan which also means channel. So msg $chan means write this message in this channel.

Fixed:
on !*:JOIN:#: {
msg $chan Hey there $nick $+ ! Welcome to $remove(#,$chr(35))) $+ !
}

Yours:
On !*:Join:#:{
msg $nick Hey There $nick ! Welcome To $chan !
}
Posted By: DevilBeach Re: On Join not working - 17/04/16 11:18 PM
I copy and pasted your exact code and it's still not working at all.
Posted By: JB_uk Re: On Join not working - 18/04/16 12:38 AM
Have you executed the updated CAP requests for twitch?

Code:
    /raw CAP REQ :twitch.tv/membership
    /raw CAP REQ :twitch.tv/commands 


I have these in a script so when I connect, they automatically execute

Code:
ON *:CONNECT: {
  if ($server == tmi.twitch.tv) {
    /raw CAP REQ :twitch.tv/membership
    /raw CAP REQ :twitch.tv/commands
  }
}

Let me know if this helps.
© mIRC Discussion Forums