A note to anyone who wants to change this for Enchanted Essence instead of Magical Residue...
Change the three instance of TKR to WKR...these are on lines 64, 81, and 276...
On line 262, change the name from "Beninort" to "Aurvidlem"...
And of course, remark your runes near that NPC, although you could change the scanning range (set at 3) if you want to mark them more centrally so you can use them with either script...
That's it!!! :-)
And neo, it seems like this could be changed permanently by adding variables for something like %resource and %NPCname, to be set by having the user select which to do at the start of the script (or automatically do both and do them based on the resources in the container, so if you run out of one, it'll switch to another?). You could also make the menu for adding the rune numbers have a third column for the runes for the EE NPC, to incorporate this?