Baked0420
2009-10-25 15:42:54
I made a function, InClan, that returns whether or not you are in a clan, previously I had made JoinClan, so whenever I login it would join a clan, but with the new update, if you were in a clan when you logged out, it'd auto-join you back in, so I made a function to determine whether or not you were already in a clan to see if you needed to join a clan. I will also make InClan(ClanName: String);, I just thought of it now, but I'm going to make so it sees if you are in the clan of the string entered, and if the string entered = '', then it'll just see if you are in any clan or not. For now, here's Function InClan: Boolean; and procedure JoinClan(ClanName: String); :
{*******************************************************************************
function InClan;
by: Baked0420
description: Checks if you are in a clan
*******************************************************************************}
function InClan: Boolean;
var
x, y: Integer;
begin
If(GetCurrentTab <> Tab_Clan) then
GameTab(Tab_Clan);
Result:= not(FindBitmapMaskTolerance(CreateBitmapMaskFromText('Not in chat', StatChars), x, y, MIX1, MIY1, MIX2, MIY2, 50, 10));
end;
{*******************************************************************************
procedure JoinClan(CharacterName: String);
by: Baked0420
description: Joins the clan of the character name you put in.
*******************************************************************************}
procedure JoinClan(ClanName: String);
var
x, y: Integer;
begin
if(not(InClan)) then
begin
If(GetCurrentTab <> Tab_Clan) then
GameTab(Tab_Clan);
Wait(200 + random(200));
if(FindBitmapMaskTolerance(CreateBitmapMaskFromText('Join Chat', StatChars), x, y, MIX1, MIY1, MIX2, MIY2, 50, 10)) then
MouseBox(x, y, x+45, y+10, 1);
Wait(100 + random(200));
TypeSend(ClanName);
end;
end;