Page 1 of 2 1 2 LastLast
Results 1 to 10 of 13

Thread: Dungeon of Doom script

  1. #1
    Senior Member Pazleysox's Avatar
    Join Date
    Feb 2009
    Posts
    363

    Default Dungeon of Doom script

    I'm working on a script that can get the ZAP Wand for you.

    I know that choice Adventure 3 is the one to pay the Oracle. After you pay the Oracle, the + Plus sign becomes useable. I'm pretty sure Mafia will auto use it once it's able (This is incorrect come to find out)

    I'm trying to put in a check to see if a choice adventure has been run. I looked at the wiki, and I think I see a way...

    Question: How do I un-equip an item, or re-equip a previous item?
    Last edited by Pazleysox; 04-19-2018 at 04:13 PM.

  2. #2
    Senior Member AlbinoRhino's Avatar
    Join Date
    May 2008
    Posts
    812

    Default

    1.
    get_property("lastPlusSignUnlock") == my_ascensions()


    2.
    item prev = equipped_item($slot[SLOTNAME]);
    equip($slot[SLOTNAME], $item[none]):
    ...
    equip($slot[SLOTNAME], prev):

  3. #3
    Senior Member Pazleysox's Avatar
    Join Date
    Feb 2009
    Posts
    363

    Default

    This is harder than I thought...

    Trying to figure out how to run 1 adventure, then do a check.

    Heres my script so far.
    PHP Code:
    void DOD()
    {
        if (
    my_meat() < 5000)
        {
        print(
    "You need atleast 5000 meat to finish this quest.");
        }
        
    set_property("choiceAdventure25"2); // Pay 5k to buy cloak
        
    add_item_condition (0$item[dead mimic]);
        
    adventure(my_adventures(), $location[Dungeons of Doom]);
        if (
    $item[dead mimic].available_amount() == 1)
        {
        print(
    "Congrats, You've got a dead mimic!  Now use it, and Zap stuff!");
        exit;}
        if (
    $item[dead mimic].available_amount() == 0)
        {
        
    DOD();
        }
    }

    void EGTS()
        {

    string dungeon visit_url("da.php");
        if (
    dungeon.contains_text("The Dungeons of Doom"))
            {
            
    DOD();
            }
    int count;
        
    set_property("choiceAdventure3"3); // Pay 1k to oracle
        
    if ($item[plus sign].available_amount() == 0)
            {
            
    set_property("choiceAdventure451"3); // Get + Plus Sign
            
    add_item_condition (1$item[plus sign]);
            }
        if (
    $item[plus sign].available_amount() == 1)
            {
            
    cli_execute("use plus sign");
            
    set_property("choiceAdventure451"5); // Get teleportitis
            
    }
        if(
    can_interact() && my_meat() > 100000 && $item[ring of teleportation].available_amount() == 0// only buy if you have 100k meat or more
            
    {
            
    cli_execute("buy ring of teleportation");
            
    item prev equipped_item($slot[acc1]);
            
    equip($slot[acc1], $item[ring of teleportation]);
            }
        if (
    $item[potion of teleportitis].available_amount() == && $item[ring of teleportation].available_amount() == && have_effect($effect[teleportitis]) == 0)
            {
            
    cli_execute("buy potion of teleportitis"); // on the chance we already know what the ! potions are...
            
    cli_execute("use potion of teleportitis");
            }
        if (
    $item[potion of teleportitis].available_amount() >= && $item[ring of teleportation].available_amount() == && have_effect($effect[teleportitis]) == 0
            {
            
    cli_execute("use potion of teleportitis");
            }
        
    adventure(my_adventures(), $location[The Enormous Greater-Than Sign]);
            
    EGTS();
        }

    void main()
    {
    //Zap wand Script
        
    if (my_meat() <= 5999)
        {
        print(
    "You need 6000 meat or more to complete this part of the quest.  Please gain some meat and try again");
        exit;
        }
    string dungeon visit_url("da.php");
        if (
    dungeon.contains_text("The Enormous Greater-Than Sign"))
            {
            
    EGTS();
            }
        if (
    dungeon.contains_text("The Dungeons of Doom"))
            {
            
    DOD();
            }

    Last edited by Pazleysox; 04-19-2018 at 05:07 PM.

  4. #4
    Senior Member AlbinoRhino's Avatar
    Join Date
    May 2008
    Posts
    812

    Default

    This is harder than I thought...

    Trying to figure out how to run 1 adventure, then do a check.
    Originally Posted by Pazleysox View Post
    http://wiki.kolmafia.us/index.php?title=Adventure
    adventure(1, $location[LOCATION NAME]);

    or

    http://wiki.kolmafia.us/index.php?title=Adv1
    adv1($location[LOCATION NAME], -1, "");


    Do a check for what? The plus sign being used? See my last post.

  5. #5
    Senior Member Pazleysox's Avatar
    Join Date
    Feb 2009
    Posts
    363

    Default

    http://wiki.kolmafia.us/index.php?title=Adventure
    adventure(1, $location[LOCATION NAME]);

    or

    http://wiki.kolmafia.us/index.php?title=Adv1
    adv1($location[LOCATION NAME], -1, "");


    Do a check for what? The plus sign being used? See my last post.
    Originally Posted by AlbinoRhino View Post
    Sorry, I meant, run 1 turn, check for a plus sign in inventory, run another turn, check for plus sign, etc. I posted the script that I've written so far.

    Here's a snippet of what I'm essentially trying to do:
    PHP Code:
    void EGTS()
     if(
    $item[plus sign].available_amount 0)
       { (
    get teleportitis/use plus sign) }
        
    adventure(1$location[The Enormous Greater-Than Sign]);
            
    EGTS(); // loop back around to see if I have plus sign yet.  If not, run another adventure.
        

    Mafia only runs 1 turn though, then aborts saying conditions not met...

  6. #6
    Senior Member AlbinoRhino's Avatar
    Join Date
    May 2008
    Posts
    812

    Default

    Can't you use a goal, as you did with the dead mimic?

    i.e. add_item_condition (1, $item[plus sign]);

    ​Then just adventure until you get it?

    PHP Code:
    add_item_condition (1$item[plus sign]);
    adventure(my_adventures(), $location[The Enormous Greater Than Sign]);

    if (
    item_amount($item[plus sign]) > 0)
    {
       ....

    Last edited by AlbinoRhino; 04-19-2018 at 05:59 PM.

  7. #7
    Senior Member Pazleysox's Avatar
    Join Date
    Feb 2009
    Posts
    363

    Default

    Can't you use a goal, as you did with the dead mimic?
    Originally Posted by AlbinoRhino View Post
    Hmm... I'll look into this again tomorrow, when I can try again. I ran into some strange problems today that I need to try and replicate.

  8. #8
    Senior Member ckb's Avatar
    Join Date
    Mar 2006
    Posts
    817

    Default

    Also, you can run adventures in while loops.

    PHP Code:
    while (item_amount($item[plus sign])==0) {
       
    adventure(1$location[The Enormous Greater Than Sign]);


  9. #9
    Senior Member Pazleysox's Avatar
    Join Date
    Feb 2009
    Posts
    363

    Default

    Is there a way to set a condition of getting a non-combat? I need to make sure the script sees the oracle before it can use the plus sign.

    I did find this page about run_choice, but I don't fully understand it. I tried to use it, but it didn't work like I thought.

    Code:
    int run_adv(location place)
    should (location place) be (location "Enormous Greater Than Sign") with "", or without?
    or should it be run_adv((Enormous Greater...) without location?

    Sorry if i'm asking too many questions. I learn best this way. I try to bull my way through things, lol.
    Last edited by Pazleysox; 04-20-2018 at 12:13 AM.

  10. #10
    Senior Member AlbinoRhino's Avatar
    Join Date
    May 2008
    Posts
    812

    Default

    "location place" Refers to data of the mafia $location[] ( http://wiki.kolmafia.us/index.php?title=Data_Types ) data type, which is named 'place'.

    so... run_adv($location[LOC_NAME])

    or... location myloc = $location[LOC_NAME]; ..and then... run_adv(myloc);

    As far as knowing if a choice adventure has occurred:

    There is the mafia property "lastEncounter" that can be checked via get_property().

    Also, each location has a combat & noncombat queue proxy.

    So... myloc.combat_queue.contains_text("MONSTER_NAME") (or you can use index_of() > -1, if you like)
    or... myloc.noncombat_queue.contains_text("CHOICE_OR_NON COMBAT_ADV_NAME")

    Or, again, you could do:
    $location[LOC_NAME].combat_queue.contains_text("MONSTER_NAME") etc...

    Edit:
    You can type "ash $location[LOC_NAME]" into the cli to see what proxy fields are available for locations and their values for the location you chose.



    Similarly,

    ash $item[ITEM]
    or
    ash $coinmaster[CM_NAME]
    or
    ash $skill[SKILL_NAME]
    or
    ash $effect[EFFECT_NAME]


    etc., for the mafia data types described on the page I linked.

    Edit, example:


    PHP Code:
    ash $location[The Enormous Greater-Than Sign]

    Returned:     The Enormous Greater-Than Sign
    nocombats 
    => false
    zone 
    => Dungeon
    parent     
    => Mountain
    parentdesc 
    => Big Mountains
    environment 
    =>     underground
    bounty 
    => none
    combat_queue 
    =>
    noncombat_queue     =>
    turns_spent => 0
    kisses 
    => 0
    recommended_stat 
    => 44
    water_level     
    => 
    I haven't played any turns there so those queues are empty.
    Last edited by AlbinoRhino; 04-20-2018 at 12:46 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
  •