mIRC Home    About    Download    Register    News    Help

Print Thread
Page 1 of 2 1 2
#84603 30/05/04 04:21 PM
Joined: May 2004
Posts: 132
N
NoPleX Offline OP
Vogon poet
OP Offline
Vogon poet
N
Joined: May 2004
Posts: 132
Hi i have trying for along time now but i cant see my error in this script:


on me:*:JOIN:#help: .timer 60 CheckIdle

alias CheckIdle {
var %chan = #help
if ($me !isop %chan) {
var %a = $chan(%chan,0,r)
while (%a) {
if ($me(%chan,%a,r).idle > 540) { /part #help }
dec %a
}
}



I wat the script to part me form channel after 9 minutes idle! And the script is set to recount when i say something and i also think its set not to part me if im voiced or op!

Please help! confused


if ($me != geek) { $life is $false }
else { $life is $true }
NoPleX
#84604 30/05/04 04:56 PM
Joined: Mar 2004
Posts: 108
X
Vogon poet
Offline
Vogon poet
X
Joined: Mar 2004
Posts: 108
on me:*:JOIN <- not correct syntax see /help on join
$chan(%chan,0,r) <- see /help $chan
The above is what I noticed at a glance.

try this: (untested)

on *:JOIN:#help:{
if ($me isop $chan) { return }
else { timeridle 1 540 part #help }
}
on *:input:#help:{
if ($me isop $chan) { return }
else { checkidle }
}
alias CheckIdle {
timeridle off
timeridle 1 540 part #help
}
I know its not the best example, or best way to go about it, but it should work and give you a little to work with. smile

-cheers


sometimes these are as bad as quit messages :tongue:
#84605 30/05/04 05:10 PM
Joined: Dec 2002
Posts: 3,138
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 3,138
Quote:
on me:*:JOIN <- not correct syntax see /help on join

The syntax is fine. Try it yourself, it means when YOU join a channel. The me: is the opposite of the ! event prefix (which means only trigger for others, not yourself).

#84606 30/05/04 05:16 PM
Joined: Feb 2004
Posts: 714
Z
Hoopy frood
Offline
Hoopy frood
Z
Joined: Feb 2004
Posts: 714
Quote:
on me:*:JOIN <- not correct syntax see /help on join
Actually that works fine. (see Collective's explanation)

NoPlex:
Code:
on me:*:JOIN:#help: .timer 60 CheckIdle

alias CheckIdle {
 var %chan = #help
  if ($me !isop %chan) &amp;&amp; ($idle &gt;= 540) { part %chan }
}
This code checks every 60 seconds your idle time ($idle) and, if its equal or higher than 540 secs, it parts you from %chan.

Hope it helps:)

Last edited by Zyzzyx26; 30/05/04 05:17 PM.

"All we are saying is give peace a chance" -- John Lennon
#84607 30/05/04 05:28 PM
Joined: Mar 2004
Posts: 108
X
Vogon poet
Offline
Vogon poet
X
Joined: Mar 2004
Posts: 108
hmm.. did not know that.. sorry and thanks smile

but as far as $idle that is "network idle time" correct? thus it wont be resetting on text to "#help" rather everytime you send to anywhere.


sometimes these are as bad as quit messages :tongue:
#84608 30/05/04 05:32 PM
Joined: Feb 2004
Posts: 714
Z
Hoopy frood
Offline
Hoopy frood
Z
Joined: Feb 2004
Posts: 714
Yes, $idle is a network idle time indeed.

If NoPlex wants just the idle on that channel, then your way (xxxYODAxxx's way) works fine smile

Zyzzy.


"All we are saying is give peace a chance" -- John Lennon
#84609 30/05/04 07:25 PM
Joined: May 2004
Posts: 132
N
NoPleX Offline OP
Vogon poet
OP Offline
Vogon poet
N
Joined: May 2004
Posts: 132
ok thanks.

And the:

var %chan = #help

stands for what?

And why:

%chan

Instead of $chan?



BTW you script is wrong! You forgot a 0 after .timer

on me:*:JOIN:#help: .timer 0 60 CheckIdlealias CheckIdle { var %chan = #help if ($me !isop %chan) && ($idle >= 540) { part %chan }}

Last edited by NoPleX; 30/05/04 07:32 PM.

if ($me != geek) { $life is $false }
else { $life is $true }
NoPleX
#84610 30/05/04 07:32 PM
Joined: Feb 2004
Posts: 714
Z
Hoopy frood
Offline
Hoopy frood
Z
Joined: Feb 2004
Posts: 714
var %chan = #help - this was on the first post of this thread, so i kept it.

the command /var creates a %variable that will only be used while that script is running.. then it will be erased. It is used to store information in a more organized way, which is usually easier to handle.

In your script, specifically, that command is not necessary, since it only uses that variable.. so, if you want to, you can change all the %chan for #help (or whatever channel you want it to be) and remove that line.
Just remember to change them ALL, or else it will not work.

var is the command /var
%chan is the name of the variable (it has to have that & in front of it).
#help is the value of that variable.

Note that you need to add an equal sign (=) between the name of the var and the value.

Hope this helps smile
Zyzzy.

Edit: in answer to your second question, you can use $chan as well.. there's no problem smile

Edit2: Indeed, the zero is missing. My bad blush

Last edited by Zyzzyx26; 30/05/04 07:34 PM.

"All we are saying is give peace a chance" -- John Lennon
#84611 30/05/04 07:35 PM
Joined: May 2004
Posts: 132
N
NoPleX Offline OP
Vogon poet
OP Offline
Vogon poet
N
Joined: May 2004
Posts: 132
ok here you made something wrong in you script:
You forgot a 0 after .timer and its CheckIdle after 60 not CheckIdlealias wink


on me:*:JOIN:#help: .timer 60 CheckIdlealias
CheckIdle {
var %chan = #help
if ($me !isop %chan) && ($idle >= 540) { part %chan }
}



but thanks for your help laugh


if ($me != geek) { $life is $false }
else { $life is $true }
NoPleX
#84612 30/05/04 07:37 PM
Joined: Feb 2004
Posts: 714
Z
Hoopy frood
Offline
Hoopy frood
Z
Joined: Feb 2004
Posts: 714
Yup.. just apologized in the post above smile

I was using as reference the 1st code, which didnt have the zero, and the alias name was changed.


"All we are saying is give peace a chance" -- John Lennon
#84613 30/05/04 07:39 PM
Joined: May 2004
Posts: 132
N
NoPleX Offline OP
Vogon poet
OP Offline
Vogon poet
N
Joined: May 2004
Posts: 132
okay laugh it was quite a simple script i just didnt know what var ment smile


if ($me != geek) { $life is $false }
else { $life is $true }
NoPleX
#84614 30/05/04 07:41 PM
Joined: Aug 2003
Posts: 1,831
I
Hoopy frood
Offline
Hoopy frood
I
Joined: Aug 2003
Posts: 1,831
This will use your idle time on that channell instead of the network-wide $idle ($idle is reset after typing anything into any window at all).

on me:*:JOIN:#help:.timer $+ # 0 60 CheckIdle
alias CheckIdle {

  • if ($me !isop #help) && ($nick(#help,$me).idle >= 540) { part #help }
}
on me:*:part:#help:.timer $+ # off

#84615 30/05/04 07:43 PM
Joined: Feb 2004
Posts: 714
Z
Hoopy frood
Offline
Hoopy frood
Z
Joined: Feb 2004
Posts: 714
Also try /help /var - full explanation with switches.

Good luck,
Zyzzy.


"All we are saying is give peace a chance" -- John Lennon
#84616 30/05/04 07:45 PM
Joined: May 2004
Posts: 132
N
NoPleX Offline OP
Vogon poet
OP Offline
Vogon poet
N
Joined: May 2004
Posts: 132
thx! BTW it works fine. But will it also part me if im op or voiced?

I tested and i didnt have op or voice and it works there. But when i part the channel it starts writeing this in the status window:

* /part: insufficient parameters (line 5, script8.ini)

whats wrong?


if ($me != geek) { $life is $false }
else { $life is $true }
NoPleX
#84617 30/05/04 07:49 PM
Joined: Feb 2004
Posts: 714
Z
Hoopy frood
Offline
Hoopy frood
Z
Joined: Feb 2004
Posts: 714
Code:
on me:*:JOIN:#help: .timerCheck 0 60 CheckIdlealias
alias CheckIdlealias {
  if ($me !isop $chan) &amp;&amp; ($idle &gt;= 540) { part $chan }
}

on me:*:PART:#help: .timerCheck off
I forgot to stop the timer once you leave the channel.

Paste this code and it should work fine smile Note that i have named the timers, so this way i can choose which timer to stop.

Tell me if it works.


"All we are saying is give peace a chance" -- John Lennon
#84618 30/05/04 07:54 PM
Joined: Aug 2003
Posts: 1,831
I
Hoopy frood
Offline
Hoopy frood
I
Joined: Aug 2003
Posts: 1,831
So did I ^^ up there, and you're still using $idle wink

#84619 30/05/04 07:57 PM
Joined: Feb 2004
Posts: 714
Z
Hoopy frood
Offline
Hoopy frood
Z
Joined: Feb 2004
Posts: 714
I posted above that if they wanted the idle only in that specify channel, then they should use xxxYODAxxx's script.

But they are using the one with $idle, so im fixing that one.

Last edited by Zyzzyx26; 30/05/04 08:00 PM.

"All we are saying is give peace a chance" -- John Lennon
#84620 30/05/04 07:59 PM
Joined: May 2004
Posts: 132
N
NoPleX Offline OP
Vogon poet
OP Offline
Vogon poet
N
Joined: May 2004
Posts: 132
oh hehe ok :tongue: i could have found that out my self but im to tired to think iv been up all night crazy


Should the:

var $chan = #help


Be in it???

Last edited by NoPleX; 30/05/04 08:03 PM.

if ($me != geek) { $life is $false }
else { $life is $true }
NoPleX
#84621 30/05/04 08:02 PM
Joined: Feb 2004
Posts: 714
Z
Hoopy frood
Offline
Hoopy frood
Z
Joined: Feb 2004
Posts: 714
You should also see if xxxYODAxxx's script is the one you actually want. The one that uses's $idle refers as idle of thw whle network, not just on that channel.

For the idle only that the chan, use YODA's.

Greetings,
Zyzzyx.


"All we are saying is give peace a chance" -- John Lennon
#84622 30/05/04 08:05 PM
Joined: May 2004
Posts: 132
N
NoPleX Offline OP
Vogon poet
OP Offline
Vogon poet
N
Joined: May 2004
Posts: 132
yes but i only need it on that one channel because you are not allowed to idle on #help after 10 minutes you will get kicked so if i forgot to part from in my script will do it by it self smile


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

Link Copied to Clipboard