mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Feb 2003
Posts: 3,432
S
sparta Offline OP
Hoopy frood
OP Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,432
Being testing this for ages without any luck. been asking here too befor, but no luck smirk
Code:
alias who-cli {
  if (%colnick_ == enabled) { upd-clienc }
  var %nr = 1
  while ($chan(%nr)) {
    var %chans = $addtok(%chans,%nr $ifmatch,149)
    inc %nr
  }
  var %nr = 1
  while $gettok(%chans,%nr,149) {
    var %token = $ifmatch
    .timer 1 $calc($gettok(%token,1,32) *5) who $gettok(%token,2,32)
    inc %nr
  }
}

raw 352:*: {
  haltdef
  if (%nickcol_ == enabled) {   
    if ($me !ison $2) { return }
    if (* isin $7) { cline -l $clinecol(po) $2 $6 }
    if ($6 isnotify) { cline -l $clinecol(.no) $2 $6 }
    if (G isin $7) { cline -l $clinecol(aw) $2 $6 }
    elseif (G !isin $7) && ($6 !isnotify) && (* !isin $7) { cline -l $clinecol(no) $2 $6 }
    upd-clienc
  }
}

the code coloring the nick as it should, but if it's a channel with many users the script freezes, and im not able to solve it, any ideas? smirk


if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }
Joined: Dec 2002
Posts: 503
B
Fjord artisan
Offline
Fjord artisan
B
Joined: Dec 2002
Posts: 503
What part exactally does it get stuck on?

Incidentally, the whole who-cli alias is odd to me. You aren't re-using %chans anywhere hear, are you re-using it somewhere else? If not, then it can be replace by something as simple as:
Code:
alias who-cli {
  if (%colornick_ == enabled) { upd-clienc }
  var %nr = $chan(0)
  while (%nr > 0) {
    .timer 1 $calc(%nr * 5) who $chan(%nr)
    dec %nr
  }
}

As for the 352, you appear to have competing coloration.

Without seeing what $clinecol and upd-clienc are actually doing, it's hard to go any further.

Joined: Feb 2003
Posts: 3,432
S
sparta Offline OP
Hoopy frood
OP Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,432
Code:
    if ($me !ison $2) { return } ; if im not on the channel, then return, if i parted.
    if (* isin $7) { cline -l $clinecol(po) $2 $6 } ; irc-operators
    if ($6 isnotify) { cline -l $clinecol(.no) $2 $6 } ; notify users
    if (G isin $7) { cline -l $clinecol(aw) $2 $6 } ; this is away users
    elseif (G !isin $7) && ($6 !isnotify) && (* !isin $7) { cline -l $clinecol(no) $2 $6 } ; return the color of normal users
    upd-clienc ; coloring the rest of the nick on the channel, op/voice/normal users

I dont know if that is the info you wanted? but all it does is check if a users is away or not, and if they are away they give the nick the right color, same goes for irc-opers - normal users.


if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Anytime you try to loop through a large channel's list of users in order to /cline people based on things like away status, it will take a long time and will freeze mIRC. The way around that is to do the coloring in parts... say nicks starting with A-F immediately when you join, then wait 2 seconds and do nicks G-M, etc. Something like that should prevent the freezing, though it will make your nick coloring take longer. Alternatively, you can use /cnick for things that may not change (such as op/voice/etc status). I think we went over that before.


Invision Support
#Invision on irc.irchighway.net
Joined: Feb 2003
Posts: 3,432
S
sparta Offline OP
Hoopy frood
OP Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,432
We talked about it yes, but we didnt come to a solution, thats why i still have the problem, havent been able to solve it.. smirk


if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }
Joined: Dec 2002
Posts: 503
B
Fjord artisan
Offline
Fjord artisan
B
Joined: Dec 2002
Posts: 503
No, that wasn't what I was talking about, but here's another thought tree to use.

Instead of acting when the who results come in like this, write the channel/name prepended with an alias name to a file, then /play -c the file with a delay.

This will shorten the pause when the coloration is happening (well, spread it out really), but you'll still get the pause when the /who results are coming in, just (hopefully) shorter.

Joined: Feb 2003
Posts: 3,432
S
sparta Offline OP
Hoopy frood
OP Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,432
dont understand you there, /splay the file? still i need to do the /who ? and i think thats what cosing mirc to freeze, i coloring the rest of the nick when i join a channel with cline after status if ($nick isop $chan) - if ($nick isvo $chan), and that dosent make me lag at all.. so it's something in the /who,


if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }
Joined: Jun 2006
Posts: 508
D
Fjord artisan
Offline
Fjord artisan
D
Joined: Jun 2006
Posts: 508
Bekar said /play, not /splay, (not a bad idea that smile)

I think it's probably your parsing of the who replies that's your problem. Most likely the fact that you call "upd-clienc" for every raw 352. You mentioned that alias colors the rest of the nicks, so I'm guessing you're looping all nicks in it...

Try whas has been suggested several times, use /cnick coloring for op/hop/voice/regular/notify/etc. Then you won't need to call upd-clienc at all.
Or at least move that from the raw 352 event to a raw 315 (End of /WHO list.)

That just leaves ircops, or away nicks to /cline (/cline over-rides /cnick so there won't be a problem there).
See if that improves things.

Joined: Feb 2003
Posts: 3,432
S
sparta Offline OP
Hoopy frood
OP Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,432
I still dont understand how to do it, write all info to a txt file, then play it, i still need the info from the raw ? i dont know about any other way to return irc-op and away users, so how would i get the info from the txt file if a user is set away or if he have a o or O line? plz explain how i can color the away users and irc-operators if i don't need the /who command ? cos im totaly lost here, been reading the posts more then 1 time, and i still can't understand how to get the info even due i have all nick in a *.txt file.

raw 315 (End of /WHO list.) <- that only return that info, so then im stuck with a line i wont even use?

/splay was a typo..


if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }
Joined: Jun 2006
Posts: 508
D
Fjord artisan
Offline
Fjord artisan
D
Joined: Jun 2006
Posts: 508
Originally Posted By: sparta
I still dont understand how to do it, write all info to a txt file, then play it, i still need the info from the raw ? i dont know about any other way to return irc-op and away users, so how would i get the info from the txt file if a user is set away or if he have a o or O line? plz explain how i can color the away users and irc-operators if i don't need the /who command ?
Nobody said to not use /who. In fact Bekar stated "but you'll still get the pause when the /who results are coming in".

Originally Posted By: sparta
raw 315 (End of /WHO list.) <- that only return that info, so then im stuck with a line i wont even use?
I was talking about calling your 'upd-clienc' alias from raw 315 instead of calling it multiple times (from each and every raw 352). Again, to get a 'End of /WHO list.' reply you must have issued a /who. wink
However, cnick coloring would mean even that was not needed.

I totally agree with Riamus, you should use cnick colors for op/hop/voice/regular/notify/etc.

Joined: Jun 2006
Posts: 508
D
Fjord artisan
Offline
Fjord artisan
D
Joined: Jun 2006
Posts: 508
Here's a sample code based on Bekar's suggestion but with some small differences, it uses /fwrite (quicker) and /plays to an alias which parses the results, rather than parsing them as they arrive.

Note: It doesn't check for isnotify because /cnick can do that better/easier/quicker†† than extra parsing with using cline.
Note: It doesn't check for chanmodes because /cnick can do that better/easier/quicker†† than extra parsing with using cline.
Code:
alias who-cli {
  if (%colornick_ != enabled) { return }
  var %nr = $chan(0)
  while (%nr > 0) {
    .timer 1 $calc(%nr * 5) who $chan(%nr)
    dec %nr
  }
}


raw 352:*:{
  if ($me !ison $2) { return }
  if !$fopen($2) { .fopen -no $2 $2.who }
  .fwrite -n $2 $3-
  halt
}
raw 315:*:{
  .fclose $2
  .play -a who_cols_ $2 $2.who 100
  .remove $2.who
  halt
}
alias -l who_cols_ {
  if ($me !ison $1) { return }
  if ($5 !ison $1) { return }
  var %a
  if (G isin $6) { %a = $clinecol(aw) }
  if (* isin $6) { %a = $clinecol(po) }
  if %a { cline -l %a $1 $5 }
  else cline -r $1 $5
}



†† Take your pick. grin

Joined: Feb 2003
Posts: 3,432
S
sparta Offline OP
Hoopy frood
OP Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,432
I tested your code, and found a problem in it..
Code:
alias -l who_cols_ {
  if ($me !ison $1) { play stop }
  if ($2 !ison $1) { return }
  echo -a -> $1 - $2
  var %a
  if (* isin $6) { %a = $clinecol(po) }
  if (G isin $6) { %a = $clinecol(aw) }
  if %a { cline -l %a $1 $5 }
  else cline -r $1 $5
}

as you see i changed the line:
if ($6 !ison $1) { return }
to
if ($2 !ison $1) { return }

That working fine untill it comes to my nick "have oper status on the network", for some reason when it comes to me it return the ident insted of the nick as $2, and after that the script halts, i also tested to bring in a clone and give that too oper status, same thing with that one, it return the ident insted of the nick, and the only way i can see what it return, then i have to comment out the line if ($2 !ison $1) { return }, any ideas what cosing this? and i also needed to remove the halt at the end of raw 352:*:{ , if i didnt the script wouldent color any nick in the channel.


if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }
Joined: Jun 2006
Posts: 508
D
Fjord artisan
Offline
Fjord artisan
D
Joined: Jun 2006
Posts: 508
Originally Posted By: sparta
I tested your code, and found a problem in it..

as you see i changed the line:
if ($6 !ison $1) { return }
to
if ($2 !ison $1) { return }

That working fine untill it comes to my nick "have oper status on the network", for some reason when it comes to me it return the ident insted of the nick as $2, and after that the script halts, i also tested to bring in a clone and give that too oper status, same thing with that one, it return the ident insted of the nick, and the only way i can see what it return, then i have to comment out the line if ($2 !ison $1) { return }, any ideas what cosing this? and i also needed to remove the halt at the end of raw 352:*:{ , if i didnt the script wouldent color any nick in the channel.

$2 is identd not the nick.
Its the same order as the original who reply, just one number lower... $7 becomes $6, $6 becomes $5, etc...

Edit:
Code:
alias -l who_cols_ {
  if ($me !ison $1) { return }
  if ($5 !ison $1) { return }
  var %a
  if (G isin $6) { %a = $clinecol(aw) }
  if (* isin $6) { %a = $clinecol(po) }
  if %a { cline -l %a $1 $5 }
  else cline -r $1 $5
}



Joined: Apr 2003
Posts: 342
M
Fjord artisan
Offline
Fjord artisan
M
Joined: Apr 2003
Posts: 342
OMIGOD NOT THIS AGAIN!

K... look at this data from my debug window...

[04:44:49] [1] (999) [#302] MeStinkBAD DannyB=+~Daniel@ftp.linux-mips.org duck_=+duck@lagged-out.net EvlPB=+~nope@adsl-068-209-217-243.sip.bna.bellsouth.net evulish__=+~tits@cpe-24-193-43-87.nyc.res.rr.com Eye_Mac=+~PaulRoue@70-100-85-21.br1.ara.mn.frontiernet.net
[04:44:54] [1] (50) /userhost MacServPro MeStinkBAD
[04:44:54] [1] (999) [#302] MeStinkBAD MacServPro=+macserv@clamshell.ambulatoryclam.net MeStinkBAD=+dustin@ip72-200-86-91.tc.ph.cox.net
[04:45:19] [1] (50) /userhost barrytoo chino- digicow ][spot Auditor
[04:45:19] [1] (50) /userhost blakespot Cardo clam dan-- Dogmatix
[04:45:19] [1] (50) /userhost Dunderklumpen evulish eye_b Fire_on_High g\\bel
[04:45:19] [1] (999) [#302] MeStinkBAD barrytoo=+~identd@panix1.panix.com chino-=+~chino@chino.com digicow=+digicow@moo.digicow.net ][spot=+~windfello@216.22.10.90 Auditor=+VenOm@sannata.org
[04:45:19] [1] (999) [#302] MeStinkBAD blakespot=+~windfello@216.22.10.90 Cardo=-cardo@cardorealm.com clam=+dan@clamshell.ambulatoryclam.net dan--=+~dan@216.254.54.156 Dogmatix=+WinAmp@203.213.54.67
[04:45:19] [1] (999) [#302] MeStinkBAD Dunderklumpen=+~Dunderklu@81-234-144-182-o925.telia.com evulish=+~grant@69.60.122.35 eye_b=+~eye_b@70-100-85-21.br1.ara.mn.frontiernet.net Fire_on_High=+~scendera@h13.225.213.151.ip.alltel.net g\\bel=+gerbil@b081043.adsl.vdis.de
[04:45:49] [1] (50) /userhost G-WiZ- Geeks Horst jeneric_ k-d
[04:45:49] [1] (50) /userhost m0oman Malamutt Morgue NDPMacBook Nelluk
[04:45:49] [1] (50) /userhost NetKeeper patno rocket625 Section31 staja
[04:45:50] [1] (999) [#302] MeStinkBAD G-WiZ-=-shogun@ip72-199-189-189.sd.sd.cox.net Geeks=-~vampira@pool-72-87-39-191.ptldor.fios.verizon.net Horst=+~peanutlx@c220-237-123-15.randw1.nsw.optusnet.com.au jeneric_=+~jeneric@wireless196.subnet2073260.ncn.net k-d=+~kd@prime.gushi.org
[04:45:50] [1] (999) [#302] MeStinkBAD m0oman=+~gorrilla@HSI-KBW-091-089-014-205.hsi2.kabelbw.de Malamutt=+~malamutt@pool-71-164-216-25.dllstx.fios.verizon.net Morgue=+Morgue_@cpe-74-75-211-247.maine.res.rr.com NDPMacBook=+~ndpmacboo@207-172-70-51.c3-0.sbo-ubr2.sbo.ma.cable.rcn.com Nelluk=+~nelluk@24-176-25-181.dhcp.klmz.mi.charter.com
[04:45:50] [1] (999) [#302] MeStinkBAD NetKeeper=+~NetKeeper@dsl-135-79.aei.ca patno=+~patno@195.149.143.194 rocket625=+~rocket625@71-219-185-243.clsp.qwest.net Section31=+~section31@207-172-70-51.c3-0.sbo-ubr2.sbo.ma.cable.rcn.com staja=+~staja@c-24-60-182-196.hsd1.ma.comcast.net
[04:46:20] [1] (50) /userhost Grif IIspot jrolland-iMac__ Lint MacServ
[04:46:20] [1] (50) /userhost MasterKat Mornx NDPTAL85 Neth Obj-Cow
[04:46:20] [1] (50) /userhost pnorman ryan42 sillyduck thisnicknamecannotberegistered VetteRacer
[04:46:20] [1] (999) [#302] MeStinkBAD Grif=-~Grif@84.203.243.150 IIspot=+~windfello@216.22.10.90 jrolland-iMac__=+~jrolland@75-17-144-206.lightspeed.milwwi.sbcglobal.net Lint=+clarus@shell.poundmac.org MacServ=+macserv@netmug.org
[04:46:20] [1] (999) [#302] MeStinkBAD MasterKat=+~bigkat@or-71-53-76-131.dhcp.embarqhsd.net Mornx=+~Morn@60-242-91-75.static.tpgi.com.au NDPTAL85=+~ndptal85@207-172-70-51.c3-0.sbo-ubr2.sbo.ma.cable.rcn.com Neth=-~kenny@host-24-225-144-130.patmedia.net Obj-Cow=+V_Bovine@c-24-218-61-186.hsd1.ma.comcast.net
[04:46:20] [1] (999) [#302] MeStinkBAD pnorman=+~pnorman@d206-116-227-248.bchsia.telus.net ryan42=-~ryanx42@adsl-68-90-43-74.dsl.hstntx.swbell.net sillyduck=+~sillyduck@c-c2cce355.87-15-64736c12.cust.bredbandsbolaget.se thisnicknamecannotberegistered=+~srd@70-140-69-159.lightspeed.sprntx.sbcglobal.net VetteRacer=+~VetteRace@ip68-229-19-182.lv.lv.cox.net
[04:46:50] [1] (50) /userhost Toren[zzz] Workey_McFly
[04:46:50] [1] (999) [#302] MeStinkBAD Toren[zzz]=-~toren@68-186-145-36.dhcp.kgpt.tn.charter.com Workey_McFly=+~Workey@64.86.141.133

Notice a pattern...
Now I'll be back in a few hours to explain....



Beware of MeStinkBAD! He knows more than he actually does!

Link Copied to Clipboard