Auto spellcasting RC file

My RC file has a lua macro that automatically selects and casts an appropriate direct damage spell.

It is currently capable of choosing between starburst, foxfire, stone arrow, bombard, scorch, airstrike, shock, flame wave, irradiate, fireball, ignition, firestorm, IOOD, LCS, and LRD.

It is designed to select the spell and the targeting point to deal maximum damage to the enemies that deserve it most - those that are high threat or low on health are priority targeted.

There are three ways to invoke it. There is the “cast” function, and the “cast_efficient” function. The difference is that “cast_efficient” takes into account the MP cost of the spell, unless threatening enemies are nearby. “cast” just deals the most damage possible (roughly speaking) without regard for MP. There is also the “cast_quiet” function that is like “cast_efficient” but avoids the loudest spells (LRD, fireball, ignition, firestorm) which you might want in certain situations, e.g. you’ve been shafted. I have bound “cast” and “cast_efficient” to keys 3 and 4, as follows:

macros += M 4 ===cast
macros += M 3 ===cast_efficient

So that, in combat, I mostly just press 3 repeatedly to cast various spells until things die. If I feel that cast_efficient isn’t getting the job done, I press 4 instead. If the situation is getting too dangerous (or I want to use a spell that “cast” doesn’t handle) then I will switch to manually selecting spells.

Feel free to give it a try. The rcfile can be found here:

2 Thanks

Looks quite impressive. Do you write the functions for fun? Do you use some kind of macro to construct parts of the rc file?

Yeah I just like to play Vehumet mages but it is a bit slow and tedious to repeatedly target fireball/firestorm to hit the maximum amount of enemies every single turn, so I wrote this to do it automatically with 1 keypress. The “monster_ac” variable is the only part that was auto generated.

Made many bugfixes and spell selection improvements in the past couple days. Also added LCS.

1 Thank