mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Mar 2014
Posts: 5
S
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
S
Joined: Mar 2014
Posts: 5
Is there any chance i can get further assistance on this? I have a welcome script and am trying to fix it up for my twitch chat. Twitch has a rule of no more than 30messages over 20seconds and i wanna make sure i dont break that rules again. I talked to xangold and he told me what i need.

xangold- "Add them to a hashtable, check the table every 1.6 seconds, and remove top message and send it or add them to a window if you must have them sequentially sent."
me- "I've been looking to change it to welcome multiple people if they join together. That only counts as one msg right?"
xangold- "Correct, that was the "merge" part (plus it looks nicer)"

Hopefully this is an appropriate place to ask for help? Im really new at scripting and am working to learn it and understand.

This is my basic "join" message-
on *:JOIN:#: { msg $chan Welcome $nick to my stream, enjoy the nuggets!! }


The goal is to have my join message multiple people at once if they join. "Welcome X,X,X and X to the stream." This sends one message in twitch chat and helps me stay under twitch.tv's limit of 30msgs in 20secs.

Joined: Dec 2013
Posts: 779
N
Hoopy frood
Offline
Hoopy frood
N
Joined: Dec 2013
Posts: 779
Code:
if (%welcomespam == on) { return }
set -u3 %welcomespam on


Nillens @ irc.twitch.tv
Nillen @ irc.rizon.net
Joined: Mar 2014
Posts: 5
S
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
S
Joined: Mar 2014
Posts: 5
Would you be able to explain what this does? Just so i can better understand =)

Joined: Dec 2013
Posts: 779
N
Hoopy frood
Offline
Hoopy frood
N
Joined: Dec 2013
Posts: 779
if (%welcomespam == on) { return }
;;; It checks if %welcomespam is on. If it is, then it'll do nothing. If it isn't it's going to continue on with whatever is later on in the code.
set -u3 %welcomespam on
;;; This turns %welcomespam on for 3 seconds. During those 3 seconds.


Nillens @ irc.twitch.tv
Nillen @ irc.rizon.net
Joined: Aug 2013
Posts: 15
P
Pikka bird
Offline
Pikka bird
P
Joined: Aug 2013
Posts: 15
hello,

i have had trouble with this aswell until a friendly user helped me with this ( sorry can't remember his username) and he gave me this code.. it causes the bot to save the names that join for x amount of seconds (you can specify that) and after the time is over it welcomes them all in 1 message


Code:
on !@*:JOIN:#:{
    if ($mid(#,2) ison $chan) {
    if ($nick == $mid(#,2)) { return }
    set -e $+(%,ajwelcome.,$cid,#) $addtok($($+(%,ajwelcome.,$cid,#),2),$nick,44)
    if (!$timer($+(.ajw.,$cid,#))) { $+(.timer.ajw.,$cid,#) 1 3 ajwelcome # }
  }
}
alias -l ajwelcome {
  if ($($+(%,ajwelcome.,$cid,$1),2)) {
    msg $1 Hi $v1 $+ , welcome to $mid($1,2) $+ 's Channel.
    unset $+(%,ajwelcome.,$cid,$1)
  }
}


you can set the time at the timer.. and the message in the alias..

the if ($nick == $mid(#,2)) { return } is so it doesn't welcome yourself. you can add || $nick == [name] to get more users that dont get welcommed



also with the code of Nillen it causes to welcome a user and then won't welcome anyone for 3 seconds and welcome a user that joins after those 3 seconds

Last edited by panda_jorstar; 10/03/14 08:32 AM.
Joined: Feb 2003
Posts: 3,432
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,432
This part is what you looking for:

$+(.timer.ajw.,$cid,#) 1 3

And i recomend you to use that, if many users join at the same time you will flood out. So it's a sort of flood protection for you. 1=how many times 3=time befor trigger.


if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }
Joined: Mar 2014
Posts: 5
S
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
S
Joined: Mar 2014
Posts: 5
Im sorry, this is a lot more detailed then what ive done so far so im a little confused as to what im editing. I know i cant paste "msg $chan Welcome $nick to my stream, enjoy your nuggets!!" over " msg $1 Hi $v1 $+ , welcome to $mid($1,2) $+ 's Channel" because we are welcoming multiple users with the new script. Most of my bot is just "on text do this" So this is a tiny bit over my head.

on !@*:JOIN:#:{
if ($mid(#,2) ison $chan) {
if ($nick == $mid(#,2)) { return }
set -e $+(%,ajwelcome.,$cid,#) $addtok($($+(%,ajwelcome.,$cid,#),2),$nick,44)
if (!$timer($+(.ajw.,$cid,#))) { $+(.timer.ajw.,$cid,#) 1 3 ajwelcome # }
}
}
alias -l ajwelcome {
if ($($+(%,ajwelcome.,$cid,$1),2)) {
msg $1 Hi $v1 $+ , welcome to $mid($1,2) $+ 's Channel.
unset $+(%,ajwelcome.,$cid,$1)
}
}

Joined: Mar 2014
Posts: 5
S
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
S
Joined: Mar 2014
Posts: 5
1= how many times (of what?) 3=time before trigger(Do i replace the 3 with a time? say i want it to hold the greeting for 10seconds, do i just replace 3 with 10? or do 3=10?)

Joined: Feb 2003
Posts: 3,432
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,432
Originally Posted By: SneakyAz
1= how many times (of what?) 3=time before trigger(Do i replace the 3 with a time? say i want it to hold the greeting for 10seconds, do i just replace 3 with 10? or do 3=10?)

1=how many times the timer trigger. 3=how long befor it trigger the command. and yes. if you change the 3 to 1 it will trigger after 1 second. If you change 3 to 10 it will take 10 seconds befor it trigger. Look at /help timers in your help filr for mirc.


if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }
Joined: Aug 2013
Posts: 15
P
Pikka bird
Offline
Pikka bird
P
Joined: Aug 2013
Posts: 15
Originally Posted By: SneakyAz
Im sorry, this is a lot more detailed then what ive done so far so im a little confused as to what im editing. I know i cant paste "msg $chan Welcome $nick to my stream, enjoy your nuggets!!" over " msg $1 Hi $v1 $+ , welcome to $mid($1,2) $+ 's Channel" because we are welcoming multiple users with the new script. Most of my bot is just "on text do this" So this is a tiny bit over my head.

on !@*:JOIN:#:{
if ($mid(#,2) ison $chan) {
if ($nick == $mid(#,2)) { return }
set -e $+(%,ajwelcome.,$cid,#) $addtok($($+(%,ajwelcome.,$cid,#),2),$nick,44)
if (!$timer($+(.ajw.,$cid,#))) { $+(.timer.ajw.,$cid,#) 1 3 ajwelcome # }
}
}
alias -l ajwelcome {
if ($($+(%,ajwelcome.,$cid,$1),2)) {
msg $1 Hi $v1 $+ , welcome to $mid($1,2) $+ 's Channel.
unset $+(%,ajwelcome.,$cid,$1)
}
}




you could do it like
Code:
 on !@*:JOIN:#:{
    if ($mid(#,2) ison $chan) {
    if ($nick == $mid(#,2)) { return }
    set -e $+(%,ajwelcome.,$cid,#) $addtok($($+(%,ajwelcome.,$cid,#),2),$nick,44)
    if (!$timer($+(.ajw.,$cid,#))) { $+(.timer.ajw.,$cid,#) 1 3 ajwelcome # }
  }
}
alias -l ajwelcome {
  if ($($+(%,ajwelcome.,$cid,$1),2)) {
    msg $1 welcome $v1 $+ , to my channel enjoy your nuggets!!.
    unset $+(%,ajwelcome.,$cid,$1)
  }
}


basicly the part that handles the names is the $v1 the other things can just be changed . just keep in mind that the $1 handles the channel for the message.
i would however not recommend changing the timer to a lower ammount of seconds else you will have the trouble of the global twitch message / second again


Last edited by panda_jorstar; 13/03/14 05:03 PM.
Joined: Mar 2014
Posts: 5
S
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
S
Joined: Mar 2014
Posts: 5
I put the script in copied right from your post but nothing happened. Was i supposed to change something else?


Link Copied to Clipboard