Ash functions

mottsy

Member
1.Does anyone know any good places to learn ash, is there a Wiki for it or something

2. How do you set something like "if completed arena in war hippy fatigues then do _____", and "if found summoning name summon _____"
 
Last edited:

Grotfang

Developer
1) There is a wiki. It is here. Another way to learn stuff is to use ashref and also to read and disseminate a variety of scripts on the forums. If you have a Mr. A and have plenty of time on your hands, dj_d's acsend.ash suite is very useful for seeing a range of techniques in action (especially as some of its contents come from other authors with varying styles). If you use any scripts already, look at them and try to find out how they work. See if you can make bits of them better - it's a great learning tool!

2) To check arena status, use get_property( sidequestArenaCompleted ); It returns a string.

Code:
if( get_property( sidequestArenaCompleted ) == "hippy" )
{
    code to be executed
}

Your second query... not sure what you are looking for there. Is it a combat action you want?
 

mottsy

Member
1) There is a wiki. It is here. Another way to learn stuff is to use ashref and also to read and disseminate a variety of scripts on the forums. If you have a Mr. A and have plenty of time on your hands, dj_d's acsend.ash suite is very useful for seeing a range of techniques in action (especially as some of its contents come from other authors with varying styles). If you use any scripts already, look at them and try to find out how they work. See if you can make bits of them better - it's a great learning tool!

2) To check arena status, use get_property( sidequestArenaCompleted ); It returns a string.

Code:
if( get_property( sidequestArenaCompleted ) == "hippy" )
{
    code to be executed
}

Your second query... not sure what you are looking for there. Is it a combat action you want?

I worded it incorrectly, basicly, use for summoning chamber if found the name

Thankyou fang
 

zarqon

Well-known member
Code:
if (get_property("demonName2") != "") cli_execute("summon 2");

Type "demons" in the CLI to see which number you want to be using.

Note that so far your requests have all been solved with accessing mafia settings using the ASH function get_property(). You can see a list of available properties by checking your username_prefs.txt file in mafia's settings directory. At any given time mafia actually knows quite a lot about your player status, without even accessing the KoL server.
 

tgetgel

Member
Code:
if (get_property("demonName2") != "") cli_execute("summon 2");

Type "demons" in the CLI to see which number you want to be using.

How do you know if a demon has already been summoned today? I want to add that check to my code. (The get_property() part is the only untested portion but it is the right number for greed.)
Code:
	if (get_property("demonName2") != "")
	{
	#summon greed demon - buy only those things needed - candles will be in inventory the second run
	if ((item_amount($item["scroll of ancient forbidden unspeakable evil"]) == 0))
		{
		cli_execute("if inkwell == 0; buy inkwell");
		cli_execute("if tattered scrap == 0; buy tattered scrap");
		cli_execute("if quill pen == 0; buy quill pen");
		cli_execute("if thin black candle < 3; buy 3 thin black candle");
		}
	cli_execute("summon Preternatural Greed");
	}
 

zarqon

Well-known member
That's another property, I think it's called "demonSummoned" or something like that. Look in your settings file.

So add that as an if check in front, and you're set. And I'm pretty sure you don't need to worry about buying scroll ingredients / candles -- mafia handles that automatically when you try to summon.
 

Bale

Minion
Mafia certainly will handle acquisition of all summoning supplies. All you need is...

Code:
if(!to_boolean(get_property("demonSummoned")) && get_property("demonName2") != "") cli_execute("summon 2");
 

tgetgel

Member
Mafia certainly will handle acquisition of all summoning supplies. All you need is...

Code:
if(!to_boolean(get_property("demonSummoned")) && get_property("demonName2") != "") cli_execute("summon 2");

Zarqon and Bale - Thanks for the code!
 
Top