
05-16-2010, 11:20 PM
|
|
N-Pulse Assistant Manager
|
 |
Join Date: Mar 2005
Posts: 2,180
|
|
Utility Collection
|
These are a few classes I've been using that I never really got around to making a proper release for (most of them don't warrant their own individual release). Some of them are likely to be added onto and changed later.
Most of them are fairly straightforward to understand, or they have documentation in the scripts.
util_common
Just a couple of simple functions I've needed. The first is a distance function that uses a heuristic. The second is a capitalization function.
util_dict
A simple associative array class. It doesn't use any fancy hash table lookups or anything, so it's probably not particularly efficient, but it gets the job done.
util_indent
A function to check the indentation of a line. Useful for parsing files where this may be necessary (I used it for parsing my behavior tree files).
util_path
The most useful (and lengthy) script in this collection. It's a wrapper around the built in findPathInArray() function. Since that function uses an awkward map array format and doesn't make particularly pretty paths (no diagonals) my function post-processes the generated path to make it better (though not much better, yet).
It's fairly well documented in the script, but just know that it also accounts for an NPC's size and where it should be blocked.
It also contains a function for traversing through the path, to make it simpler for you.
util_requesthttp2
To be honest, this isn't tested very well, but seeing as it's largely Inverness' util_sql but rewritten for requestHttp(), I don't see there being any issues with it, but please let me know if there are.
util_sleep2
An attempt to get around the issues with using sleep() inside of a timeout loop. Though it will still cause problems if used before setTimer() is called, if done afterwards it works fine. |
__________________
Quote:
*SlikRick: so should I even ask about your aim status?
*Xor: well if you want to
*Xor: but i am LARPING
*SlikRick: While on a computer?
*Xor: yes
*Xor: in my living room
*SlikRick: ahh
*Xor: i have a fort setup to hide from beasts
|
|
Last edited by coreys; 05-16-2010 at 11:40 PM..
|
|
|