mIRC Home    About    Download    Register    News    Help

Print Thread
#108992 24/01/05 06:06 PM
Joined: Aug 2004
Posts: 147
N
Vogon poet
OP Offline
Vogon poet
N
Joined: Aug 2004
Posts: 147
$1-: hel. lo my dog is eat. ing a cat!
/untokenize 46 $1-
$1: hel lo
$5: eat ing

Basicly instead of seperating tokens, it combins them.

#108993 24/01/05 06:41 PM
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
Quote:
$1-: hel. lo my dog is eat. ing a cat!
/untokenize 46 $1-
$1: hel lo
$5: eat ing

Basicly instead of seperating tokens, it combins them.


That doesnt make sence to me, your saying if it encounters a token seperator at the end of a $x join it to the next one?

Well assumuing you have spaces as your standard $x seperators you could do.

/tokinize 255 $replacex($1-,. $+ $chr(32),$chr(32),$chr(32),$chr(255))

#108994 24/01/05 08:23 PM
Joined: Aug 2004
Posts: 147
N
Vogon poet
OP Offline
Vogon poet
N
Joined: Aug 2004
Posts: 147
Yes thats what I'm saying, it will put together two tokens, and what about strings that have $chr(255) in them?

$1-: cmd "c:\program files\mirc" $chan
/untokenize $asc(") $1-
$1: cmd
$2: c:\program files\mirc
$3: $chan

#108995 24/01/05 11:05 PM
Joined: Dec 2002
Posts: 2,962
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 2,962
Quote:
$1-: cmd "c:\program files\mirc" $chan
/untokenize $asc(") $1-
$1: cmd
$2: c:\program files\mirc
$3: $chan


Based on your previous example, that would actually leave you with:
$1: cmd c:\program
$2: files\mirc $chan

Anyway, the problem with your idea of this command is that it either somehow 'knows' what the current tokens are meant to be or otherwise only works by treating spaces as the delimiting token.
ie.
/tokenize 44 cow,pig sheep,.duck
/untokenize 46 $1-

When evaluated it would become /untokenize 46 cow pig sheep .duck and so would result in $1 = cow, $2 = pig, and $3 = sheep duck, which is almost certainly not what the scripter would be expecting (or hoping) to happen.

#108996 24/01/05 11:44 PM
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
Quote:
Yes thats what I'm saying, it will put together two tokens, and what about strings that have $chr(255) in them?


Umm use something else, like $chr(13), but yes i know what your getting at.

Quote:
$1-: cmd "c:\program files\mirc" $chan
/untokenize $asc(") $1-
$1: cmd
$2: c:\program files\mirc
$3: $chan


From this Im getting the impression your having trouble passing parameters becuase some of them have spaces, there is a easy trick to getting around this.
say you have this
Code:
alias blah {
  echo -a The Instruction is $1
  echo -a The Folder is $2
  echo -a The Channel is $3
}


passing it /blah cmd "c:\program files\mirc" $!chan
is going to cause problems
>The Instruction is $1cmd
>The Folder is $2 "c:\program
>The Channel is $3 files\mirc"

but you can simply do this $blah(cmd,"c:\program files\mirc",$!chan)
>The Instruction is $1cmd
>The Folder is $2 "c:\program files\mirc"
>The Channel is $3 $chan

Im not sure if that above trick/method is going to be any help to u in what you want but i hope it might be (if u want to do anything specific at all smile ).

#108997 25/01/05 12:14 AM
Joined: Aug 2004
Posts: 147
N
Vogon poet
OP Offline
Vogon poet
N
Joined: Aug 2004
Posts: 147
im not sure what i was talking about... must have been one of those things where i thought i had a good idea but i ddint. i think i wanted to reverse the tokenizing of a string so something like

/untokenize c[,c] text

tokenize 32 a s d f
$1: a
$2: s
$3: d
$4: f
untokenize 32 $1-
$1: a s d f

tokenize 46 a.s d.f
$1: a
$2: s d
$3: f
untokenize 46,32 $1-
$1:a.s
$2:d.f

so like it would like return it to the orginal string, then tokenize 32 the recovered string

#108998 01/02/05 06:02 PM
Joined: Oct 2003
Posts: 3,918
A
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
I don't know if im reading this wrong
but in the original example, you could just remove the token delimiters:

$remove(he. lo world, $chr(46))

and that will join them....... if thats what you want then just use $remove


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"
#108999 01/02/05 06:05 PM
Joined: Oct 2003
Posts: 3,918
A
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
Quote:
Yes thats what I'm saying, it will put together two tokens, and what about strings that have $chr(255) in them?

$1-: cmd "c:\program files\mirc" $chan
/untokenize $asc(") $1-
$1: cmd
$2: c:\program files\mirc
$3: $chan


Keep in mind, this example is the equivalent of
/tokenize $asc(") $1-

its also the equivalent of $remove($1-,")

I still dont see the use of this command


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"

Link Copied to Clipboard