I'd like to first start by thanking, once again , the following people that helped me get the script up and running:
simo, caesar and willyw, cheers for your help. P.S, I think you pretty much wrote the script with very little to no input from me (so I can't really take any credit for doing anything what so ever).
Below is the script (after some modifications, no doubt that they are poor ones at that) that I'm currently using and I would like to make it a little bit more advanced, allowing me to add multiple 'inputs'/'criteria' and the ability to 'blacklist' specific nicks.
Code: Select all
bind join * * case:joined
bind nick * * case:nick
proc case:joined {nick uhost hand chan} {
# we trigger our special function to do the testing when someone just joined the channel
case:action $chan $nick
}
proc case:nick {nick uhost hand chan newnick} {
# we trigger our special function to do the testing when someone just changed his nick to a new one
case:action $chan $newnick
}
proc case:action {chan nick} {
# check if bot is the one that joined the channel and then check if he's a channel operator (has @)
if {[isbotnick $nick] || ![botisop $chan]} return
# we split the nick in sepatate elements (let's call them letters) and grab only the first one
set letter [lindex [split $nick ""] 0]
# we test if the letter we previously grabbed is in uppercase (result will be 1) or lowercase (result will be 0)
set test [string is upper $letter]
if {![string compare -length 4 "User" $nick]} {
set test 0
}
# if the result is 1 then proceed to the next step
if {$test} {
# test if the nick isn't already voiced
if {![isvoice $nick $chan]} {
# nick isn't already voiced so give him voice (+v)
pushmode $chan +v $nick
}
# the previous test failed thus we do something else in return
} else {
# test if nick has voice (+v) on the channel
if {[isvoice $nick $chan]} {
# and now we actually remove his voice (+v) status
pushmode $chan -v $nick
}
}
}
I'd like to make it possible to add more 'variables', such as:
Code: Select all
if {![string compare -length 5 "Guest" $nick]} {
if {![string compare -length 6 "Andro|" $nick]} {
Also I'd like to be able to blacklist specific users (just by adding the nicks manually to the script, it doesn't need to be anything fancy like a channel/msg command). This function will, hopefully, get the bot to ignore said user so that if they change their nick to uppercase, it won't voice them.
I would appreciate anyone’s expertise on this one, like before, I am extremely grateful for any help that anyone can offer.
Regards,
Dizmo.