mIRC Home    About    Download    Register    News    Help

Print Thread
#78162 06/04/04 09:37 AM
Joined: Mar 2004
Posts: 540
A
Armada Offline OP
Fjord artisan
OP Offline
Fjord artisan
A
Joined: Mar 2004
Posts: 540
I have a on text that sets a variable
%listeners.112 03:57:47 06/04/2004 25 SNRadioBot The Offspring - Get it Right
%listeners.113 04:01:02 06/04/2004 25 SNRadioBot Disturbed - Remember
%listeners.114 04:06:03 06/04/2004 27 SNRadioBot Disturbed - Stupify
%listeners.115 04:10:33 06/04/2004 27 SNRadioBot Metallica S&M - The Thing That Should Not Be
%listeners.116 04:18:03 06/04/2004 27 SNRadioBot Linkin Park - Believe Me
112 113 114 115 116 is just a increment
What i want to do is loop though with and do things with the variable but I cant "resolve" the variable, ive try the [ ] things and $eval i just cant get it

#78163 06/04/04 09:48 AM
Joined: Dec 2002
Posts: 3,138
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 3,138
Code:
var %i = 1
while ( $eval($+(%,listeners.,%i),2) ) { 
  echo -a %i = $ifmatch
  inc %i
}

That what you want?

#78164 06/04/04 09:54 AM
Joined: Mar 2004
Posts: 540
A
Armada Offline OP
Fjord artisan
OP Offline
Fjord artisan
A
Joined: Mar 2004
Posts: 540
Sweet thanks

#78165 06/04/04 10:12 AM
Joined: Mar 2004
Posts: 540
A
Armada Offline OP
Fjord artisan
OP Offline
Fjord artisan
A
Joined: Mar 2004
Posts: 540
Hmm tried to do something with it, Im not good with whiles so I tried to change to a if so I could add something like to loop through to catch a dj's name
Code:
 alias listeners {
  var %x = $var(%listeners.*,0)
  var %i = 1
  :begin
  if (%i <= %x) {
    if ($1 isin $eval($+(%,listeners.,%i),2)) { 
      echo -a $ifmatch
      inc %i
    }
  }
} 

I probably slaughtered your code frown sorry lol smile

#78166 06/04/04 10:35 AM
Joined: Dec 2002
Posts: 3,138
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 3,138
I guess this is closer to what you want:
Code:
alias listeners {
  var %x = $var(%listeners.*,0)
  var %i = 1
  :begin
  if (%i <= %x) {
    if ($1 isin $eval($+(%,listeners.,%i),2)) { 
      echo -a %i
    }
    inc %i
    goto begin
  }
}

#78167 06/04/04 11:34 AM
Joined: Mar 2004
Posts: 540
A
Armada Offline OP
Fjord artisan
OP Offline
Fjord artisan
A
Joined: Mar 2004
Posts: 540
Thanks again man


Link Copied to Clipboard