Jump to content

meko

Core Developers
  • Content Count

    347
  • Joined

  • Last visited

  • Days Won

    44

meko last won the day on April 12

meko had the most liked content!

About meko

  • Rank
    Advanced Member

Contact Methods

  • IRC Nickname
    meko

Profile Information

  • Gender
    Not Telling
  • Github
    Helianthella

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Hercules has no LTS versions so the latest revision of the stable branch is always the most stable revision since we do not backport patches to older releases. Keep in mind that new bugs do appear from time to time but if you encounter some please report them so that they may be patched in the next release. If bugs are severe we also do pre-releases (denoted as vXX.XX.XX+Y) to address them in-between 2 releases
  2. MD5 is not encryption, it is only hashing. Ideally Argon2 or PBKDF2 should be used when storing passwords but the engine currently supports neither. There is a PR that implements PBKDF2 for Hercules but it is currently on hold
  3. From the error it appears that FluxCP is trying to connect to your mysql server but fails to reach it and the connection times out. You may have forgotten to update the DbConfig.Hostname when you moved to your new host
  4. Keep in mind that performing SQL queries is slow, especially when there's 200 rows of results so you should be using getunits() when possible. If you do not provide a map to getunits() it will search the whole server, just like the SQL query that is used in Ridleys script.
  5. this is untested but you could do something similar to: - script mapitem FAKE_NPC,{ end; OnCall: // @mapitem <nameid> <amount>{, <map>} [email protected]$ = [email protected]_parameters$[0]; [email protected] = atoi([email protected]_parameters$[1]); [email protected]$ = strcharinfo(PC_MAP); if ([email protected]_parameters == 3) { [email protected]$ == [email protected]_parameters$[2]; } else if ([email protected]_parameters != 2) { dispbottom("mapitem: illegal number of arguments."); dispbottom("Usage:"); dispbottom("@mapitem <nameid> <amount> for the current map"); dispbottom("@mapitem <nameid> <amount> <map> for another map"); end; } if (getmapinfo(MAPINFO_ID, [email protected]$) < 0) { dispbottom(sprintf("mapitem: map `%s` not found.", [email protected]$)); end; } [email protected] = getiteminfo([email protected]$, ITEMINFO_ID) < 0 ? getiteminfo(atoi([email protected]$), ITEMINFO_ID) : getiteminfo([email protected]$, ITEMINFO_ID); if ([email protected] < 0) { dispbottom(sprintf("mapitem: item `%s` does not exist.", [email protected]$)); end; } [email protected]$ = getiteminfo([email protected], ITEMINFO_AEGISNAME); if ([email protected] < 0 || [email protected] > .max) { dispbottom(sprintf("mapitem: trying to give %d `%s`, while the maximum allowed is %d.", [email protected], [email protected]$, .max)); end; } [email protected] = getunits(BL_PC, [email protected], false, [email protected]$); freeloop(true); for ([email protected] = 0; [email protected] < [email protected]; [email protected]) { if (.bound != false) { getitembound([email protected], [email protected], .bound, [email protected][[email protected]]); } else { getitem([email protected], [email protected], [email protected][[email protected]]); } } freeloop(false); [email protected] = [email protected]; [email protected] = [email protected] * [email protected]; dispbottom(sprintf("mapitem: gave %d `%s` (%d total) to %d players on map `%s`", [email protected], [email protected]$, [email protected], [email protected], [email protected]$)); end; OnInit: bindatcmd("itemmap", "mapitem::OnCall", 14, 99); .max = 100; .bound = IBT_ACCOUNT; // set to false to disable }
  6. If you want to do it from a script, you would use getunits(): [email protected] = getunits(BL_PC, [email protected], false, "geffen"); for ([email protected] = 0; [email protected] < [email protected]; [email protected]) { getitem(Bubble_Gum_Box_10, 1, [email protected][[email protected]]); }
  7. Running with root privileges is inherently insecure and so Hercules will complain when trying to start as the root user. You must create a new user and run Hercules under that new user (preferably as a daemon). To run a command with sudo your user must be in the sudoers file (you can edit it with visudo) but keep in mind that Hercules will also warn you when running with sudo (since it runs as root).
  8. Hercules builds just fine on ARMv8 but the macro checking for ARM version has not been updated yet for __ARM_ARCH_8A__ so compilation will fail until a PR is merged that changes cbasetypes.h. Meanwhile you can use this git patch: --- a/src/common/cbasetypes.h +++ b/src/common/cbasetypes.h @@ -67,6 +67,9 @@ #define __ARM_ARCH_VERSION__ 6 #elif defined(__ARM_ARCH_7A__) || defined(__ARM_ARCH_7R__) || defined(__ARM_ARCH_7S__) // gcc ARMv7 #define __ARM_ARCH_VERSION__ 7 +#elif defined(__ARM_ARCH_8A__) || defined(__ARM_ARCH_8R__) || defined(__ARM_ARCH_8M_BASE__) \ + || defined(__ARM_ARCH_8M_MAIN__) // gcc ARMv8 +#define __ARM_ARCH_VERSION__ 8 #elif defined(_M_ARM) // MSVC #define __ARM_ARCH_VERSION__ _M_ARM #else --
  9. It means you are trying to concatenate the elements of an array into a string but the array is empty. You must make sure the array is non-empty before imploding it: if (getarraysize([email protected]$)) { [email protected]$ = implode([email protected]$); }
  10. Whenever you see a deprecation warning you should look at the script documentation for instructions, which in this case instructs you to use specialeffect(). You can find more details on the Deprecation Notice thread: In your case you would simply replace it with: specialeffect(EF_BEGINASURA, AREA, playerattached());
  11. If what you want is create a NPC that you can only interact with every 15 minutes you could do something similar to this: // create a NPC template: - script giver FAKE_NPC,{ // get the item name from the NPC name [email protected]$ = strnpcinfo(NPC_NAME_HIDDEN); // check when the player last obtained this item [email protected] = .obtained[playerattached()]; if ([email protected] <= time_from_minutes(-15)) { // give the item getitem([email protected]$, 1); // update the last obtained date .obtained[playerattached()] = now(); mes("Enjoy!"); } else { // calculate the difference [email protected] = [email protected] - time_from_minutes(-15); // tell the player to wait mesf("Don't be greedy! Try again %s.", FuzzyTime(time_from_seconds([email protected]))); // This would print, ie: "Don't be greedy! Try again in 5 minutes and 32 seconds." } close; } // now make duplicates: einbech,172,113,4 duplicate(giver) new name#Jellopy 4_M_EINMAN // ^ this would spawn a NPC named "new name" that gives a Jellopy every 15 minutes This creates a template NPC that gets its parameters from the NPC name so you can create several duplicates that all give different items. PS: to make it easier to read this script uses the Date and Time functions file
  12. the error message already tells you what is wrong: you forgot a closing parenthesis if ( getguildinfo(GUILDINFO_MASTER_NAME, getcharid( getcharid(2) ) != getcharid(0) ) the parenthesis for getguildinto() is never closed: (((()) != ()) you should add a ) closing parenthesis before the !=
  13. inarray() is not a script command of Hercules (see the docs in doc/script_commands.txt) and is also not included in the "Array manipulation functions" script You should either replace it with a for() loop or if you want to use Array manipulation functions you should use array_exists() like so: // with Array manipulation functions: if (!array_exists([email protected]_id, get_unique_id())) { ... } // with a for() loop: [email protected] = getarraysize([email protected]_id); for ([email protected] = 0; [email protected] < [email protected]; [email protected]) { if ([email protected]_id[[email protected]] == get_unique_id()) { break; } ... } Keep in mind that get_unique_id() is also not part of Hercules so if you don't have a plugin that provides it or source mods (not recommended) it will not work
  14. mesf(format, ...param) is just a shorthand for mes(sprintf(format, ...param)) so you don't have to use both mesf() and sprintf(). You can find the documentation in doc/script_commands.txt: mesf(), sprintf() Replace this line: mes "^FF0000Your Latest Record^000000: "[email protected]+"."[email protected]+" Seconds."; With this line: mesf("^FF0000Your Latest Record^000000: %d.%03d Seconds.", [email protected], [email protected]); Replace this line: mes "^0000FFTime Taken^000000: [ "[email protected]_s+"."[email protected]_ms+" Sec. ]"; With this line: mesf("^0000FFTime Taken^000000: [ %d.%03d Sec. ]", [email protected]_s, [email protected]_ms); For the areaannounce() lines you can use sprintf(), like this: areaannounce("map name", .x1, .y1, .x2, .y2, sprintf("Your time is %dm %02ds %03dms", .m, .s, .ms), bc_area);
  15. By two more zeroes do you mean zero-padding so that the numbers are in the same format, like 008 (always the same width)? You can do zero-padding with sprintf() like so: sprintf("%03d", 5); // 005 so you would use it like this: mesf("^0000FFTime Taken^000000: [ %d.%03d Sec. ]", @emp_s, @emp_ms); // this would print, for example: Time taken: [ 5.095 Sec.]
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.