ReadySteadyGo
2008-09-15 18:22:28
<!– BEGIN TEMPLATE: formanswers –>
Jack Shannon - SRL Member Application Form
Jack Shannon
What is the meaning to life?
Where you Referred to SRL? If yes, by whom?
no
Programming Knowledge
N/A
Other Communitys
N/A
How Long have You Played Runescape
On and off 3-4 years
Are you affilated in anyway with Jagex LTD?
No
—————————————————–
Please write down a paragraph about Yourself.
I SCAR scripted a few years ago but stopped when I quit Runescape. Started Runescape again a couple of months ago, but thought that SCAR had died out until about 3-4 weeks ago when I found SRL. Researched it a bit, read a few tutorials to remind myself but also to learn all the new methods of doing things.
The Script I am posting is a WIP, started it yesterday.
——————————————————
Please Post a Sample of your Work. Only SCAR Scripts Accepted
——————————————————
<!– END TEMPLATE: formanswers –>
Jack Shannon - SRL Member Application Form
Jack Shannon
What is the meaning to life?
Where you Referred to SRL? If yes, by whom?
no
Programming Knowledge
N/A
Other Communitys
N/A
How Long have You Played Runescape
On and off 3-4 years
Are you affilated in anyway with Jagex LTD?
No
—————————————————–
Please write down a paragraph about Yourself.
I SCAR scripted a few years ago but stopped when I quit Runescape. Started Runescape again a couple of months ago, but thought that SCAR had died out until about 3-4 weeks ago when I found SRL. Researched it a bit, read a few tutorials to remind myself but also to learn all the new methods of doing things.
The Script I am posting is a WIP, started it yesterday.
——————————————————
Please Post a Sample of your Work. Only SCAR Scripts Accepted
//Yew Cutter by Jack Shannon
program YewCutter;
{.Include SRL\SRL.scar}
{.Include SRL\SRL\Skill\WoodCutting.scar}
var
x, y: Integer;
Deposits: Integer;
{-------------------------------------------------------------------------------
Name: MyMouse
Description: Combines Mouse and FFlag
-------------------------------------------------------------------------------}
Procedure MyMouse(x, y: integer);
begin
Mouse(x, y, 3, 3, True);
Wait(800 + Random(500));
FFlag(5 + Random(5));
end;
{-------------------------------------------------------------------------------
Name: WalkToYews
Description: Walks to the Yew trees
-------------------------------------------------------------------------------}
procedure WalkToYews;
var
RoadColor, DTM1, DTM2: integer;
begin
MakeCompass('N');
SetRun(True);
RoadColor := FindRoadColor;
if RadialWalk(RoadColor, 225, 270, 66, -1, 0) then
begin
Wait(500);
FFlag(5 + Random(5));
end;
MyMouse(565, 88);
MyMouse(571, 91);
DTM1 := DTMFromString('78DA634C67626008644001FCBDA20CFF81342' +
'310FF0702C65CA09A185435D619AA0CFC503520C0580854E34340' +
'4D2D504D05AA9ADCEA09286A0020010C25');
DTM2 := DTMFromString('78DA634C63626008624001FCBDA20CFF81342' +
'310FF0702C608A01A575435D619AA0CFC503520C05803545389AA' +
'26B77A02AA9A66A09A6802E6F402D524E257030012960DE3');
if FindSymbol(x, y, 'Tree') then
begin
MyMouse(x, y);
end else
if DTMRotated(DTM1, x, y, MMX1, MMY1, MMX2, MMY2) then
begin
MyMouse(x, y);
FreeDTM(DTM1);
end else
if DTMRotated(DTM2, x, y, MMX1, MMY1, MMX2, MMY2) then
begin
MyMouse(x, y);
FreeDTM(DTM2);
end;
end;
{-------------------------------------------------------------------------------
Name: WalkToBank
Description: Walks to Catherby bank
-------------------------------------------------------------------------------}
procedure WalkToBank;
var
BankDTM: integer;
begin
MakeCompass('N');
BankDTM := DTMFromString('78DA639CCEC4C060C680028A0A3319FE03694' +
'620FE0F048C3D4035DAA86AFEFC6162E087AA0101C6094035EA04' +
'D4CC01AAD1C0AD0628CB000018F30F74');
MyMouse(690, 88);
MyMouse(687, 81);
RoadColor := FindRoadColor;
if RadialWalk(RoadColor, 50, 130, 66, -1, 0) then
begin
Wait(500);
FFlag(5 + Random(5));
end;
if DTMRotated(BankDTM, x, y, MMX1, MMY1, MMX2, MMY2) then
begin
Mouse(x, y, 3, 3, True);
Wait(800 + Random(500));
FFlag(5 + Random(5));
end;
FreeDTM(BankDTM);
end;
{-------------------------------------------------------------------------------
Name: FindYew
Description: Finds the nearest Yew tree
-------------------------------------------------------------------------------}
function FindYew(var x, y: Integer): Boolean;
var
Points: TPointArray;
YewBoxes: T2DPointArray;
BoxCenter: TPoint;
i: integer;
begin
Result := False;
if (not FindColorsTolerance(Points, 3175783, MSX1, MSY1, MSX2, MSY2, 15)) then
Exit;
Result := True;
SortTPAFrom(Points, Point(MSCX, MSCY));
YewBoxes := TPAtoATPAEx(Points, 30, 30);
for i := 0 to High(YewBoxes) do
begin
BoxCenter := MiddleTPA(YewBoxes[i]);
MMouse(BoxCenter.x, BoxCenter.y, 10, 10);
if IsUpText('ew') then
begin
Result := True;
GetMousePos(x, y);
Exit;
end;
end;
end;
{-------------------------------------------------------------------------------
Name: FollowYewPoint
Description: Outputs the new co-ords of Yew
-------------------------------------------------------------------------------}
function FollowYewPoint(var x, y: integer): Boolean;
var
TempP: Tpoint;
Points: TpointArray;
begin
Result:= False;
TempP.x := x;
TempP.y := y;
repeat
if FindColorsTolerance(Points, 3175783, TempP.x - 40, TempP.y - 40, TempP.x + 40, TempP.y + 40, 15) then
TempP := MiddleTPA(Points);
until (not FlagPresent);
Result := True;
end;
{-------------------------------------------------------------------------------
Name: ChopYews
Description: Chops down Yews until inventory is full
-------------------------------------------------------------------------------}
procedure ChopYews;
var
tm: integer;
begin
MarkTime(tm);
repeat
if (not FindYew(x, y)) then
begin
Exit;
WriteLn('Could not find yew')
end;
Mouse(x, y, 0, 0, True);
Wait(200 - random(100));
if (not FollowYewPoint(x, y)) then
begin
Exit;
WriteLn('Could not follow yew point')
end;
MMouse(x, y, 3, 3);
repeat
Wait(500 + random(100));
FindEnt(x, y, True);
until (not IsUpText('ew')) or (InvFull);
FindNormalRandoms;
until(InvFull) or (TimeFromMark(tm) > (15 *60000));
end;
{-------------------------------------------------------------------------------
Name: OpenBankFast_cb
Description: Taken from SRL, added the arguments: 'Catherby' , 'cb'
-------------------------------------------------------------------------------}
function CaOpenBankFast(Location: String): Boolean;
var
x, y, i, l, c, z: Integer;
Info: TIntegerArray;
Booths, t: TPointArray;
begin
Wait(400);
case LowerCase(Location) of
'akb', 'al kharid': Info := [MSCX, MSCY, 7969203, 25, 1];
'lb', 'lumbridge': Info := [MSCX, MSCY, 4807788, 10, 1];
'veb', 'varrock east': Info := [MSCX, MSCY, 2971236, 10, 1];
'vwb', 'varrock west': Info := [270, 270, 5689318, 25, 1];
'feb', 'falador east': Info := [MSCX, MSCY + 50, 4612728, 14, 1];
'fwb', 'falador west': Info := [MSCY, MSCY, 4612728, 14, 1];
'db', 'draynor': Info := [MSCX, MSCY, 605006, 4, 1];
'eb', 'edgeville bank': Info := [MSCX + 50, MSCY, 3230295, 9, 2];
'cb', 'catherby': Info := [MSCX, MSCY, 7763833, 10, 1];
else
begin
srl_Warn('OpenBankFast', 'Unknown bank: '+Location, warn_AllVersions);
Exit;
end;
end;
MakeCompass('n');
z := GetColorToleranceSpeed;
ColorToleranceSpeed(Info[4]);
FindColorsSpiralTolerance(Info[0], Info[1], Booths, Info[2], MSX1, MSY1, MSX2, MSY2, Info[3]);
ColorToleranceSpeed(z);
SetArrayLength(t, 0);
t := Booths;
SetArrayLength(Booths, 0);
Booths := ReArrangeAndShortenArray(t, 14);
l := GetArrayLength(Booths) -1;
for i := 0 to l do
begin
if (not LoggedIn) or BankScreen or PinScreen then
Break;
if (LowerCase(Location) = 'vwb') or (LowerCase(Location) = 'varrock west') then
begin
Booths[i].X := Booths[i].X + 5;
Booths[i].Y := Booths[i].Y - 20;
end;
MMouse(Booths[i].X, Booths[i].Y, 3, 3);
Wait(75 + Random(75));
if IsUpText('ooth') Then
begin
GetMousePos(x, y);
Mouse(x, y, 0, 0, False);
Wait(70 + Random(75));
if ChooseOption('uickly') then
begin
FFLag(0);
MarkTime(c);
repeat
Wait(100);
until (BankScreen) or (PinScreen) or (TimeFromMark(c) > 3000);
if (Length(Players) > 0) then
if (Players[CurrentPlayer].Pin <> '') then
InPin(Players[CurrentPlayer].Pin);
end;
end;
end;
Result := (BankScreen) or (PinScreen);
end;
{-------------------------------------------------------------------------------
Name: Bank
Description: Deposits all in Catherby Bank
-------------------------------------------------------------------------------}
procedure Bank;
begin
CaOpenBankFast('cb');
InPin('1604');
DepositAll;
CloseBank;
end;
{-------------------------------------------------------------------------------
Name: ProgressReport
Description: Displays a rundown of how the script is doing
-------------------------------------------------------------------------------}
procedure ProgressReport;
begin
ClearReport;
WriteLn('----- Yew Cutter')
WriteLn('----- Duration:' + TimeRunning)
WriteLn('----- Trips:' + IntToStr(Deposits))
WriteLn('----- Yews:' + IntToStr(Deposits * 27))
end;
{-------------------------------------------------------------------------------
Name: SetupScript
Description: Sets up the Main Loop
-------------------------------------------------------------------------------}
Procedure SetupScript;
begin
SetupSRL;
ClearDeBug;
ActivateClient;
wait(2000);
end;
{-------------------------------------------------------------------------------
Main Loop
-------------------------------------------------------------------------------}
begin
SetupScript;
repeat
WalkToYews;
ChopYews;
WalkToBank;
Bank;
until(false);
end.——————————————————
<!– END TEMPLATE: formanswers –>
i liek u