Results 1 to 8 of 8

Thread: get_property question

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

    Default get_property question

    PHP Code:
    if ($item[Thor's Pliers].available_amount() >= 1 && get_property("_thorsPliersCrafting") == 0)
        { bat_jacket = bat_jacket + 10;    }
    if ($item[Thor'
    s Pliers].available_amount() >= && get_property("_thorsPliersCrafting") == 1)
        { 
    bat_jacket bat_jacket 9;    }
    if (
    $item[Thor's Pliers].available_amount() >= 1 && get_property("_thorsPliersCrafting") == 2)
        { bat_jacket = bat_jacket + 8;    } 
    I won't post the whole thing. Is there an easier way to get the number I'm looking for?
    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
    Join Date
    Jun 2016
    Posts
    330

    Default

    10 - get_property("_thorsPliersCrafting").to_int() ?

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

    Default

    10 - get_property("_thorsPliersCrafting").to_int() ?
    Originally Posted by the dictator View Post
    Of course it's that easy. I'm so good at making scripts work harder than they have to. In case anyone's interested, here's a way to use your free crafting everyday to make some wads.

    PHP Code:
    int bat_jacket;
    bat_jacket 0;
    int borrow_knife 0;
    string campground visit_url("campground.php?action=workshed");
        if (
    campground.contains_text("warbear auto-anvil"))
            {
            
    bat_jacket += get_property("_warbearAutoAnvilCrafting").to_int();
            }
        if (
    $item[loathing legion knife].available_amount() == && get_property("_legionJackhammerCrafting") == 0)
            {
            
    refresh_stash();
            
    take_stash(1$item[loathing legion knife]);
            
    cli_execute("fold loathing jackhammer");
            
    borrow_knife 1;
            }
        if (
    $item[loathing legion knife].available_amount() >= )
            {
            
    bat_jacket += get_property("_legionJackhammerCrafting").to_int();
            
    cli_execute("fold loathing jackhammer");
            }
        if (
    $item[Thor's Pliers].available_amount() >= 1)
            {
            bat_jacket += 10 - get_property("_thorsPliersCrafting").to_int();
            }
        if (have_skill ($skill[Inigo'
    s Incantation of Inspiration]))
            {
            
    cli_execute("cast 5 Inigo's Incantation of Inspiration");
            
    bat_jacket += get_property("_inigosCasts").to_int();
            }
        if (
    $item[Cuppa Craft tea].available_amount() >= 1)
            { 
            
    cli_execute("use 1 cuppa craft tea");
            
    bat_jacket bat_jacket 6
            }
        if (
    have_skill ($skill[Rapid Prototyping]))
            {
            
    bat_jacket += get_property("_rapidPrototypingUsed").to_int();
            }
        if (
    have_skill ($skill[Expert Corner-Cutter]))
            {
            
    bat_jacket += get_property("_expertCornerCutterUsed").to_int();
            }

        
    cli_execute("buy " bat_jacket " leathery bat skin");
        
    cli_execute("create " bat_jacket " bat-ass leather jacket");
        
    cli_execute("smash " bat_jacket " bat-ass leather jacket");
        
    bat_jacket 0;

    if (
    borrow_knife == 1)
        {
        
    cli_execute("fold loathing knife");
        
    put_stash(1$item[loathing legion knife]);
        
    borrow_knife 0;
        }

        
    bat_jacket 0;

    if (
    $item[loathing legion jackhammer].available_amount() >= 1)
        {
        
    cli_execute("fold loathing knife");
        } 
    I use this as part of my daily script now. Along with running all my free turns, and casting all skills I can.
    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.

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

    Default

    Paz - your Inigo logic is a bit off. You want to cast 5-get_property("_inigosCasts").to_int() times, then craft based on have_effect($effect[Inigo's Incantation of Inspiration])

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

    Default

    haha, thanks ckb, ill fix it when I return from vacation on tuesday

  6. #6
    Senior Member
    Join Date
    Apr 2018
    Posts
    262

    Default

    Wait, to_int() is a type method of strings in ASH? I thought it was just a pure function.

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

    Default

    Wait, to_int() is a type method of strings in ASH? I thought it was just a pure function.
    Originally Posted by Saklad5 View Post
    to_int() is how ASH loads a "string" (integer actually) of numbers.
    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.

  8. #8
    Developer fronobulax's Avatar
    Join Date
    Feb 2009
    Location
    Central Virginia, USA
    Posts
    4,339

    Default

    See https://wiki.kolmafia.us/index.php?t..._For_Beginners

    Furthermore, there are two distinct ways to call functions, user-defined or built-in:
    Conventional,

    function(param1[,param2,param3,...]);

    and "Java style":

    param1.function([param2,param3,...]);

    The only difference between the two forms is aesthetics, as they are functionally equivalent.

Posting Permissions

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