Floor66
2008-12-06 08:41:06
UPDATE: Shortened all functions in. Removed TPA's, they were unnecessary because of STATIC (non-changing) colours!
My custom made GameTab 10 functions!
To use these you must open your GameTab.scar and look for:
Around that is:
Change that to:
Then
Paste the code below underneath the corresponding section in GameTab.scar
My custom made GameTab 10 functions!
To use these you must open your GameTab.scar and look for:
InStrArrExAround that is:
Function InStrArrEx(S: String; StrArr: TStringArray; Var Where: Integer): Boolean; forward;
function CloseWindow: Boolean; forward;
function ClickContinue(Click, Wait: Boolean): Boolean; forward;
Change that to:
Function InStrArrEx(S: String; StrArr: TStringArray; Var Where: Integer): Boolean; forward;
function CloseWindow: Boolean; forward;
function ClickContinue(Click, Wait: Boolean): Boolean; forward;
Procedure TypeSend(Text: String); forward;
Then
Paste the code below underneath the corresponding section in GameTab.scar
//****************************************************************************//
// * GameTab 10 Related Functions.
//****************************************************************************//
{*******************************************************************************
Function InClanChat: Boolean;
By: Floor66
Description: Checks if we are in a Clan Chat
*******************************************************************************}
Function InCC: Boolean;
Begin
If GetCurrentTab <> 10 Then GameTab(10);
Result := Not FindTextTpa(39935, 0, MIX1, MIY1, MIX2, MIY2, 'ot in chat', 3, Nothing);
End;
{*******************************************************************************
Procedure LeaveCC;
By: Floor66
Description: Leaves the current Clan Chat
*******************************************************************************}
Function LeaveCC: Boolean;
Var
x, y, t : Integer;
Begin
If GetCurrentTab <> 10 Then GameTab(10);
If FindTextTpaEx(39935, 0, MIX1, MIY1, MIX2, MIY2, x, y, 'eave', 3, Nothing) Then
Begin
Mouse(x, y+10, 7, 7, True);
MarkTime(t);
While Not InCC Do
Begin
Wait(50+Random(100));
If TimeFromMark(t) > 10000 Then
Begin
Result := False;
Exit;
End;
End;
Result := True;
End;
End;
{*******************************************************************************
Function JoinCC(Username: String; LeaveIfIn: Boolean): Boolean;
By: Floor66
Description: Joins the specified Clan Chat
Example: JoinCC('zezima', True);
Will go out of current chat and join 'zezima'
Example2: JoinCC('zezima', False);
Will quit if we're already inside a chat
*******************************************************************************}
Function JoinCC(Username: String; LeaveIfIn: Boolean): Boolean;
Var
x, y, T, T2 : Integer;
Begin
If GetCurrentTab <> 10 Then GameTab(10);
Case LeaveIfIn Of
True: If InCC Then LeaveCC;
False: If InCC Then Exit;
End;
MarkTime(T2);
While InCC Do
Begin
Wait(50+Random(25));
If TimeFromMark(T2) > 10000 Then
Begin
Result := False;
Exit;
End;
End;
If FindTextTpaEx(39935, 10, MIX1, MIY1, MIX2, MIY2, x, y, 'oin', 3, Nothing) Then
Begin
Mouse(x, y, 7, 7, True);
End;
While Not FillIn Do Wait(50+random(25));
TypeSend(Username);
MarkTime(T);
While Not InCC Do
Begin
Wait(50+Random(100));
If TimeFromMark(T) > 10000 Then
Begin
Result := False;
Break;
Exit;
End;
End;
Result := True;
End;
Procedure TypeSendCC(Txt: String);
Begin
If Not InCC Then Exit;
TypeSend('/'+ Txt);
End;