|
Joined: Jul 2010
Posts: 30
Ameglian cow
|
OP
Ameglian cow
Joined: Jul 2010
Posts: 30 |
First off, Does RusselB still help here? Secondly, I run a small network where I need a anti idle script for my mirc.
Most anti-idle scripts I've seen only kick people out of a channel when a set amount of seconds, minutes, or hours are reached.
I do not wish to kick people off the network, I only desire to check their idle time every 10 minutes and if they have been idle hh:59:59 ( basically 1 hour), in my channel, then /sajoin them to #idle and then /sapart them from #Channel.
This keeps them on the network so they know they are not banned, yet moves them from the channel they are idling in, to one set up specifically for people who wish to idle.
RusselB had an anti-idle script which I loved, but it is set up to kick.
Can anyone here who has the time and inclination to help, build me an anti-idle script that works with hours, minutes and seconds, plus, does not kick but uses sajoin and sapart.
Thanks for any help.
|
|
|
|
Joined: Dec 2013
Posts: 779
Hoopy frood
|
Hoopy frood
Joined: Dec 2013
Posts: 779 |
If you still have access to RusselB's anti-idle script we could most likely very simply change that from kicking to /sapart and /sajoin instead.
Nillens @ irc.twitch.tv Nillen @ irc.rizon.net
|
|
|
|
Joined: Feb 2003
Posts: 2,812
Hoopy frood
|
Hoopy frood
Joined: Feb 2003
Posts: 2,812 |
Just loop through $nick(#chan,%i).idle and kick the users who have a value greater than 3600 (1 hour). You can call this alias with a timer every minute.
Well. At least I won lunch. Good philosophy, see good in bad, I like!
|
|
|
|
Joined: Jul 2010
Posts: 30
Ameglian cow
|
OP
Ameglian cow
Joined: Jul 2010
Posts: 30 |
I do have a copy of RusselB's anti-idle script. If you can adjust this code to make it use sajoin #idle and then, sapart #mychannel, I sure would appreciate it.
------------------------------------------------
ctcp *:version:*: ctcpreply $nick VERSION Idle Kicker 10.19.2010 by Russel Bairstow on *:start:{ if !$hget(idle_kick) { .hmake idle_kick 10 } if $exists($qt($scriptdiridlekick.hsh)) { .hload idle_kick $qt($scriptdiridlekick.hsh) } load_idle } on *:exit:{ .timers off .hsave -o idle_kick $qt($scriptdiridlekick.hsh) } on *:disconnect:{ $+(.timer,$network,*) off .hsave -o idle_kick $qt($scriptdiridlekick.hsh) } menu channel { Idle Kick .$iif(!$idle($network,$chan),Set,Reset) Allowed idle time : idle $network $chan $iif($duration($$?="Time in hh:mm:ss format. Note that hh and mm are not required and will default to 0 if not supplied") isnum,$v1,$duration($v1)) .$iif($idle($network,$chan),Clear Idle Time $duration($idle($network,$chan),3)) : .hdel idle_kick $+($network,.,$chan,.,Idle) .$iif(!$exempt($network,$chan),Set,Reset) Exempt Modes: { var %exempt = $$?="Enter characters for exemption status (o = op, h = half-op, v = voice, r = regular)" var %exempt1 = $remove(%exempt,o,h,v,r) exempt $network $chan $remove(%exempt,%exempt1) } .$iif($exempt($network,$chan),Clear Exempt Modes $exempt($network,$chan)) : .hdel idle_kick $+($network,.,$chan,.,Exempt) .Exempt Nick(s) : { var %exempt.nicks = $replace($$?="Nick(s) to exempt",$chr(44),$chr(32)) var %a = 1, %b = $numtok(%exempt.nicks,32) while %a <= %b { .hadd -m idle_kick $+($network,.,$chan,.,Exempt.Nick) $addtok($hget(idle_kick,$+($network,.,$chan,.,Exempt.Nick)),$gettok(%exempt.nicks,%a,32),32) inc %a } } .Manual Check : check_idle $chan } on *:op:#:{ if $opnick == $me { var %exempt = $hget(idle_kick,$+($network,.,$chan,.,Exempt)), %a = 1, %b = $nick($chan,0,a,%exempt) while %a <= %b { if !$istok($hget(idle_kick,$+($network,.,$chan,.,Exempt.Nick)),$nick($chan,%a,a,%exempt),32) { $+(.timer,$network,.,$chan,.,$nick($chan,%a,a,%exempt)) -m 0 500 check_idle $chan $nick($chan,%a,a,%exempt) } inc %a } } if o isin $exempt($network,$chan) && $timer($+($network,.,$chan,.,$opnick)) { $+(.timer,$network,.,$chan,.,$opnick) off } } on *:help:#:{ if h isin $exempt($network,$chan) && $timer($+($network,.,$chan,.,$hnick)) { $+(.timer,$network,.,$chan,.,$hnick) off } } on *:voice:#:{ if v isin $exempt($network,$chan) && $timer($+($network,.,$chan,.,$vnick)) { $+(.timer,$network,.,$chan,.,$vnick) off } } alias -l exempt { if $isid { return $hget(idle_kick,$+($network,.,$chan,.Exempt)) } else { .hadd -m idle_kick $+($1,.,$2,.Exempt) $3 } } alias -l idle { if $isid { return $hget(idle_kick,$+($1,.,$2,.Idle)) } else { .hadd -m idle_kick $+($1,.,$2,.Idle) $3 } } alias -l check_idle { if !$2 { var %exempt = $exempt($network,$1), %a = 1, %b = $nick($1,0,a,%exempt) while %a <= %b { .timer 1 %a $iif($nick($1,%a,a,%exempt).idle > $idle($network,$chan),.kick $1 $nick($1,%a,a,%exempt) No idling allowed) inc %a } } else { if ($nick($1,$2).idle > $idle($network,$chan)) { .kick $1 $2 No idling allowed } } } alias -l load_idle { var %a = 1, %b = $scon(0) while %a <= %b { .scon %a var %c = 1, %d = $chan(0) while %c <= %d { var %exempt = $exempt($network,$chan(%c)), %e = 1, %f = $nick($chan(%c),0,a,%exempt) while %e <= %f { $+(.timer,$network,.,$chan(%c),.,$nick($chan,%e,a,%exempt)) -m 0 500 check_idle $chan $nick($chan(%c),%e,a,%exempt) inc %e } inc %c } inc %a } } on *:quit:{ $+(.timer,$network,*,$iif($nick != $me,$nick)) off } on *:part:#:{ if $nick == $me { $+(.timer,$network,.,$chan,*) off } elseif $timer($+($network,.,$chan,.,$nick)) { $+(.timer,$network,.,$chan,.,$nick) off } } on *:kick:#:{ if $knick == $me { $+(.timer,$network,.,$chan,*) off } elseif $timer($+($network,.,$chan,.,$knick)) { $+(.timer,$network,.,$chan,.,$knick) off } } on @*:join:#:{ if !$istok($hget(idle_kick,$+($network,.,$chan,.,Exempt.Nick)),$nick,32) { $+(.timer,$network,.,$chan,.,$nick) -m 0 500 check_idle $chan $nick }
|
|
|
|
Joined: Dec 2013
Posts: 779
Hoopy frood
|
Hoopy frood
Joined: Dec 2013
Posts: 779 |
else { if ($nick($1,$2).idle > $idle($network,$chan)) { .kick $1 $2 No idling allowed } } This part of the code handles the kicking. Replace it with something like this. else {
if ($nick($1,$2).idle > $idle($network,$chan)) {
/sajoin $2 #idle
/sapart $2 $1
}
} Edit: looked up how /sajoin and /sapart handled the tokens.
Last edited by Nillen; 08/03/15 06:06 PM.
Nillens @ irc.twitch.tv Nillen @ irc.rizon.net
|
|
|
|
Joined: Jul 2010
Posts: 30
Ameglian cow
|
OP
Ameglian cow
Joined: Jul 2010
Posts: 30 |
It was worth the try, but it didn't work. I suspect RusselB's script may have stopped working with the many mirc updates in past years. I will have to find something else that will protect +v +h +o +a , and still scan for idle time of over an hour and use sajoin #Idle | sapart #mychannel.
I will keep looking in case others would like to try to write one.
Thanks
|
|
|
|
Joined: Jul 2010
Posts: 30
Ameglian cow
|
OP
Ameglian cow
Joined: Jul 2010
Posts: 30 |
Hello again, Its March 13, 2015. All attempts to come up with an anti idle script that does not use the kick or ban command, but instead uses the /sajoin and /sapart command, have failed.
========= A young person on my network attempted to write a script for our usage but it seems to be buggy in that it wants to post the results of the /whois command, into my active window. This posting of the whois turns in to an annoyance and I cannot chat with people without it being flooded every minute into my screen.
Here is the script he wrote and maybe you here can completely change this script or write it in such a way where it will not check the idle time every minute nor post it into my chat window.
========================
on *:start:{ $+(.timer,$network,.,idlecheck) 0 60 check_idle }
on *:exit:{ .timers off }
on *:disconnect:{ $+(.timer,$network,.,idlecheck) off }
alias check_idle { var %x 1 while ($nick(#christianchat,%x)) { if $v1 isreg #christianchat && $v1 != $me { .enable #WhoisHide .whois $v1 $v1 } inc %x } }
; This part of the script makes sure that *internal* whois command responses stay hidden. Apparently it's not enough to prefix the command with a dot. #WhoisHide off raw 311:*:halt ; All these raw numbers are the response codes which the server might send in response to a whois request. raw 307:*:halt raw 335:*:halt raw 671:*:halt raw 319:*:halt raw 378:*:halt raw 379:*:halt raw 308:*:halt raw 309:*:halt raw 310:*:halt raw 313:*:halt raw 312:*:halt raw 301:*:halt
raw 317:*: { if $2 ison #christianchat && $2 isreg #christianchat && $2 != $me && $3 > 3600 { ;If user is on channel, if user is a normal (non-status'd) user, if user isn't me, and if user's idle time is more than 1 hour. sapart $2 #christianchat sajoin $2 #idle
} halt ; Silence the whois response. }
raw 318:*:disable #WhoisHide | halt ; Signal 318 means that the whois data is complete. Now we can turn WhoisHide off again.
; If any residual whois data appears to the user, it means we forgot to add a signal here.
#WhoisHide end ====================================
Please help if you can
|
|
|
|
|