mIRC Home    About    Download    Register    News    Help

Print Thread
when another says !add blabla,this how to get... #67941 15/01/04 05:09 PM
Joined: Jan 2004
Posts: 14
N
no_brain Offline OP
Pikka bird
OP Offline
Pikka bird
N
Joined: Jan 2004
Posts: 14
How to get the "blabla" and the "this" ? ^^

Last edited by no_brain; 15/01/04 05:23 PM.
Re: when another says !add blabla this how to get... #67942 15/01/04 05:18 PM
Joined: Feb 2003
Posts: 282
S
saragani Offline
Fjord artisan
Offline
Fjord artisan
S
Joined: Feb 2003
Posts: 282
on 1:TEXT:!add*:*: {
set %b $2
set %c $3
}



Now %b = blabla and %c= this

Re: when another says !add blabla this how to get... #67943 15/01/04 05:20 PM
Joined: Feb 2003
Posts: 282
S
saragani Offline
Fjord artisan
Offline
Fjord artisan
S
Joined: Feb 2003
Posts: 282
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-

Re: when another says !add blabla this how to get... #67944 15/01/04 05:24 PM
Joined: Jan 2004
Posts: 14
N
no_brain Offline OP
Pikka bird
OP Offline
Pikka bird
N
Joined: Jan 2004
Posts: 14
Sorry, I have forgotten this

with a ,

So the users can add questions and answers

Re: when another says !add blabla this how to get... #67945 15/01/04 05:29 PM
Joined: Feb 2003
Posts: 282
S
saragani Offline
Fjord artisan
Offline
Fjord artisan
S
Joined: Feb 2003
Posts: 282
Ok, would you mind explaning??
I didn't get the last part.

Re: when another says !add blabla this how to get... #67946 15/01/04 05:33 PM
Joined: Jan 2004
Posts: 14
N
no_brain Offline OP
Pikka bird
OP Offline
Pikka bird
N
Joined: Jan 2004
Posts: 14
!add question,answer

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

Re: when another says !add blabla this how to get... #67947 15/01/04 05:47 PM
Joined: Feb 2003
Posts: 282
S
saragani Offline
Fjord artisan
Offline
Fjord artisan
S
Joined: Feb 2003
Posts: 282
Ok....
Then do this:

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

Re: when another says !add blabla this how to get... #67948 16/01/04 10:04 PM
Joined: Jan 2004
Posts: 3
Z
Zachu Offline
Self-satisified door
Offline
Self-satisified door
Z
Joined: Jan 2004
Posts: 3
/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

Re: when another says !add blabla,this how to get... #67949 17/01/04 06:28 AM
Joined: Sep 2003
Posts: 4,230
D
DaveC Offline
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
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.