Filthy pirates

dj_d

Member
Hate 'em. Any way to replicate the "insults" CLI command from ASH? Or get the information from the prefs?

And on a related note, if there was a
string cli_execute_and_return()
that returned whatever ASH would normally print in a buffer, that would be happymaking.
 

zarqon

Well-known member
The First Things First consult script handles insulting the pirates if you haven't learned them all yet. You might want to take a look at how I did it there, if not just use that script. :) Link in my sig.
 

Alhifar

Member
Well, I'd just finished this up when I noticed that zarqon had posted, and his way is possibly more efficient, but here's a function that will retrieve the status of your insults and put them in a map.
Code:
boolean[int] get_insults()
{
	boolean[int] insults;
	if( get_property( "lastPirateInsultReset" ) < get_property( "knownAscensions" ) )
	{
		set_property( "lastPirateInsult1" , false );
		set_property( "lastPirateInsult2" , false );
		set_property( "lastPirateInsult3" , false );
		set_property( "lastPirateInsult4" , false );
		set_property( "lastPirateInsult5" , false );
		set_property( "lastPirateInsult6" , false );
		set_property( "lastPirateInsult7" , false );
		set_property( "lastPirateInsult8" , false );
	}
	int x = 1;
	while( x<=8 )
	{
		insults[x] = get_property( "lastPirateInsult" + x ).to_boolean();
		x = x + 1;
	}
	return insults;
}

EDIT: To reply to your second point, I believe I've read that the mafia devs don't want to allow returning what is written to the CLI because it would allow mallbots.
Slightly off-topic, as a proof of concept, I wrote up an ASH script that replicates the function of the insults CLI command to help show that there really isn't anything that the mafia devs want to allow that can't be accessed some way from ASH. Yes, I realize that the script is rather useless, but I'm just that bored.
 

Attachments

  • insult_get.ash
    2.8 KB · Views: 46

dj_d

Member
Hm. I thought of that, but when I checked the prefs file between throwing insults, it didn't appear to update. Maybe I was just learning the same insult over and over again. Strange.

In any case, what I'm looking for isn't to know when to insult (I already use your script for that Z! :) ) but to know when to Step Up. Thanks both for your help!

I'm not sure how retrieving the command line results would allow mallbotting? You can't get prices from the command line...
 

Alhifar

Member
Hmm, I thought I had read something about that, but searching, I'm unable to find anything on returning a value from cli_execute. Maybe I was just imagining things.
 

lostcalpolydude

Developer
Staff member
searchmall item [ with limit number ] - search the Mall (taken from mafia's help) lets you get mall prices; I use it sometimes to check that I'm getting the right semirares to put in the mall after getting them (using a CLI script that searches for several semirares that could possibly have a high value). I'm sure that if this output was available to ash scripts, it would be realistic to have the prices checked and buying decisions made based on it.
 

zarqon

Well-known member
How would you handle Stepping Up in a script? It's not a choiceadv, and generates an auto-stop.

The only way I can think of would be running the whole zone with visit_url() and run_combat(). Then just find the URLs for Stepping Up and playing pong, then when you hit that page, check to see if you have all the insults. FTF already calculates an "insultsknown" number. You could use that logic to decide when to step up vs. step on by.
 

dangerpin

Member
You aren't confronted by the Step Up to the Table adventure until after you use the blueprints. Isn't it simpler just to hold off on using the blueprints until after you have hit the % of known insults that you desire?
 

dj_d

Member
OK... I'm stuck. I did all the work to manage it with visit_url (thanks all!), but it still bounces me out of my script with "unsupported choiceadv". Help! Can you give me a way to suppress this somehow?
 

zarqon

Well-known member
I think you can write a placeholder "choiceAdventureXXX=2" property to your settings file.
 
Top