mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Jul 2007
Posts: 34
D
Ameglian cow
OP Offline
Ameglian cow
D
Joined: Jul 2007
Posts: 34
I know that i can hit Ctrl + k and make a color menu appear, as well as hit Ctrl + b, Ctrl + u and Ctrl + r to make it bold, or underline, or highlight in black respectively, but is there a script that allows me to do it automatically? I was thinking of an 'On input' script, but when i typed /help on input, i got very confused....i had no clue as to what to type, nor did i understand what the scripts were supposed to do....if someone could break the code down and explain it, that would help.....but i would like the script for doing this....ALL HELP IS GREATLY APPRECIATED! THANKS IN ADVANCE!

Joined: Dec 2002
Posts: 2,031
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Dec 2002
Posts: 2,031
Originally Posted By: dylaninfd

Ctrl + r to make ... highlight in black...



It's reverse, ctrl+r reverses the normal text color and the background color of the window.

Joined: Aug 2005
Posts: 1,052
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Aug 2005
Posts: 1,052
Originally Posted By: dylaninfd
I was thinking of an 'On input' script, but when i typed /help on input, i got very confused....i had no clue as to what to type, nor did i understand what the scripts were supposed to do....if someone could break the code down and explain it, that would help


Code:
on *:INPUT:#YOURCHANNEL:{
  if ($left($1,1) == /) { return }
  else {
    if (lol isin $1-) { msg # $replace($1-,lol,Laughing Out Loud) | halt }
    if (mIRC isin $1-) { msg # $replace($1-,mIRC,4M0irc) | halt }
  }
}


Here I gave you 2 examples of using an automatic bold and color method.

The first if statement we have to make sure that if you input a / that it lets you excute any commands EX: /server irc.whatever.com etc...

The else statement we have the code in question, here in this code when you type lol in a channel it will automatically fill in the lol with Laughing Out Loud where aughing ut oud will be bold and the LOL will not, I use the replace command $replace($1-,WORD,NEWWORD) method then we have to halt the original string to be shown so you do not talk double or see a echo version of your script.

So in order to properly use this script and add your own words to be automatically colored and/or bold/underline you will need to add a new if statement within the else statement like above

the process would be as follows...

if (MYWORD isin $1-) { msg # $replace($1-,MYWORD,THE WAY I WANT IT TO SHOW) | halt }

hope this helps


Code:
if $reality > $fiction { set %sanity Sane }
Else { echo -a *voices* }
Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
Quote:

Code:
if ($left($1,1) == /) { return }



or

Code:
if (/* iswm $1) { return }

Joined: Jul 2007
Posts: 34
D
Ameglian cow
OP Offline
Ameglian cow
D
Joined: Jul 2007
Posts: 34
Ok, i have a script that I can use, but I dont get why there is a space of nothing right before my words....
"<MyNick> There are spaces right before my text"
"<MyNick> While normally, there is just one space w/o a script"

The script that I am using is

Code:
on *:INPUT:*:{
  if ($left($1,1) == /) { .disable #st | / $+ $1- | .timer 1 3 .enable #st | halt }
  else say 4 $1- | halt
}
#st end
menu channel {
  Talkers
  .Script Talker
  ..Enable: .enable #st
  ..Disable: .disable #st
  )


If you can figure out why it is doing this, it would be greatly appreciated! THANKS!

Joined: Jul 2006
Posts: 107
L
Vogon poet
Offline
Vogon poet
L
Joined: Jul 2006
Posts: 107
Change
Code:
else say 4 $1-

to
Code:
else say 4$1-


Also, I believe those 'halt's are completely unnecessary.



LonDart
Joined: Jul 2007
Posts: 34
D
Ameglian cow
OP Offline
Ameglian cow
D
Joined: Jul 2007
Posts: 34
no, changing it from
Code:
else say 4 $1- 
to
Code:
else say 4$1- 
just made it show the text $1- over and over again......any other suggestions?

Last edited by dylaninfd; 31/07/07 06:18 PM.
Joined: Dec 2002
Posts: 2,031
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Dec 2002
Posts: 2,031
Code:

else say $+(04,$1-)


Joined: Jul 2007
Posts: 34
D
Ameglian cow
OP Offline
Ameglian cow
D
Joined: Jul 2007
Posts: 34
My script that i have now put down is
Code:
on *:INPUT:*:{
  if ($left($1,1) == /) { .disable #st | / $+ $1- | .timer 1 3 .enable #st | halt }
  else say $+(4 ,$1) | halt
}
#st end
menu channel {
  Talkers
  .Script Talker
  ..Enable: .enable #st
  ..Disable: .disable #st
  )

But now, it only shows the first word....everything else gets deleted. On the plus side, there isnt a space! Anything else you can pull out of thin air?!

Last edited by dylaninfd; 31/07/07 06:49 PM.
Joined: Jul 2007
Posts: 34
D
Ameglian cow
OP Offline
Ameglian cow
D
Joined: Jul 2007
Posts: 34
WHOOPS, guess i forgot to put a - after a part! THANKS rock! U ROCK, lol. betcha get that a lot! thanks everyone for all the help and ideas!

Joined: Jul 2006
Posts: 107
L
Vogon poet
Offline
Vogon poet
L
Joined: Jul 2006
Posts: 107
You left out the -

Code:
else say $+( 4 ,$1-)


details, details smirk They'll drive you crazy.


LonDart
Joined: Jul 2007
Posts: 34
D
Ameglian cow
OP Offline
Ameglian cow
D
Joined: Jul 2007
Posts: 34
Grr, once again, i have run into a problem (yeah, i know, who woulda thought!) My final script looks like this:
Code:
on *:INPUT:*:{
  if ($left($1,1) == /) { .disable #st | / $+ $1- | .timer 1 3 .enable #st | halt }
  else say $+(4,$1-) | halt
}
#st end
menu channel {
  Talkers
  .Script Talker
  ..Enable: .enable #st
  ..Disable: .disable #st
  )


But when i try to put a highlight in, it messes everything up....it puts it back to regular, default black. I used this script to make the color and highlight appear:
Code:
on *:INPUT:*:{
  if ($left($1,1) == /) { .disable #st | / $+ $1- | .timer 1 3 .enable #st | halt }
  else say $+(8,2,$1-) | halt
}
#st end
menu channel {
  Talkers
  .Script Talker
  ..Enable: .enable #st
  ..Disable: .disable #st
  )

Now, the text is all black, default. I am going to assume that the commas are confusing the script.....what is the way to fix THIS problem?! AGAIN: THANKS AND YOU HAVE ALL BEEN SO MUCH HELP!

Joined: Jul 2006
Posts: 107
L
Vogon poet
Offline
Vogon poet
L
Joined: Jul 2006
Posts: 107
oops indeed. I pasted without paying attention blush

Code:
else say $+( 4 ,$1-)

should have been
Code:
else say $+( 04 ,$1-)

that's Control+K, ZERO Digit
You need to zero-pad the single-digit color codes
To get the comma for the second color code, use $chr(44)

So for
Code:
else say $+(8,2,$1-)

try
Code:
else say $+(08,$chr(44),02,$1-)

A guess, really.


LonDart
Joined: Jul 2007
Posts: 34
D
Ameglian cow
OP Offline
Ameglian cow
D
Joined: Jul 2007
Posts: 34
That fixed everything. now, my only problem is, when i type numbers, the first number gets deleted and its default black again. I don't know whats causing this and its a minor problem. It only happens if i start the text with a number....if it starts with anything else it is fine....a fix would be great....my script is now:
Code:
on *:INPUT:*:{
  if ($left($1,1) == /) { .disable #st | / $+ $1- | .timer 1 3 .enable #st | halt }
  else say $+(08,$chr(44),02,$1-)
}

and everything works but that one problem....well, hope you geniuses can figure it out, cuz this moron cant!

Joined: Jul 2006
Posts: 107
L
Vogon poet
Offline
Vogon poet
L
Joined: Jul 2006
Posts: 107
That code works here.

I guess all your formatting needs to include the second color parameter, to allow you to type numerals at the beginning. So
Code:
else say $+(04,$1-)

would need to be
Code:
else say $+(04,$chr(44),00,$1-)

00 being white.
Obviously you'd use the code for your normal bkgnd color


LonDart
Joined: Aug 2007
Posts: 1
B
Mostly harmless
Offline
Mostly harmless
B
Joined: Aug 2007
Posts: 1
Code:
#st on
on *:INPUT:*:{
  if ($left($1,1) == /) { .disable #st | / $+ $1- | .timer 1 3 .enable #st | halt }
  else say $+(4,$1-) | halt
}
#st end
menu channel {
  Script Talker
  .Enable: .enable #st
  .Disable: .disable #st
 }


Code:
#st on
before can not enable , now it's on / off code..


Link Copied to Clipboard