meko

Core Developers
  • Content count

    310
  • Joined

  • Last visited

  • Days Won

    41

Everything posted by meko

  1. map server by itself does not auto-restart, what you are using is a wrapper script (map-server.bat) if you do not want it to restart you should use map-server.exe directly or make your own wrapper script
  2. You do know screenshots are a thing, right? and for text you can use a paste service... Anyway, you'll want to install libmariadb-client-lgpl-dev (on older Ubuntu versions you might also need libmariadbclient-dev-compat) or libmysqlclient-dev
  3. Version v10

    125 downloads

    This script provides various array manipulation functions, and more might be added in the future. All of those functions (except the arithmetic ones) work with both integer and string arrays. The start of the array is always implicitly index 0, unless an index is specified, ie @array[index] array_pad(<array>, <size>, <value>) pads the array left or right with <value> until it reaches <size> size. If <size> is negative it will pad left. > returns the number of added entries setarray([email protected], 1, 2, 3, 4, 5); // initialize the array array_pad([email protected], 8, 69); // => 3 // array is now: 1, 2, 3, 4, 5, 69, 69, 69 setarray([email protected], 1, 2, 3, 4, 5); // initialize the array array_pad([email protected], -8, 69); // => 3 // array is now: 69, 69, 69, 1, 2, 3, 4, 5 array_replace(<array>, <needle>, <replacement>{, <neq>}) finds every occurrence of <needle> within the array and replaces it with <replacement>. if <neq> is true, finds entries that do not match instead > returns the number of changed entries setarray([email protected], 1, 1, 3, 1, 5); // initialize the array array_replace([email protected], 1, 69); // => 3 // array is now: 69, 69, 3, 69, 5 array_find(<array>, <needle>{, <neq>}) finds the first occurrence of <needle> within the array. if <neq> is true, finds entries that do not match instead > returns the index, or if none is found returns -1 setarray([email protected], 1, 2, 3, 4, 5); // initialize the array array_find([email protected], 3); // => 2 array_find([email protected], 1); // => 0 array_find([email protected], 6); // => -1 array_rfind(<array>, <needle>{, <neq>}) like array_find, but finds the last occurrence. if <neq> is true, finds entries that do not match instead > returns the index, or if none is found returns -1 setarray([email protected], 1, 2, 3, 4, 3); // initialize the array array_rfind([email protected], 3); // => 4 array_rfind([email protected], 4); // => 3 array_rfind([email protected], 6); // => -1 array_exists(<array>, <needle>{, <neq>}) very similar to array_find() but it instead just checks if it exists or not. if <neq> is true, finds entries that do not match instead > returns true or false setarray([email protected], 1, 2, 3, 4, 5); // initialize the array array_exists([email protected], 3); // => true array_exists([email protected], 6); // => false array_count(<array>, <needle>{, <neq>}) similar to array_find() but iterates through the whole array. if <neq> is true, finds entries that do not match instead > returns the total number of occurrences of <needle> setarray([email protected], 1, 69, 3, 69, 5); // initialize the array array_count([email protected], 69); // => 2 array_entries(<array>) a wrapper around array_count(). behaves similarly to getaraysize() but does not count holes > returns the number of non-empty entries setarray([email protected], 1, 2, 0, 0, 5); // initialize the array getarraysize([email protected]); // => 5 array_entries([email protected]); // => 3 array_remove(<array>, <needle>{, <neq>}) finds and removes every occurrence of <needle> from the array, while shifting left. if <neq> is true, finds entries that do not match instead > returns the number of removed entries setarray([email protected], 1, 69, 3, 69, 5); // initialize the array array_remove([email protected], 69); // => 2 // array is now: 1, 3, 5 array_reverse(<array>) reverses the array > returns true setarray([email protected], 1, 2, 3, 4, 5); // initialize the array array_reverse([email protected]); // => true // array is now: 5, 4, 3, 2, 1 array_sum(<array>) iterates through the whole array to perform an arithmetic addition > returns the sum of every entries of the array setarray([email protected], 1, 2, 3, 4, 5); // initialize the array array_sum([email protected]); // ((((1 + 2) + 3) + 4) + 5) => 15 array_difference(<array>) iterates through the whole array to perform an arithmetic subtraction > returns the difference of every entries of the array setarray([email protected], 1, 2, 3, 4, 5); // initialize the array array_difference([email protected]); // ((((1 - 2) - 3) - 4) - 5) => -13 array_product(<array>) iterates through the whole array to perform an arithmetic multiplication > returns the product of every entries of the array setarray([email protected], 1, 2, 3, 4, 5); // initialize the array array_product([email protected]); // ((((1 * 2) * 3) * 4) * 5) => 120 array_quotient(<array>) iterates through the whole array to perform an arithmetic division > returns the quotient of every entries of the array setarray([email protected], 1, 2, 3, 4, 5); // initialize the array array_quotient([email protected]); // ((((1 / 2) / 3) / 4) / 5) => 0 array_shift(<array>) removes the first entry of the array, while shifting left > returns the value of the removed entry setarray([email protected], 1, 2, 3, 4, 5); // initialize the array array_shift([email protected]); // => 1 // array is now: 2, 3, 4, 5 array_unshift(<array>, <value>) adds <value> to the start of the array, while shifting right > returns the new size of the array setarray([email protected], 1, 2, 3, 4, 5); // initialize the array array_unshift([email protected], 69); // => 6 // array is now: 69, 1, 2, 3, 4, 5 array_pop(<array>) removes the last entry of the array > returns the value of the removed entry setarray([email protected], 1, 2, 3, 4, 5); // initialize the array array_pop([email protected]); // => 5 // array is now: 1, 2, 3, 4 array_push(<array>, <value>) adds <value> to the end of the array > returns the new size of the array setarray([email protected], 1, 2, 3, 4, 5); // initialize the array array_push([email protected], 69); // => 6 // array is now: 1, 2, 3, 4, 5, 69 array_shuffle(<array>) shuffles the array > returns true setarray([email protected], 1, 2, 3, 4, 5); // initialize the array array_shuffle([email protected]); // => true // array is now: 1, 4, 2, 3, 5 (example, unpredictable) array_unique(<array>{, <threshold>}) allows array entries to appear up to <threshold> times (1 by default) and removes the extraneous ones. useful to remove duplicate entries > returns the number of removed entries setarray([email protected], 1, 3, 3, 4, 5); // initialize the array array_unique([email protected]); // => 1 // array is now: 1, 3, 4, 5 array_diff(<base array>, <array>{, <array>...}, <result array>) compares the base array against one or more other arrays and fills the result array with the entries in base array that are not present in any of the other arrays > returns the number of entries not found in other arrays setarray([email protected], 1, 2, 3, 4, 5, 6, 7, 8); // initialize the base array // fill the arrays to compare with the base array: setarray([email protected], 2, 3, 4, 5, 6, 7, 8); // missing "1" setarray([email protected], 1, 2, 3, 4, 6, 7, 8); // missing "5" setarray([email protected], 1, 2, 3, 4, 5, 6, 7); // missing "8" // compare foo, bar and baz against base, and fill result: array_diff([email protected], [email protected], [email protected], [email protected], [email protected]); // => 3 // [email protected] is now: 1, 5, 8 array_filter(<array>, "<function>") filters the array using a function that is tested against every entries. if the function returns false, the relevant entry is removed and the array is shifted left > returns the number of removed entries function script is_prime { if (getarg(0) <= 1) return false; for ([email protected] = 2; [email protected] <= getarg(0) / 2; [email protected]) if ((getarg(0) % [email protected]) == 0) return false; return true; } setarray([email protected], 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); array_filter([email protected], "is_prime"); // => 9 // array is now: 2, 3, 5, 7, 11, 13 array_sort(<array>) sorts the array in ascending order > returns true setarray([email protected], 2, 1, 8, 4, 5, 7, 6, 3); // initialize the array array_sort([email protected]); // => true // array is now: 1, 2, 3, 4, 5, 6, 7, 8 array_rsort(<array>) sorts the array in descending order > returns true setarray([email protected], 2, 1, 8, 4, 5, 7, 6, 3); // initialize the array array_rsort([email protected]); // => true // array is now: 8, 7, 6, 5, 4, 3, 2, 1 Requires Hercules of June 24 2017 or newer version -------------------------------------------------------------------------------------- This script was made by me, for The Mana World + Evol. License: public domain (CC0)
  4. see array_unique() in
  5. Contribute to open source and get a free limited-edition T-shirt What's Hacktoberfest? Hacktoberfest — brought to you by DigitalOcean in partnership with GitHub and Twilio — is a month-long celebration of open source software. Maintainers are invited to guide would-be contributors towards issues that will help move the project forward, and contributors get the opportunity to give back to both projects they like, and ones they've just discovered. No contribution is too small—bug fixes and documentation updates are valid ways of participating. From October 1 to October 31, contribute to any open source project (Hercules included) on GitHub to get a free T-shirt! 5 pull requests are required. (Pull requests do not have to be merged and accepted; as long as they've been opened between the very start of October 1 and the very end of October 31, they count towards a free T-shirt.) We will be marking easy-to-tackle issues with the Hacktoberfest tag so that first time contributors can more easily find them. >> Register on hacktoberfest.digitalocean.com Resources GitHub Learning Lab How to create a Pull Request on GitHub Understanding the GitHub Flow Open source 101 Hercules documentation Hercules wiki FAQ It is free to participate? Yes! Is shipping included? Yes. DigitalOcean offers free worldwide shipping. What shirt sizes are available for Hacktoberfest 2018? DigitalOcean have not yet made public the size chart for 2018, but we know they at least offer S to 4XL sizes, for both male and female. What's included in the package? A thank you letter. A T-Shirt. A bunch of cool stickers. Do I need to register for Hacktoberfest before starting to open Pull Requests? No. You may register at any time during the month of October and DigitalOcean will count your pull requests retroactively from October 1 onwards. Do all of my Pull Requests have to be sent to the same repository? No. You may send PRs to any number of repositories you like, and as long as they are public and have an OSI-approved license they will count towards the 5+ PRs objective. Do I have to wait for the start of October to open Pull Requests? You may contribute all year long, but only PRs that are opened during the month of October will be counted.
  6. if you want double quotes to be part of a string you have to escape them "foo \"bar\" baz"
  7. the errors here are quite explicit: you are using variables that are not declared (ep, char_id); you will have to declare them in the parameters of the function or inside the function before they can be used
  8. This is a bug and is fixed in https://github.com/HerculesWS/Hercules/pull/2247 This patch should land in the next release but meanwhile you can manually apply it
  9. Thank you! Hercules would like to thank everyone who contributed for hukktoberfest 2018 linton-dawson (newcomer) (first-time contributor) akshat157 (newcomer) (first-time contributor) @Emistry (staff) @KirieZ @Dastgir (staff) IpshitaC (newcomer) (first-time contributor) @Asheraf (staff) @Kubix (first-time contributor) @Habilis (first-time contributor) 🦄 shouxian92 (first-time contributor) jvastbinder (first-time contributor) @4144 (staff) @Myriad j-chad (newcomer) (first-time contributor) MohanSha (newcomer) (first-time contributor) BinaryCrochet (newcomer) (first-time contributor) @kisuka (staff) 🐺 VictoriaLa (newcomer) (first-time contributor) List of pull requests: https://git.io/fxpL5 We hope to see you again next year! ✨🎉
  10. Just run it natively on windows: https://downloads.mariadb.org/interstitial/mariadb-10.3.10/winx64-packages/mariadb-10.3.10-winx64.msi/from/http%3A//mariadb.mirror.iweb.com/?serve Otherwise, you might want to consider WSL
  11. It's the last week of Hacktoberfest! If you’ve already completed 5 or more pull requests, you’ll be hearing from DigitalOcean via email soon for them to collect your address and t-shirt size. If you’re still working on reaching your goal, keep in mind that you may contribute to any project on GitHub, not just Hercules. (yes, even rAthena) Click here to find issues labeled "Hacktoberfest" on GitHub. Hacktoberfest values: Everyone is welcome! – This program welcomes everyone already in the open source software community, and anyone who is interested in diving in. Quantity is fun, Quality is key – Participating leads to personal growth, professional opportunities, and community building. It all starts with meaningful contributions. Short term action, long term impact – We stand on the shoulders of those who came before us. Your participation has a lasting effect long after October. Happy hukking 🎃
  12. you'll want to look into the item options system: https://github.com/HerculesWS/Hercules/blob/stable/db/item_options.conf https://github.com/HerculesWS/Hercules/blob/stable/doc/script_commands.txt#L3285
  13. @Rebel thanks for the second bug report! I have updated the pull request
  14. @Rebel this should fix your crash: https://github.com/HerculesWS/Hercules/pull/2247
  15. wow that's quite awkward then; we should definitely get rid of it I'll open a PR to remove useless usages of getd
  16. sorry, we do not provide support for rAthena, however the following should work: [email protected]_id = monster("prontera", 150, 150, "Poring", PORING, 1); setunitdata([email protected]_id, UDT_MAXHP, 100000); setunitdata([email protected]_id, UDT_HP, 100000); Also keep in mind that mob events are called upon death, not summon
  17. @Darius Trevor This is fixed in https://github.com/HerculesWS/Hercules/pull/2240 but please use constants directly instead of using getd
  18. ARCH_MERC_GUILD, SPEAR_MERC_GUILD and SWORD_MERC_GUILD are hardcoded constants, so you cannot use them as variable Instead of doing something like this to get their values: setarray([email protected]$, "SPEAR_MERC_GUILD", "SWORD_MERC_GUILD", "ARCH_MERC_GUILD"); ... getd([email protected]$[1]) Just use the plain constants: setarray([email protected], SPEAR_MERC_GUILD, SWORD_MERC_GUILD, ARCH_MERC_GUILD); ... [email protected][1]
  19. setunitdata() was added in April 2017, so if you have a recent version of Hercules you should already have it. You can find the documentation in doc/script_commands.txt
  20. Since Hercules now uses LGTM, If you fix code quality issues during the month of October, Semmle (the company behind LGTM) will donate $3 to the World Wildlife Fund (WWF) to protect endangered species for every point you obtain. You can also win nice prizes, such as a free ticket to GitHub Universe 2018 (including travel and accommodation), a Holy Stone HS160 Shadow FPV camera drone, or a Raspberry PI 3 B+ Starter Kit development board. Points will only be awarded for fixes that reach the main branch of a project’s repository (i.e. for Pull Requests that are merged), and will be awarded as follows: 1 point per recommendation, 3 points per warning, and 5 points per error fixed. Since Hercules has automatic code review enabled, then points awarded for fixes will be 3x the normal amount. This means 3 points, 9 points, and 15 points. So for example, if a participant fixes 3 errors, they will be awarded 45 points ((3 * 5) * 3), and Semmle will donate $135 to WWF. >>>> Register on https://competitions.lgtm.com/ghu-2018
  21. @MikZ this PR should fix your issue: https://github.com/HerculesWS/Hercules/pull/2227
  22. @MikZ yes, nevermind, it seems this function is actually called from pc.c when a player spends or obtains zeny. I'll submit a patch shortly
  23. this script does not use queuesize() so it cannot trigger this warning, this means your issue is in another script, not this one
  24. db/(pre-)re/achiemement_db.conf
  25. 'amount ! =0! in function 'achievement_validate_zeny this is pretty explicit, it means you put a zeny achievement in the achievement db with Goal: 0, which is invalid, because players cannot spend -0 or gain +0 zeny