mIRC Homepage
Posted By: RusselB What's wrong with this? - 05/09/05 04:36 PM
Details as to what it appears to be doing are commented in the code
Code:
 on @*:text:!autoplay:#:{
  ;this command never removes the address
  .avoice $iif($avoice($address),-r) $address $chan $network
  ;this line always shows the second option
  describe # $iif($avoice($address),smiles as $nick decides to be,sighs as $nick decides to stop being) a permanent player
}
 
Posted By: MikeChat Re: What's wrong with this? - 05/09/05 05:16 PM
I tried this:
Code:
on @*:text:!autoplay:#:{
  avoice $iif($avoice($address($nick,3)), -r $address($nick,3) $chan $network  , $address($nick,3) $chan $network)
  describe # $iif($avoice($address($nick,3)),smiles as $nick decides to be,sighs as $nick decides to stop being) a permanent player
}

worked well, I think you need to have both options for the $iif to work
the avoice add and remove have to match in all parameters to work right it seems
Posted By: buster2007 Re: What's wrong with this? - 05/09/05 05:19 PM
a entry in the auto-voice list looks like nick!id@address

$address returns only [email]id@address[/email]

that's the problem
Posted By: RusselB Re: What's wrong with this? - 05/09/05 05:22 PM
I don't know why I would have to have both, when I've used just one before, and from the help file
Quote:
$iif(1 == 2, yes) returns nothing


But, I'm not too proud to have some extra code if it makes it work. I'll give your suggestion a try and see what I get...Note I'm just using $address rather than $address($nick,3)
Posted By: RusselB Re: What's wrong with this? - 05/09/05 05:26 PM
Thanks for the information
Posted By: MikeChat Re: What's wrong with this? - 05/09/05 05:26 PM
might not be the $iif, but the avoice that was causing it to not remove the address, as I said it seemed to need the address, channel, network in the remove to match the address that was in the avoice or it would "update" the address' parameters for channel and network rather than removing it.
Posted By: MikeChat Re: What's wrong with this? - 05/09/05 05:37 PM
this also worked
Code:
on @*:text:!autoplay:#:{
  avoice $iif($avoice($wildsite), -r ) $wildsite $chan $network)
  describe # $iif($avoice($wildsite),smiles as $nick decides to be,sighs as $nick decides to stop being) a permanent player
}

changed back to just $address and it doesn't work (even though $address returns a value if you echo it in the script)
$address($nick,N) or $wildsite but not $address, anyone know why?
Posted By: RusselB Re: What's wrong with this? - 06/09/05 10:31 PM
Per Buster2007's response, the format returned by $address is incorrect for avoice (and I would therefore also imagine aop)

By making some slight modifications, the following code works
Code:
 on @*:text:!autoplay:#:{
  .avoice $iif($avoice($address($nick,3)),-r ) $nick $chan 3 $network
  describe # $iif($avoice($address($nick,3)),smiles as $nick decides to be,sighs as $nick decides to stop being) a permanent player
  if ($nick !isvoice $chan) && $avoice($address($nick,3)) {    .mode $chan +v $nick  }
  elseif ($nick isvoice $chan) && !$avoice($address($nick,3)) {    .mode $chan -v $nick  }
}
 
© mIRC Discussion Forums