mIRC Home    About    Download    Register    News    Help

Print Thread
$v1 and $ifmatch question #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
Re: $v1 and $ifmatch question #164994 20/11/06 11:47 PM
Joined: Feb 2006
Posts: 546
J
jaytea Offline
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
Re: $v1 and $ifmatch question #164995 20/11/06 11:50 PM
Joined: Sep 2003
Posts: 4,230
D
DaveC Offline
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

Re: $v1 and $ifmatch question #164996 20/11/06 11:51 PM
Joined: Sep 2003
Posts: 4,230
D
DaveC Offline
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
pffft beat me to it!

Re: $v1 and $ifmatch question #164997 21/11/06 04:23 AM
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