mIRC Homepage
Posted By: ghettowboy help with query - 17/04/07 06:09 PM
hey all,

i kinda stumped on something, i'm trying to get a query option in this script working. its for a custom window /w list box what it does is list ops in da listbox. but it only looks at the first name in the list no matter which name you click on.. was hoping someone could shed some light on this .. this is what i'm doing:
Code:
Query $remove($1,@):/query $remove($line(@Chat.Win,$sline(@Chat.Win,$1),1),@)
 

thats my menu code

Code:
alias Chat.Refresh {
  var %ptr = 1- $+ $line(%Chat.WinName,0,1)
  dline -l %Chat.WinName %ptr
  %ptr = $nick(%Chat.Chan,0,o)
  while (%ptr) {
    var %opnick = $remove($nick(%Chat.Chan,%ptr,o).pnick,+)
    if ($istok(%Chat.Bots,%opnick,44) != $true) { aline -l %Chat.WinName %opnick }
    dec %ptr
  }
}
 

and thats the alias that rereshes the window nlist... as you can see i'm using the pnick switch to show prefixes, could that be why it's not working??

thanks in advance

Posted By: PhantasyX Re: help with query - 18/04/07 01:12 AM
From what I understand I believe this might help you:

Query $remove($$1,@) :{ query $remove($line(@Chat.Win,$sline(@Chat.Win,$$1),1),@) }

(Changed the $1's to $$1's. Its untested but I believe this is the correct way.)
Posted By: ghettowboy Re: help with query - 18/04/07 03:57 AM
still not working... confused
Posted By: ghettowboy Re: help with query - 18/04/07 12:43 PM
i think it's because of my use of the .pnick property... to get the prefixes..?? is there another way to do this? ....anyone?
Posted By: RoCk Re: help with query - 18/04/07 01:13 PM
The $$1 in your $sline should just be 1

~ Edit ~

Also, I'm sure there's some regex way of removing all available prefixes...

Code:
alias npnick {
  while ($left($1,1) isin $prefix) tokenize 32 $right($1,-1)
  return $1
}


Whith this identifier you could use this...

Query $npnick($sline(@Chat.Win,1)) :query $npnick($sline(@Chat.Win,1))
Posted By: ghettowboy Re: help with query - 18/04/07 02:09 PM
THE ROCK RULES!!!!!! that did the trick ... thanks cool
© mIRC Discussion Forums