Very cool function, couple things I notice:
1. Seems that you've declared a variable
c of type integer but not used it, consequently the function outputs a string which won't be much use for running numbers based on an item's price
the alternative is
strToInt()'ing all of your calls to this function.
You can fix this by wrapping a
strToIntDef() around your result
2. The assignation of values to
a and
b can be shortened:
Simba Code:
ab := between('GEPrice">', '<', getPage('2007.runescape.wikia.com/wiki/Exchange:' + item));
potentially all three operations can be done in a single line but that gets hard to read:
Simba Code:
result := replace(between('GEPrice">', '<', getPage('2007.runescape.wikia.com/wiki/Exchange:' + item)), ',', '', [rfReplaceAll]);
This is quite cool though, I don't think I've seen one of these for OSRS before!
E: If you really wanted to you could make the script sanitize the user input, i.e. replace all space characters (" ") with underscores ("_") so users could call your function with
Bronze dagger as the input rather than
Bronze_dagger