Fairly Self explanatory. When invited it opens a dialog which allows you to accept or deny the invite, as well as ignore nick (which in fact stores the users hostmask based on $atype) or ignore invited for the channel (network specific).
If you do opt to use the deny message feature, you should also use the command /invite.bot
This will keep the script from messaging that bot, because if it does that, you will get an error message, and nobody likes that.
setting $denymsg to anything will create a message to send to someone when they hit deny. Note that both ignores will NOT use this. I have included (commented) my deny message. To use it, simply remove line 5 (alias -l denymsg return $null) and remove the ; from the beginning of the line below it.
Cheers :)
//replace the 4 in the line below to change the mask type used! type /help $mask for more info.
alias -l atype return 4
//if you set this to anything besides $null or 0 (zero), the person who invited you will be noticed whatever you set it to!
alias -l denymsg return $null
;alias -l denymsg return I'm sorry, but for any of several reasons, I was unable to accept your invitation to: $eval($did($dname,20).text,1)
dialog invite {
title "Invitation"
size -1 -1 89 76
option dbu
button "Accept", 1, 5 36 37 12, ok cancel
button "Deny", 2, 48 36 37 12, ok cancel
button "Ignore Chan", 3, 5 52 37 12, ok cancel
button "Ignore Nick", 4, 48 52 37 12, ok cancel
text "Channel:", 5, 3 4 25 8, right
text "By:", 6, 16 13 11 8, right
text "Network:", 7, 3 22 25 8, right
text "© Savage_CL 2011", 100, 39 67 49 8, right
text "", 20, 30 4 54 8
text "", 30, 30 13 54 8
text "", 40, 30 22 54 8
text "", 50,100 100 5 5, hidden
}
on *:INVITE:#:{
if ($istok(%bannedaddr,$mask($fulladdress,$atype),32)) RETURN
elseif ($istok(%bannedchan. [ $+ [ $network ] ],$chan,32)) RETURN
else {
noop $regex(addr,$fulladdress,/(.*)/Si) $regex(chan,$chan,/(.*)/Si)
dialog -m [ invite $+ $ticks ] invite
}
}
on *:DIALOG:invite*:init:0:{
did -a $dname 20 $regml(chan,1)
did -a $dname 30 $gettok($regml(addr,1),1,33)
did -a $dname 40 $network
did -a $dname 50 $regml(addr,1)
}
on *:DIALOG:invite*:sclick:1-4:{
if ($did == 1) {
join $did($dname,20).text
dialog -x $dname
}
elseif ($did == 2) {
if (($denymsg) && ($did($dname,30).text != %serv.bot. [ $+ [ $network ] ])) { .notice $did($dname,30).text $denymsg }
dialog -x $dname
}
elseif ($did == 3) {
set %bannedchan. $+ $network $addtok(%bannedchan. [ $+ [ $network ] ],$did($dname,20),32)
dialog -x $dname
}
elseif ($did == 4) {
set %bannedaddr $addtok(%bannedaddr,$mask($did($dname,50).text,$atype),32)
dialog -x $dname
}
}
alias invite.bot {
set %serv.bot. $+ $network $1
echo 7 -ae The Services bot for $network has been set to: %serv.bot. [ $+ [ $network ] ]
}
iv been having a little play with this and i changed
;alias -l denymsg return I'm sorry, but for any of several reasons, I was unable to accept your invitation to: $eval($did($dname,20).text,1)
to
alias -l denymsg return I'm sorry, but for any of several reasons, I was unable to accept your invitation to join $did($dname,20).text
and now works perfectly. just another option for you :)
nice code overall nice job.