Search results

  1. philmasterplus

    Bug JavaScript bugs

    Unfortunately, the arguments object is still a thing. function main() { print("I got " + arguments.length + " arg(s)"); } In this case, should KoLmafia ask the user for the argument(s)? If so, it would have to statically analyze the code for uses of "arguments"--which is probably brittle.
  2. philmasterplus

    Bug JavaScript bugs

    What you're looking for is probably difficult to achieve. Between default parameters, the arguments object, and rest parameters (...args), it's practically impossible to guess the answer to "how many arguments does this function need?" If you want to accept multiple arguments, you could try...
  3. philmasterplus

    Philter, the inventory cleanup script

    That would be neat. I'll have to figure out how an operation like this (select multiple & edit) could be implemented. Please understand that my backlog is getting somewhat long, so a change would take some time to arrive.
  4. philmasterplus

    Mysticality Farming in Bathroom request

    First, what do you mean by "mysticality farming"? If you're looking to power level, just set up the noncombat choices and use KoLmafia's auto-adventuring feature. No scripting needed. Second, why would someone want to spend their valuable time for you when you're hesitant to spend yours? Had...
  5. philmasterplus

    What functions are treated as assertions?

    That sounds tricky to describe without knowledge of KoLmafia's internal mechanics. Suppose I want to prevent my code from aborting. Is there a rule of thumb that I can use to decide which functions to capture?
  6. philmasterplus

    Bug - Fixed Nemesis Quest tracking property is not updated upon quest start

    KoLmafia version: r20783 When starting the Nemesis Quest by visiting your guild's "same class guy" (guild.php?place=scg) NPC as an Accordion Thief, the quest property (questG04Nemesis) is not set to started. Looking at QuestManager.java, it appears that some checks are missing or handled...
  7. philmasterplus

    What functions are treated as assertions?

    I recently learned that some built-in ASH functions behave like assertions when their return values are not used: // Abort the script if it fails to retrieve the item retrieve_item(1, $item[ mae west ]); // Don't abort the script even if it fails to retrieve the item boolean result =...
  8. philmasterplus

    Bug - Fixed JavaScript code cannot call custom ASH function under special circumstances

    Looks like the section was added a long time ago by @Bale. Is there a list of "assertive" functions that exhibit this behavior (i.e. sets interpreter state to RETURN)? Or would I have to dive into LibraryFunctions.java and check each method? I appreciate your idea, but I believe exceptions make...
  9. philmasterplus

    Bug - Fixed JavaScript code cannot call custom ASH function under special circumstances

    I actually tested using r20781, but the following code now sends two kmails instead of one: js const { kmail } = require('zlib.ash'); kmail(myName(), 'test1', 0); kmail(myName(), 'test2', 0); Your fix didn't include heeheehee's patch, but somehow killed two birds with one stone.
  10. philmasterplus

    Bug - Fixed JavaScript code cannot call custom ASH function under special circumstances

    Thanks. I just checked r20780 and it fixes both the original issue (skipping function calls) and the throwing-instead-of-returning-false problem.
  11. philmasterplus

    Bug - Fixed JavaScript code cannot call custom ASH function under special circumstances

    I tested your patch and it makes the code in #1 work correctly. It also made sending multiple kmails possible: const { kmail } = require('zlib.ash'); kmail(myId(), 'test1', 0); kmail(myId(), 'test2', 0); I ran my daily farming script and Philter--both are JavaScript scripts that rely on many...
  12. philmasterplus

    Bug - Fixed JavaScript code cannot call custom ASH function under special circumstances

    @heeheehee Thanks, I'll try the patch tomorrow when I have the time. @Veracity Thanks for the info. I already suspected that there was a reason why ASH was implemented so. I already knew that a change is impossible since plenty of code depend on the current behavior. Looking back, I regret that...
  13. philmasterplus

    Bug - Fixed JavaScript code cannot call custom ASH function under special circumstances

    Huh. @gausie recently pointed out that function calls in ASH have different semantics depending on their position (standalone expression vs rhs of an assignment). E.g. retrieve_item(a); will abort immediately on failure, but boolean stuff = retrieve_item(a); won't. I personally dislike this and...
  14. philmasterplus

    New Content - Implemented IOTM - May 2021 - Shortest-Order Cook

    Shorter-Order Cook is marked as combat0,delevel in familiars.txt. Since it also deals prismatic damage and drops items, could we add combat1,drop to its type?
  15. philmasterplus

    Bug - Fixed JavaScript code cannot call custom ASH function under special circumstances

    KoLmafia version: r20777 When calling a custom ASH function from JavaScript, the function call is "skipped" when the ASH function meets certain conditions. I have an ASH script named test-lib.ash that defines a function: // test-lib.ash void speak(string message) { int unused...
  16. philmasterplus

    Philter, the inventory cleanup script

    You're supposed to run the cleanup command. Enter ocd-cleanup in the gCLI. (The new command is philter, but it's under development)
  17. philmasterplus

    ZLib -- Zarqon's useful function library

    Request: Can we deprecate (and eventually remove) equals(str1, str2)? It's supposed to case-sensitively compare two strings, but is now redundant because the == operator became case-sensitive in KoLmafia r16180. This was 6 years ago, and I doubt anyone is using equals() now. I'm submitting a...
  18. philmasterplus

    ZLib -- Zarqon's useful function library

    I used autoBasement last year, so there's one data point. The topic of maintaining old scripts would probably belong to this thread. Abandoned projects could be moved to Github under the LASS org to allow multiple people to contribute. Admittedly, contacting people who no longer play is often...
  19. philmasterplus

    Feature git based script checkout

    Looking at other package managers... Cargo (from Rust) supports git URLs, optionally with branches or tags: cargo install --git https://github.com/my-org/project-foo.git cargo install --git https://github.com/my-org/project-foo.git --branch my-branch cargo install --git...
  20. philmasterplus

    Feature git based script checkout

    Awesome work! But we should first review why everyone wants to check out/clone subdirectories, and why some projects are using release branches. It's because KoLmafia enforces a strict rule on the directory structure. We can't have READMEs, package.jsons, or even .gitignore files. This could...
Back
Top