mIRC Home    About    Download    Register    News    Help

Print Thread
#117838 19/04/05 09:57 PM
Joined: Apr 2005
Posts: 111
X
Vogon poet
OP Offline
Vogon poet
X
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

#117839 19/04/05 11:01 PM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
No, but you're close
Code:
on *:connect:{
.enable #version | .version
}

#version off
RAW 351:*:{ if (unreal isin $3) { echo -a caca } |  .disable  #version
#version end


That should work.

#117840 19/04/05 11:18 PM
Joined: Apr 2005
Posts: 111
X
Vogon poet
OP Offline
Vogon poet
X
Joined: Apr 2005
Posts: 111
doesnt work , friend

#117841 19/04/05 11:43 PM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
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.

#117842 19/04/05 11:55 PM
Joined: Apr 2005
Posts: 111
X
Vogon poet
OP Offline
Vogon poet
X
Joined: Apr 2005
Posts: 111
thnx works

#117843 20/04/05 12:13 AM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
np

#117844 20/04/05 12:30 AM
Joined: Apr 2005
Posts: 111
X
Vogon poet
OP Offline
Vogon poet
X
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

#117845 20/04/05 05:54 AM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
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

#117846 20/04/05 09:27 AM
Joined: Apr 2003
Posts: 701
K
Hoopy frood
Offline
Hoopy frood
K
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

#117847 20/04/05 09:37 AM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
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

#117848 20/04/05 09:41 AM
Joined: Feb 2004
Posts: 2,019
Hoopy frood
Offline
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.
#117849 20/04/05 07:31 PM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Well, I don't know...he can try both and use whichever one works for him.

#117850 20/04/05 08:41 PM
Joined: Feb 2004
Posts: 2,019
Hoopy frood
Offline
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.
#117851 20/04/05 09:56 PM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
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

#117852 20/04/05 10:09 PM
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
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.

#117853 21/04/05 03:54 AM
Joined: Feb 2004
Posts: 2,019
Hoopy frood
Offline
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.

Link Copied to Clipboard