Dark09188 Posted July 20 Author Share Posted July 20 At the moment I'm trying to teach myself how to script. Link to comment Share on other sites More sharing options...
xkkmEl Posted July 20 Share Posted July 20 (edited) Perhaps it might help you looking at some typical code segments. Here's one for looping through an inventory (you might use that on your akActionRef param to find the least valuable gem): int i = r.getNumItems() while i i -= 1 Form item = r.getNthForm( i) if isLootable( item) return True endif endwhile return False Here testing if x is a less valuable gem than y: ; Note that this ignore the charge level ; Comparing the charge is trickier; you need to test the references, ; and you need to move them out of the inventory to do that. function bool isLessValuable( Form x, Form y) return !y || (x.getType() == 52 && x.getGoldValue() < y.getGoldValue()) endfunction It would be easier to help you if you shared your sample code in text rather than pixels. Edited July 20 by xkkmEl Link to comment Share on other sites More sharing options...
Recommended Posts