mIRC Home    About    Download    Register    News    Help

Print Thread
#85436 05/06/04 05:51 AM
Joined: Apr 2003
Posts: 24
S
Ameglian cow
OP Offline
Ameglian cow
S
Joined: Apr 2003
Posts: 24
I need to split a line thats entered via a channel trigger into multiple lines where it finds a specific character.

Is this possible if so could you point me in the rigtht direction please?

Joined: May 2003
Posts: 79
A
Babel fish
Offline
Babel fish
A
Joined: May 2003
Posts: 79
For the channel trigger, you can look in some events such as on text, on input (text by yourself), on kick, on join, and a lot more... just type for example: /help on text
Then, in the events, just redirect $1- to the alias called split I give.
Code:
alias split {
  var %a = 1, %b = $gettok($1-,0,32)
  while (%a <= %b) {
    echo -a $gettok($1-,%a,32)
    inc %a
  }
}

Just replace the 32 in both gettok by the char value of the character you want. For example, if you want the specific character to be ";", you would do: //echo -a $asc(;)
So you would replace 32 (the space) by 59 and do:
/split first line;second line;third line here;fourth line and so on; fifth..

Also, you can replace the "echo -a" by whatever you want.

Last edited by Artwerks; 05/06/04 12:48 PM.

Link Copied to Clipboard