Vis_Vires
2015-04-01 13:12:12
This is my first working script. It took me a while to write and i had alot of help from The_Prince so a large thanks to him for helping me out. The script simply steals from the stall until my inventory is full of gems, it then finds the shopkeeper and sells the gems to him and repeats.
program TheifBot;
{$i SRL-OSR/SRL.simba}
function InShop: Boolean; //Check to make sure shop is open before selling
var x, y:Integer;
begin
if FindColorTolerance(x, y, 2070783 , 227, 25, 321, 40, 1) then
Result := true
else
Result := false;
End;
function OutShop: Boolean; // check to make sure shop is close before moving on
var x, y:Integer;
Begin
if FindColorTolerance(x, y, 1253790, 123, 225, 323, 335, 1) then
Result := true
else
Result := false;
End;
(*
Set Player in front of Scimitar Stall
Set Camera to north
And all the way up (Up Arrow Key)
*)
Procedure ClickStall
var
x, y:integer
Begin
repeat;
if FindObj(x, y, 'cim', 6118756, 2) then //find stall
Begin
Mouse(x, y, 2, 2, true); //click on stall
wait(3350); //wait 3.35 secconds
End;
until (InvFull);
End;
Procedure FindShopkeeper;
var
x, y:integer
Begin
repeat
if FindObj(x, y, 'hopk', 733534, 2) then
Begin
Mouse (x, y, 2, 2, true); //trade shopkeepr (true = RClick false = LClick)
wait(2500);
End;
until (InShop);
End;
Procedure SellItems;
var
x, y, Sell100:integer;
Begin
Sell100 := BitmapFromString(48, 7, 'meJxjYGCQUddmAAMgAxeauuMYEEH' +
'UILMx1aDJwrlAAJclKEUQEeMeiL9wuQfZwZjmIPsFjzdJdQ+mLJwL' +
'MQ2rOchSuOyF+5SK7kELPaxScHH89lLoHoj5WN2DJoUnHuEBRRX34' +
'EkzmFZj2gsHFMYXWrwg24VVCgAb+Vss');
if FindObjEx(x, y, ['lood', 'ood'], [791905, 7191905], 15, 50, 544, 206, 740, 465) then //finds Diamsond in inventory
Begin
Mouse (x, y, 2, 2, false); //right clicks blood diamond
wait(300);
if FindBitmapToleranceIn(Sell100, X, Y, 475, 155, 764, 497, 145) then
begin
mmouse(x, y,1,1);
Wait(150);
ClickMouse(X, Y, mouse_Left);
wait(500);
end;
End;
if FindObjEx(x, y, ['ce', 'mond'], [8213007 , 8213007 ], 15, 50, 544, 206, 740, 465) then
Begin
Mouse (x, y, 2, 2, false); //right click ice diamond
wait(300);
if FindBitmapToleranceIn(Sell100, X, Y, 475, 155, 764, 497, 145) then
begin
mmouse(x, y,1,1);
Wait(150);
ClickMouse(X, Y, mouse_Left);
wait(500);
end;
End;
if FindObjEx(x, y, ['apis', 'zuli'], [15100242 , 15100242 ], 15, 50, 544, 206, 740, 465) then
Begin
Mouse (x, y, 2, 2, false); //right click lapiz
wait(300);
if FindBitmapToleranceIn(Sell100, X, Y, 475, 155, 764, 497, 145) then
begin
mmouse(x, y,1,1);
Wait(150);
ClickMouse(X, Y, mouse_Left);
wait(500);
End;
End;
End;
Procedure CloseShop
var
x, y: integer;
Begin
wait(500);
if FindObjEx(x, y, ['los', 'ose'], [1449250, 1449250], 1, 10, 478, 29, 489, 39) then
Begin
mmouse(x, y,1,1);
wait(150);
ClickMouse(X, Y, Mouse_Left);
wait(200);
End;
End;
Begin
MouseSpeed :=15;
repeat
ClickStall;
FindShopkeeper;
SellItems;
CloseShop;
until(false);
End.
I'll still be fine tuning it and make it 100% flawless but its been running for a few hours with no bugs. If you have any suggestions to make this script better please tell me I'm always looking to learn more.