
Originally Posted by
Rasta Magician
check out amount.scar and trade.scar you'll see you have all you need in there.
Open Trade, Get Trader Name. GetTextAtEx can also be useful, search for the name you want in the text box, then move to it and if uptext('trade'); then click on it.
~RM
He doesn't want to open the trade then check.
EDIT:
SCAR Code:
function TradeCheckAccept(TradeWith: TStringArray): Boolean;
var
k, c, Tx, Ty: Integer;
TP: TPoint;
Text, Name: string;
CPts: TPointArray;
begin
if (not(LoggedIn)) then Exit;
for k := 8 downto 1 do
begin
TP := TextCoords(k);
if (FindColor(Tx, Ty, 8388736, TP.x, TP.y, TP.x + 200, TP.y + 14)) then
begin
WriteLn('Found Trade');
Text := Trim(GetTextAtEx(TP.x - 2, TP.y - 2, 0, SmallChars,
False, False, 0, 1, 8388736, 60, False, tr_allChars));
Name := Copy(Text, 1, Pos('wi', Text) - 1);
WriteLn(Name + ' wishes to trade');
if (not(InStrArr(Name, TradeWith, True))) then Continue;
WriteLn(Name + ' was in TradeWith array, trading...');
FindColorsTolerance(CPts, 8388736, TP.x, TP.y, TP.x + 200, TP.y + 14, 0);
MiddleTPAEx(CPts, Tx, Ty);
c := 0;
while (not(TradeScreen)) do
begin
Mouse(Tx, Ty, 50, 5, True);
Wait(5000);
Inc(c);
if (c >= 5) then
begin
WriteLn('Could not open bank screen');
Exit;
end;
end;
Result := True;
Exit;
end;
end;
I used an array instead of a single string because I believe it would be more useful. So to use it:
SCAR Code:
if (TradeCheckAccept(['tradewithme', 'imonthelist', 'this function is leet'])) then WriteLn('Blah blah');
Tell me if it doesn't work. I haven't tested it.