(Hopefully) Improved stationary combat buttons with damage estimates

Miser

New member
This script attempts to improve the stationary combat buttons of Mafia. It lets you specify the buttons yourself instead of having to use the ones Mafia offers you, and allows you to restyle them with CSS. Most importantly, however, it attempts to calculate the amount of damage each action would deal and displays the range of possible values on the buttons.

Currently, the script supports normal attack and all class skills. Other skills will be included later on.
A button for slinging Mercenaries would be supported as well, only I don't know the URL used for funkslinging items, and I can't figure it out at the moment since I don't have the skill.

Be aware that while the estimates are usually more or less accurate with most skills, normal attack and skills that rely on it (LTS, Shieldbutt, ...) are often inaccurate because the defense value of the opponent is not known.

I was not able to actually test any skills except for the pastamancer ones, so there may be a few bugs. Also, a few details (like elemental forms or elemental cookbooks) are currently not taken into account, and the code is generally a bit messy and sometimes inefficient.

To configure the buttons, you have to edit the function calls within the do_buttons() function towards the bottom of the script. For example, you could write
Code:
add_attack("Attack");
add_script("Script");
add_skill($skill[entangling noodles],"Noodles");
to create three buttons for attack, script and noodles, the string arguments being the captions of the buttons.

Enjoy the script, any feedback would be appreciated.
 

Attachments

  • fight.ash
    17.8 KB · Views: 105

raorn

Member
Great script, thanks. Here's a hint for you on how to use two items:

Code:
	public static ScriptValue throw_items( final ScriptValue item1, final ScriptValue item2 )
	{
		return RuntimeLibrary.visit_url( "fight.php?action=useitem&whichitem=" + item1.intValue() + "&whichitem2=" + item2.intValue() );
	}
 
Top