SRL Archive - Help and Support

NEED FindShopKeeper Proc


JuKKa

2007-03-17 19:05:19

Basically i need a WORKING or non working shopkeeper finder which will trade with the shopkeeper, i will use this with my Oak/seller in lumby. I made one my self but it also attempts to trade with other players though i set the Chooseoption(x,y,'rade shop').

im kinda just asking for someone to post one that will trade… heres the current one im using;

[Php]
procedure FindShopKeepers;
begin
if not loggedin then exit;
if invfull then
begin
Players[CurrentPlayer].Loc := 'Trading With ShopKeeper';
repeat
wait(50+random(50))
if not loggedin then break;
if FindMSColorTol(x,y,ShopKeeper,3)then
begin
MMouse(x,y,0,0)
wait(50+random(100))
if isuptext('-to Shop')then
begin
Mouse(x,y,0,0,false)
wait(100+random(100))
Chooseoption(x,y,'Trade');
Flag;
end;
end;
until(ShopScreen)
end;
end;
[/Php]

i have tried many variations of the Chooseoption(x,y,''); but with nogoes

-Be kind and post a working one :(

Cheesehunk

2007-03-17 19:15:39



ShopKeeper1 := 5465723;
ShopKeeper2 := 5926277;
ShopKeeper3 := 5663104;


//*********************** Thanks Tarajunky *******************************//

function ClickText3(text : String; x1, y1, x2, y2 : Integer; Cancel: Boolean) : Boolean;
var TextLength, a, b : Integer;
begin
if(IsTextInAreaEx(x1,y1,x2,y2,a,b,Text,100,UpChars,False,True,0,1,-1))then
begin
TextLength := Length(Text);
Mouse(a + 2 + random(TextLength*6), b + random(3) + 8,0,0, true)
result:= true;
end else
if (Cancel) and(IsTextInAreaEx(x1,y1,x2,y2+50,a,b,'Cancel',100,UpChars,False,
True,0,1,-1))then
begin
TextLength := 6;
Mouse(a + 2 + random(TextLength*6), b + random(3) + 8,0,0, true)
end;
end;

//********************* Based off Phantom's FindGerrant ******************//

function FindSalesMan: Boolean;
var Sx, Sy, C, DownKey: Integer;
begin
if ShopScreen then
begin
Result := True;
DebugScript('Shop Open');
Exit;
end;
if not LoggedIn then Exit;
Sx := 246;
Sy := 163;
FindRandoms;
DebugScript('Finding Shop Keeper');
if (FindColorSpiralTolerance(Sx, Sy, ShopKeeper1, 10, 10, 500, 330, 5) or
FindColorSpiralTolerance(Sx, Sy, ShopKeeper2, 10, 10, 500, 330, 5) or
FindColorSpiralTolerance(Sx, Sy, ShopKeeper3, 10, 10, 500, 330, 5)) then
begin
DebugScript('Found color, searching..');
Sx := Sx + Random(3);
Sy := Sy + Random(2);
MMouse(Sx, Sy, 0, 0);
Wait(100 + Random(50));
C := 0;
if IsUpTextMulti('hop', 'Shop', 'Sho') then
begin
DebugScript('Found ShopKeeper');
if (Random(15) = 1) then
begin
Mouse(Sx, Sy, 0, 0, True);
FindRandoms;
FFlag(0);
Wait(500 + Random(250));
if (not (GetColor(442, 434) = 0)) and ClickToContinue then
begin
Wait(500 + Random(250));
if ClickNpcChatText('Yes please') then
Wait(250 + Random(200))
end;
end else
begin
Mouse(Sx, Sy, 0, 0, False);
Wait(100 + Random(50));
if ClickText3('Trade Shop', Sx - 200, Sy - 300, Sx + 200, Sy + 250, True) then
begin
DebugScript('Opening shop.');
FFlag(0);
WWait(500 + Random(150));
end;
end;
end;
if ShopScreen then
begin
Result := True;
DebugScript('Shop open');
Exit;
end;
end;
//SendArrowSilentWait(Random(4), 100 + Random(700));
DownKey := 37 + Random(4);
Wait(100 + Random(50));
KeyDown(DownKey);
Sleep(100 + Random(700));
KeyUp(DownKey);
FTWait(1);
end;

MarkTime(BankMark);
repeat
if not LoggedIn or (TimeFromMark(BankMark) > 35000) then
Break;
FTWait(1);
until FindSalesMan;
Here's a version from my script, some stuff is not in SRL, but it can be edited.:) ClickText3 = Tarajunky's, lags a bit with long text's.. FindSalesMan = Orignally based of FindGerrant.

JuKKa

2007-03-17 19:35:38

thank u Cheesehunk it works great!
i already added them to my script :)