mIRC Home    About    Download    Register    News    Help

Print Thread
#164993 20/11/06 11:16 PM
C
Canario
Canario
C
Code:
alias save.cfg {
  if (3 isnum) echo -a hadd -m $prot.hss txt.ft $v1
}
alias prot.hss {
  if ($dialog(chanprot)) && ($did(chanprot,5).seltext) return $+(chanprot.,$v1)
  else { return chanprot.Global }
}


I think that $v1 or $ifmatch must return 3, but in this case for some reason doesn´t return anything. I can see that another times, somebody knows why? I don´t understand smirk

Joined: Feb 2006
Posts: 523
J
Fjord artisan
Offline
Fjord artisan
J
Joined: Feb 2006
Posts: 523
$v1 is carried over from aliases to ones that called them, so when $prot.hss evaluates, since it contains an if statement, the value of $v1 is changed from that point on. what you can do is make sure $v1 evaluates before $prot.hss:

Code:
if (3 isnum) echo -a hadd -m $prot.hss txt.ft [ $v1 ]


look at /help brackets


"The only excuse for making a useless script is that one admires it intensely" - Oscar Wilde
D
DaveC
DaveC
D
in the /SAVE.CFG alias the echo well return the $v1 of the LAST IF or $IIF or WHILE comparasion, which in the echo lines case is the comparision that occured inside the $PROT.HSS alias

to fix.....
alias save.cfg { if (3 isnum) echo -a hadd -m $prot.hss txt.ft [ $v1 ] }

The above correction well correct this problem, the [ ] are evaluation order control brackets, these tell mirc to evaluate this value before the others, and well result in the $v1 value from the /IF (3 ISNUM) comparision, being evaluated to replace the $v1

D
DaveC
DaveC
D
pffft beat me to it!

C
Canario
Canario
C
Thabks a lot!


Link Copied to Clipboard