mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Jul 2006
Posts: 4,145
W
Wims Offline OP
Hoopy frood
OP Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,145
The first one is with $N identifier, the mirc help file said that we can stick "text" after a $N or $N-M :
//tokenize 32 Ga is Ga | echo -a $1-this_text_will_be_shown

if text contains a number, mIRC will ignore all the characters before it, including the number

//tokenize 32 Ga is Ga | echo -a $1-.72Ga:)
or
//tokenize 32 Ga is Ga | echo -a $1-.72Ga82:)
or
//tokenize 32 Ga is Ga | echo -a $1-this_text_won't_be_shown>9

The second is about $v1 $v2 $ifmatch or $ifmatch2
The example below juste show with $v1 but i've tested with the other :

alias Kitai return $iif(one,two)
alias Wims if (three) echo -a > Ga $Kitai $v1

typing /wims will echo "> Ga two one" whereas $v1 should return three, it seems that $v1 takes the value from the last actual comparaison. Don't know if it's a bug or not but i think $v1 and others should return the value from the last comparaison in the alias itself







#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
Originally Posted By: Wims
The first one is with $N identifier, the mirc help file said that we can stick "text" after a $N or $N-M :
//tokenize 32 Ga is Ga | echo -a $1-this_text_will_be_shown

if text contains a number, mIRC will ignore all the characters before it, including the number

//tokenize 32 Ga is Ga | echo -a $1-.72Ga:)
or
//tokenize 32 Ga is Ga | echo -a $1-.72Ga82:)
or
//tokenize 32 Ga is Ga | echo -a $1-this_text_won't_be_shown>9


Strange, I never knew that you could add text, I always thought it worked like:


//tokenize 32 Ga is Ga | echo -a $1-2

Which returns: Ga is

Joined: Jul 2006
Posts: 4,145
W
Wims Offline OP
Hoopy frood
OP Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,145
Yes you can use $N-M but you can too stick text : $N-Msome_text


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
Yeah, I never knew that. I see what you mean about mIRC ignoring all the characters before it, how weird.

Joined: Sep 2005
Posts: 2,881
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,881
Originally Posted By: Wims
typing /wims will echo "> Ga two one" whereas $v1 should return three, it seems that $v1 takes the value from the last actual comparaison. Don't know if it's a bug or not but i think $v1 and others should return the value from the last comparaison in the alias itself


Changing that behaviour will break a lot of scripts.

Joined: Jul 2006
Posts: 4,145
W
Wims Offline OP
Hoopy frood
OP Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,145
Maybe but so : how can you refer to a comparaison in a alias itself ?
In both case of what $v1 refer to, you have to use a variable to stock other comparaison, a little bit annoying.
What i want to know in fact is what mirc should do :] .


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Having it use the last comparison seems more appropriate for what most people will use $v1 for. Of course, that means that you can't use $v1 in certain situations. Even so, $v1 is relatively new and people did fine without it, so I'm sure that having to put the comparison back in there instead of using $v1 won't be so bad.


Invision Support
#Invision on irc.irchighway.net
Joined: Dec 2002
Posts: 2,031
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Dec 2002
Posts: 2,031
I agree with Wims that these identifiers should be local to the alias/event calling them. Like local variables...

Code:
; Usage: /alias.one
alias alias.one {
  var -s %aliastest = alias one
  alias.two
  echo -a %aliastest <-- alias one
}
alias alias.two {
  var -s %aliastest = alias two
  echo -a %aliastest <-- alias two
}


alias.one sets the local variable %aliastest to the value 'alias one', then it calls alias.two which sets a local variable with the same name %aliastest to the value of 'alias two' but the value of the variable of the same name in alias.one is not changed. I think $v1 and $ifmatch should behave the same way. As far as breaking scripts, so what, scripts can be updated.

~ Edit ~
I would call this part a feature request rather than a bug report.


Link Copied to Clipboard