looks ok, thats a nice start! :)
i made this a short time ago. (posted in members).
maby you can get some idees out of it ;)
FindExchange screen etc.
program GrandExchange;
{.include srl/srl.scar}
var
Log: Integer;
Function FindExchangeScreen: Boolean;
var
Tx, Ty: integer;
begin
Result := IsTextInAreaEx(190, 30, 328, 52, Tx, Ty, 'Grand Exchange', 10, UpChars,
True, False, 0, 0, 39116);
end;
Function OpenExchange: Boolean;
var
Cx, Cy: Integer;
begin
Result := FindObjCustom(Cx, Cy, ['Desk', 'Use Desk'], [6850714], 10);
if Result then
begin
Mouse(Cx, Cy, 2, 2, False);
ChooseOption('Exchange ');
Flag;
Wait(2000);
if FindExchangeScreen then
begin
Result := True;
Exit;
end;
end;
Result := False;
end;
procedure CloseExchenge;
var
C: Integer;
begin
if FindExchangeScreen then
repeat;
Inc(c);
Mouse(485, 42, 3, 3, True);
Wait(1000);
until((C >= 2) or (Not(FindExchangeScreen)));
end;
Function LookForOpenSlot(var Tx, Ty, Slot: Integer): Boolean;
var
SlotCoords: Array [0..5] Of TPoint;
I: Integer;
begin
SlotCoords[0].x := 79; SlotCoords[4].x := 237;
SlotCoords[0].y := 86; SlotCoords[4].y := 206;
SlotCoords[1].x := 238; SlotCoords[5].x := 395;
SlotCoords[1].y := 86; SlotCoords[5].y := 206;
SlotCoords[2].x := 394; Slot := 0;
SlotCoords[2].y := 86;
SlotCoords[3].x := 82;
SlotCoords[3].y := 206;
MMouse(530, 219, 10, 30);
For I := 0 to 5 do
begin
Result := IsTextInAreaEx(SlotCoords[i].x, SlotCoords[i].y, SlotCoords[i].x + 55,
SlotCoords[i].y + 25, Tx, Ty, 'Empty', 20, UpChars, True, False, 0, 0, 39372);
if Result then
begin
Slot := i + 1;
Exit;
end;
end;
end;
Function ExchangeSellItem(ItemBitmap: Integer; SellAmount: string;
LowestPrize: Boolean; ItemTol: Integer): Boolean;
var
Tx, Ty, Slot: Integer;
begin
if OpenExchange then
begin
if LookForOpenSlot(Tx, Ty, Slot) then
begin
WriteLn('Free Slot: ' + IntToStr(Slot));
Mouse(Tx + 10, Ty, 20, 30, True);
Wait(1000 + Random(500));
Mouse(Tx + 35, Ty + 50, 20, 10, True);
Wait(2000 + Random(500));
if (not(TabExists(4))) then
begin
if FindBitmapToleranceIn(ItemBitmap, Tx, Ty, MIX1, MIY1, MIX2, MIY2, ItemTol) then
begin
Mouse(Tx, Ty, 2, 2, True);
Wait(2000 + Random(500));
if FindDeformed(Tx, Ty, ItemBitmap, 104, 94, 147, 134) then
begin
Mouse(237, 223, 3, 3, True);
if (not(FindExchangeScreen)) then Exit;
Wait(2000 + Random(500));
TypeSend(SellAmount);
Wait(2000 + Random(500));
if LowestPrize then
Mouse(286, 222, 3, 3, True)
else Mouse(339, 223, 3, 3, True);
Mouse(216, 285, 100, 10, True);
Wait(2000 + Random(500))
Result := True;
end;
end;
end;
end;
end;
CloseExchenge;
end;
procedure Load; //current bitmap is from a noted willow log.
begin
Log := BitmapFromString(9, 4, 'beNrzkY8MUERGsSFKoT7ygZ6yP' +
'q4yQDYcQUQ8HKScbSTszMWAKoEiQAaQCxQEIqAsUASIIFyICEQQaC' +
'AIAQCcZhmX');
end;
begin
SetUpSRl;
Load;
if ExchangeSellItem(Log, '50', True, 20) then
WriteLn(' Sucsefully Exchanged.');
CloseExchenge;
FreeBitmap(Log);
end.
Good Luck :)