Goodleech: Pure ROM Leechosity
-----------------------------------------------
by Generalme/prisen for #roms4free and #r0mz2k
VERSION 1.13a
FOR mIRC 5.9

(Turn on Word Wrap. You'll be glad you did.)

WHAT THIS SCRIPT DOES:
*Leeches files from a goodmiss.txt file (nesmiss.txt, genmiss.txt, etc).

*THIS IS NOT AN IDLEBOT. IT DOES NOT ANTI-IDLE. If the file server wants to disconnect you for too much idle time, goodleech WILL COMPLY AND DISCONNECT. This is different from most leech scripts in that it does not sit on the fserve for stupid amounts of time and it does NOT QUEUE FILES. The script will not take up more than one (1) queue slot. This is to protect you from pissing off others. This is so that others can get files also without having to deal with you.

IF YOU WANT TO DOWNLOAD THIS, YOU MUST AGREE TO THE FOLLOWING:
a) ONLY HOLD YOURSELF RESPONSIBLE if someone gets pissed and takes action against you, 
b) not be a lamer who will gripe about the above rule, the fact that xxxx portion of the script does not work, or etc. WE ARE OPEN FOR CRITICIZM, I CAN TAKE IT, PLEASE GIVE IT. BUT PLEASE, ONLY CONSTRUCTIVE, NO COMPLAINTS.

Meet these terms? please download/use goodleech.mrc.

SETTING UP:
/load -rs goodleech.mrc. Allow initialization of the script if prompted.
In the channel or menubar popups, select 'Goodleech 1.3'. This will start up Goodleech.

THE DIALOG, EXPLAINED:

Current Session tab:
This tab shows you a bit more detail about what Goodleech is doing. If it is not currently at work, obviously, it will tell you. During a leech session, Goodleech will report who it's leeching from, how many files are in the process queue, how many were successfully downloaded, and etc. This tab is fairly self-explanitory and should be easy to understand.
Buttons along the bottom:

getfail.txt: opens getfail.txt, a log of files that Goodleech failed to completely download.

noexist.txt: opens noexist.txt, a log of files that did not exist as reported by the file server.
(Be advised that the two above files are deleted between sessions.)
Downloads: opens your client's 'Get' folder.

Downloads: Opens your client's download folder.

Stop: Stops all leeching, and shuts down the Goodleech script immediately. Any file transfers will continue as normal.

Pause: Stops leeching temporarily. When paused, this button will change to 'Resume'. This is good to use in case you need bandwidth, or if the fileserver is going down temporarily. As long as you do not exit your client, you are able to resume. Any file transfers will continue as normal until finished.

Done: closes the dialog.

Session Settings tab:
This tab is used to start a new Goodleech session. If you define a new session and you are already leeching, the previous session will stop. Goodleech will not start a session until it has all the information it needs to connect and find the files you want.

Options:

*miss.txt file: Click 'Browse...' to locate the *miss.txt file that contains the files you need for a complete set. This must be a plain text file where the filenames start on line 3. This allows goodleech to ignore the header 'You are missing xxx of xxx nnnnn ROMs'. This file will not be modified by goodleech. Once you select the *miss file to use you can click the 'View' button to look at it.

Fileserver channel: Specify the channel that the fileserver you wish to connect to is in, ie. '#roms4free'.

/list: Suggests channels with "rom" either in the name or topic.

Fileserver trigger: Specify the trigger that is used to connect to the fileserver, ie. '!isgood' or '!goodable'.

!list: Provides a list of fileserver triggers to choose from in the specified channel. Fileservers must comply with the #roms4free rule of "all triggers must start with !" in order to be recognized by this feature.

Log Failed Downloads/Nonexistant files: Enables logging to the above mentioned getfail.txt and noexist.txt.

Use Good Dirs: For file servers that scan their ROMs with the 'dirs' option, this should be enabled. The standard GoodTools dir set is used and expected.

Anti-Idle: For modem users. This will keep your connection on the file server from idling out. The script will send one of a few commands randomly. Please check with the file server owner before using this option.

Extension: Default is .zip. If you are leeching files that have a different extension (ie. .smd or .bin) specify here. The leading . must be specified for this to work.

No Folders: For file servers where the ROMs that you want are located in the root directory (\), this should be enabled.

Download timeout: A period of time, in seconds, that Goodleech uses to retry the current download or command if there is no response from the server.

Folder 1,2,3,4: This is where you specify what folder Goodleech should be looking in. For example, if the files you need are in a folder on the fileserver [\genroms\genren\pd], you should type 'genroms' in the folder 1 box, Place a check in Folder 2 option and type 'genren', and place a check in the Folder 3 option and type 'pd'. I am sorry if this is difficult to understand. Msg me if you need some help.

Browse Fserve: Take a look at what's on the file server. Select a folder, click 'Use this folder', and Goodleech will fill in the folders for you.

Session Settings: If you wish to save the settings to a file and be able to load them up later, click Save. If you want to load a previously saved session, click Load. The *miss.txt specified will be re-read and leeching will start from the beginning again.

KNOWN ISSUES:
*Please report any bugs you find. We need as specific information as possible.
*Be aware that the file servers you use must be completely Polaris 2001 2.01 compliant. Modified servers or those that use a different script will not work and are not supported by goodleech.
*After loading a saved session, goodleech might complain about something not being complete when you click Leech. This seems to be weirdness in mIRC, but I'm working on it.
*Multiple sessions are not possible. Don't try.

CHANGES IN 1.13 (Considered beta, plz report any issues)
*Code optimization again, major rework to the script. All variable names have been changed.
*File size reduced by like 8k, but like you care ;)
*Sessions are now suspendable (saved to disk for resuming later in case you need to reboot or whatever)
*YOU'LL LIKE THIS: Goodleech now uses a totally different method for building its temporary file, leecher.txt. It's instantaneous. Nice, eh?
*When saving (and suspending) sessions, the associated *miss.txt file is built and saved to a file along with the .gsp or .gls file. 

CHANGES IN 1.11a
*fixed the damn anti-idle bug slonny bitched about.

CHANGES IN 1.11
*A file extension of any length may now be used, for example, .bin.zip. (Thanks Dremscape.)
*Several enhancements/fixes to fileserver browser.
*Other bugfixes.

CHANGES IN 1.10
*Channel name now shows up automatically when the dialog is called from a channel window.
*Added an option to leech files with extensions other than .zip.
*Goodleech won't stop now if the fileserver happens to change its nickname. (Thanks Neo-Link)
*Goodleech halts itself if the fileserver quits for any reason. You will need to scan new files and restart your session in case this happens.
*TO PROMOTE EVEN FUTHER LAZINESS: We now have an 'fserve browser'. It shows you all the files and folders available on any fserve and loads the folder up into goodleech for you. GOOD GOD MAN, THAT'S LAZY! :) The option to manually enter folder names is still there, for those with slower connections/control freaks.
*Added GoodWSx.
*Chat windows now close if you don't have mIRC set up to do that.
*Code optimization (like you care)

CHANGES IN 1.07
*Got rid of some more unused variables, and made sure those variables are gotten rid of when you upgrade to any newer version.
*In case you are 31337 (pssh) and installed mIRC to a folder with spaces, this release should work much better for you. JUST LIKE KHALED, WE DON'T RECOMMEND INSTALLING mIRC INTO A FOLDER WITH SPACES IN THE NAME.
*Corrected some bracketing issues {} (DAMN GENERALME, GET IT TOGETHER!) :) (Thanks Dremscape for helping us out)
*Made some changes to the menus, nonworking items were removed.
*Other cosmetic fixes.
*OPTIMIZATION SOON, I PROMISE :)

CHANGES IN 1.06
*glcore.mrc eliminated thanks to new 60k script limit! THANKS KHALED, YOU ANSWERED OUR PRAYERS :) The script now requires mIRC 5.9, so make sure you have upgraded.

CHANGES IN 1.05 (Core 0.994)
*Fixed the TRANSLATED/TRANSLATIONS dir bug. Thanks to whomever reported it :)
*Compatibility issues with mIRC 5.9 were corrected.
*Variables are cleaner now; Goodleech won't leave so much crap lying around.

CHANGES IN 1.04 (Core 0.993)
*Fixed a bug in which the version of Goodleech would not be updated when you used the Update (Reload) button from the options menu.
*Goodleech can now be installed to any folder. Sessions are saved to the same folder as goodleech.mrc. Temporary or "work" files are still saved to the same folder as mIRC. Please let me know if this is a problem.
*No changes to glcore.mrc in this version.

CHANGES IN 1.03 (Core 0.993)
*A few more minor bugs squashed.
*Menu added to the dialog. Leaves room for expandability and is helpful for those (freaks) who prefer menus.

CHANGES IN 1.02 (Core 0.992)
*Bugfix release to supplement the be-all-end-all-ness.
*Corrected issues with the script going too fast. The script now waits for a response from the server before sending another command.
*Some dir corrections, script also understands "Invalid Directory" message.
*Misc corrections to some stuff we missed..stupid bugs..
*To promote futher laziness and/or futher 31337ness of this script, when you click !list a list of detected file server triggers is presented to you. Of course, you can still specify your own with or
without clicking the !list button.

CHANGES IN 1.01 (Core 0.991)
*ADDED GOOD DIRS SUPPORT. This has been very, very difficult and probably will still not work *perfectly* as there are some exceptions in the Goodtools' codes. When tested the script had about a 90% hit rate and was able to efficiently and correctly go to the dir where the rom was. Don't try to leech GBx all at one time with this yet. You will need to leech GBMONO and GBC separately.
*ADDED SESSION CONFIG SAVING/LOADING. A highly requested feature. You are now able to save your settings before leeching and load them up later. Settings get saved to files with extension .gls and resemble ini files if viewed.
*REDESIGNED DIALOG. Yep, you got it. Looks perty, eh?
*MANY, MANY BUGFIXES.


TO DO:
*TOSEC/Arcade support, maybe.

Please msg Generalme or prisen with any comments/bugs/love etc..try to be as specific as possible when reporting bugs. 
Please visit #r0mz2k, and #roms4free on irc.newnet.net plz kthxlater.