mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Jan 2004
Posts: 129
A
AaronL Offline OP
Vogon poet
OP Offline
Vogon poet
A
Joined: Jan 2004
Posts: 129
Hi all.
I try to change the characters in a line into $chr(43) [this is a +] but excluding the spaces.
example:
line = New York
new line shouild be: +++ ++++

i have this sofar, but it doesn't work.

%teller = $len(%antwoord)
var %i = 1
while (%i <= %teller) {
%hinta = $replace(%hinta,%antwoord,$chr(43))
inc %i
}

greetz
aaron


Deridio fatum
Joined: Feb 2004
Posts: 714
Z
Hoopy frood
Offline
Hoopy frood
Z
Joined: Feb 2004
Posts: 714
Code:
alias teller {
  var %i = 1, %total = $numtok($1-,32), %output
  while (%i &lt;= %total) {
    var %x = $len($gettok($1-,%i,32))
    var %output = %output $+ $str(+,%x) $+ $chr(160)
    inc %i
  }
  $iif($isid,return,say) %output
}
I tested here and it works fine smile

Have fun wink
Zyzzy.


"All we are saying is give peace a chance" -- John Lennon
Joined: Jan 2004
Posts: 129
A
AaronL Offline OP
Vogon poet
OP Offline
Vogon poet
A
Joined: Jan 2004
Posts: 129
Hi Zyzzyx26

i tried your solution but i got the error:
/say: insufficient parameters

greetz
aaron


Deridio fatum
Joined: Feb 2004
Posts: 714
Z
Hoopy frood
Offline
Hoopy frood
Z
Joined: Feb 2004
Posts: 714
I tested here once again at it works as it should. Remember that, to use /teller <word>, you must be in a channel or query window, or else it wont work.

You can use it in 2 ways: /teller word to send the sentence to the channel/query - or - $teller(word) to return the sentence (in a script, maybe). Also make sure you copied the whole code.

Good luck smile
Zyzzyx.


"All we are saying is give peace a chance" -- John Lennon
Joined: Jan 2004
Posts: 129
A
AaronL Offline OP
Vogon poet
OP Offline
Vogon poet
A
Joined: Jan 2004
Posts: 129
hi Zyzzyx26

i forgot the ,word>
after that i got the error: you'r not in a channel.
so i changed the SAY into MSG #CHANNELNAME

works like a charm now.
Thank you very much for your help.

Greetz
Aaron


Deridio fatum
Joined: Feb 2004
Posts: 2,019
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
Hi,

Usage: $reptext(string,char)

Code:

alias reptext var %a | .echo -q $regsub($$1,/\S/g,$$2,%a) | return %a

This works in all cases except if the char is a \
There's a small work around possible for that, but imo it's not worth it.

Greets

Last edited by FiberOPtics; 15/08/04 03:45 PM.

Gone.
Joined: Feb 2004
Posts: 714
Z
Hoopy frood
Offline
Hoopy frood
Z
Joined: Feb 2004
Posts: 714
yw, glad it works! smile


"All we are saying is give peace a chance" -- John Lennon

Link Copied to Clipboard