Hash Script Options from a config file
mIRC Code
+ 0 likes
Please Register to submit score.
| Average Score | 4.0 |
| Scores Submitted | 1 |
| Date Added | Dec 23, 2006 |
| Last Updated | Dec 27, 2006 |
| Tags | hash options script tables |
|
|
Introduction
Essentially this is hash tables for dummies. This allows you have user set options for your script, that are read from a config file. Maksure you change the text between the <>s to whatever it tells you.
1. Your script MUST be an INI, no .mrcs.
2. create the file <yourscript's name>.conf
3. put the text [options] at the top and
thisismyoption=myoptions value, and use ";"'s for comments explaining
what they are for the user to edit.
4. make sure all the <yourscriptnames> are the same thing, with NO SPACES ALLOWED
5. Again make sure you edit this properly, look at it in notepad before pasting.
6. options added
7. use this in ANY script you want. This gave me a few headaches figuring it out, so hopefully I saved you said headache.
edit: I don't use global variables simply because mIRC only can handle one variable file at a time.
If this variable file is unloaded, or someone's script that loads its own variable file is loaded, my code would cease to function.
edit2: besides hash tables rock my socks off. just cut paste, and use the fucking identifiers.
edit: forgot, the custom identifiers $yourscrip_options(option)
and $yourscript_version(name|version|original file) are used to access your data.
mIRC Snippet:
Hash Script Options from a config file
Posted on Dec 23, 2006 6:30 pm
Posted on Dec 23, 2006 6:30 pm
why not set it to were you can set your scriptname with % it will take an hour to change all of that .
mIRC Snippet:
Hash Script Options from a config file
Posted on Dec 24, 2006 6:55 am
Posted on Dec 24, 2006 6:55 am
RoninWarrior: Read the author notes.
It looks nice, but i have no experince in hash files.
It looks nice, but i have no experince in hash files.
mIRC Snippet:
Hash Script Options from a config file
Posted on Dec 25, 2006 11:28 pm
Posted on Dec 25, 2006 11:28 pm
Then create a custom identifier so it would be easier for the user to edit the configurations needed ;)
Sample:
alias _Scriptname return Script_name_here
alias _Scriptver return Script_version_here
Usage: $_Scriptname & $_Scriptver
Sample:
alias _Scriptname return Script_name_here
alias _Scriptver return Script_version_here
Usage: $_Scriptname & $_Scriptver
mIRC Snippet:
Hash Script Options from a config file
Posted on Dec 26, 2006 1:28 am
Posted on Dec 26, 2006 1:28 am
;o





