mIRC Home    About    Download    Register    News    Help

Print Thread
stripping first word from an echo help. #138838 07/01/06 09:09 PM
Joined: Jan 2006
Posts: 5
A
adama Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
A
Joined: Jan 2006
Posts: 5
im using this to relay text that starts with a colored text ABC in it from 1 channel to another

on *:TEXT:*ABC*:#chan1:{
msg #chan2 $1-
}

but what i would like to do is strip the ABC out of the text being echoed. only to display the text after ABC.any1 can help?

Re: stripping first word from an echo help. #138839 07/01/06 09:14 PM
Joined: Oct 2004
Posts: 72
C
captain_comic Offline
Babel fish
Offline
Babel fish
C
Joined: Oct 2004
Posts: 72
look at /help $remove
maybe you should include the colorcodes to prevent other abc's to be removed

Last edited by captain_comic; 07/01/06 09:15 PM.
Re: stripping first word from an echo help. #138840 07/01/06 09:53 PM
Joined: Jan 2006
Posts: 5
A
adama Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
A
Joined: Jan 2006
Posts: 5
could you give me an example of using the $remove with color code with my script? sorry just started looking at mirc scripting recently, looked at help but i think im messing up somewhere.

Last edited by adama; 07/01/06 09:54 PM.
Re: stripping first word from an echo help. #138841 07/01/06 10:07 PM
Joined: Nov 2005
Posts: 42
A
Aenei Offline
Ameglian cow
Offline
Ameglian cow
A
Joined: Nov 2005
Posts: 42
What code have you come up with thus far?

Re: stripping first word from an echo help. #138842 07/01/06 10:17 PM
Joined: Oct 2004
Posts: 72
C
captain_comic Offline
Babel fish
Offline
Babel fish
C
Joined: Oct 2004
Posts: 72
Suppose you put ABC in your room with red on white (color code 4,0) and after that black foreground (color code 1). This is what you can do then:

on *:TEXT:*ABC*:#chan1: {
msg #chan2 $remove($1-, 4 $+ $chr(44) $+ 0abc1)
}

Re: stripping first word from an echo help. #138843 07/01/06 10:33 PM
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Code:
 on *:text:*abc*:#chan1:{
.msg #chan2 $gettok($strip($1-,c),2-,32))
}
 


Takes the entry, then strips any colour codes from it, then returns all but the first word

Re: stripping first word from an echo help. #138844 07/01/06 10:33 PM
Joined: Jan 2006
Posts: 5
A
adama Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
A
Joined: Jan 2006
Posts: 5
Thank you , worked like a charm!

i was having trouble with how to enter the color codes in a script, just needed ur example, i thought it was same for how you change text when chatting.

Thanks again