mIRC Homepage

Idle script

Posted By: NoPleX

Idle script - 21/09/04 08:29 AM

Hmm... I got this problem... You all know the channel #help where you are not allowed to idle.... I need a script that parts me from the channel when i have idled for -u420.... I know i need to create a timer but i dont know how to make it restart the time when i write something in the channel so i wont get parted from the channel... And it parts me when i havent written anything in the channel for the 420 sec's... Can someone please help me confused

Posted By: Coolkill

Re: Idle script - 21/09/04 09:02 AM

Well you could just cut to the chase, and create the timer (over and over), when you type.

[color:orange]; Triggers when you type something into '#help'

On *:Input:#help:{
; Checks if its a /command, if not proceed.
if (/* !iswm $$1) {
; creates a timer (if exists, resets) to part '#help'
.timer#help 1 420 part #help
; end if statement
}
; end event.
}
[/color]

Edit:

[color:orange]; starts timer when you join.

on me:*:JOIN:#help:{ .timer#help 1 420 part #help }
; stops timer when you part
on me:*:PART:#help:{ .timer#help off }
[/color]
Eamonn.
Posted By: FiberOPtics

Re: Idle script - 21/09/04 09:07 AM

That wouldn't make him leave if he just joined and said nothing.


on me:*:JOIN:[color:red]#
: $+(.timer,idle,#) 1 420 part #
on me:*:PART:#: $+(.timer,idle,#) off
on *:INPUT:#: if /* !iswm $$1 { $+(.timer,idle,#) 1 420 part # }
[/color]

Greets

Edit: @Noplex: replace the # to the channel of your liking. Note you only have to change it in the red parts.
Posted By: Coolkill

Re: Idle script - 21/09/04 09:08 AM

Just like the above wouldnt make it just work for #help, but for all channels? laugh

Eamonn.
Posted By: FiberOPtics

Re: Idle script - 21/09/04 09:10 AM

Well I expected him to know to atleast change the channel, lol.

Anyway, it's edited, cya.
Posted By: NoPleX

Re: Idle script - 21/09/04 09:21 AM

Okay then i can use this one right:

on *:JOIN:#help:{
.timercheck 0 60 idlecheck
}

alias idlecheck {
if ($nick(#help,$me).idle >= 420) {
part #help
}

on *:INPUT:#help:{
.timercheck off
.timercheck 0 60 idlecheck
}

on *:PART:#help:{
.timercheck off
}

crazy
Posted By: FiberOPtics

Re: Idle script - 21/09/04 09:23 AM

You sure could use it, but it's a bit redundant.

And you're not specifying that you have to be the joining, parting nick, so it will trigger on other users.

Just go with Coolkill's or my version, they're the same anyway.

Greets
Posted By: Coolkill

Re: Idle script - 21/09/04 09:30 AM

Also, just incase your un-aware, there is $idle if your after your idle time, but its a bit pointless if your running a timer anyway.

Eamonn.
Posted By: NoPleX

Re: Idle script - 21/09/04 09:34 AM

okay well els this one might work as well:

on *:JOIN:#help:{
.timeridle 1 420 part #help
}

on *:input:#help:{
checkidle
}

alias CheckIdle {
timeridle off
timeridle 1 420 part #help
}
Posted By: FiberOPtics

Re: Idle script - 21/09/04 09:39 AM

Close...though you don't need to stop a timer if you'll start the same timer again, because restarting the timer will overwrite the old one.

Also, again, you are not specifying that it should be YOU who is joining/parting.

on me:*:JOIN:#help: ...
on me:*:PART:#help: ...

or

on *:JOIN:#help: if $nick == $me { ..
on *:PART:#help: if $nick == $me { ..

And right now, the input will trigger if you perform commands in that window, like for example //echo -a blabla, but that won't send anything to the channel, so on INPUT should not be triggerd there, which is why you should include:

if /* !iswm $$1 {

Finally, you forgot the on PART event, to stop the timer when you part the channel manually.

Greets
Posted By: NoPleX

Re: Idle script - 21/09/04 09:44 AM

oh yes i forgot... It's becouse im not use to use the me:*:join command... i'm use to the *:join:#help:{ if ($nick == $me) command... Thats why... i didnt know what the other one ment blush :tongue:

Got one mor question... Why cant you just type: on me:join:#:

Why does the star have to be there like this on me:*:join:#: ???

smile



Hehe oh yes i forgot to write them but offcouse i know thay have to be there wink
Posted By: FiberOPtics

Re: Idle script - 21/09/04 09:51 AM

Because the "me" there, is an event flag, and not an event level.

If you would have event levels in your user list like:

me:*!*@some.address.com
me:*!*@some.other.address.com

then you could do on me:JOIN:#:...

Greets
Posted By: wiebe

Re: Idle script - 21/09/04 11:06 AM

it depends a bit on the definition of being idle here, if it is reset after sending anything to the channel (message, nick change, etc) then you can check $nick(#help,$me).idle in your script.

if this is #help on quakenet, this should work.

wiebe
Posted By: FiberOPtics

Re: Idle script - 21/09/04 02:13 PM

Yeah, that would work, but why would we do that, since there's already a timer running that will make us part after the max allowed time. If we're still there, it must mean we aren't over the max time, so it's not needed to check as well.

But it's good to mention.

Greets
Posted By: NoPleX

Re: Idle script - 21/09/04 11:19 PM

Well thaks for your help all... I have been scripting for a long time but it has been 3 months since last time because of school.... So thanks for you kind help laugh
© 2022 mIRC Discussion Forums