mIRC Home    About    Download    Register    News    Help

Print Thread
#98149 21/09/04 08:29 AM
Joined: May 2004
Posts: 132
N
NoPleX Offline OP
Vogon poet
OP Offline
Vogon poet
N
Joined: May 2004
Posts: 132
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



if ($me != geek) { $life is $false }
else { $life is $true }
NoPleX
#98150 21/09/04 09:02 AM
Joined: Dec 2002
Posts: 788
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 788
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.

#98151 21/09/04 09:07 AM
Joined: Feb 2004
Posts: 2,019
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
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.


Gone.
#98152 21/09/04 09:08 AM
Joined: Dec 2002
Posts: 788
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 788
Just like the above wouldnt make it just work for #help, but for all channels? laugh

Eamonn.

#98153 21/09/04 09:10 AM
Joined: Feb 2004
Posts: 2,019
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
Well I expected him to know to atleast change the channel, lol.

Anyway, it's edited, cya.


Gone.
#98154 21/09/04 09:21 AM
Joined: May 2004
Posts: 132
N
NoPleX Offline OP
Vogon poet
OP Offline
Vogon poet
N
Joined: May 2004
Posts: 132
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


if ($me != geek) { $life is $false }
else { $life is $true }
NoPleX
#98155 21/09/04 09:23 AM
Joined: Feb 2004
Posts: 2,019
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
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

Last edited by FiberOPtics; 21/09/04 09:25 AM.

Gone.
#98156 21/09/04 09:30 AM
Joined: Dec 2002
Posts: 788
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 788
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.

#98157 21/09/04 09:34 AM
Joined: May 2004
Posts: 132
N
NoPleX Offline OP
Vogon poet
OP Offline
Vogon poet
N
Joined: May 2004
Posts: 132
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
}

Last edited by NoPleX; 21/09/04 09:36 AM.

if ($me != geek) { $life is $false }
else { $life is $true }
NoPleX
#98158 21/09/04 09:39 AM
Joined: Feb 2004
Posts: 2,019
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
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

Last edited by FiberOPtics; 21/09/04 09:43 AM.

Gone.
#98159 21/09/04 09:44 AM
Joined: May 2004
Posts: 132
N
NoPleX Offline OP
Vogon poet
OP Offline
Vogon poet
N
Joined: May 2004
Posts: 132
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

Last edited by NoPleX; 21/09/04 09:47 AM.

if ($me != geek) { $life is $false }
else { $life is $true }
NoPleX
#98160 21/09/04 09:51 AM
Joined: Feb 2004
Posts: 2,019
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
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


Gone.
#98161 21/09/04 11:06 AM
Joined: May 2004
Posts: 95
W
Babel fish
Offline
Babel fish
W
Joined: May 2004
Posts: 95
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

#98162 21/09/04 02:13 PM
Joined: Feb 2004
Posts: 2,019
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
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


Gone.
#98163 21/09/04 11:19 PM
Joined: May 2004
Posts: 132
N
NoPleX Offline OP
Vogon poet
OP Offline
Vogon poet
N
Joined: May 2004
Posts: 132
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


if ($me != geek) { $life is $false }
else { $life is $true }
NoPleX

Link Copied to Clipboard