mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Jun 2003
Posts: 1
Y
yonos Offline OP
Mostly harmless
OP Offline
Mostly harmless
Y
Joined: Jun 2003
Posts: 1
Ok folks i have a strange question
for my on:text: handler i'm sending which part of the text captured i want to work with to another variable as $2 or $3 etc..
so i have /set %blah $2 then i'm calling an alias blargh %blah to process these ...
the reason for this is i have multiple on:text handlers with different parts of their msg's trapped that i want to deal with in one alias. however when i go to use %blah it only contains the $2 and doesn't evaluate to the text it should have =/
any help ?
code looks like
on 1:TEXT:%match5:%chan5:{
/set %blah $2
blargh %blah
}

alias blargh {
/set -n %search-crit $read(mp3s.txt,st,$1)
if $readn != 0 {
/haltdef
}
else {
/aline -ah @mp3 $timestamp $$1-
/write mp3s.txt $1
}
}

so you can see the problem is when i go to match what i've caught against what i already have in the file.. well i have nothing to compare with as i'd be literally comparing $2,$3 instead of the text it represents... thanks in advance for advice/help wink

Joined: Feb 2003
Posts: 2,812
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2003
Posts: 2,812
when you /set %blah $2, that "$2" is already evaluated into text before it gets /set to %blah. Before I try wrapping my mind around it further, try removing all instances of -n you may be using in /set. the -n flag does exactly what you're explaining, to treat the value as plain text and not to evaluate it. If you're doing /set -n %blah $2, then yes, %blah == "$2" (without quotes).


Well. At least I won lunch.
Good philosophy, see good in bad, I like!
Joined: Jan 2003
Posts: 2,523
Q
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,523
As you correctly said, $2 is evaluated inside the on TEXT event before it ends up filling %blah. I cannot explain yono's problem by looking at the info he provided, since I don't see anything that could cause this. However, the -n in /set is not the problem. Apart from the above said, -n does a different thing: it treats the value as plain text as opposed to a math expression:
/set %a 1 + 1
would fill %a with "2" but
/set -n %a 1 + 1
would fill %a with "1 + 1". But identifiers and variables would be evaluated whether -n was used or not.


/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com
Joined: Feb 2003
Posts: 2,812
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2003
Posts: 2,812
Ah hah. That would make more sense. I couldn't imagine Khaled changing the order in which variables/identifiers are evaluated on the account of /set, but the -n flag has a familiarity to $read -n

Thanks.


Well. At least I won lunch.
Good philosophy, see good in bad, I like!

Link Copied to Clipboard