BraK
2010-10-03 13:39:25
I just want to know if these functions can be added to Fletch.scar considering it's empty. They have been tested and work.
Feedback
{*******************************************************************************
Function IsFletchOption: Boolean;
By: BumbleBee
Description: Returns true if the Fletching Menu in chat box is open.
*******************************************************************************}
function IsFletchOption: Boolean;
begin
result := CountColor(128, MCx1, MCy1, MCx2, MCy2) > 0;
end;
{*******************************************************************************
Function FletchOption: Boolean;
By: Brak
Description: Clicks on the specified option in the chat box and fletches the
specified ammount. Arguments are as follows:
For Log : 'regular' 'oak' 'willow' 'maple' 'magic' are the valid arguments.
For Option : 'shaft' 'shortbow' 'longbow' 'stock'
For Amount Type in how many to fletch.
*******************************************************************************}
function FletchOption(const Log, Option: String; Amount: Integer): boolean;
var
T: Integer;
OPoint: Tpoint;
begin
if not LoggedIn then exit;
OPoint.y := 380;
case Lowercase(Log) of
'oak', 'willow', 'maple', 'yew':
begin
case Lowercase(Option) of
'shortbow': OPoint.x := 84;
'longbow': OPoint.x := 234;
'stock': OPoint.x := 384;
else
begin
Writeln('The Option value is incorrect');
Result := false;
exit;
end;
end;
end;
'magic':
begin
case Lowercase(Option) of
'shortbow': OPoint.x := 104;
'longbow': OPoint.x := 364;
else
begin
Writeln('The Option value is incorrect');
Result := false;
exit;
end;
end;
end;
'regular':
begin
case Lowercase(Option) of
'shortbow': OPoint.x := 174;
'longbow': OPoint.x := 294;
'stock': OPoint.x := 414;
'shaft': OPoint.x := 54;
end;
end;
else
begin
Writeln('The Log Value is Incorrect.');
result := false;
exit;
end;
end;
if IsFletchOption then
MouseBox(OPoint.x, OPoint.y, OPoint.x + 49, OPoint.y + 84, 2);
if WaitOption('ake X', 500) then
begin
T := GetTimeRunning + 3000;
while (GetTimeRunning < T) do
begin
Wait(RandomRange(200, 400));
if (CountColor(0, MCX1, MCY1, MCX2, MCY2) = 277) then
break;
end;
Wait(RandomRange(600, 800));
result := True;
TypeSend(IntToStr(Amount));
end;
end;Feedback