get_property question

Pazleysox

Member
PHP:
if ($item[Thor's Pliers].available_amount() >= 1 && get_property("_thorsPliersCrafting") == 0)
	{ bat_jacket = bat_jacket + 10;	}
if ($item[Thor's Pliers].available_amount() >= 1 && 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?
 

Pazleysox

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

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:
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 += 5 - get_property("_warbearAutoAnvilCrafting").to_int();
		}
	if ($item[loathing legion knife].available_amount() == 0 && 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() >= 1 )
		{
		bat_jacket += 3 - 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 += 5 - 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 += 5 - get_property("_rapidPrototypingUsed").to_int();
		}
	if (have_skill ($skill[Expert Corner-Cutter]))
		{
		bat_jacket += 5 - 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.
 

ckb

Minion
Staff member
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])
 
Top