YoHoJo
2012-05-11 17:16:05
Can someone post example lines of code for Google docs and excel that grab real time GE prices from runescape GE website.
2012-05-11 17:16:05
2012-05-11 17:21:13
2012-05-11 17:36:43
2012-05-11 19:32:53
=ImportHtml("http://itemdb-rs.runescape.com/results.ws?query=Coal Ore", "table", )=[B]Index[/B](ImportHtml("http://itemdb-rs.runescape.com/results.ws?query=Coal Ore", "table", ),[B]2,3[/B])2012-05-13 00:14:09
2012-05-13 06:56:14
2012-05-13 07:02:06
2012-05-13 07:03:53
From: NexPB
I can't realy help you but if I may ask why do you need it in Excl?
2012-05-13 07:09:00
From: YoHoJo
Docs is fine, and your method was working too, but (I think) if I accidentally mess up a line, or type in a wrong item name, or screw up the SRL somehow, the docs throws a pop up error at me, and then the cell I was using becomes completely unusable and It was getting my very very frustrated!
procedure GetPriceGe;
var
url, price, final: String;
begin
Case (Lowercase(Ore)) of
'iron', 'iron ore': oreID := 440;
end;
url := ('http://www.scripts.master-bot.org/GEPriceChecker.php?id=' + IntToStr(oreID));
price := GetPage(url);
if (orePrice = 0) then
begin
final := Trim(price);
if (final = '') then writeln('FAILED TO GET PRICES! RESTART SCRIPT.');
writeln('Price ore: ' + final);
orePrice := StrToInt(final);
end else
Exit;
end;
2012-05-13 07:10:19
2012-05-13 07:40:07
program new;
{.include SRL/SRL.simba}
{.include SRL/SRL/Misc/Online.simba}
Const
SavePath = 'C:\Simba\Prices\'; //Make sure this ends in "\"
Var
Items : array of Variant;
Names : array of String;
Prices : array of Integer;
Procedure ItemsToGrab;
begin
Items := [563, 'Nature Rune', 7936]; //You can type the ID or the name
Names := ['Law Rune', 'Nature Rune', 'Pure Essence']; //Make sure these two arrays are the same length
end;
Procedure GrabItems;
Var
i : integer;
begin
SetArrayLength(Prices, GetArrayLength(Items));
for i := 0 to high(Items) do
Prices[i] := GetGEPrice(Items[i]);
end;
Procedure SaveItems;
Var
S : String;
i, n : integer;
begin
ForceDirectories(SavePath);
if(FileExists(SavePath + 'Prices.csv'))then
DeleteFile(SavePath + 'Prices.csv');
for i := 0 to high(Prices) do
S := S + Names[i] + ',' + IntToStr(Prices[i]) + ',' + #10;
n := CreateFile(SavePath + 'Prices.csv');
WriteFileString(n, S);
CloseFile(n);
end;
begin
ItemsToGrab;
if(GetArrayLength(Items) <> GetArrayLength(Names))then
begin
srl_Warn('ItemsToGrab', 'Array Lengths are not the same!', warn_AllVersions);
TerminateScript;
end;
GrabItems;
SaveItems;
end.
Navigate to the filepath you specified in the script above:
then follow the pictures:







2012-05-13 07:48:38
2012-05-13 08:04:27
From: YoHoJo
Damn thanks for taking the time to do that yourself and even screenshot each step of the way that was very nice of you!
I think easiest thing to do though would just be to have the proper URL and 'grabbing' of the price though wouldn't you think so?
Also what if I don't want all of my values in a column straight down? What I want them in all different cells all over the palace?
I think a simple formula line I can edit per item and put into any cell I want would be best.
2012-05-13 08:19:59
From: YoHoJo
I think a simple formula line I can edit per item and put into any cell I want would be best.
=Index(ImportHtml("http://itemdb-rs.runescape.com/results.ws?query=Coal Ore", "table", ),2,3) =Index(ImportHtml(Concatenate("http://services.runescape.com/m=itemdb_rs/results.ws?query=", B3), "table", ),2,3) 2012-05-13 08:33:21
2012-05-13 08:42:19
From: putonajonny
Try this, just whipped it up:
http://putonajonnyscripts.hostoi.com/price.php?Item=563
Just enter the item ID/Name after Item= (563 is law rune)
2012-05-13 08:59:57
From: CephaXz
Very helpful thread here! I wanted to learn how to make a progress report with profit/hour report, not using constants to input the profit everytime I start script.
Let's say I want to count the profit of tanning hides. How should I make it so it counts the profit made per item/inventory? Like leather price - hide price.
red dhide leather:
http://scriptauthentication.net16.net/price.php?Item=2507
red dragonhide:
http://scriptauthentication.net16.net/price.php?Item=1749
{.include SRL/SRL/Misc/Online.simba} then add this as a global variable:Var
ProfitPerItem : integer; Then during the setup of the script add:ProfitPerItem := GetGEPrice(2507) - GetGEPrice(1749);Then a proggy could be:WriteLn('Profit Made: '+IntToStr(ProfitPerItem * HidesTanned));
2012-05-13 09:08:14
From: putonajonny
Add this near the top of your script (at the bottom of the other ones that look like it):then add this as a global variable:{.include SRL/SRL/Misc/Online.simba}Then during the setup of the script add:Var
ProfitPerItem : integer;Then a proggy could be:ProfitPerItem := GetGEPrice(2507) - GetGEPrice(1749);WriteLn('Profit Made: '+IntToStr(ProfitPerItem * HidesTanned));
2012-05-13 09:23:34
From: putonajonny
Try this, just whipped it up:
http://putonajonnyscripts.hostoi.com/price.php?Item=563
Just enter the item ID/Name after Item= (563 is law rune)
2012-05-13 09:31:40
From: abu_jwka
Can I ask how you got it to output just that number and not the whole spreadsheet format like this?: https://docs.google.com/spreadsheet/ccc?key=0AuXQNkjY2OyVdG8xWHBmbTVaTGduUWtfdVd2anM1aUE#gid=0
Put the URL in like this: http://pricegrabbing.host-ed.me/price.php?Item=ItemName
or
http://pricegrabbing.host-ed.me/price.php?Item=ItemID




2012-05-15 02:15:05
2012-05-15 09:14:43
From: cause
Putonajonny, that is so helpful, thanks!
2012-05-17 01:18:29
From: putonajonny
Worth making a tutorial?
2012-05-17 23:05:19