SimbaGod
2013-10-06 21:02:40
Edited thread! Got help for something else but now im asking…
IMPORTANT* Is it possible to add a code so the bot can stay logged in? Like for example, each 30 seconds, it moves the camera? I would like a simple code with anything that can let the bot stay logged in. :D
less IMPORTANT* Is it possible to change the link in of 2007 for eoc? Basically I want to get both so if you are able to put them both in one script(like when you say !07 its pc 2007 and if !eoc its pc eoc), would be great. If not, can you guys help make this into RS3? I think its only the link but i dont know what link for eoc and if its really that.
IMPORTANT* Is it possible to add a code so the bot can stay logged in? Like for example, each 30 seconds, it moves the camera? I would like a simple code with anything that can let the bot stay logged in. :D
less IMPORTANT* Is it possible to change the link in of 2007 for eoc? Basically I want to get both so if you are able to put them both in one script(like when you say !07 its pc 2007 and if !eoc its pc eoc), would be great. If not, can you guys help make this into RS3? I think its only the link but i dont know what link for eoc and if its really that.
program Pricechecker;
{$DEFINE SMART}
{$I SRL-OSR/SRL.Simba}
Type T07Item = record
Name : String;
ID,Average,RecentLow,
RecentHigh,AlchPrice : Integer;
end;
var
LastT : string;
// By Flight
function getItem(Item: String): T07ITem;
var
fullS,s1,s2: String;
begin
Result.ID := 0;
fullS := GetPage('http://forums.zybez.net/runescape-2007-prices/api/' + Item);
if (Pos('"error"', fullS) > 0) then
Exit;
Result.Name := capitalize(Item);
Result.ID := Round(StrToInt(between('"id":"', '"', fullS)));
Result.Average := Round(StrToFloat(between('average":"', '"', fullS)));
Result.RecentHigh := Round(StrToFloat(between('t_high":"', '"', fullS)));
Result.RecentLow := Round(StrToFloat(between('t_low":"', '"', fullS)));
Result.AlchPrice := Round(StrToFloat(between('lch":"', '"', fullS)));
end;
procedure start();
var
T,S : String;
I : Integer;
item: T07Item;
Expl: TStringArray;
begin
repeat
T := lowercase(getChatBoxText(8, 128));
Expl := explode(' ', T)
for I:=0 to high(Expl) do
begin
if (Expl[I] = '!pc') then
begin
T := replace(T, '!pc ', '');
T := replace(T, ' ', '_');
if not (T = LastT) then
begin
LastT := T;
writeLn(T);
item := getItem(T);
if (item.ID > 0) then
TypeSend('/'+item.Name+' is '+intToStr(item.Average))
else
begin
writeln('Incorrect item');
TypeSend('/Incorrect Item');
end;
end;
end else if (Expl[I] = '!full') then
begin
T := replace(T, '!full ', '');
T := replace(T, ' ', '_');
if not (T = LastT) then
begin
LastT := T;
writeLn(T);
item := getItem(T);
if (item.ID > 0) then
begin
S := toStr(item);
TypeSend('/'+S);
end else
begin
writeln('Incorrect item');
TypeSend('/Incorrect Item');
end;
end;
end;
end;
until false;
end;
begin
setupSRL();
activateClient();
start();
end.


