mIRC Home    About    Download    Register    News    Help

Print Thread
#164993 20/11/06 11:16 PM
Joined: Nov 2003
Posts: 67
C
Canario Offline OP
Babel fish
OP Offline
Babel fish
C
Joined: Nov 2003
Posts: 67
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


irc.universochat.net
#escripting
Joined: Feb 2006
Posts: 546
J
Fjord artisan
Offline
Fjord artisan
J
Joined: Feb 2006
Posts: 546
$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
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
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

Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
pffft beat me to it!

Joined: Nov 2003
Posts: 67
C
Canario Offline OP
Babel fish
OP Offline
Babel fish
C
Joined: Nov 2003
Posts: 67
Thabks a lot!


irc.universochat.net
#escripting

Link Copied to Clipboard