I want to make a timer kick script, and basically for name changes.
I believe his problem is that when his timer executes, if the person changed their nick (after setting the timer, but before the timer executes), the timer will be attempting to kick the former nick, instead of the new nick.
This sort of script is overall messy. And honestly, you'd be better off not using a delayed kick, it introduces too many problems, and too many checks, since there isn't an "on *:nick:#:{}" you have to perform a while loop, for each channel.
It's easier to make the script channel independent, but then the delay would only work for one channel..
alias kickit { $+(.timer.kickit.,$active,.,$$1) 1 20 kick $active $1 $$?="Message?" }
on ^*:nick:{
var %i = 1
while ($comchan($newnick,%i)) {
var %channel = $v1
if ($comchan($newnick,%i).op) {
var %timername = $+(.kickit.,%channel,.,$nick)
if ($timer(%timername)) {
var %secs = $timer(%timername).secs , %msg = $gettok($timer(%timername).com,4-,32)
.timer $+ %timername off
$+(.timer.kickit.,%channel,.,$newnick) 1 %secs kick %channel $newnick %msg
}
}
inc %i
}
}
Just a cheap alias I threw together, though, I'll let it be known, I rather kick someone immediately, I'm not a fan of loops.
In a channel: /kickit nick
This will kick a nick after 20 seconds, even if they change their nick.