mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Apr 2016
Posts: 86
B
Babel fish
OP Offline
Babel fish
B
Joined: Apr 2016
Posts: 86
I have a mirc bot inside a partnered stream and I was wondering if there was a script for the subscribers to add themselves to a command. So whenever a sub would type !addme , there $nick will go under the command !line . And if they want removed from the list, the can type !removeme and they will no longer appear in the !list. And the !list command would have the first person-last person who typed !addme

Is this possible?

Joined: Oct 2015
Posts: 112
B
Vogon poet
Offline
Vogon poet
B
Joined: Oct 2015
Posts: 112
I do not have a partnered stream to test this code in, but I believe that it should work. Good luck. smile

Code:
ON *:TEXT:!addme:#: {
  IF (($msgtags(subscriber)) && (!$istok(%sub_list,$nick $+ $chr(44),32))) {
    SET %sub_list %sub_list $nick $+ $chr(44)
    MSG $chan $nick $+ , you have been added to the !list.
  }
}

ON *:TEXT:!removeme:#: {
  IF ($istok(%sub_list,$nick $+ $chr(44),32)) {
    SET %sub_list $remtok(%sub_list,$nick $+ $chr(44),0,32)
    MSG $chan $nick $+ , you have been removed from the !list.
  }
}

ON *:TEXT:!list:#: MSG $chan $left(%sub_list,-1)

Joined: Apr 2016
Posts: 86
B
Babel fish
OP Offline
Babel fish
B
Joined: Apr 2016
Posts: 86
Originally Posted By: Blas
I do not have a partnered stream to test this code in, but I believe that it should work. Good luck. smile

Code:
ON *:TEXT:!addme:#: {
  IF (($msgtags(subscriber)) && (!$istok(%sub_list,$nick $+ $chr(44),32))) {
    SET %sub_list %sub_list $nick $+ $chr(44)
    MSG $chan $nick $+ , you have been added to the !list.
  }
}

ON *:TEXT:!removeme:#: {
  IF ($istok(%sub_list,$nick $+ $chr(44),32)) {
    SET %sub_list $remtok(%sub_list,$nick $+ $chr(44),0,32)
    MSG $chan $nick $+ , you have been removed from the !list.
  }
}

ON *:TEXT:!list:#: MSG $chan $left(%sub_list,-1)


This unfortunately doesn't seem to be working, I copied and pasted it in the Remote tab and tried testing it and nothing happened. smirk But thank you for trying

Joined: Oct 2015
Posts: 112
B
Vogon poet
Offline
Vogon poet
B
Joined: Oct 2015
Posts: 112
I'm sorry to hear that. I did test the script using mods in my channel and just changing $msgtags(subscriber) to $msgtags(mods) and it appears to work great. Perhaps someone with more knowledge could chime in here and help. I assume that you are testing the script using users that are a subscriber of the channel, as the script is designed to ignore anyone that is not a subscriber of the channel.

Joined: Apr 2016
Posts: 86
B
Babel fish
OP Offline
Babel fish
B
Joined: Apr 2016
Posts: 86
I really need this to work, I posted a separate post asking the same thing and I was told about and .ini file, I know what it is but I'm not exactly sure how it would be scripted at all so all subscribers to the Twitch channel could use it. Any other possible way or other script that this would work???

Joined: Oct 2015
Posts: 112
B
Vogon poet
Offline
Vogon poet
B
Joined: Oct 2015
Posts: 112
It appears that I forgot to add the ".key" after the $msgtags(subscriber) part. I have indeed just tested this script in a friends channel who is a partnered streamer and it works 100%. The !addme command will ignore anyone who is not a subscriber of the channel.

I am using the latest version of mIRC as well as SReject's JSON and mTwitch scripts (Core and DisplayName). They are worth adding to any mIRC bot for Twitch IMO. If that isn't an option for you, I believe that at the very least, you will need your mIRC to request "tags" from the Twitch server. Make sure that you have something like the following code in a script file or in your remote.ini file. If you have a mIRC bot on Twitch, chances are that you may have already added the "commands" and/or "membership" to be requested, but not the "tags."

Code:
ON *:CONNECT: IF ($server == tmi.twitch.tv) CAP REQ :twitch.tv/commands twitch.tv/tags twitch.tv/membership



I fixed the earlier script here:
Code:
ON *:TEXT:!addme:#: {
  IF (($msgtags(subscriber).key) && (!$istok(%sub_list,$nick $+ $chr(44),32))) {
    SET %sub_list %sub_list $nick $+ $chr(44)
    MSG $chan $nick $+ , you have been added to the !list.
  }
}

ON *:TEXT:!removeme:#: {
  IF ($istok(%sub_list,$nick $+ $chr(44),32)) {
    SET %sub_list $remtok(%sub_list,$nick $+ $chr(44),0,32)
    MSG $chan $nick $+ , you have been removed from the !list.
  }
}

ON *:TEXT:!list:#: MSG $chan $left(%sub_list,-1)

Joined: Apr 2016
Posts: 86
B
Babel fish
OP Offline
Babel fish
B
Joined: Apr 2016
Posts: 86
This works out perfect thanks so much! Just one thing, is there a mods command for the list command for the mods to remove the person from the list?

Joined: Apr 2016
Posts: 86
B
Babel fish
OP Offline
Babel fish
B
Joined: Apr 2016
Posts: 86
I need it so Moderators of the channel can remove specific people and that the broadcaster can !resetline so it'll reset the entire line? Is that possible


Link Copied to Clipboard