Pulling outfits from Hagnks

Heyas

Anyone know if using "pull Swashbuckling Getup", for example, will pull the entire swashbuckling getup, regardless of whatever parts of swashbuckling getup you may already have in inventory?
 

jasonharper

Developer
The command would actually be "pull outfit swashbuckling getup", and of course it only pulls the parts you don't already have in inventory.
 
Ok, cool.. but!


if (pulls_remaining() > 0) {
print("You still have " + pulls_remaining() + " pulls you can make today.");

if (my_level() >= 4 ) {
cli_execute("pull outfit Knob Goblin Harem Girl Disguise");
}

if (my_level() >= 7 ) {
item_to_pull = "Miner's helmet";
if ( (pulls_remaining() > 0) && (storage_amount(item_to_pull) > 0) && (item_amount($item[item_to_pull] = 0)) )
cli_execute("pull " + item_to_pull;

string item_to_pull = "7-Foot Dwarvern mattock";
if ( (pulls_remaining() > 0) && (storage_amount(item_to_pull) > 0) && (item_amount($item[item_to_pull] = 0)) )
cli_execute("pull " + item_to_pull;

item_to_pull = "Miner's pants";
if ( (pulls_remaining() > 0) && (storage_amount(item_to_pull) > 0) && (item_amount($item[item_to_pull] = 0)) )
cli_execute("pull " + item_to_pull;
}

I can now get the outfit pull working (I think), thanks to your syntax.. but the individual ones are giving me gyp.

I think the "storage amount" syntax is wrong but I can't figure out where.. :S
 

Grotfang

Developer
There are a lot of problems with that code snippet. Please, please, please verify your code in mafia - it tells you the line that your first problem arises so you can correct it.

Problems:

  • Keep datatypes clear and make sure you define them. item_to_pull should be an item, not a string. Convert later.
  • Close your parentheses after opening them. cli_execute frequently left them open. In addition, don't add additional closing parentheses where you hadn't opened them.
  • Spell items correctly. Dwarven, not dwarvern.
  • Comparing equality needs ==, not =.

Corrected code:

Code:
if( pulls_remaining() > 0 )
{
	print( "You still have " + pulls_remaining() + " pulls you can make today." );
	if( my_level() >= 4 )
	{
		cli_execute( "pull outfit Knob Goblin Harem Girl Disguise" );
	}
	if( my_level() >= 7 )
	{
		item item_to_pull = $item[Miner's helmet];
		if( ( pulls_remaining() > 0 ) && ( storage_amount( item_to_pull ) > 0 ) && ( item_amount( item_to_pull ) == 0 ) )
			cli_execute( "pull " + item_to_pull.to_string() );

		item_to_pull = $item[7-Foot Dwarven mattock];
		if( ( pulls_remaining() > 0 ) && ( storage_amount( item_to_pull ) > 0 ) && ( item_amount( item_to_pull ) == 0 ) )
			cli_execute( "pull " + item_to_pull.to_string() );

		item_to_pull = $item[Miner's pants];
		if( ( pulls_remaining() > 0 ) && ( storage_amount( item_to_pull ) > 0 ) && ( item_amount( item_to_pull ) == 0 ) )
			cli_execute( "pull " + item_to_pull.to_string() );
	}
}

Simpler format:

Code:
if( pulls_remaining() > 0 )
{
	print( "You still have " + pulls_remaining() + " pulls you can make today." );
	if( my_level() >= 4 )
		cli_execute( "pull outfit Knob Goblin Harem Girl Disguise" );
	if( my_level() >= 7 )
		foreach x in $items[miner's helmet, 7-foot dwarven mattock, miner's pants]
			if( ( pulls_remaining() > 0 ) && ( storage_amount( x ) > 0 ) && ( item_amount( x ) == 0 ) )
				cli_execute( "pull " + x.to_string() );
}

Hope that helps.
 

Veracity

Developer
Staff member
Also, if you are using "pull outfit Knob Goblin Harem Girl Disguise", then surely you can "pull outfit Mining Gear".
 
Thanks Grotfang : I was having some difficulty getting to make my brain think like an array. That's very cool code, and I will get myself a notepad editor that shows whether I have matching brackets or not :)

Veracity: yes, I could, but I wanted to know how to do it individually too, for when I want to pull individual non-outfits that will also also be needed at certain levels (eg, the big book of pirate insults, as it costs 1000, may as well be a pull.) Half of the reason I'm n00bing around here is to remind myself how to code. (The other half, of course, being to make my KoL life easier ;)

Cheers
Richo
 
Top