Hello,
My first script for Achaea, so hope nothing blows up!
https://raw.githubusercontent.com/poormuffin/vsys/master/Character%20DB.nxs
This system uses API calls to api.achaea.com to gather and save information on players that are online while you are.
For the most part it will keep up-to-date on player data with a few exceptions:
- Using CDB CITYCHECK NAME will hard-code the city for players who are hiding the city. This is only updated by running the command on the player again.
- The database is automatically updated periodically for players who are online. To refresh all player data, including offline players in the database use CDB UPDATE.
In Game Commands
cdb |
|
show this list in game |
cdb reload |
reload cdb in case something goes wrong |
cdb update |
update data for everyone online |
cdb citizens
[city] |
show all users in this house |
cdb class
[class] |
show all users of this class in
the database |
cdb whois
[character] |
show cached info on this user |
cdb house
[house] |
show all characters in this house |
cdb stats |
|
show all visible online players
per city |
cdb change
[name] city [City] |
change a players city |
cdb change
[name] city [Notes] |
Add a note for this player, this overwrites the last note |
cdb
citycheck [name] cdb citycheck list |
Update a player that is hiding their city List all players where the city was overridden by the above
|
cdb huntwith
<range> |
List players from your city online that are within <range> of your
level, default is 10 levels |
cdb sparwith
<range> |
List players online that are within <range> of your level, default
is 10 levels |
cdb youth
<range> |
List players online that are under
level <range>, default is 50 levels |
API - Use these in your own scripts, string outputs are always lowercase, input is case insensitive
cdb_exists(name) |
return if a character exists in the DB, you
should call this before calling other API functions! |
cdb_getByName(name) |
get character info and add to the DB, does not return anything |
cdb_get_rank(name) |
return ranking for the character |
cdb_get_city(name) |
return a players city |
cdb_get_class(name) |
return a players class |
cdb_get_level(name) |
return a players level |
cdb_get_pk(name) |
return a players kill count |
cdb_get_house(name) |
return a players house |
GUI Modifications
Color players by city in the who's online and room info tabs:
Command output examples
> cdb whois <person> (a few examples)
> cdb citizens hashan
> cdb stats
> cdb class monk
> cdb house outriders
> cdb houses
(exerpt)
> cdb huntwith 5
> cdb sparwith 5
> cdb youth 20
Updating players with hidden cities
Players that are showing up with cities as (hidden) need to be manually overridden to report the correct city.
To do this use 'CDB CITYCHECK NAME', where name is the players name.
This override is NOT checked by the system and can become stale if the person changes cities, so you will want to check these people every so often.
You can list all players with this override by using 'CDB CITYCHECK LIST'
Inline colours
I have not added any support for colouring names in the main play area as the main reason for this package is to add the API functions to be used by other packages and the Room info window colouring works well for me.
However I have added support for ANGEL PRESENCES, which you may want to adapt if you us another similar skill, I didn't add others as I cannot test them.
Resetting the system
If you need to reset the system and start again from scratch:
- Disable the reflex package from the settings > Reflex Packages area by unchecking the associated box.
- Delete 'nameDB' from the variables tab.
- Re-enable the package. The system should start up and show the start up note, if not use CDB RELOAD
Comments
@Ronwe @Rhivona @Ictinus ?