mIRC Home    About    Download    Register    News    Help

Print Thread
Page 1 of 2 1 2
#116923 10/04/05 07:31 PM
Joined: Jan 2005
Posts: 75
Z
ztnaraM Offline OP
Babel fish
OP Offline
Babel fish
Z
Joined: Jan 2005
Posts: 75
i'm using a nicklist dll, i've spoke to a few people about this and no luck, basically, the idea is, when someone joins the custom nicklist should update to show how many people are ~ (+q)
but using $nick($chan,0,~) in the below returns 0
any ideas?
Code:
ON *:JOIN:#:{
  if ($nick == $me) {
    var %nl = dll resources\dlls\nicklust3.dll,%nc = $chan,
    %nl Mark $window(%nc).hwnd nLUST_CallBack hideempty nodefcolors hottrack rowselect tooltips balloontips underlinehot
    %nl SetGroupText %nc 1 > Regulars
    %nl AddGroup %nc 40 ~ 8 > Owners [~] $nick($chan,0,~)
}  

#116924 10/04/05 07:38 PM
Joined: Feb 2005
Posts: 194
A
Vogon poet
Offline
Vogon poet
A
Joined: Feb 2005
Posts: 194
Well, correct me if I'm wrong, but your talking about an owner? I'm on an IRCX server but the owner has a "." before it not a "~". However, this is to identify owners:

$nick($chan,0,q)

You have to use the mode parameter not the nicklist symbol. Good luck!

Last edited by alhammer; 10/04/05 07:41 PM.

"God sometimes puts us in the dark for us to see the light"
#116925 10/04/05 07:42 PM
Joined: Jan 2005
Posts: 75
Z
ztnaraM Offline OP
Babel fish
OP Offline
Babel fish
Z
Joined: Jan 2005
Posts: 75
you can use
$nick($chan,0,~)
$nick($chan,0,.)
$nick($chan,0,&)
$nick($chan,0,-)
$nick($chan,0,*)
$nick($chan,0,q)
$nick($chan,0,o)
$nick($chan,0,@)

etc, list goes on, i've tried every one of t hose to show how many of what are in the channel, and they all return 0

#116926 10/04/05 07:44 PM
Joined: Aug 2003
Posts: 314
S
Fjord artisan
Offline
Fjord artisan
S
Joined: Aug 2003
Posts: 314
In a self join event, the channel nicklist isn't yet filled. You need to wait for raw 366 (end of /names) before $nick() will return accurate information

#116927 10/04/05 07:45 PM
Joined: Jan 2005
Posts: 75
Z
ztnaraM Offline OP
Babel fish
OP Offline
Babel fish
Z
Joined: Jan 2005
Posts: 75
So what happens if i'm trying to update the ammount of users when other people are parting/joining etc

i can't /who everytime.

#116928 10/04/05 07:48 PM
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
did u ensure $chan had a value at the time ?

#116929 10/04/05 07:48 PM
Joined: Feb 2005
Posts: 194
A
Vogon poet
Offline
Vogon poet
A
Joined: Feb 2005
Posts: 194
This is what I have:

Code:
raw 366:*:{
  echo $2 12Channel Counter: There are $nick($2,0) People in $2 ยป $nick($2,0,q) Owners, $nick($2,0,o) Hosts, $nick($2,0,v,o) Voiced 
}


I hope that helps. Remember though, that only for when You join a channel. Like Sigh said, raw 366 is the join event raw. When using the raw, you have to use $2 insted of $chan. wink

Last edited by alhammer; 10/04/05 07:51 PM.

"God sometimes puts us in the dark for us to see the light"
#116930 10/04/05 07:50 PM
Joined: Aug 2003
Posts: 314
S
Fjord artisan
Offline
Fjord artisan
S
Joined: Aug 2003
Posts: 314
No /who required at all. I'm saying you cannot reference the nicklist in a join event where $nick = $me because the nicklist doesn't really exist yet. This is because the server sends you a 'join' command indicating you've joined the channel just before it sends the nicklist, so when you join a channel the join event triggers before the list of nicks is sent to you

Have your code run in a raw event, numeric 366

#116931 10/04/05 07:50 PM
Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
Can't you create an alias, when they join and trigger the alias when they join?

Code:
alias test {
  var %x = $nick($chan,0)
  while (%x) {
    if ($left($nick($chan,%x).pnick,1) ==  @) { nicklist for operators.. }
    if ($left($nick($chan,%x).pnick,1) ==  .) { nicklist for owners.. }
    dec %x
  }
}


Just an example..

#116932 10/04/05 08:01 PM
Joined: Feb 2005
Posts: 194
A
Vogon poet
Offline
Vogon poet
A
Joined: Feb 2005
Posts: 194
I have no clue what that DLL is or what it does, but here is what I think may work:

Code:
raw 366:*: { test }
on !*:JOIN:#: { test }
on *:PART:#: { test }
alias test {
  var %nl = dll resources\dlls\nicklust3.dll,%nc = $chan,
  %nl Mark $window(%nc).hwnd nLUST_CallBack hideempty nodefcolors hottrack rowselect tooltips balloontips underlinehot
  %nl SetGroupText %nc 1 > Regulars
  %nl AddGroup %nc 40 ~ 8 > Owners [~] $nick($chan,0,q)
}  


crazy


"God sometimes puts us in the dark for us to see the light"
#116933 10/04/05 08:12 PM
Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
Well, the the On Join/Part looks like it should work if the DLL syntax is correct on the otherhand I don't think it would work for the Raw event because you are using $chan in the alias when in a Raw event $chan is null.

So what you could do is when calling the alias use:

test <#channel>

Code:
On !*:Join:#: { test $chan }
On !*:Part:#: { test $chan }

Raw 366:*: {
  test $2
}

alias test {
  blah..
}

#116934 11/04/05 04:06 AM
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
Im going to throw 2c worth in, even tho i havent read what everyone wrote (mahahahahhaha its been a long day) I do this

Code:
on *:JOIN:#:{ if ($nick == $me) { who $chan } } | ; set off a who on the chan
raw 352:*:{ haltdef } | ; dont display the who data (this is optional)
raw 315:*:{ haltdef | some.alias.to.do.to.the.channel $2 } | ; $2 is the channel


Since raw 366 ends the Names list, but the address list still dont hold jack all, I do a /who $chan when i first join, which comes back straight after the names list, and loads all the $ial values, then i trip the join event on the end of a who list, you could incoperate some store what channels you just joined %var and only activate the 315 alias if its in that %var (removing it afterwards), but i wrote my code so it doesnt care if you manually do another /who channel, so i didnt care.

This would i think do.
Code:
on *:JOIN:#:{ if ($nick == $me) { set %on.join.who.channel.list %on.join.who.channel.list $chan | who $chan } }
raw 352:*:{ if $istok(%on.join.who.channel.list,$2,32) { haltdef } }
raw 315:*:{ if $istok(%on.join.who.channel.list,$2,32) { haltdef | set %on.join.who.channel.list $remtok(%on.join.who.channel.list,$2,1,32) | some.alias.to.do.to.the.channel $2 }


/me yells let the abuse of me begin for talking about the wrong thing.

#116935 11/04/05 12:46 PM
Joined: Jan 2005
Posts: 75
Z
ztnaraM Offline OP
Babel fish
OP Offline
Babel fish
Z
Joined: Jan 2005
Posts: 75
sorry, i've been away for a while. This is exactly what i have that builds the custon nicklist when i join, and it auto updates when people
part/join/quit or whatever, i presume the dll does all the work, as it does work properly

i just thought, seeing as it updates by itself, that putting a simple $nick($chan,0,~) or whatever prefix or mode next to the group that it would show correctly the number of users with that mode
i don't see it's a dll error, i'm really stumped

Code:
 ON *:JOIN:#:{
  if ($nick == $me) {
    var %nl = dll resources\dlls\nicklust3.dll,%nc = $chan,
    %nl Mark $window(%nc).hwnd nLUST_CallBack hideempty nodefcolors hottrack rowselect tooltips balloontips underlinehot
    %nl SetGroupText %nc 1 &gt; Regulars [r]
    %nl AddGroup %nc 40 ~ 8 &gt; Owners [~] $nick(%nc,0,~)
    %nl AddGroup %nc 50 &amp; 7 &gt; Protect [&amp;]
    %nl AddGroup %nc 5 . 1 &gt; Owners [.] 
    %nl AddGroup %nc 10 @ 3 &gt; Ops [@]
    %nl AddGroup %nc 20 % 0 &gt; Halfops [%]
    %nl AddGroup %nc 30 + 0 &gt; Voices [+]
    %nl SetGroupPos %nc 1 end
    %nl SetColor %nc bkg $color(2)
    %nl SetColor %nc text %c3
    %nl SetColor %nc hottext $color(1)
    %nl SetColor %nc divider $color(12) $color(2)
    %nl SetBranchImage %nc &gt; 0
    %nl SetHeaderColor %nc 1 %c1
    %nl SetHeaderColor %nc 5 %c1
    %nl SetHeaderColor %nc 10 %c1
    %nl SetHeaderColor %nc 20 %c1
    %nl SetHeaderColor %nc 30 %c1
    %nl SetHeaderFontStyle %nc bold
  }
  haltdef
}
alias nlust_callback {
  if ($1 = tooltip) {
    dll resources\dlls\nicklust3.dll SetTipTitle $2 1 &gt; $chr(32) $3
    return Notify: $_isnotifylist($3,Yes,No)
  }
  elseif ($1 == popups) {
    return $true
  }
}
alias _isnotifylist {
  if ($notify($1)) return $2
  return $3
}
  

#116936 11/04/05 01:23 PM
Joined: Aug 2003
Posts: 314
S
Fjord artisan
Offline
Fjord artisan
S
Joined: Aug 2003
Posts: 314
I told you why this happens, perhaps you'd care for an example:

Code:
raw 366:*:{
  dll resources\dlls\nicklust3.dll AddGroup $2 40 ~ 8 &gt; Owners [~] $nick($2,0,~)
}


Put it in a group so it only activates after you've first joined a channel

#116937 11/04/05 01:39 PM
Joined: Apr 2005
Posts: 10
F
Pikka bird
Offline
Pikka bird
F
Joined: Apr 2005
Posts: 10
Quote:
I have no clue what that DLL is or what it does, but here is what I think may work:

Code:
raw 366:*: { test }
on !*:JOIN:#: { test }
on *:PART:#: { test }
alias test {
  var %nl = dll resources\dlls\nicklust3.dll,%nc = $chan,
  %nl Mark $window(%nc).hwnd nLUST_CallBack hideempty nodefcolors hottrack rowselect tooltips balloontips underlinehot
  %nl SetGroupText %nc 1 &gt; Regulars
  %nl AddGroup %nc 40 ~ 8 &gt; Owners [~] $nick($chan,0,q)
}  


crazy

That's full of bugs!
1. do not use $chan in aliases... in aliases $chan means ACTIVE WINDOW, and not channel where the one joined
2. it's same thing, just that u write in a alias instead
My ideea
Code:
 
 alias getucnt {
var %i = 1
var %c = $1
var %sign = $2
var %signed = 0
if (!%c) haltdef
while ($nick(%c,%i).pnick) {
var %buff = $ifmatch
if ($mid(%buff,1,1) == %sign) inc %signed
inc %i
}
return %signed
}
 

Then u use $getucnt($chan,~)

#116938 11/04/05 01:55 PM
Joined: Aug 2003
Posts: 314
S
Fjord artisan
Offline
Fjord artisan
S
Joined: Aug 2003
Posts: 314
Quote:
1. do not use $chan in aliases... in aliases $chan means ACTIVE WINDOW, and not channel where the one joined


Not exactly. In an alias, $chan is evaluated based on where it was called from, so if you perform the alias from a text event, $chan in the alias will return the same value it would in the event. And if you run the alias from a window's editbox, it will return the name of the active window only if it's a channel

#116939 11/04/05 01:55 PM
Joined: Jan 2005
Posts: 75
Z
ztnaraM Offline OP
Babel fish
OP Offline
Babel fish
Z
Joined: Jan 2005
Posts: 75
Quote:
I told you why this happens, perhaps you'd care for an example:

Code:
raw 366:*:{
  dll resources\dlls\nicklust3.dll AddGroup $2 40 ~ 8 &gt; Owners [~] $nick($2,0,~)
}


Put it in a group so it only activates after you've first joined a channel


that still doesn't account for users who quit/part/join/get killed/get different modes

#116940 11/04/05 02:02 PM
Joined: Jan 2005
Posts: 75
Z
ztnaraM Offline OP
Babel fish
OP Offline
Babel fish
Z
Joined: Jan 2005
Posts: 75


also try this if that pic doesn't show

Last edited by ztnaraM; 11/04/05 02:25 PM.
#116941 11/04/05 02:16 PM
Joined: Aug 2003
Posts: 314
S
Fjord artisan
Offline
Fjord artisan
S
Joined: Aug 2003
Posts: 314
That image is broken

As for accounting for all that, why should it? As I said, it is purely an example. Your problem was that you couldn't get $nick() to return accurate values in a join event where $nick = $me. I explained the reason for this, and told you what to use instead. I don't think this bears repeating 3 times

#116942 11/04/05 02:23 PM
Joined: Jan 2005
Posts: 75
Z
ztnaraM Offline OP
Babel fish
OP Offline
Babel fish
Z
Joined: Jan 2005
Posts: 75
You're not understanding me, forget the on join event all together, i can remove that and use an alias to build the nicklist, it uses no other events/aliases to update the nicklist, it's the dll that does all the work, if i can do //echo -a $nick(#,0,~) at anytime and it shows correct, why can't i implement it into the nicklist? being as it updates on it's own it should also update $nick(#,0,~)

Page 1 of 2 1 2

Link Copied to Clipboard