mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Mar 2004
Posts: 111
Z
Zeusbwr Offline OP
Vogon poet
OP Offline
Vogon poet
Z
Joined: Mar 2004
Posts: 111
Ok, i havent had the need to use /tokenize befor so i dunno if this is what i want, and read it and i dont think its what i want. What i need is basicly to take a word or collection of characters if you will and put them into token form. Example:
I have the word "Hello" k now i want to turn that into..
"H.e.l.l.o", is there a way to do this or am i ganna have to create a identifyer to loop backwards through the word tossing in a character (in this case chr 46) in between each letter or number.

Joined: Nov 2003
Posts: 2,327
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Nov 2003
Posts: 2,327
Code:
alias dot {
  var %i = 1, %dot
  while $mid($1,%i,1) {
    %dot = %dot $+ $mid($1,%i,1) $+ .
    inc %i
  }
  return $left(%dot,-1)
}

$dot(hello world) = h.e.l.l.o. .w.o.r.l.d


New username: hixxy
Joined: Apr 2004
Posts: 871
Sat Offline
Hoopy frood
Offline
Hoopy frood
Joined: Apr 2004
Posts: 871
There's no standard way of doing that, however you can create an alias like this:

Code:
/splitup { 
  var %x = $1
  .echo -q $regsub(%x,/(.)(?=.)/g,\1 $+ $chr($2),%x)
  return %x
}

and then use it like this to put "h.e.l.l.o" on your screen:

Code:
//echo -a $splitup(hello,46)

Of course you can pass the result to /tokenize as well.


Saturn, QuakeNet staff
Joined: Mar 2004
Posts: 111
Z
Zeusbwr Offline OP
Vogon poet
OP Offline
Vogon poet
Z
Joined: Mar 2004
Posts: 111
ya... well i assume that means here is no identifier already in mirc, and 2nd off.. unless im using your script wrong, that dont work lol. I know how to loop through the text adding chars anyway, i was just wondering if mirc already had something in it.

*edit* err i was referring to tidy's. havent tested the 2nd post blush

*2nd edit* sorry trax, it works lol, wasent paying attention and didnt notice you had "alias dot" in it lol. Thx for savin me the time smile

Last edited by Zeusbwr; 19/04/04 04:13 PM.
Joined: Jan 2003
Posts: 2,523
Q
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,523
There is no built-in identifier for what you want. You can either use tidy_trax's alias or this one:
Code:
alias whatever var %a | !.echo -q $regsub($1,/(?<=.)(?=.)/g,\1 $+ $replace($2,\,\\,$,\$),%a) | return %a
The syntax is $whatever(text,char), for example:

//echo -a $whatever(something,@)


Edit: people sneaking up and posting while I'm previewing my reply is the story of my life :tongue:

Last edited by qwerty; 19/04/04 04:12 PM.

/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com

Link Copied to Clipboard