Page 1 of 3 1 2 3 LastLast
Results 1 to 10 of 26

Thread: Actually Ed and consult scripts: failure when hitting underworld entrance

  1. #1
    Senior Member
    Join Date
    Jun 2011
    Posts
    414

    Default Actually Ed and consult scripts: failure when hitting underworld entrance

    So I've only recently started playing around with a consult script. And I'm running up against a wall where the script is still trying to run, even when Mafia hits the Underworld entrance choice adventure.

    My script reads:
    Code:
    void main(int round, monster foe, string page) {
        use_skill($skill[Storm of the Scarab]);
    }
    This works fine anytime I win the combat before dying. But when I die, and Mafia hits the Underworld choice adventure, it spits out: You don't have a skill uniquely matching "1 Storm of the Scarab". Then I have to run through the choice manually, via the Relay Browser, and run the script again when I'm back in combat.

    If the script would just hand control back off, Mafia would navigate the choice adventure correctly, and return me to combat. (It was doing this correctly before I was using a consult script). But it looks like the script is still trying, and failing, to run the choice adventure on its own.

    How can I fix this? Can I tell the script to stop without using abort(), which will stop Mafia altogether?

  2. #2
    Senior Member
    Join Date
    Oct 2014
    Posts
    172

    Default

    Deleted
    Last edited by cheesecookie; 03-29-2015 at 01:49 AM.

  3. #3
    Senior Member
    Join Date
    Jun 2011
    Posts
    414

    Default

    If you add a check that you have the skill first, does that help?

    Code:
    if(have_skill($skill[Storm of the Scarab]))
    {
        use_skill($skill[Storm of the Scarab]);
    }
    Originally Posted by cheesecookie View Post
    Thanks for the suggestion. Unfortunately, that throws the same error.

    If your consult script isn't long, you could convert it to a combat filter and use that. It won't fail this situation since it does not directly try to invoke the skill but rather it returns the string "skill storm of the scarab" when it would be called.
    Originally Posted by cheesecookie View Post
    I think that I'd have to be adventuring with adventure(int, location, string) in order to use a combat filter, right? I'm just trying to get this consult script to work when adventuring either through the relay browser, or with Mafia's Adventure tab.

  4. #4
    Senior Member Theraze's Avatar
    Join Date
    Mar 2010
    Posts
    8,743

    Default

    The problem from an end-user standpoint is that it appears to believe that the combat is continuing while in the underworld. When it tries to continue the combat and fails, you either get that sort of error or one regarding being overdrunk.

  5. #5
    Senior Member
    Join Date
    Jun 2011
    Posts
    414

    Default

    The problem from an end-user standpoint is that it appears to believe that the combat is continuing while in the underworld. When it tries to continue the combat and fails, you either get that sort of error or one regarding being overdrunk.
    Originally Posted by Theraze View Post
    Exactly right. If Mafia could tell that the combat was over, and take control back from the script, it could navigate the choice correctly.

    It occurred to me that I could detect the choice adventure in-script; after all, the script has the page HTML. But I'm not sure how to tell the script to select one of the options at that choice adventure. Hmm...

  6. #6
    Senior Member Theraze's Avatar
    Join Date
    Mar 2010
    Posts
    8,743

    Default

    I believe it's already actually supposed to do that and default to fighting the battle twice before it aborts to the underworld choice. The problem appears to be that it doesn't use that when coming from a consult script, but only with simple actions.

  7. #7
    Senior Member
    Join Date
    Jun 2011
    Posts
    414

    Default

    I believe it's already actually supposed to do that and default to fighting the battle twice before it aborts to the underworld choice. The problem appears to be that it doesn't use that when coming from a consult script, but only with simple actions.
    Originally Posted by Theraze View Post
    Yep. My installation of Mafia handles this just fine when it's running combat based on a CCS. It will navigate through the choice adventure correctly, as determined by my _edDefeats and edDefeatAbort preferences. But it never gets to that point when using a consult script.

    With a little more research, it looks like I could call visit_url("choice.php?pwd&whichchoice=1023&option= 2") to navigate through the choice? Hmm... I'll have to try that.
    Last edited by PaladinWhite; 03-23-2015 at 01:46 PM.

  8. #8

    Default

    Or you can use run_choice(2).

  9. #9
    Senior Member
    Join Date
    Jun 2011
    Posts
    414

    Default

    Okay, hard-coding the choice visit into the script worked. So now it reads:

    Code:
    void main(int round, monster foe, string page) {
        if(contains_text(page, "Like a Bat Into Hell")) {
            visit_url("choice.php?pwd&whichchoice=443&option=2");
        }
        else use_skill($skill[Storm of the Scarab]);
    }
    I'm still perplexed as to why it doesn't work natively, but this is a not-too-kludgy workaround. Woohoo! Thanks for the input, everyone.
    Last edited by PaladinWhite; 03-23-2015 at 01:48 PM.

  10. #10
    Senior Member Theraze's Avatar
    Join Date
    Mar 2010
    Posts
    8,743

    Default

    Since this is actually a bug report, could this thread be moved to the proper board? There is a hackish workaround, but two facts remain:
    1) This is a mafia bug where consult scripts don't properly pass their handling to the choice handler when dying in Ed-runs, and
    2) This is not a CCS script for the repository and so is currently in the wrong place.

Similar Threads

  1. Feature - Implemented random_attributes not being passed to consult scripts
    By DoctorRotelle in forum Bug Reports
    Replies: 7
    Last Post: 05-25-2015, 04:38 AM
  2. Feature - Implemented Duplicate scripts cause "not found" error for consult scripts
    By nightslide in forum Bug Reports
    Replies: 6
    Last Post: 06-10-2013, 07:07 PM
  3. Multiple consult scripts?
    By fxer in forum Scripting Discussion
    Replies: 2
    Last Post: 03-04-2013, 08:43 PM
  4. Replies: 0
    Last Post: 05-06-2010, 06:14 AM
  5. Passing variables to consult scripts from the ccs
    By Captain Kirk in forum Custom Combat Settings
    Replies: 0
    Last Post: 08-17-2008, 05:53 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •