Hi!!!
I was trying some things in my mIRC, and noticed a lack of something,
then sought in the mIRC help file and don't found it, I tried here on the site and don't found it, so i decided to create my own.
sorry if already there is one of this done, but i tried to find it!!!
is it an identifier to make token with ONLY ONE WORD and the C parameter
syintax: $maketok(word,C)
The C parameter is the ascii value of the character separating the tokens.
/echo $maketok(word,32) <--| will return w o r d
/echo $maketok(word,44) <--| will return w,o,r,d
/echo $maketok(word,46) <--| will return w.o.r.d
/echo $maketok(word,2) <--| will return word
/echo $gettok($maketok(word,46),1,46) <--| will return-> w
/echo $gettok($maketok(word,46),3,46) <--| will return-> r
/echo $gettok($maketok(word,46),4,46) <--| will return-> d
/echo $gettok($maketok(word,46),$r(1,$len($1)),46) <--| will return-> a random letter from the word
Jah Bless´´´
/*
#-> By rhasttaff <-#
#-> $maketok(word,C) identifier <-#
is it an identifier to make token with ONLY ONE WORD and the C parameter
syintax: $maketok(word,C)
The **C** parameter is the ascii value of the character separating the tokens.
/echo -a $maketok(word,32) |--> will return w o r d
/echo -a $maketok(word,44) |--> will return w,o,r,d
/echo -a $maketok(word,46) |--> will return w.o.r.d
/echo -a $maketok(word,33) |--> will return w!o!r!d
===============================================
some uses:
====
to return:
r
h
a
s
t
t
a
f
f
using: /eg1 rhasttaff
and:
alias eg1 {
var %a = $1, %b = 1
while (%b <= $len(%a)) {
echo -a $gettok($maketok(%a,46),%b,46)
inc %b
}
}
======================================================
to return:
f
f
a
t
t
s
a
h
r
using: /eg2 rhasttaff
and:
alias eg2 {
var %a = $1, %b = $len(%a)
while (%b >= 1) {
echo -a $gettok($maketok(%a,46),%b,46)
dec %b
}
}
========================================================
and by type /eg3 rhasttaff
with:
alias eg3 {
echo -a --> $maketok($1,46) <--I will return-> r.h.a.s.t.t.a.f.f
echo -a --> $gettok($maketok($1,46),3,46) <--I will return-> a
echo -a --> $gettok($maketok($1,46),$r(1,$len($1)),46) <--I will return-> maybe ->r<- maybe ->f<- ...any random letter from the word-> rhasttaff
}
ATTENTION if you want test these examples you may put them below to the line from: (*/)
=================================================================================
*/
alias maketok {
if (!$2) { echo 4 -as * ERROR $eval($maketok,0) too few parameters | halt }
var %b- = 0
while (%b- <= $len($1)) {
var %c- = $iif(%b- < 1,$left($1,1),$left($right($1,- $+ %b-),1))
if (%c-) { var %d- = $iif($2 != 32,%d- $+ %c- $+ $chr($2),%d- %c-) }
inc %b-
}
return $iif($2 = 32,%d-,$left(%d-,-1))
}
Hallo!! Thanks for comments and incentive Brothers :)
^Neptune yes man it will do exactlly as you posted.
/echo -a $maketok(Hello Pretty world,46) = H.e.l.l.o. .P.r.e.t.t.y. .w.o.r.l.d
but
/echo -a $maketok(Hello Pretty world,32) = H e l l o P r e t t y w o r l d
Gummo
yeah i have alread used $mid others times, i don't know wtf i was thinking when i dont see that, including it culd be used to make this identifier, i think i lost this point. but it was a problem in taht moment and after killing some neurons i made it :\
as you sayd, but ok :|
to use it now i like more in
/echo -a $maketok(Hello Pretty World,2) = Hello Prettyy World
/echo -a $maketok(Hello Pretty World,31) = Hello Prettyy World
Thanks again!!
Jah Bless´´´
Pretty nice actually. Although I wouldn't call it $maketok. Maybe... $septok? Short for seperate-token? :P
Would be nice to fix the spaces problem though. I don't see why you couldn't just interpret $chr(32) ad make it come out. Such as:
$maketok(hello there,46)
Could return:
h.e.l.l.o. .t.h.e.r.e
Good work though. 7/10