Page 2 of 2 FirstFirst 1 2
Results 11 to 14 of 14

Thread: if(!in_hardcore()) question

  1. #11
    Minion Bale's Avatar
    Join Date
    Jun 2008
    Posts
    13,250

    Default

    As soon as an if() is true, it won't bother with the else.

    In other words...

    if($item[solid shifting time weirdness].available_amount() > 0 &&(!in_hardcore()))
    else... who cares?

    Solution? Remove the word else and just have a succession of unconnected if statements.

  2. #12
    Senior Member Crowther's Avatar
    Join Date
    Nov 2006
    Posts
    1,344

    Default

    I think you might want to use "can_interact()" instead of "!in_hardcore()". The player might be hardcore for life, but it seems more accurate.

  3. #13
    Developer
    Join Date
    Apr 2010
    Posts
    3,995

    Default

    Personally I just shortcircuit all that with :

    maximize("adv, 0.1 pvp fights +switch trick-or-treating tot", false);
    Can add +switch disembodied hand in if you want to consider time sword too, and can always weight adventures and fights differently.

  4. #14
    Senior Member ckb's Avatar
    Join Date
    Mar 2006
    Posts
    701

    Default

    That looks... way more complicated than it needs to be.
    First, you are using 'else if', so it will stop after the first check that evaluates true. So if you have a time shifting weirdness, and not a hand+time sword, it will stop there.
    Second, Mafia can maximize with familiars too, if you tell it to.
    Try this:

    PHP Code:
        print ("Maxamizing turn count... This might take a moment, we have a lot to check...""Blue");
        if(
    $item[li'l unicorn costume].available_amount()==0 && have_familiar($familiar[Trick-or-Treating Tot])) {
            buy(1,$item[li'
    l unicorn costume]);
        }
        
    maximize("adv, +switch Disembodied Hand, +switch Trick-or-Treating Tot"false);
        print(
    "Finished checking for rollover adventures.""green"); 
    edit: triple ninja'ed!

Posting Permissions

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