Priority targeting

I don’t know if this helps… but it helped with my warrior types…

I take all enemies and group them manually… then pick the target from what I know of all enemies. For instance, a munchkin within attack range is more important than a thrower outside of attack range. This is because the munchkin can damage me while I’m moving to attack the thrower. Of course, if nothing is in attack range, I move toward missile types until I can hit them. This structure has helped me:

var i, type,                 // Counter
    foes, foe, nFoes,   // For the enemy loop
    grpFoes= {};        // The grouping object

loop {
// Loop through enemies and add them to group.
    foes = this.findEnemies();
    nFoe = foes.length;
    grpFoes = {};
    for (i = 0; i < nFoes; i++) {
        foe = foes[i];
        type = foe.type;
    // If no group for this type, create it.
        if (!grpFoes[type])
            grpFoes[type] = [];
    // Add foe to the group.
        grpFoes[type].push(foe);
    }

// Prioritze according to group....

        /* ...Targetting algorithm here... */
}

Using throttling keeps instructions low, and largely meets my needs. This allows me to get info on the enemy I’d like from each group (i.e farthest thrower vs closest munchkin) and weigh each independently for threat analysis. Since you are using a wiz, this may not necessarily apply to you, but thought I would throw it out there.