|
Joined: May 2004
Posts: 132
Vogon poet
|
OP
Vogon poet
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
|
|
|
|
Joined: Dec 2002
Posts: 787
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 787 |
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.
|
|
|
|
Joined: Feb 2004
Posts: 2,013
Hoopy frood
|
Hoopy frood
Joined: Feb 2004
Posts: 2,013 |
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.
|
|
|
|
Joined: Dec 2002
Posts: 787
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 787 |
Just like the above wouldnt make it just work for #help, but for all channels?  Eamonn.
|
|
|
|
Joined: Feb 2004
Posts: 2,013
Hoopy frood
|
Hoopy frood
Joined: Feb 2004
Posts: 2,013 |
Well I expected him to know to atleast change the channel, lol.
Anyway, it's edited, cya.
|
|
|
|
Joined: May 2004
Posts: 132
Vogon poet
|
OP
Vogon poet
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 }
|
|
|
|
Joined: Feb 2004
Posts: 2,013
Hoopy frood
|
Hoopy frood
Joined: Feb 2004
Posts: 2,013 |
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.
|
|
|
|
Joined: Dec 2002
Posts: 787
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 787 |
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.
|
|
|
|
Joined: May 2004
Posts: 132
Vogon poet
|
OP
Vogon poet
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.
|
|
|
|
Joined: Feb 2004
Posts: 2,013
Hoopy frood
|
Hoopy frood
Joined: Feb 2004
Posts: 2,013 |
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.
|
|
|
|
Joined: May 2004
Posts: 132
Vogon poet
|
OP
Vogon poet
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  :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:#: ??? Hehe oh yes i forgot to write them but offcouse i know thay have to be there 
Last edited by NoPleX; 21/09/04 09:47 AM.
|
|
|
|
Joined: Feb 2004
Posts: 2,013
Hoopy frood
|
Hoopy frood
Joined: Feb 2004
Posts: 2,013 |
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
|
|
|
|
wiebe
|
wiebe
|
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
|
|
|
|
Joined: Feb 2004
Posts: 2,013
Hoopy frood
|
Hoopy frood
Joined: Feb 2004
Posts: 2,013 |
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
|
|
|
|
Joined: May 2004
Posts: 132
Vogon poet
|
OP
Vogon poet
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
|
|
|
|
|