

[ Some tips to make a mIRC addon. by CoolMaster ]

This help is the way I think to make a good addon.

First of all, you need to know a few of identifiers,events and aliases.
You need to know witch version that command/identifier... is implemented. 
e.g. if you use while loop, version can't be less than 5.7 So whe use on load 
event. e.g.

Note: $version returns the corrent mIRC Version
on *:load:{
if ($version < 5.7) { .unload $scriptdirFILE | echo $colour(info) -s *** Canno't load addon, need mIRC5.7+ | halt }
else echo $colour(info) -s *** Script loaded 
}

Second look at $colour identifier, i recommend use this identiifer to make echos
because some colours aren't anoying for some backgrounds or other...

If it's possivel use #groups to enable,disable.
Use variables started with addon-name to not replace value of some important variavel.
If possivel use local variables because is more fast and are deleted at the end
of execution.
If possivel use Hash Table to store information.
Hash Tables and ini files save on $mircdir and warn that when script load.
It's a good idea use addon file to store info on ini format.
If you have a sound or other, allways use $scriptdir to locate the script location.
e.g. splay -w $scriptdirINTRO.MP3 

Allways explain who to use addon, or to open main addon dialog.
Some documentation on a separated file or in addon file is useful. With some knowing 
bugs, versions and other misc help.
Also it's a good ideia to show some info, help and other when you load an addon.

Allways use 'local' aliases, with this aliases only are accessible to that scriptfile
and this prevent 2 same aliases names.
e.g. alias -l sw sockwrite -n $1-
and will take no efect from /sw command or other /sw alias, can only be call from
corrent script execution.

When use some dialog, please choose a name and table associated to that addon
it's very used about dialog with name about, and it's very common that the most
of scripts have a dialog with this name and will mess up all dialog. Consider that,
this is aplycable to custom @windows .

Don't rip anything from other addons/scripts.

Never make an addon to make some lamer thinks, like nukes or flood bots... 
Never try to make an addon with backdoors, comfliting commands, and other
nom ethic thinks. Else you can be rejected from mIRC Scripters comunity
and from other people.

Write an addon to run correctly even if is used on a full script.

In my opinion popups to access it's not important but it's a good idea make
some on status and menubar.

If you use an addon on your script please keep kreditz alive, like author, email and other
some useful info.

Very important, before you publish your addon check if all thinks are right, and
test it.

I recommend use a nom ini addon file format!
The addon only can be a remote script, not aliase or on popups area, because on remote
you can also do alias and popups.

If you have two or more files, use a file to load, with name expressing that, like: loadme.mrc
And when user loads that file you will load all rest of files, then unload loadme.mrc file.
Neve assume that user will put all files in $mircdir so use $scriptdirNAME-OF-FILE-TO-LOAD.

Unfortunetly, mIRC don't have any unload event so it's a good ideia to make
a simple aliase to unload addons, unset variables, delete hash table and ini file,
and hfree to hash table. And disable #groups. The user of addon need to know about
existence of the aliase, popup. 




[ Conclusion ]
I only show some tips that you have to considering when making an addon.
In my opinion 80% of scripters don't follow this rules and the addon user provably
unload addon and delete it :]. 

Well I want apollogies for my english :) I know it sucks.
Be cool :]


				CoolMaster <coolmaster@PTLink.net>
				http://coolmaster.org 
				You can find me on PTLink <GameOver.PTLink.net> then #PTLink , #Xeon 
				CoolMaster productions (28/04/01 04:07 am)

