mIRC Home    About    Download    Register    News    Help

Print Thread
Page 1 of 2 1 2
Joined: Feb 2006
Posts: 307
N
Fjord artisan
OP Offline
Fjord artisan
N
Joined: Feb 2006
Posts: 307
hello

I have this script, which is supposed not to msn the people that match the protect list, but it does

any idea?

thanks

Code:
alias mm {
  var %a = $nvnick($chan,0)
  while (%a) {
    if (($fulladdress !isignore) && ($fulladdress !isprotect)) {
      .timer 1 $calc(%a * 9) .msg $nvnick($chan,%a) $1-
    }
    dec %a
  }
}

Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
1) Please ensure that you do have the addresses in the protect list set to match the same format as $fulladdress (ie:nick!user@host)

Aside from that, I see nothing wrong with your code.

Joined: Aug 2005
Posts: 1,052
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Aug 2005
Posts: 1,052
RusselB Have you considered maybe the custom Identifier nvnick Could be an issue?

It is after all called upon in a while loop through a variable change.


Code:
if $reality > $fiction { set %sanity Sane }
Else { echo -a *voices* }
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
I did consider that, but the identifier seemed familiar to me, and while I couldn't find it in the current help file, testing the code did not generate an error for that identifier, and I don't have any aliases called nvnick, so I'm suspecting that it's either an old identifier, or an undocumented one.

Joined: Aug 2005
Posts: 1,052
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Aug 2005
Posts: 1,052
Ya your right seems like it used to be an old identifier because I did google it and it came up many times, however in my current mirc its not included.


Code:
if $reality > $fiction { set %sanity Sane }
Else { echo -a *voices* }
Joined: Feb 2006
Posts: 307
N
Fjord artisan
OP Offline
Fjord artisan
N
Joined: Feb 2006
Posts: 307
Originally Posted By: RusselB
1) Please ensure that you do have the addresses in the protect list set to match the same format as $fulladdress (ie:nick!user@host)

Aside from that, I see nothing wrong with your code.


can you tell me please how to check this?
the addresses in my protect list are like: some*!*@*

Joined: Feb 2006
Posts: 307
N
Fjord artisan
OP Offline
Fjord artisan
N
Joined: Feb 2006
Posts: 307
anyone please ?

Joined: Aug 2003
Posts: 144
M
Vogon poet
Offline
Vogon poet
M
Joined: Aug 2003
Posts: 144
make for example
//echo -a $protect(1)
and
//echo -s $ignore(1)

check if the result is nick!user@host...

if the result is nick!*@* it´s wrong because $fulladress will return nick!nick@12.455.34.23.com.

Hope this help good luck

Joined: Feb 2006
Posts: 307
N
Fjord artisan
OP Offline
Fjord artisan
N
Joined: Feb 2006
Posts: 307
thanks
it does reply the correct answer

Joined: Feb 2006
Posts: 307
N
Fjord artisan
OP Offline
Fjord artisan
N
Joined: Feb 2006
Posts: 307
can anyone help me with this please ? any solution ?

thanks

Joined: Jul 2006
Posts: 4,145
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,145
Are you using mirc 6.33 to test this ? Because there is a known bug with condition like your...


Edit : $nvnick, $nhnick and $nopnick can be used to return non-voice/halfop/op users

Last edited by Wims; 07/08/08 05:59 PM.

#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Feb 2006
Posts: 307
N
Fjord artisan
OP Offline
Fjord artisan
N
Joined: Feb 2006
Posts: 307
nope I use 6.21

is there anything I can do?

Last edited by nataliad; 10/08/08 11:51 PM.
Joined: Jul 2006
Posts: 4,145
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,145
In fact the code is wrong, $fulladdress is only avalaible inside an event, logically, $fulladdress is $null here, you need to check the address of $nvnick($chan,%a) with $address($nvnick,$chan,%a),5) to respect the format :

Code:
alias mm {
  var %a = $nvnick($chan,0)
  while (%a) {
  var %addr $address($nvnick($chan,%a),5)
  if (%addr !isignore) && (%addr !isprotect) .timer 1 $calc(%a * 9) .msg $!nvnick($chan,%a) $1-
    dec %a
  }
}
This should work, but the $address value could be $null too


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Feb 2006
Posts: 307
N
Fjord artisan
OP Offline
Fjord artisan
N
Joined: Feb 2006
Posts: 307
it doesn;t work:

* Invalid format: $address (line 585, script.ini)

Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
flukey thing with $address (and a few other identifiers that use commas)
Try using this re-write
Code:
alias mm {
  var %a = $nvnick($chan,0)
  while (%a) {
  var %addr = $nvnick($chan,%a)
  %addr = $address(%addr,5)
  if (%addr !isignore) && (%addr !isprotect) .timer 1 $calc(%a * 9) .msg $!nvnick($chan,%a) $1-
    dec %a
  }
}

I'm going to presume that this alias is called from within a channel, otherwise $chan will return $null

Joined: Feb 2006
Posts: 307
N
Fjord artisan
OP Offline
Fjord artisan
N
Joined: Feb 2006
Posts: 307
this is wrong too

I get

welcome No such nick/channel

Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Code:
alias mm {
  var %a = 1, %b = $nick($chan,0)
  while %a <= %b {
    var %addr = $nick($chan,%a)
    %addr = $address(%addr,5)
    if (%addr !isignore) && (%addr !isprotect) {
      .timer 1 %a msg $!nick($chan,%a) $1-
    }
    dec %a
  }
}


Try this.. I have removed the usage of $nvnick as it's no longer supported via the help file, also, due to the noted/corrected bug regarding the usage of parentheses with the if statement, you may wish to ensure that you are running the latest version of mIRC.

Joined: Jul 2006
Posts: 4,145
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,145
It is not something with $address, it is just a mistake I've made.
Since mIRC 6.21, mirc does not care about the equal sign, and i'm used to not use it, a lot of people would said "a bad habit"...


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Feb 2006
Posts: 307
N
Fjord artisan
OP Offline
Fjord artisan
N
Joined: Feb 2006
Posts: 307
Originally Posted By: RusselB
Code:
alias mm {
  var %a = 1, %b = $nick($chan,0)
  while %a <= %b {
    var %addr = $nick($chan,%a)
    %addr = $address(%addr,5)
    if (%addr !isignore) && (%addr !isprotect) {
      .timer 1 %a msg $!nick($chan,%a) $1-
    }
    dec %a
  }
}


Try this.. I have removed the usage of $nvnick as it's no longer supported via the help file, also, due to the noted/corrected bug regarding the usage of parentheses with the if statement, you may wish to ensure that you are running the latest version of mIRC.


this crashes my mirc, I cannot update to latest mirc, because I will lose data

isn't there something for my version 6.21?

Last edited by nataliad; 14/08/08 09:35 PM.
Joined: Feb 2007
Posts: 234
M
Fjord artisan
Offline
Fjord artisan
M
Joined: Feb 2007
Posts: 234
What data do you think you will lose? I ask because the mIRC installer is supposed to save your entire current configuration. In fact you can make a backup copy of your mIRC directory if you want.

Last edited by MTec007; 14/08/08 10:24 PM.
Page 1 of 2 1 2

Link Copied to Clipboard