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,150
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,150
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,150
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,150
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,150
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,150
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.
Joined: Jul 2006
Posts: 4,150
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,150
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
  }
}
Try with this.


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
I can't see any reason why this would crash your 6.21 as all of the commands, variable assignments and comparisons are valid for 6.21 (as far as I am able to determine).

Joined: Jul 2006
Posts: 4,150
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,150
You've modified my code, i was using while (%a) and /dec %a, you were using while (%a <= %b) and /dec %a, a infinite loop.


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Ooops blush Thought I'd changed that to inc

Joined: Feb 2006
Posts: 307
N
Fjord artisan
OP Offline
Fjord artisan
N
Joined: Feb 2006
Posts: 307
Originally Posted By: Wims
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
  }
}
Try with this.


again, it msgs people that I have protected...

Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Try replacing
Code:
var %addr = $address($nvnick($chan,%a),5)
with
Code:
var %addr = $+($nick,*!*@*.*)
I just back checked the previous posts and realized that the format you're reporting for the addresses in the protect list don't match the format returned by $address(<nick>,5)

Joined: Jul 2006
Posts: 4,150
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,150
Quote:
I just back checked the previous posts and realized that the format you're reporting for the addresses in the protect list don't match the format returned by $address(<nick>,5)
Imo, he is requesting some help here, this means that he should gave the right information to us, but he never stated clearly how he store his protect list.
Also, $address could be $null, he should try to debug this code with an echo with the value of %addr, and $nick should be $nvnick($chan,%a) in your last line wink


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
All of the information that has been requested has been provided, but this topic has gotten big enough that some of the earlier replies have been forgotten.

An earlier reply
Quote:
the addresses in my protect list are like: some*!*@*
therefore the information in the protect list is stored in the format of <nick>*!*@* with the nick having a wildcard following it, and both the ident and host portions of the address being wildcarded, in contrast to the absolute return by $address(<nick>,5)

mIRC doesn't have a $address mask that matches that format, so I used the $+ concatenator to make an address format that matches the format in the list.

Joined: Jul 2006
Posts: 4,150
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,150
I hope you're right, but the $nick part have to be changed anyway


#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: Wims
[quote]Imo, he is requesting some help here, this means that he should gave the right information to us, but he never stated clearly how he store his protect list.


my protect list is stored in every possible way, which means, but is not limited to:

any*!*@*
*any!*@*
*any*!*@*

*!*@any*
*!*@*any
*!*@*any*

*!*any@*
*!any*@*
*!*any*@*

there may be also, 'channels' and 'network name or server address' value (but this is rare and I wouldn't like this to complicate matters)

I usualy use these aliases to add to my protect list:

/i protect -w $$1 $+ *!*@*
/d protect -w *!*@* $+ $$1
/l protect -w $+(*!*@,$$1,*)
/y protect -w $+(*,$$1,!*@*)

sorry for any inconvenience, I thought it was known that my protect list could be anything...

Last edited by nataliad; 17/08/08 12:37 AM.
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Do yourself a favour.. pick one format for the information on your protect list, and stick with it. mIRC's /protect command has an optional [type] parameter, so you can fill that parameter in with the number that corresponds with the mask format you wish to use.
See /help $mask for a list of numbers and their corresponding formats.

It'll make writing any script that references your protect list a lot easier.

If you have a lot of entries on your protect list, I'll see what I can do about writing a conversion script, but I'll need to know what format you actually want to use.

Doing a quick think on this, based on this additional information, I think the following code would work
Code:
alias msg2 {
  if $chan && $$1 {
    var %a = 1, %b = $nick($chan,0)
    while %a <= %b {
      set %msg2 $addtok(%msg2,$nick($chan,%a),44)
      var %c = 0, %d = 19
      while %c <= %d {
        if $protect($address($nick($chan,%a),%c)) {
          set %msg2 $remtok(%msg2,$nick($chan,%a),1,44)
        }
        if $ignore($address($nick($chan,%a),%c)) {
          set %msg2 $remtok(%msg2,$nick($chan,%a),1,44)
        }
        inc %c
      }
      inc %a
    }
    .msg %msg2 $1-
  }
}

Usage: /msg2 common message here

Last edited by RusselB; 17/08/08 03:28 AM.
Joined: Jul 2006
Posts: 4,150
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,150
Originally Posted By: RusselB
All of the information that has been requested has been provided
funny.


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
You disagree? If so, please provide references where information was requested from the OP, in regards to this topic, and the OP has not provided the information.

Joined: Jul 2006
Posts: 4,150
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,150
I'll not provide anything, and yes of course i disagree, i'm not saying it's your fault or the OP fault, i'm just saying that wrong questions have been asked to the OP and it took 32 replies to state that finally, we were not aware about how his protect list was, the most important thing.
And now, the only solution you gave him is that he should change his "stored method" simply to make the code easier.Again i'm not saying it's bad or something like that.


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Hmm.. You say that you disagree that the OP has provided information that has been requested, yet you're unwilling or unable to substantiate this. As to the format for the protect list
Quote:
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*!*@*

At this point, the OP has given a specific format that the protect list is in. It's not until much later that it's revealed that this is, in fact, only one of the formats that the protect list uses.

Quote:
And now, the only solution you gave him is that he should change his "stored method" simply to make the code easier.
-- Did you completely miss the code I appended to that message? Also, that was a suggestion, since, if the OP wanted other scripts that also referenced the protect list, they are easier to write if one format is used in the protect list, rather than multiple formats.


Joined: Jul 2006
Posts: 4,150
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,150
I disagree about the whole thing, bot about what you said.You have asked some information and the OP gave you only one part of the info since there are multiple format in his protect list.My post was not against you, rather against the OP but i already said that he should have gave better information.

Quote:
Did you completely miss the code I appended to that message? Also, that was a suggestion, since, if the OP wanted other scripts that also referenced the protect list, they are easier to write if one format is used in the protect list, rather than multiple formats.
Yes, i don't even read your code.I've simply read the part when you suggest him to use only one format.It is true that it would make thing easier for him, but it's not what he was looking for at the beginning.


#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 msg2 {
  if $chan && $$1 {
    var %a = 1, %b = $nick($chan,0)
    while %a <= %b {
      set %msg2 $addtok(%msg2,$nick($chan,%a),44)
      var %c = 0, %d = 19
      while %c <= %d {
        if $protect($address($nick($chan,%a),%c)) {
          set %msg2 $remtok(%msg2,$nick($chan,%a),1,44)
        }
        if $ignore($address($nick($chan,%a),%c)) {
          set %msg2 $remtok(%msg2,$nick($chan,%a),1,44)
        }
        inc %c
      }
      inc %a
    }
    .msg %msg2 $1-
  }
}

Usage: /msg2 common message here


I get this error:
* /set: line too long (line 557, script.ini)

I don't understand about the protect reference, you may tell me what to do about this, thanks

Last edited by nataliad; 18/08/08 01:21 AM.
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
First off, there's no need for you to have this at the end of another script. I suggest loading it into a new/empty remote page/file in the Script editor, then try it again, as it's hard for me to know just which line is causing the problem when the line number that is referenced is higher than the total number of lines in the code.

I also just spotted one small possible problem, which can be taken care of by putting
Code:
unset %msg2
just after the
Code:
alias msg2 {
line

Unless you're in a huge channel, this should handle that problem.
GTW: This is another good reason for upgrading, as mIRC 6.3 (I think) and above allow for more information to be stored in the variable names before that error message occurs.

Before 6.3 variables were limited to about 900 characters, after that they can hold about 4000. A significant increase, especially for a code like this.

Page 1 of 2 1 2

Link Copied to Clipboard