mIRC Home    About    Download    Register    News    Help

Print Thread
#69178 24/01/04 09:41 PM
Joined: Jan 2004
Posts: 129
A
AaronL Offline OP
Vogon poet
OP Offline
Vogon poet
A
Joined: Jan 2004
Posts: 129
Hoi allemaal

Ik probeer een teller te maken die bijhoudt of er meer dan 1 persoon in de channel is.

on *:join:#: {
set %personen $nick(#,0)
if (%personen > 1) && (%personen < 3) { doe iets }
}
(die < 3 voorkomt dat het iedere keer wordt uitgevoerd als er weer iemand binnen komt)
Dit werkt goed. Het probleem zit hem in de PART en QUIT
on *:part:#: {
set %personen $nick(#,0)
if (%personen < 2) { doe iets }
} <~~ zelfde met quit.

Dit echter werkt niet goed. Zien jullie de fout?
Alvast bedankt
Aaron




Deridio fatum
#69179 24/01/04 10:09 PM
Joined: Jan 2003
Posts: 3,012
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2003
Posts: 3,012
There is an offchance that someone that speaks your language frequents the forum, but for the most part--this is an English speaking forum. If you happen to know any english, please translate.


-KingTomato
#69180 24/01/04 10:35 PM
Joined: Aug 2003
Posts: 1,831
I
Hoopy frood
Offline
Hoopy frood
I
Joined: Aug 2003
Posts: 1,831
Well, I *think* the problem is that as far as mIRC is concerned the person is still on the channel until after the part/quit event is finished.
See /help /updatenl for a way to overcome this.
Code:
on *:part:#:{
  [color:blue]updatenl[/color]
  set %personen $nick(#,0)
  if (%personen &lt; 2) { doe iets }
}


#69181 24/01/04 10:59 PM
Joined: Oct 2003
Posts: 30
Ameglian cow
Offline
Ameglian cow
Joined: Oct 2003
Posts: 30
[translation]

Hello everybody

I'm tring to create a counter wich counts wheter there are more then 1 person on the channel

on *:join:#: {
set %pers $nick(#,0)
if (%pers > 1) && (%pers < 3) { do something }
}
(The < 4 prevents to do this everytime if somebody gets back in the channel)
This all works good. The problem is in the PART and QUIT

on *:part:#: {
set %pers $nick(#,0)
if (%pers < 2) { do something }
} <~~ same with QUIT

This doesn't work good. Can you see the error?

Thanks in advance

Aaron

[/translation]

[footer in dutch]
(Aaron: aangezien dit engels board is graag engels praten, ik vertaal je reactie maar eenmalig, indien je geen engels kan kun je beter een nederlands forum opzoeken denk ik)
[/footer in dutch]


------
Cheers m8!
#69182 24/01/04 11:02 PM
Joined: Jan 2004
Posts: 129
A
AaronL Offline OP
Vogon poet
OP Offline
Vogon poet
A
Joined: Jan 2004
Posts: 129
hi all.

I'm sorry. i will ask my question again in english

point is that %personen = 1 when only the bot is in the channnel. As soon someon joins the room the %personen will increase with 1. As long there are more people then 1 in the channel a timer gives some messages each hour. This need to stop as they leave and the bot is alone again. So with part/quit the counter needs to decrease.

increase works, but decrease not.

thanxs in advange
Aaron


Deridio fatum
#69183 24/01/04 11:14 PM
Joined: Aug 2003
Posts: 1,831
I
Hoopy frood
Offline
Hoopy frood
I
Joined: Aug 2003
Posts: 1,831
I figured the problem was something like that just from the code.. :[/b])
Did you try with the /updatenl command I suggested?

#69184 25/01/04 11:05 AM
Joined: Jan 2004
Posts: 129
A
AaronL Offline OP
Vogon poet
OP Offline
Vogon poet
A
Joined: Jan 2004
Posts: 129
Hi again.

well, i made the routine like this

on *:part:#mychannel: {
Set %personen $nick(#,0)
/updatenl
if (%personen < 2) { doesomething }
}

in the channel are me and the bot and the counter =2 like it should. But when i part the channel the counter still stays on 2.
so it didn't work.
Hope someone can help me

Greetz
aaron


Deridio fatum
#69185 25/01/04 01:44 PM
Joined: Aug 2003
Posts: 1,831
I
Hoopy frood
Offline
Hoopy frood
I
Joined: Aug 2003
Posts: 1,831
Quote:
well, i made the routine like this
 
on *:part:#mychannel: {
Set %personen $nick(#,0)
/updatenl
if (%personen < 2) { doesomething }
}
Look at where I put the updatenl command wink
Code:
on *:part:#mychannel:{ 
[color:blue]  updatenl[/color]
  Set %personen $nick(#,0)
  if (%personen &lt; 2) { doesomething }
}
The idea is to update the nicklist BEFORE you set the variable. laugh

#69186 25/01/04 02:48 PM
Joined: Jan 2004
Posts: 129
A
AaronL Offline OP
Vogon poet
OP Offline
Vogon poet
A
Joined: Jan 2004
Posts: 129
Yeeeeeeeeeeeeeeeeeeeeeeee. it worked.

Thanks Iori and others.

greetz
Aaron


Deridio fatum

Link Copied to Clipboard