|
Joined: Apr 2005
Posts: 111
Vogon poet
|
OP
Vogon poet
Joined: Apr 2005
Posts: 111 |
ON *:CONNECT:{ .enable #version | .version if %tipodered isin unreal { .echo -a caca } }
#version off RAW 351:*:{ set %tipodered $2 | .disable #version } #version end
its right what i do?
thnx
|
|
|
|
Joined: Aug 2004
Posts: 7,252
Hoopy frood
|
Hoopy frood
Joined: Aug 2004
Posts: 7,252 |
No, but you're close on *:connect:{
.enable #version | .version
}
#version off
RAW 351:*:{ if (unreal isin $3) { echo -a caca } | .disable #version
#version end
That should work.
|
|
|
|
Joined: Apr 2005
Posts: 111
Vogon poet
|
OP
Vogon poet
Joined: Apr 2005
Posts: 111 |
|
|
|
|
Joined: Aug 2004
Posts: 7,252
Hoopy frood
|
Hoopy frood
Joined: Aug 2004
Posts: 7,252 |
oops...try changing the $3 to $2...had the font too small when I was referencing the page I have RAW information on, and thought there was a space rather than a . at a location.
|
|
|
|
Joined: Apr 2005
Posts: 111
Vogon poet
|
OP
Vogon poet
Joined: Apr 2005
Posts: 111 |
|
|
|
|
Joined: Aug 2004
Posts: 7,252
Hoopy frood
|
Hoopy frood
Joined: Aug 2004
Posts: 7,252 |
|
|
|
|
Joined: Apr 2005
Posts: 111
Vogon poet
|
OP
Vogon poet
Joined: Apr 2005
Posts: 111 |
how i get only the word , for example ,
on *:connect:{ .enable #version | .version }
#version on RAW 351:*:{ echo -a estas $2 if $2 == Unreal3 { .echo -a TESTEADO } if $2 == u2 { .echo -a PETEADO } }
.disable #version #version end
|
|
|
|
Joined: Aug 2004
Posts: 7,252
Hoopy frood
|
Hoopy frood
Joined: Aug 2004
Posts: 7,252 |
Replace the $2 in your comparisons with $gettok($2,$calc($numtok($2,46) - 2),46)
I think that should get what you're looking for
|
|
|
|
Joined: Apr 2003
Posts: 701
Hoopy frood
|
Hoopy frood
Joined: Apr 2003
Posts: 701 |
or just $gettok($2,-3,46)
$gettok supports negative indices, -1 means last token, -2 the one before that, etc
|
|
|
|
Joined: Aug 2004
Posts: 7,252
Hoopy frood
|
Hoopy frood
Joined: Aug 2004
Posts: 7,252 |
Thanks for the update Kelder...only thing is the information he's looking for, doing it your way, would be at $gettok($2,-2,46) not -3
|
|
|
|
Joined: Feb 2004
Posts: 2,019
Hoopy frood
|
Hoopy frood
Joined: Feb 2004
Posts: 2,019 |
Nope.
Suppose $numtok(<string>,46) returns 5. That means there are 5 dot delimited tokens.
You are doing $calc($numtok(<string>,46) - 2), which gives 3, which means you'll reference the third token starting from the beginning.
$gettok(<string>,-3,46) references the third string starting from the back.
Riddle me this, riddle me that, where's the -3 token at?
a.b.c.d.e
-1 = e -2 = d -3 = c
1 = a 2 = b 3 = c
Suppose $numtok was 6 -> 6-2 = 4, 4th token from the beginning, is the 3rd token from the back.
Etc.
Gone.
|
|
|
|
Joined: Aug 2004
Posts: 7,252
Hoopy frood
|
Hoopy frood
Joined: Aug 2004
Posts: 7,252 |
Well, I don't know...he can try both and use whichever one works for him.
|
|
|
|
Joined: Feb 2004
Posts: 2,019
Hoopy frood
|
Hoopy frood
Joined: Feb 2004
Posts: 2,019 |
I don't think you understood.
The method Kelder showed and yours are the same (atleast if that position in the string is always there), but using the negative range is just shorter and quicker.
Gone.
|
|
|
|
Joined: Aug 2004
Posts: 7,252
Hoopy frood
|
Hoopy frood
Joined: Aug 2004
Posts: 7,252 |
Hey. I've only been scripting in mIRC for about 9 months...I didn't realize you could use a negative number...not that I do, I'll be changing some of my scripts to take advantage of the fact...the time difference might not be much on an encounter by encounter basis, but accumulatively, it could be quite a bit
|
|
|
|
Joined: Sep 2003
Posts: 4,230
Hoopy frood
|
Hoopy frood
Joined: Sep 2003
Posts: 4,230 |
you can also use like
$gettok(a.b.c.d.e,-3-,46) to get c.d.e or $gettok(a.b.c.d.e,-4--2,46) to get b.c.d although $gettok(a.b.c.d.e,2--2,46) dont work as I would have expected with a result of just b, i would have expected b.c.d, the parser must not like a smaller number second i guess.
|
|
|
|
Joined: Feb 2004
Posts: 2,019
Hoopy frood
|
Hoopy frood
Joined: Feb 2004
Posts: 2,019 |
Ive only been scripting since januayr 2004 but well, i th ink coming to this frum is great to learn new things, that's what I did. I just got bac k from going out it'sall good.
Good luck,
FO;
Gone.
|
|
|
|
|