Hi all,
I have idle kick/warning script that I am using, it will give a warning at 4hrs 30 minutes idle then kick at 5 hours.
in order to get the warning to work since the $idle variable change, I have it set to be >= of %idlewarn, the alias runs every minute to check for the idle. The problem I am having is the script will send out the notice every minute instead of just once.
<script>
if $nick(#,%idlecheck.nick).idle == %idlenotice {
/echo 4 # %idlecheck.nick is at 5 hours idle
}
if $nick(#,%idlecheck.nick).idle >= %idlewarn {
/.timer 1 $calc(30 + %idlecheck.count) //msg %idlecheck.nick hi, you have been idle now for over 4 hrs and 30 minutes (no talking in the channel. Private message does not count) Please say something in the channel. If you are idle past 5hrs we will kick you.
/echo 4 # %idlecheck.nick 4 hr 30 minute warning issued
}
</script>
My question is how can I put in a condition that says this this person has already been warned skip them?
I tried putting in a set %warn $+ $nick 1 when it sent the message then changed the f $nick(#,%idlecheck.nick).idle >= %idlewarn { to be
if $nick(#,%idlecheck.nick).idle >= %idlewarn && %warn $+ nick == $null {
But this did not seem to work. any ideas on how I can have this send only one notice instead of 1 every minute until they talk in the channel or are kicked?
(notes)
%idlecheck.nick is set by
set %idlecheck.count 1
:next
set %idlecheck.nick $nick(#,%idlecheck.count)
if %idlecheck.nick == $null goto done
inc %idlecheck.count
goto next
:skip
inc %idlecheck.count
goto next
:done