-
Content Count
618 -
Joined
-
Last visited
-
Days Won
15
Posts posted by Mumbles
-
-
pls. when
-
In what way(s) do you intend for it to be different from normal storage?
-
-
Hello Rhina,
Welcome to Hercules! If you have any questions in regards to script conversion, please feel free to ask. As for showcases, you may do so in the various Releases sections across the support forums. Please bear in mind that although our community is primarily English-speaking, we do have sections for Portuguese topics as well. I look forward to seeing your posts and contributions to Hercules. See you around!Note: Translated topic title to English (previously "Novo no Hercules como Script") for the sake of keeping it in this support board.
-
Since you brought up the list of characters thing as an example. Supposed to be i would like to get all the character name of all characters on my server. Your function would only get the first 128 values ( 128 character names supposed to be ). A suggestion from me that you might want to add into your function is to support > 128 values. That will make your function more flexible and more awesome. Anyway good job!
The only purpose of getcharname() is to return a single character's name, by querying the database with an ID; the example above that returns all character names of the account being invoked uses an array filled by query_sql(), which may multiple results. This limitation is not exclusive to getcharname(), as any array filled in any manner (currently) can only store 128 values. It is my understanding that the limitation on arrays may soon be lifted, though it is up to our core developers or other contributors to do so; I wouldn't know where to begin.
@Mumbles
Question: What if for example, the character deletion is still ongoing, but suddenly someone logins that same account, what will happen then?
If you're deleting an account, I recommend you ban the account prior to doing so; if the system hosting your database has at least 512MB RAM, the deletion process should only take a second (if not less). Despite this, a check is made to ensure that the account is not logged in when the invoking user chooses to confirm removal.
This check can be found on lines 80-86:
case 3: // Confirm removal if (isloggedin(.@account_id)) { mes "All characters from this account must be offline before proceeding."; next; break; }
-
There is a existing command for this?
rid2name(getcharid(3));
rid2name() will only return the name of an online character, using their RID; additionally, the character name may not be produced properly, since the RID for a player is the account ID. getcharname() queries the `char` table for the name of the specified character ID, regardless of whether or not they are online. I've purposefully released an Account Remover utility simultaneously to demonstrate how this function may be used efficiently.
Here's an excerpt in which getcharname() is used to list all character names on an account:
mes .npc_name$; switch (@menu) { case 1: // View list of characters if (query_sql("SELECT `char_id` FROM `char` WHERE `account_id` = '"+ .@account_id +"' ORDER BY `name` ASC", .@char_id[0])) { mes "List of characters:"; for (.@i = 0; .@i < getarraysize(.@char_id); .@i++) { mes "- ^0000FF"+ getcharname(.@char_id[.@i]) +"^000000"; } } else { mes "There are no characters on this account."; } next; break;
Documentation for rid2name() can be found in doc/script_commands.txt.
-
total account deletion?
Currently, this is designed to erase the core account and character data attached to an account. The idea came from a discussion about account deletion via SQL that @jaBote left a comment on.
// Delete account data query_sql "DELETE FROM `account_data` WHERE `account_id` = '"+ .@account_id +"'"; query_sql "DELETE FROM `friends` WHERE `friend_account` = '"+ .@account_id +"'"; query_sql "DELETE FROM `guild_expulsion` WHERE `account_id` = '"+ .@account_id +"'"; query_sql "DELETE FROM `guild_member` WHERE `account_id` = '"+ .@account_id +"'"; query_sql "DELETE FROM `login` WHERE `account_id` = '"+ .@account_id +"'"; query_sql "DELETE FROM `party` WHERE `leader_id` = '"+ .@account_id +"'"; query_sql "DELETE FROM `pet` WHERE `account_id` = '"+ .@account_id +"'"; query_sql "DELETE FROM `sc_data` WHERE `account_id` = '"+ .@account_id +"'"; query_sql "DELETE FROM `storage` WHERE `account_id` = '"+ .@account_id +"'"; // Delete account registry information if (.acc_reg) { query_sql "DELETE FROM `global_reg_value` WHERE `account_id` = '"+ .@account_id +"'"; } // Delete character data for (.@i = 0; .@i < getarraysize(.@char_id); .@i++) { query_sql "DELETE FROM `cart_inventory` WHERE `char_id` = '"+ .@char_id[.@i] +"'"; query_sql "DELETE FROM `char` WHERE `char_id` = '"+ .@char_id[.@i] +"'"; query_sql "DELETE FROM `friends` WHERE `char_id` = '"+ .@char_id[.@i] +"'"; query_sql "DELETE FROM `guild` WHERE `char_id` = '"+ .@char_id[.@i] +"'"; query_sql "DELETE FROM `homunculus` WHERE `char_id` = '"+ .@char_id[.@i] +"'"; query_sql "DELETE FROM `hotkey` WHERE `char_id` = '"+ .@char_id[.@i] +"'"; query_sql "DELETE FROM `inventory` WHERE `char_id` = '"+ .@char_id[.@i] +"'"; query_sql "DELETE FROM `mail` WHERE `dest_name` = '"+ getcharname(.@char_id[.@i]) +"'"; query_sql "DELETE FROM `mail` WHERE `send_name` = '"+ getcharname(.@char_id[.@i]) +"'"; query_sql "DELETE FROM `memo` WHERE `char_id` = '"+ .@char_id[.@i] +"'"; query_sql "DELETE FROM `mercenary` WHERE `char_id` = '"+ .@char_id[.@i] +"'"; query_sql "DELETE FROM `mercenary_owner` WHERE `char_id` = '"+ .@char_id[.@i] +"'"; query_sql "DELETE FROM `quest` WHERE `char_id` = '"+ .@char_id[.@i] +"'"; query_sql "DELETE FROM `skill` WHERE `char_id` = '"+ .@char_id[.@i] +"'"; }
Note that in this version, some unwanted "residue" may be left over. For example, guilds in which the leader's account was deleted may still remain intact while the server is intact; a server restart finalise the changes, but this situation hasn't been tested. Additionally, skills that belonged to an account's deleted homunculus will remain in the `homunculus_skills` database.
If you have any questions, comments, or suggestions, please feel free to leave your input.
-
-
Function: getcharname()
Description:
Return the name belonging to the character ID referenced.
Example usage:
Download:
https://github.com/datmumbles/Scripts/raw/master/func/getcharname.txt
-
Utility: Account Remover
Description:
Allows for a (mostly) clean removal of accounts and regular character data via '@removeacc'. Rejects accounts that are currently online and prevents deletion of system accounts by default. See configuration for additional options.
Download:
https://github.com/datmumbles/Scripts/raw/master/util/removeacc.txt
Chemical Crush reacted to this -
Use Hercules' doc/script_commands.txt for reference if you're unsure of whether or not we have a script command that you need. Additionally, a script-checker was added to Hercules just recently for Linux, OS X, and Windows; it can also be used on Haru's website. This script-checker is a great and convenient way of checking your script's compatibility with Hercules, as it will return any errors the map-server would encounter if loaded.
-
Merge from a commit or add your changes manually.
Example DIFF:
https://github.com/HerculesWS/Hercules/commit/24fb73c653388c7d76fcd0a0bcc08b4af4c5e9cb
-
The last time I checked, colour-coding signified hidden socket enchantments or broken equipment.
Knife - 1 hidden socket
Knife - 2 hidden sockets
Knife - 3 hidden sockets
Knife - 4 hidden sockets
Knife - broken
What's a "hidden socket?"
A hidden socket is a socket (commonly known as a "card slot") that has been enchanted and/or is not shown on the client data as having that many enchantable sockets. For example, if you have a Knife [0] with a card or enchantment, its name may turn lime or turquoise. These types of items are usually obtained by faulty/deliberate scripts that enchant into nonexistent sockets or an outdated slotcounttable.txt in your data folder or GRF.
-
Set use_md5_passwords to yes in conf/login-server.conf:
// Store passwords as MD5 hashes instead of plaintext ?// NOTE: Will not work with clients that use <passwordencrypt>use_MD5_passwords: yes
If you've already done this and are still experiencing errors, execute sql-files/tools/convert_passwords.sql in your main schema to convert your existing passwords into MD5 hashes.
-
Hello Akkarin,
We don't really use the Talk pages; I've tried to initiate some discussion in the past, but most discussions take place on forums or on IRC. As for cleaning up, we appreciate any help we can get! Thanks for your interest.
-
setwall "mapname",x,y,6,7,0,"wallname";
what is the use of (6,7,0)
It means you're creating an invisible wall that starts on coordinates (x, y) on "mapname" and is 6 cells long in the direction 7 (see below); the shootable flag is off (0 = off, 1 = on), meaning that it cannot be hit/targeted, and the name of the wall is "wallname".
Direction 7 means the wall is facing the northeast corner and will continue for 6 cells:
[1][8][7] [2][0][6] [3][4][5]
-
Try adding this somewhere:
delwall "Wall Name";
Here's the documentation for setwall and delwall: http://herc.ws/wiki/Setwall
-
It's probably being caused by the GM Sandman skill. Unequip your Angra or comment out the GM Sandman skill in the item db it and you should stop receiving that error.
-
I've experienced this error in the past when loading a character equipped with Angra Manyu. Do you have any players with this item equipped?
-
-
-
i also would like too see this
btw does putting on the diffrent commands like few alootid and a alootype alrdy works using at the same time ?
That's a good question; I assume using the rate/type would work separately, since they're not part of the same function, but I may be wrong. @alootid would work similarly concurrently, but I don't see it being a part of a "combination" per se, unless it's used in such a way that just adds a specific item to the list of rate/type items being autolooted.
-
It works fine, but won't delete your pick. Here's a version that does:
- script Sample -1,{ OnPCLoadMapEvent: getmapxy(.@map$, .@x, .@y, 0); if (.@map$ == "guild_vs3") { if (!countitem(7318) || getequipid(1) != 5137) { message strcharinfo(0),"You need to have an Alice Doll equipped and 1 Old Pick to proceed!"; sleep2 1000; warp "SavePoint", 0, 0; } delitem 7318, 1; message strcharinfo(0), "1 Old Pick has been deleted from your inventory."; } end;} guild_vs3 mapflag loadevent
-
Sirius has been virtually non-responsive for over six months now. As far as support and updates go, Harmony is dead; I am unaware of their actual server status but I would assume they still serve their function, should you actually get Harmony working from your end.
Ubuntu and Hercules
in General Server Support
Posted
Might be skipping your plugins?