SCAR Code:
{*******************************************************************************
function CurrentChat: string;
By: IceFire908
Description: Returns the current chat you have open.
*******************************************************************************}
function CurrentChat: string;
var
Ch: TStringArray;
M: TPoint;
I: Byte;
begin
Result := 'unknown';
GetMousePos(M.X, M.Y);
if (PointInBox(M, IntToBox(3, 481, 404, 503))) then
MMouse(M.X, M.Y - 33, 5, 5);
for I := 0 to 6 do
if (GetColor(9 + (57 * I), 484) <> 5399409) then
Break;
Ch := ['all', 'game', 'public', 'private', 'clan', 'trade', 'assist'];
if (not (InRange(I, 0, 6))) then
Exit;
Result := Ch[I];
end;
{*******************************************************************************
function CurrentChatStatus(Chat: string): string;
By: IceFire908
Description: Returns the current chat status.
*******************************************************************************}
function CurrentChatStatus(Chat: string): string;
var
St, Ch: TStringArray;
C: TIntegerArray;
M, T: TPoint;
I: Integer;
II: Byte;
S: TBox;
begin
Result := 'unknown';
GetMousePos(M.X, M.Y);
if (PointInBox(M, IntToBox(3, 481, 404, 503))) then
MMouse(M.X, M.Y - 33, 5, 5);
if (LowerCase(Chat) = 'all') then
begin
if (CurrentChat = 'all') then
Result := 'on'
else
Result := 'off';
Exit;
end;
C := [65280, 65535, 255, 16776960]
St := ['on', 'friends', 'off', 'hide'];
Ch := ['game', 'public', 'private', 'clan', 'trade', 'assist'];
if (not (InStrArrEx(LowerCase(Chat), Ch, I))) then
Exit;
S := IntToBox(71 + (57 * I), 492, 107 + (57 * I), 501);
T := Point((S.X1 + S.X2) div 2, (S.Y1 + S.Y2) div 2);
for II := 0 to 3 do
if (FindColorSpiral(T.X, T.Y, C[II], S.X1, S.Y1, S.X2, S.Y2)) then
if ((Ch[I] = 'game') and (C[II] = 65535)) then
Result := 'filter'
else
if ((Ch[I] = 'game') and (C[II] = 65280)) then
Result := 'all'
else
Result := St[II];
end;
{*******************************************************************************
function SetChatEx(Chat, Status: string): Boolean;
By: IceFire908
Description: Sets the chat to desired status.
*******************************************************************************}
function SetChatEx(Chat, Status: string): Boolean;
var
Ch: TStringArray;
Cha, Sta: string;
C, M: TPoint;
I: Integer;
begin
GetMousePos(M.X, M.Y);
if (PointInBox(M, IntToBox(3, 481, 404, 503))) then
MMouse(M.X, M.Y - 33, 5, 5);
Cha := LowerCase(Chat);
Sta := LowerCase(Status);
Result := (CurrentChatStatus(Cha) = Sta);
if (Result) then
Exit;
Ch := ['all', 'game', 'public', 'private', 'clan', 'trade', 'assist'];
if (not (InStrArrEx(Cha, Ch, I))) then
Exit;
C := Point(33 + (56 * I), 492);
if (((Cha = 'all') and (Sta = 'on')) or (Sta = 'view')) then
begin
if (not (CurrentChat = Cha)) then
Mouse(C.X, C.Y, 5, 5, True);
Result := True;
Exit;
end;
Mouse(C.X, C.Y, 5, 5, False);
Wait(200 + Random(100));
Result := ChooseOption(Capitalize(Status));
end;