Originally Posted by
KeepBotting
I think the original was by The Mayor, unsure though. If anyone knows, tell me and I'll update my script with credits accordingly
That one. It pulls from the RS Wikia which always uses underscores
Buut... it needs to be 'Copper_ore'
(writing one that fixes idiot's incorrect formatting)
Here we go...
Simba Code:
function getGEPrice(itemName: string): integer;
var
wikiaPage, priceString: string;
i, num: integer;
begin
num := ord(itemName[1]);
if inRange(num, 97, 122) then
itemName[1] := chr(num - 32);
for i := 2 to length(itemName) do
begin
num := ord(itemName[i]);
if inRange(num, 65, 90) then
itemName[i] := chr(num + 32);
end;
itemName := replace(itemName, ' ', '_', [rfReplaceAll]);
wikiaPage := getPage('http://runescape.wikia.com/wiki/Exchange:' + itemName);
priceString := between('GEPrice">', '</span>', wikiaPage);
result := strToIntDef(ExtractFromStr(priceString, numbers), -1);
itemName := replace(itemName, '_', ' ', [rfReplaceAll]);
writeLn(itemName + ' price: ' + toStr(result));
end;
i renamed it cause its more descriptive. rename it as you so desire.
so this works with...
Simba Code:
getGEPrice('Copper_ore');
getGEPrice('coPPer_oRe');
getGEPrice('COPPER_ORE');
getGEPrice('coPPer oRe');
etc, etc...