PDA

View Full Version : Yellow Ray Consult script



kain
11-17-2009, 05:29 PM
So I've tired of fighting harem girls and dwarf miners and filthy hippies .... when I could just disintegrate them!

Attached is a combat consult script. It looks at a property called "_YOROIDS_target" for the particular monster to stasis/yellow ray.

Since I didn't really know how to insert this into FTF or SmartStasis, I also wrote a hack-y script to set the _YOROIDS_target variable and adventure in <location> until <goal> is satisfied. This is mostly-satisfactory ... but not 100%, because some goals can be dropped by multiple monsters. For example, you could get the mining outfit from EITHER a 7-foot dwarf or a 7-foot dwarf foreman ... and I don't know how to do that.

The yellowray.ash script is hack-y because you currently have to edit it to tell it what goal you're looking for and what area to adventure in to get it.

I'm sure this could simply and easily be tweaked into something polished and elegant, but for right now, it's working (for me, at least) so I thought I'd share.

Bale
11-17-2009, 08:14 PM
I'd probably solve the issue by having my consult script compare the drops of whatever monster I'm fighting to is_goal().


> goal set outfit

Condition set: miner's helmet
miner's helmet
Condition set: 7-Foot Dwarven mattock
miner's helmet
7-Foot Dwarven mattock
Condition set: miner's pants
miner's helmet
7-Foot Dwarven mattock
miner's pants
miner's helmet
7-Foot Dwarven mattock
miner's pants

> ash is_goal($item[miner's pants])

Returned: true
Then use that in the consult script something like this...


boolean yellow_ray = false;
foreach key in item_drops( foe )
if(is_goal(key)) yellow_ray = true;
If you want to get fancy, you can have it only use a yellow ray if the monster drops at least 2 items that are goals. That will increase the consult script's generic utility. :D


boolean yellow_ray = false;
if (get_counters("Major Yellow Recharge", 0, 151) == "") {
int item_goals = 0;
foreach key in item_drops( foe )
if(is_goal(key)) item_goals = item_goals + 1;
yellow_ray = item_goals > 1;
}
Yeah, that's starting to look pretty good. Now you can just rewrite your entire script to make use of that boolean. ;)

kain
11-17-2009, 10:52 PM
Interesting use of "goal set outfit" ... I didn't know that existed!

I shall start a rewrite tomorrow, thanks for the tips/pointers.