Salutations -
I'm toying with the idea of a sub that will do the following:
1) Scan a given radius and find all NPCs
2) Determine, via context menu, if each NPC is a vendor
3) Assign each vendor's unique ID to a %npc_id[num] variable. For example, if there were 3 vendors, the variables would be
- %npc_id1 XXXXX
- %npc_id2 YYYYY
- %npc_id3 ZZZZZ
The point of this sub is, of course, to abuse TM's item buying routines.
Basic structure would be something like this, I think:
scan tile radius 15 for type IS
determine if IS is yellow
Open context menu for yellow IS
If context includes 'buy'
assign ID to %npc_ id[#]
increment %npc_id[#]
ignore vendor
Eventually, it should also identify types of npc vendor (tailor, provisioner, mage, scribe, etc, etc).
Is my approach logical, or do I need a different angle?
