mIRC Home    About    Download    Register    News    Help

Print Thread
#156172 12/08/06 05:10 PM
Joined: Jan 2006
Posts: 40
D
DjJax Offline OP
Ameglian cow
OP Offline
Ameglian cow
D
Joined: Jan 2006
Posts: 40
; *********************
; ignora toda la lista
; *********************

alias ignorar {
set %loopz 1
:Loop
.set %time $nick(#,%loopz)
.ignore %time
inc %loopz
if $nick(#,0) == 5 { return }
if %loopz > 50 { halt }
goto loop
}

this works fine on mirc 6.17 but in the newest version 6.2 does not


any help


thnx

#156173 12/08/06 07:05 PM
Joined: Jan 2004
Posts: 2,127
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2004
Posts: 2,127
Exactly what is is supposed to do? it looks like it ignores the 1st person in the list, but then if there are exactly 5 people, then it doesn't continue on to the 2nd person.

#156174 13/08/06 12:54 AM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Usage: /ignorar <channel>
Code:
 alias ignorar {
var %loopz = 1
if ($nick($1,0) != 5) {
while %loopz &lt;= 50 {
.ignore $nick($1,%loopz)
inc %loopz
}
}
 


It looks like your code ignores the first person in the channel, then checks if there are exactly 5 people in the channel. If there are, then the code stops, otherwise it continues until the first 50 people in the channel have been ignored.

The above is a better written version of your current code.

Please note that # doesn't always return the channel in an alias, and (technically) it's never supposed to return the channel, so you should/need to pass the channel name in a parameter.

If you'll tell just exactly what it is you want your code to do, then I or someone else will be happy to assist.

#156175 13/08/06 04:45 AM
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
[
Code:
alias ignorar {
  .ignore $nick($1,%loopz)
  if ($nick($1,0) != 5) {
    var %m = $iif($v1 &gt; 50,50,$v1), %loopz = 2
    while (%loopz &lt;= %m) {
      .ignore $nick($1,%loopz)
      inc %loopz
    }
  }
}


You never were ignoring the first nick before, also im checking the max nicks in channel isnt overshoot.

#156176 15/08/06 09:55 PM
Joined: Aug 2006
Posts: 1
M
Mostly harmless
Offline
Mostly harmless
M
Joined: Aug 2006
Posts: 1
Probably best to use $$1...

#156177 15/08/06 10:22 PM
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
No, Probably best to NOT use $$1, the effect of that is to HALT processing of any running script should $1 be null. The Usage for the command was clearly defined, thus error checking wasnt going to be needed for that.

#156178 15/08/06 10:33 PM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
RusselB adds a previously unknown fact to his list of things to be careful of when programming in mIRC


Link Copied to Clipboard