Script Walkthroughs

This section provides walkthroughs on how to create scripts for each script set from the ground up.

 

General

To begin creating any script, you must first create the script file and add it to the script set of your choice. Press Alt-T/R to load the Code Editor. Go to the Script Set menu item and select the script set of your choice. We will be using System. Press Ctrl-N to create a new script file. Press Ctrl-D to add the script file to the current script set (System in our case). Because the file has not been saved, it will prompt you to save it before adding it to the set. Select any file name you want; for the walkthrough we will use Script Walkthroughs.lss.

You should have something very similar to this.

You are now ready to create an actual script.

 

System Scripts

To write scripts for the MHS system, you must handle the correct events. Events are similar to mIRC script events, such as ON TEXT.

First, create a script file by following the steps outlined in General, if you have not already. Our examples used the Script Walkthroughs.lss file created there.

On_StartUp

First we will handle the On_StartUp event. Just add the following shell code:

void On_StartUp( HWND hWnd ) {
}

You can fill the function with any contents you desire. Here we add a simple Warning( "Starting: %.8X", hWnd ); to show a message box. Press Ctrl-S to save the file.

You should have something similar to this.

When MHS finishes its loading routine after starting, this function will now be called, and a message box will be shown.

Remember that Script Walkthroughs.lss must be added to the System script set. You may save and compile the file, but because this function is only called once when MHS starts, you will not be able to see the results of this function until you restart MHS.

 

Copyright © 2006 Shawn (L. Spiro) Wilcoxen