Code: Select all
bind pubm - "$EngNickChangeWrkChan !nickchange*" EngNickChange:pubm:EngNickChangeTrig
proc EngNickChange:pubm:EngNickChangeTrig {nick uhost hand chan args} {
global EngNickChangeMsgBan EngNickChangeBanTime
set name [string range $args 13 end-1]
if { [isop $nick] || [ishalfop $nick] || [isvoice $nick] } {
if { [onchan $name $chan ] } {
if { [isop $name $chan] || [ishalfop $name $chan] || [isvoice $name $chan] || [string match "FreshIRC.com" $uhost] } {
puthelp "PRIVMSG $chan :ACTION $name likes his name as it is.."
return 0
}
puthelp "PRIVMSG $chan :ACTION $name, You have one minute to change your name to a more appropriate name. Use /nick newname to change it."
set test "newchanban $chan $name NCTrig \"$EngNickChangeMsgBan\" $EngNickChangeBanTime none"
timer 1 $test
return 0
}
puthelp "PRIVMSG $chan :ACTION I don't see $name"
}
}
bind pubm - "$EngNickChangeWrkChan *" EngNickChange:pubm:EngNickChange
proc EngNickChange:pubm:EngNickChange {nick uhost hand chan args} {
global EngNickChangeWarn EngNickChangeMsgWarn EngNickChangeMsgKick EngNickChangeMsgBan EngNickChangeBanTime
if {[string tolower [string range $nick 0 7]] == "emuleirc" || [string tolower [string range $nick 0 4]] == "fresh"} {
if {([info exists EngNickChangeWarn($uhost)] == 1)} {
if {$EngNickChangeWarn($uhost) == 1} {
putserv "KICK $chan $nick : $EngNickChangeMsgKick"
incr EngNickChangeWarn($uhost)
} elseif {$EngNickChangeWarn($uhost) == 2} {
newchanban $chan $nick NCAuto $EngNickChangeMsgBan $EngNickChangeBanTime none
}
} else {
puthelp "PRIVMSG $chan :ACTION $nick $EngNickChangeMsgWarn"
set EngNickChangeWarn($uhost) 1
timer 60 "unset $EngNickChangeWarn($uhost)"
}
}
}
First: In the first proc, I use the "args" var.. Is it normal for the args string to look like "{!nickchange name}".. I didn't notice the "{}" in other procs I did..
Second: When I do the newchanban in the second proc, it adds the ban and instantly removes that user.. But when I do it in a timer, it adds the ban, but doesn't enfoced it until the user leaves and returns to the channel? How can I get it to enfoce the ban instantly?