Jump to content

Need a bit of help.


Guest LAS

Recommended Posts

So far my friend.. she wanted a input code that changes the colors for the first letter in every word and the rest of the word would be a diffent color. Well I tryed a few months before to get help here.. and didnt work out so well. Anywas I found out a way, only one problem. The code removes the same chrs as the first letter in the word sense I had to use $remove so that I can remove the first letter. I just woundern if anyone here knows how to help me.

 

ins {
 %x = 1
 var %in = $remove($1-,$chr(32))
 while (%x <= $len(%in)) {
  var %in.p = $gettok($1-,%x,32)
   var %in.n = $left(%in.p,1)
   var %in.n2 = %in.n2 13 $+ %in.n $+ 10 $+ $remove(%in.p,%in.n)
   .inc %x
 }
 return %in.n2
}

 

It maybe not the best code in the world. But it does work up to the point of removing the same chrs as the first letter.

 

Example: Test

 

Anywas any help would be nice... sense I cant figure out how to make this stop that.. unsure.gif

Link to comment
Share on other sites

  • 2 weeks later...

Try this...

 

on *:Input:#:{
 if (/* !iswm $1) {
   set %blah.aa $1-
   set %blah.bb 1
   set %blah.cc $numtok(%blah.aa,32)
   while (%blah.bb <= %blah.cc) { 
     set %blah.msg %blah.msg 04 $+ $left($gettok(%blah.aa,%blah.bb,32),1) $+ 09 $+ $right($gettok(%blah.aa,%blah.bb,32),$calc($len($gettok(%blah.aa,%blah.bb,32)) - 1))
     inc %blah.bb
   }
   msg $chan %blah.msg
   haltdef
   unset %blah.*
 }
}

 

I dont like using "set" but var wasnt working lol, i hope this is what you were after, just change the color numbers on the %blah.msg(09 and 04), you could also make a group to control it tongue.gif

 

If you have any problems or other questions email me: us3rX [at] killanet [dot] net

and let me know... i dont check this board very often tongue.gif

 

us3rX ph34r.gif

 

Edit: sorry if any typos, i am tired as hell, lol

Link to comment
Share on other sites

you could try this, even though he said var wasn't working,

 

 on *:Input:#:{
if (/* !iswm $1) {
  var %blah.aa = $1- , %blah.bb = 1 , %blah.cc = $numtok(%blah.aa,32)
  while (%blah.bb <= %blah.cc) { 
    set %blah.msg %blah.msg 04 $+ $left($gettok(%blah.aa,%blah.bb,32),1) $+ 09 $+ $right($gettok(%blah.aa,%blah.bb,32),$calc($len($gettok(%blah.aa,%blah.bb,32)) - 1))
    inc %blah.bb
  }
  msg $chan %blah.msg
  haltdef
}
} 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...