mIRC Home    About    Download    Register    News    Help

Print Thread
N
no_brain
no_brain
N
How to get the "blabla" and the "this" ? ^^

Last edited by no_brain; 15/01/04 05:23 PM.
S
saragani
saragani
S
on 1:TEXT:!add*:*: {
set %b $2
set %c $3
}



Now %b = blabla and %c= this

S
saragani
saragani
S
I don't really understand what you want... You want only the second and the third word, and each one of them will be added to a seperate variable??

Or do you want to take the whole text from the second word and put it in a variable??

For the second option you will need:
set %b $2-

N
no_brain
no_brain
N
Sorry, I have forgotten this

with a ,

So the users can add questions and answers

S
saragani
saragani
S
Ok, would you mind explaning??
I didn't get the last part.

N
no_brain
no_brain
N
!add question,answer

and I like to have the question and the answer ^^

S
saragani
saragani
S
Ok....
Then do this:

on 1:TEXT:!add*:*: {
tokenize 44 $2-
set %question $1
set %answer $2
}

Z
Zachu
Zachu
Z
/tokenize isn't very good idea in all scripts
I think "Teh Thing" you were looking for is $gettok
Code:
 $gettok(Hi! My name is John,3,32) 

returns "name"
First parameter is text
Second parameter is "which token"
Third parameter is ASC code for character you want to separte all tokens

D
DaveC
DaveC
D
on *:TEXT:!add*:*: {
set %before.the.comma $mid($gettok(. $2-,1,44),3)
set %after.the.comma $gettok(. $2-,2-,44)
}


i use $mid($gettok(. $2-,1,44),3) and not $gettok($2-,1,44) as a line begining with comma well have that comma ignored.


Link Copied to Clipboard