SRL Archive - SRL Suggestions

Fletch.scar


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.


{*******************************************************************************
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

Gu3st...

2010-10-03 13:43:12

"result := CountColor(128, MCx1, MCy1, MCx2, MCy2) > 0;" Seems a bit unreliable if you ask me… What about an InRange there? :)
"result := InRange(CountColor(128, MCx1, MCy1, MCx2, MCy2), Countcolor - 10, CountColor + 10);"

FletchOption could be made a lot shorter with the use of arrays, and JaGeX will soon be releasing a new function to make it easier for fletchers to fletch by the way

Dervish

2010-10-03 13:45:40

From: Zyt3x
"result := CountColor(128, MCx1, MCy1, MCx2, MCy2) > 0;" Seems a bit unreliable if you ask me… What about an InRange there? :)
"result := InRange(CountColor(128, MCx1, MCy1, MCx2, MCy2), Countcolor - 10, CountColor + 10);"

FletchOption could be made a lot shorter with the use of arrays, and JaGeX will soon be releasing a new function to make it easier for fletchers to fletch by the way


Explain the function please ? :p

BraK

2010-10-03 13:49:32

It'll be easy enough to adjust depending on what they update. How could they make it easier make all option. It'd be really easy to adjust for something like that. I'll have to look into putting all this into an array. It'd probably end up a T2DStringarray. Thanks for the feedback Zyt3x.

~BraK

E: IsFletchOption, Returns if the menu is in the chatbox after you use the knife on the logs. Probably could change that to detect the text.

FletchOption, chooses which option you want to do based on the log and item arguements entered. Next it moves the mouse to a random location in the TBox and right clicks. It then waits for the options to pop up and then chooses make X. Next it waits for the Enter ammount peice too pop up then waits a randomrange to make sure. Finally it sends the amount.