mIRC Home    About    Download    Register    News    Help

Print Thread
P
Piku
Piku
P
Hi friends!
I am in problem. I want to make a script for my own text color.

Example : when i input

"any text"

it will be replace

%prefix +[[
%sufix ]]+

and finally my own color will be

+[[ any text ]]+

i make a dialog box with 2 edit box and one ok button. i made these as bellow :

edit 1, - - - - autohs %prefix
edit 2, - - - - autohs %sufix
button "ok" 3, - - - -, ok

now i want, when i input an design like "+[[" on edit box 1 and another design in edit box 2 like "]]+" it will save on veriables. when i input a text like "any kinds of text" it will be replace

+[[ any kinds of text ]]+

please help me!!! i want to use this in simple script. i don't want to use any dll files or $drawpicture.

Joined: Feb 2004
Posts: 2,013
F
Hoopy frood
Offline
Hoopy frood
F
Joined: Feb 2004
Posts: 2,013
In order for you to do this kind of thing, you will need to learn how to work with dialogs in mIRC.

/help dialogs

There is a lot of information in that section. Things especially important for you: the section about $did, as your editboxes with the decoration will have to be referenced by $did to store their values to a variable.

The text in editbox 1 would be: $did(<dialogname>,1)
The text in editbox 2 would be: $did(<dialogname>,2)

Setting variables is easy, for global vars use /set.

Now the last part, is when do you set the values to the variables? You'll need to have an event that tells you "ok you should store the values now". This could be upon closing of the dialog, which you can catch with on dialog events, which can also be found in the help file in that section. Small hint, the event you're looking for is "close".

Then when you got all that in place, still remains for you to script the on input event. This event is triggered when you send text through the editbox of where you usually type. The incoming text is filled in $1-, and you will need to use haltdef/halt to stop the default text from showing. Instead you'll need to message something along the lines of: %prefix $1- %suffix

As you can see, I am not scripting this for you because of the following reason:

"Give a man a fish, you have fed him for today.
Teach a man to fish, and you have fed him for a lifetime."

I'm guiding you and dropping clues, but you need to put it together.

Don't forget, the help file contains a lot of information, and if you're smart enough, most of the time the help file is all you really need. If some concepts aren't clear to you, you can always check out some tutorials for example on these sites:

www.mirc.net
www.mircscripts.org




Link Copied to Clipboard