mIRC Home    About    Download    Register    News    Help

Print Thread
Page 2 of 2 1 2
Joined: Jul 2006
Posts: 4,144
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,144
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,144
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,144
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,144
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,144
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,144
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,144
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,144
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,144
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,144
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,144
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,144
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,144
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 2 of 2 1 2

Link Copied to Clipboard