mIRC Home    About    Download    Register    News    Help

Print Thread
#234874 13/11/11 05:14 PM
Joined: Nov 2011
Posts: 38
B
Bast Offline OP
Ameglian cow
OP Offline
Ameglian cow
B
Joined: Nov 2011
Posts: 38
I have made an dialog wich i have alots of vars

I want to get
if ($strip($2) == %triggertwo.1)

into somthing like this
if ($strip( $+ %stripnr $+ ) == %triggertwo.1)

anyone got an idea how to do this??

Joined: Jul 2007
Posts: 1,129
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
No need for $+ on both sides of the variable.

$strip(%stripnr)

will do.

Joined: Nov 2011
Posts: 38
B
Bast Offline OP
Ameglian cow
OP Offline
Ameglian cow
B
Joined: Nov 2011
Posts: 38
Cant get it to work that way either

It does react but it dosent set %savethis when i use $strip(%strip.1)

Code:
if ($strip($1) == %triggertwo.1) { set %savethis $strip($3) | goto setthings.1 }


Code:
if ($strip(%trgnutwo.1) == %triggertwo.1) { set %savethis $strip(%strip.1) | goto setthings.1 }



Last edited by Bast; 13/11/11 10:13 PM.
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Are you sure the variables match? What is each variable when you echo them?


Invision Support
#Invision on irc.irchighway.net
Joined: Oct 2003
Posts: 3,918
A
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
If it's not setting, either $3 is null or the if is $false and not triggering.


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"
Joined: Nov 2011
Posts: 38
B
Bast Offline OP
Ameglian cow
OP Offline
Ameglian cow
B
Joined: Nov 2011
Posts: 38
it does echo $3 so the vars is just fine.
But it dosent react to the strip part in the code at all.

Seems like it cant read ($strip(%vars) correct

Joined: Oct 2003
Posts: 3,918
A
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
Before blaming mIRC for everything that goes wrong with your script, you should look at your code. "it" can read ($strip(%vars)) perfectly fine, the problem has nothing to do with syntax, but semantics. It's not "reacting" to the strip part because it's not reaching that block of code. DEBUG your code to ensure that the if statement is getting through. My bet is it's not. Check that the values you're testing in your if condition are actually what you expect them to be, that's likely the issue.


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"
Joined: Jul 2007
Posts: 1,129
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
Use:
Code:
tokenize 32 $strip($1-)
if ($1 == %triggertwo.1) {
set %savethis $3 
goto setthings.1 
}
but where is the $2 ?

Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
mIRC handles stripping variables just fine. You can verify it with this:

//var %t = 12testing | echo -a $strip(%t)

You will need to display your variables/$1- to see what's wrong. Echo all variables/$1- right before the IF statement. Then, since you're comparing two items in your IF, make sure they are exactly the same (with exception to control codes). You have something that you think is equal, but is not. You'll have to debug it to find out what. Without the exact values for your variables and $1-, we can't do anything other than tell you that you have to debug your code.


Invision Support
#Invision on irc.irchighway.net
Joined: Nov 2011
Posts: 38
B
Bast Offline OP
Ameglian cow
OP Offline
Ameglian cow
B
Joined: Nov 2011
Posts: 38
Well i have tried it all, cant figure it out.
Code:
if ($strip(%strip1) == %triggerone) {
if ($strip(%strip2) == %triggertwo) { set %savethis $strip(%strip3) | goto setthings }


This works just fine

Code:
if ($strip($1) == %triggerone) {
if ($strip($2) == %triggertwo) { set %savethis $strip($3) | goto setthings. }


And i have echoed out all %strip1-3 to see if they are set.
The scripts dosent trigger on the if statement if i use $strip(%strip1)

Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
What are the values of all variables and $1- that you are testing? Exact values before using $strip(). And why do you have an open IF on both of those?


Invision Support
#Invision on irc.irchighway.net
Joined: Jul 2007
Posts: 1,129
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
Why don't try it like so and see what happens:
Code:
if ($strip(%strip1) == $strip(%triggerone)) {
if ($strip(%strip2) == $strip(%triggertwo)) { 
set %savethis $strip(%strip3)
goto setthings
}


CODE EDITED -

Last edited by Tomao; 14/11/11 04:57 AM.
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
You still have an open IF. There needs to be another }.


Invision Support
#Invision on irc.irchighway.net
Joined: Nov 2011
Posts: 38
B
Bast Offline OP
Ameglian cow
OP Offline
Ameglian cow
B
Joined: Nov 2011
Posts: 38
the IF is closet further down, i have a couple of more %var to set if the if match.

if i echo

Code:
//echo ($strip(%trgnuone.1) == %triggerone.1)

i get
Code:
($strip(%trgnuone.1) ==


if i echo
Code:
//echo ($strip( $+ %trgnuone.1 $+ ) == %triggerone.1 $+ )

i get
Code:
($strip($1) == OK)


wich is the variable i want to check against.
If you guys say it should work i must work, i dont have qlue thou

Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
If you're echoing, then remove the extra ()'s around it...

Code:
//echo -a $strip(%var1) == %var2


That's why that's doing what you see. But that's not the problem you're asking about... From your example, you have $1 in your variable. And the TEXT "$1" is not equal to the TEXT "OK". If you want to use the value of $1, then you need to evaluate it (or just put the value into the variable instead of the TEXT "$1").

Code:
if ($strip($eval(%var1,2)) == %var2) { }


Anything in your variable will be treated as text and will not be evaluated unless you tell mIRC to evaluate it. $1 as text is simply $1. It's not the value within $1. To get that, you use $eval().


Invision Support
#Invision on irc.irchighway.net
Joined: Nov 2011
Posts: 38
B
Bast Offline OP
Ameglian cow
OP Offline
Ameglian cow
B
Joined: Nov 2011
Posts: 38
that was what i needed
thx Riamus2 smile

Joined: Jul 2007
Posts: 1,129
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
So, as it turned out you wanted the value of the variable to be evaluated, but your explanation of the problem itself was ambiguous, let alone the $strip() matter.

Joined: Nov 2011
Posts: 38
B
Bast Offline OP
Ameglian cow
OP Offline
Ameglian cow
B
Joined: Nov 2011
Posts: 38
well i have to thank you for being patient wink


Link Copied to Clipboard