Wanted
2009-07-29 04:45:20
You need a lot of those functions to run the other ones in there.
CoinAmountEx is good for if you need to know exactly how much money you have if you have 100k or 10mil or more.
Unrelated: SCAR tags are stupid, for some reason they make into and some stuff doesn't appear to be spaced evenly though it is.
CoinAmountEx is good for if you need to know exactly how much money you have if you have 100k or 10mil or more.
Unrelated: SCAR tags are stupid, for some reason they make into and some stuff doesn't appear to be spaced evenly though it is.
// * function CurrentChat: string; // * by IceFire908
// * function CurrentChatStatus(Chat: string): string; // * by IceFire908
// * function SetChatEx(Chat, Status: string): Boolean; // * by IceFire908
// * function CoinAmountEx(Area: String): LongInt; // * by IceFire908
{*******************************************************************************
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 (I = 0) then
begin
if (GetColor(13, 487) = 1123377) then
Break;
end
else
if (GetColor(14 + (56 * I), 487) = 1123377) then
Break;
Ch := ['all', 'game', 'public', 'private', 'clan', 'trade', 'assist'];
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;
{*******************************************************************************
function CoinAmountEx(Area: string): LongInt;
By: IceFire908
Description: Returns the exact amount of coins in a specified interface.
Returns 0 if failed.
*******************************************************************************}
function CoinAmountEx(Area: string): LongInt;
var
OC, OG: string;
G, E: TPoint;
CH: TBox;
I: Byte;
begin
if (not (FindCoins(G.X, G.Y, Area))) then
Exit;
Result := GetAmount(G.X, G.Y);
if (Result < 99999) then
Exit;
OC := CurrentChat;
OG := CurrentChatStatus('game');
SetChatEx('game', 'view');
Wait(50 + Random(100));
SetChatEx('game', 'all');
Wait(50 + Random(100));
Mouse(G.X, G.Y, 5, 5, False);
Wait(200 + Random(100));
if (ChooseOption('xamine')) then
begin
Wait(50 + Random(100));
FixChat;
Wait(200 + Random(100));
for I := 0 to 7 do
begin
CH := IntToBox(7, 442 - (14 * I), 170, 455 - (14 * I));
if (IsTextInAreaEx(CH.X1, CH.Y1, CH.X2, CH.Y2, E.X, E.Y, 'oins', 0, SmallChars, False, False, -1, 1, 0)) then
begin
Result := StrToIntDef(GetNumbers(GetTextAtEx(8, E.Y, 0, SmallChars, False, False, -1, 1, 0, 60, False, tr_AllChars)), 0);
Break;
end
else
if (IsTextInAreaEx(CH.X1, CH.Y1, CH.X2, CH.Y2, E.X, E.Y, 'ovely', 0, SmallChars, False, False, -1, 1, 0)) then
Break;
end;
end;
Wait(50 + Random(100));
SetChatEx(OC, 'view');
Wait(50 + Random(100));
SetChatEx('game', OG);
end;