Bionicle
2010-03-03 18:08:03
{*******************************************************************************
function GetLobbyTab: Integer;
By: Bionicle1800
Description: Gets current lobby tab.
*******************************************************************************}
function GetLobbyTab: Integer;
var
T: Integer;
begin
for T := 0 to 4 do
begin
if GetColor(97 + T*123, 31) = 7375258 then
begin
result := T + 1;
exit;
end;
end;
end;
{*******************************************************************************
function LobbyTab(Tab: Integer): Boolean;
By: Bionicle1800
Description: Goes to the lobby tab specified by the integer 'Tab'.
Valid arguments are 1 through 5.
*******************************************************************************}
function LobbyTab(Tab: Integer): Boolean;
begin
if not InRange(Tab, 1, 5) then
begin
Srl_Warn('LobbyTab', 'Tab ' + IntToStr(Tab) + ' is not valid.', warn_AllVersions);
exit;
end;
result := GetLobbyTab = Tab;
if result then
exit;
Mouse(97 + (Tab-1)*123, 31, 6, 6, true);
Wait(30);
result := GetLobbyTab = Tab;
end;
{*******************************************************************************
function JoinLobbyClan(Clan: String): Boolean;
By: Bionicle1800
Description: Joins a clan chat in the lobby specified by the string 'Clan'.
*******************************************************************************}
function JoinLobbyClan(Clan: String): Boolean;
begin
if LobbyTab(4)then
begin
if GetColor(308, 273) = 7838847 then
begin
Mouse(RandomRange(233, 533), RandomRange(269, 292), 0, 0, true);
Wait(100+Random(50));
TypeSend(Clan);
if GetColor(294, 290) = 7838847 then
begin
Mouse(RandomRange(265, 377), RandomRange(287, 307), 0, 0, true);
Wait(1000+Random(500));
result := true;
end;
end;
end;
end;
{*******************************************************************************
function LeaveLobbyClan: Boolean;
By: Bionicle1800
Description: Leaves a clan chat in the lobby.
*******************************************************************************}
function LeaveLobbyClan: Boolean;
begin
LobbyTab(4);
if GetColor(308, 273) = 6842472 then
begin
Mouse(233+random(300), 269+random(21), 0, 0, true);
result := true;
end;
end;Comments, additions, corrections, fixes, commits are all welcome and appreciated :p