mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Jun 2008
Posts: 3
N
nish Offline OP
Self-satisified door
OP Offline
Self-satisified door
N
Joined: Jun 2008
Posts: 3
I am trying to modify the output of whois so that only returns the channels that an user has ops in.

I'm pretty new to all this and am struggling to understand how arrays etc. are implement in mirc.

This is what I am trying to do.


raw 319:*:{

split channel string ($3-) in to an array

loop through array {
. if $regex($array_element,^@) { ;if array element begins with an @
.... add to the end of $list_chans_with_ops
. }
}
msg $me $list_chans_with_ops
}


Any pointers greatly appreciated.


Last edited by nish; 10/06/08 09:15 PM.
Joined: Oct 2003
Posts: 3,918
A
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
Arrays are *not* implemented in mIRC, so that's probably your first problem.

$3- is as much of an array as any list of data in mIRC, you don't need to "split" it.

Code:
var %i = 1
while ($gettok($3-,%i,32) != $null) {
  var %word = $v1
  if ($regex(%word, /^@/)) { ... }
  inc %i
}


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"
Joined: May 2008
Posts: 329
A
Fjord artisan
Offline
Fjord artisan
A
Joined: May 2008
Posts: 329
Code:
raw 319:*: {
  echo 1: $1  2: $2  3: $3  4-: $4-
; This will show you the value of each string.
  set %usrtotnumopdchns %match($3,@,0,32) ; change $3 accordingly
  set %usrtotnumopdchns.org %usrtotnumopdchns
  while (%usrtotnumopdchns) {
    set %useropedchan %match($2,@,%usertotalopedchans,32)
    set %totaluseropedchans $addtok(%totaluseropedchans,%useropedchan,32)
    dec %usrtotnumopdchns
  }
  echo -s Channels $nick is op'd on %usrtotnumopdchns.org : %totaluseropedchans
  %unset %totaluseropedchans
}


I registered; you should too.
Joined: May 2008
Posts: 329
A
Fjord artisan
Offline
Fjord artisan
A
Joined: May 2008
Posts: 329
Originally Posted By: argv0
Arrays are *not* implemented in mIRC, so that's probably your first problem.

$3- is as much of an array as any list of data in mIRC, you don't need to "split" it.

Code:
var %i = 1
while ($gettok($3-,%i,32) != $null) {
  var %word = $v1
  if ($regex(%word, /^@/)) { ... }
  inc %i
}


Are you sure it's $v1 and not $1. My raw's get their variables from $1 not $v1. I checked and $1 has a value but $v1 doesn't.


I registered; you should too.
Joined: Oct 2003
Posts: 3,918
A
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
/help $v1 would tell you why $v1 will only return data inside an if or while statement.


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"

Link Copied to Clipboard