Results 1 to 3 of 3

Thread: in_multi_fight

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

    Default in_multi_fight

    I'm running free turns with Eldritch Attunement active, so I can max out my free fights.

    PHP Code:
        {
            if (
    have_familiar($familiar[machine elf]))
                {
                
    cli_execute("familiar machine elf");
                }
            {
            while (
    to_int(get_property("_machineTunnelsAdv")) < )
            
    adv1($location[The Deep Machine Tunnels],-1,"");
            }
        } 
    I'm getting this: You are currently in a multi-stage fight after every single fight today.

    I've added this to my script:
    PHP Code:
            if(in_multi_fight())
                {
                
    run_combat();
                } 
    Into the script here, so it looks like this now:
    PHP Code:
            while (to_int(get_property("_machineTunnelsAdv")) < )
            
    adv1($location[The Deep Machine Tunnels],-1,"");
            if(
    in_multi_fight())
                {
                
    run_combat();
                }
             } 
    I have also changed IF to WHILE, and get the same results. I'm getting this error only from this location. I don't have the (in_multi_fight()) anywhere else in my script.

    Can anyone help me with this?
    Scripts I have written:
    Unlock Dread A Script to save you a bunch of clicks.
    Standard Rollover Bonus A Script that shows best items to pull/equip for bonus turns.
    Standard PVP Bonus A Script that shows the best items to pull/equip for bonus PVP Fights.
    Rollover Management A Script that does all the daily deeds you might have forgotten, or might have missed.
    Chatbot A Chatbot script. Simple start for those who want/need one for their clan.
    Zap Wand A Dungeon of Doom ZAP WAND getting script.

  2. #2
    Senior Member Pazleysox's Avatar
    Join Date
    Feb 2009
    Posts
    384

    Default

    PHP Code:
        {
            if (
    have_familiar($familiar[machine elf]))
                {
                
    cli_execute("familiar machine elf");
                }
            {
            while (
    to_int(get_property("_machineTunnelsAdv")) < )
            
    adv1($location[The Deep Machine Tunnels],-1,"");
            }
        } 
    Originally Posted by Pazleysox View Post
    I think my error stems from having this whole thing inside "{}" I removed it from another location on the script, and have no issues, and don't have anything else like that. I'll have to check tomorrow when I have more free fights.

    EDIT: That might not be the issue. I think there's a problem with having the machine elf as your familiar. I had the same issue elsewhere when the script (had a bug) used the machine elf as my familiar. When it was fixed, it ran fine. Still... More into tomorrow when I can research it.
    Last edited by Pazleysox; 12-26-2018 at 02:18 PM. Reason: machine elf
    Scripts I have written:
    Unlock Dread A Script to save you a bunch of clicks.
    Standard Rollover Bonus A Script that shows best items to pull/equip for bonus turns.
    Standard PVP Bonus A Script that shows the best items to pull/equip for bonus PVP Fights.
    Rollover Management A Script that does all the daily deeds you might have forgotten, or might have missed.
    Chatbot A Chatbot script. Simple start for those who want/need one for their clan.
    Zap Wand A Dungeon of Doom ZAP WAND getting script.

  3. #3
    Senior Member
    Join Date
    Jun 2016
    Posts
    283

    Default

    The problem is actually a lack of curly bracers, to wrap the check into the while loop. If you don't follow a while or if statement with curly bracers it will only cover the first command right after, so right now, it's trying to visit the location repeatedly, and only after that while loop finishes, it will go and check to see if it's still in a multifight.

    My free fight script, for some examples/inspiration: https://pastebin.com/kzvL8DT2

    The relevant part for you, with comments:
    Code:
    void MachineElf() {
        if(have_familiar($familiar[Machine Elf]) && $familiar[Machine Elf].fights_today < $familiar[Machine Elf].fights_limit)
        {
            HeavyRains($familiar[Machine Elf].fights_limit-$familiar[Machine Elf].fights_today+1);
            if (have_effect($effect[Inside The Snowglobe])!=0)
                cli_execute("uneffect Inside The Snowglobe"); // My autoattack is setup to automatically run away if I have that effect in the deep machine tunnels, since it happens when I'm in there with my stomping boots
            FreeDrops("item, exp, 0.25 mainstat, 10000 max");
            use_familiar($familiar[Machine Elf]);
            while($familiar[Machine Elf].fights_today < $familiar[Machine Elf].fights_limit) { // <- Note this bracket
                adv1($location[The Deep Machine Tunnels], -1, "");
                while ( in_multi_fight() )
                    run_combat();
            } // <- And his brother over here
        }
    }
    Last edited by the dictator; 12-26-2018 at 09:31 PM.

Posting Permissions

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