SRL Archive - OSR Help

ATPA Problems


xtrapsp

2012-04-05 18:27:11

Hey guys,

So this is winding me the F up now. :P

I have to APTA's one for IVY (Which works) and one for a nest.

I'm struggling so bad to figure this out.. it's a war.

program xtraivy;

//{$DEFINE SMART}
{$i SRL\SRL.simba}
{$i SRL/SRL/skill/woodcutting.simba}
{$i sps/sps.simba}
{$i SRL/SRL/Misc/Debug.simba}

{===================================================================

Instructions:
1. Start by IVY (This script was written for CastleWars but it should work
elsewhere.
2. Make sure hatchet is equiped
3.Leave bot to work it's magic
4. Check every now and again as Simba hasn't done all Randoms!

XtraIVY

Release Date : 17/02/2012

Author : xtrapsp

Support: [url]http://villavu.com/forum/showthread.php?t=75528[/url]

Changelog:
06/03/2012 - Theres been a huge SRL Update so I'm learning source. Tweaking parts of code!
23/02/2012 - Changed around with the Nest Settings
20/02/2012 - Cleaned up script a bit + Setup script for addons
17/02/2012 - Chopping done.
18/02/2012 - Added Various antiban.
19/02/2012 - Added elements which aren't in use yet.


===================================================================}

Const
SRLStats_Username = '';
SRLStats_Password = '';
NumbOfPlayers= 1;
StartPlayer= 0;
Debug = True;


procedure DeclarePlayers;

begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;

with Players[0] do
begin
Name := 'xtrapsp';
Pass := '';
Nick := '';
Pin := '';
BoxRewards := ['amp'];
lampSkill := SKILL_WOODCUTTING;
Member := True;
Active := True;
end;

end;

function ClickNest: Boolean;
var
x, y, i, h : Integer;
TPA : TPointArray;
ATPA : T2DPointArray;
begin
if not LoggedIn then Exit;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.15, 0.27);
FindColorsSpiralTolerance(x, y, TPA, 5727592, MSX1, MSY1, MSX2, MSY2, 21);
ATPA := SplitTPAEx(TPA, 5, 5);
writeln('Check line excecuted');
if (Length(ATPA) = 0) then
begin
writeln('Could not find Nest colour');
Exit;
end;
SortATPASize(ATPA, True);
h := High(ATPA);
for i := 0 to h do
begin
Writeln('Length: ' + IntToStr(Length(ATPA[i])));
MiddleTPAEx(ATPA[i], x, y);
MMouse(x, y, 4, 4);
if WaitUpText('est', 100) then
begin
Writeln('Found Nest!');
Mouse(x, y, 2, 2, True);
Result := True;
Wait(8000 + Random(16000));
end else
Writeln('Couldn''t find the right uptext for a Nest.');
wait (100 + Random(1000));
Makecompass('N');
end;

SetColorSpeed2Modifiers(0.2, 0.2);//Don't forget to reset back to default.
ColorToleranceSpeed(1);
end;
Procedure AFK;
begin
if not loggedIn then Exit;
Case Random (100) Of
1..15 : Wait(1000 + Random (3050));
16..24 : Wait (1340 + Random (1093));
25..45: Wait (1211 + Random (6000));
46..47: Wait (20000 + Random (10000)); // This looks like you've gone to get a drink
48..67: BoredHuman;
end;
end;

Procedure Birdsnest2;
var
x, y: Integer; //IsChatBoxTextAnyLine(Text: string; TextCol: Integer): Boolean;
begin
if IsChatBoxTextAnyLine('A bird', 255) Then
begin
FindObjEx(x, y, ['ake B', 'Bird', 'nest'], [2767422, 2961972, 3818051], 5, 50, 191, 149, 354, 252);
Mouse(x, y, 0, 0, True);
Wait(1500+Random(500))
end;
end;

procedure Invfull_bank;
var
myPath:TPointArray;
BankSymbol,x,y:integer;
begin
if not LoggedIn then exit else
FindNormalRandoms;
SetColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.02, 0.07);
if InvFull Then begin
Writeln('Inventory full. Attempting to walk to bank in Castle Wars');
SPS_Setup(RUNESCAPE_SURFACE,['3_10','4_10']);//SPS Areas
myPath :=[ Point(1503, 4368), Point(1564, 4365), Point(1606, 4366),
Point(1635, 4355), Point(1643, 4324), Point(1648, 4300),
Point(1645, 4286), Point(1628, 4279), Point(1605, 4280),
Point(1595, 4309), Point(1575, 4280), Point(1597, 4311)];//Path
SPS_WalkPath(myPath);
BankSymbol := DTMFromString('mggAAAHicY2NgYAhmYmCIAOIgIPYB4kAgjgRiRUYGBjkg'+
'lgJiBSBWB2JlIC4KEmY4cOAAw5bFrmCagYGR4fvbtwzYA'+
'DNYFjuGAAC7xwyd');
if FindDTM(BankSymbol,x, y,1, 1, 200, 200) then
begin
Writeln('looking for DTM Symbol');
Mouse(x,y,1,1,True);
While (IsMoving) do
begin
repeat
OpenBankChestEdge(SRL_BANK_CW);
Until(BankScreen); //there's no failsafe here, but it's fine standards wise
DepositAll;
end;
Writeln('Attempting to walk to back to IVY');
SPS_Setup(RUNESCAPE_SURFACE,['3_10','4_10','3_11']);//SPS Areas
myPath := [Point(1592, 4279), Point(1635, 4279), Point(1645, 4314),
Point(1647, 4351), Point(1594, 4385), Point(1543, 4410),
Point(1517, 4372), Point(1534, 4368), Point(1505, 4370),
Point(1519, 4369), Point(1522, 4372), Point(1514, 4375),
Point(1509, 4372), Point(1518, 4372), Point(1510, 4365),
Point(1528, 4373)];
SPS_WalkPath(myPath);
(* We revert back to the defaults here. *)
SetColorSpeed2Modifiers(0.2, 0.2);
SetColorToleranceSpeed(1);
end;
end;
end;

function ClickIVY: Boolean;
var
x, y, i, h : Integer;
TPA : TPointArray;
ATPA : T2DPointArray;
begin
if not LoggedIn then Exit;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.02, 0.7);
FindColorsSpiralTolerance(x, y, TPA, 4619873, MSX1, MSY1, MSX2, MSY2, 11);
ATPA := SplitTPAEx(TPA, 10, 10);
DebugATPA(ATPA, 'aptatest');

if (Length(ATPA) = 0) then
begin
writeln('Could not find IVY colour');
Exit;
end;
SortATPAFromMidPoint(ATPA, Point(MSCX, MSCY));
h := High(ATPA);
for i := 0 to h do
begin
Writeln('Length: ' + IntToStr(Length(ATPA[i])));
MiddleTPAEx(ATPA[i], x, y);
MMouse(x, y, 4, 4);
if WaitUpText('vy', 100) then
begin
Writeln('Found Ivy!');
Mouse(x, y, 2, 2, True);
Result := True;
Wait(8000 + Random(16000));
AFK;
ClickNest;
end else
Writeln('Couldn''t find the right uptext for IVY.');
wait (100 + Random(1000));
end;
SetColorSpeed2Modifiers(0.2, 0.2);//Don't forget to reset back to default.
ColorToleranceSpeed(1);
end;

procedure x_Stats_Commit;
var
Gained: Integer;
begin
stats_IncVariable('Woodcutting EXP', (Gained));
Stats_Commit;
Writeln('Updated SRL Stats')
end;

Procedure ProgressReport;
var
startEXP, newExp, Gained : Integer;
begin
startExp := Players[CurrentPlayer].Integers[0];
newExp := GetXPBarTotal;
Gained := newExp - startExp;
WriteLn('Exp gained: ' + ToStr(Gained));
x_Stats_Commit;
end;

Procedure Antiban_Upgrade;
var
I: Integer;
CurrentCompassDegree: Extended;
begin
I := Random(1000);
case (I) of
0..99 :
begin
GameTab(tab_Stats);
HoverSkill('ccWoodcutting', False);
GameTab(28);
end;
100..200 :
begin
SleepAndMoveMouse(7000 + Random(500));
MakeCompass(CurrentCompassDegree-18+Random(32));
end;
200..210 :
begin
GameTab(Tab_Stats);
MakeCompass(CurrentCompassDegree-2+Random(34));
Wait(3000 + Random(500));
GameTab(28);
end;
211..220 :
begin
BoredHuman;
MakeCompass('N');
end;
221..300 :
begin
GameTab(Tab_Stats);
Wait(100 + Random(1000));
end;
end;
end;

Procedure FindNest_old;
var
X, Y: Integer;
Begin
if not LoggedIn then
Exit;
FindNormalRandoms;

If FindObjCustom(x, y, ['Ne', 'st'], [3290938,3883332], 5) Then
begin
Mouse( x, y, 2, 2, True);
Writeln('Found a nest... Attempting to pickup');
MakeCompass(10 + random(50));
end;
End;

begin
SMART_Server := 1;
SetupSRL;
DeclarePlayers;
LoginPlayer;
ToggleXPBar(True);
Players[CurrentPlayer].Integers[0] := GetXPBarTotal;
Writeln('Your using XtraIvy V 2.00');
Writeln('Please report any bugs on the thread');
Writeln('Thanks for using the most flawless IVY script on Simba :)');
MakeCompass('N');
Repeat
FindNormalRandoms;
ClickIVY;
ClickNest;
Case Random (77) Of
1..15 : Antiban_Upgrade;
end;
ClickNest
until(Not LoggedIn);
End.

I removed the repeats from the TPA's and made a loop in the main bit… so it does ClickIVY and then ClickNest. I've tried messing around with it… haha

PLEASE Help me. I'm pulling my hair out because I know it will be something stupid.

Problem: It won't find nests. Won't even start looking for them…

masterBB

2012-04-05 18:31:52

I believe you forgot to mention the problem, unless I'm retarded. What is the behavior or error you wish to eliminate?

xtrapsp

2012-04-05 18:32:51

From: masterBB
I believe you forgot to mention the problem, unless I'm retarded. What is the behavior or error you wish to eliminate?


Sorry I'm not quite with it :) Editted

Frement

2012-04-05 18:36:30

You should try using DebugATPA :)

xtrapsp

2012-04-05 18:45:05

From: Frement
You should try using DebugATPA :)


I have ;) I'm just so…. fedup of trying to fix something I can't fix haha :duh:

I need some alternate view…

nickrules

2012-04-05 19:53:20

function ClickNest: Boolean;
var
x, y, i, h : Integer;
TPA : TPointArray;
ATPA : T2DPointArray;
begin
if not LoggedIn then Exit;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.15, 0.27);

FindColorsSpiralTolerance(x, y, TPA, 5727592, MSX1, MSY1, MSX2, MSY2, 21);

ATPA := SplitTPAEx(TPA, 5, 5);

writeln('TPA split into ' + tostr(length(ATPA)) + ' parts.');

if (Length(TPA) = 0) then //changed from length(ATPA) to length(TPA)
begin
writeln('The TPA was empty, no colours found.');
Exit;
end;

SortATPASize(ATPA, True);
h := High(ATPA);
//writeln('ATPA is ' +tostr(h));
for i := 0 to h do
begin
Writeln('Length: ' + IntToStr(Length(ATPA[i])));
MiddleTPAEx(ATPA[i], x, y);
MMouse(x, y, 4, 4);
if WaitUpText('est', 100) then
begin
Writeln('Found Nest!');
Mouse(x, y, 2, 2, True);
Result := True;
Wait(8000 + Random(16000));
end else
Writeln('Couldn''t find the right uptext for a Nest.');
wait (100 + Random(1000));
Makecompass('N');
end;

SetColorSpeed2Modifiers(0.2, 0.2);//Don't forget to reset back to default.
ColorToleranceSpeed(1);
end;

Only changed one line, the rest is extra debugging. So, what is it outputting?

xtrapsp

2012-04-05 19:59:54

From: nickrules
function ClickNest: Boolean;
var
x, y, i, h : Integer;
TPA : TPointArray;
ATPA : T2DPointArray;
begin
if not LoggedIn then Exit;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.15, 0.27);

FindColorsSpiralTolerance(x, y, TPA, 5727592, MSX1, MSY1, MSX2, MSY2, 21);

ATPA := SplitTPAEx(TPA, 5, 5);

writeln('TPA split into ' + tostr(length(ATPA)) + ' parts.');

if (Length(TPA) = 0) then //changed from length(ATPA) to length(TPA)
begin
writeln('The TPA was empty, no colours found.');
Exit;
end;

SortATPASize(ATPA, True);
h := High(ATPA);
//writeln('ATPA is ' +tostr(h));
for i := 0 to h do
begin
Writeln('Length: ' + IntToStr(Length(ATPA[i])));
MiddleTPAEx(ATPA[i], x, y);
MMouse(x, y, 4, 4);
if WaitUpText('est', 100) then
begin
Writeln('Found Nest!');
Mouse(x, y, 2, 2, True);
Result := True;
Wait(8000 + Random(16000));
end else
Writeln('Couldn''t find the right uptext for a Nest.');
wait (100 + Random(1000));
Makecompass('N');
end;

SetColorSpeed2Modifiers(0.2, 0.2);//Don't forget to reset back to default.
ColorToleranceSpeed(1);
end;

Only changed one line, the rest is extra debugging. So, what is it outputting?


Will try that out in a bit :) Thanks, In my script where would I put that function? I tried line 216 as i removed the loop and I tried the main loop but it doesn't start looking for the nest.. it's continuously on IVY?

nickrules

2012-04-05 20:43:17

That would just replace your current clicknest function.

here's the "full" thing:
program xtraivy;

//{$DEFINE SMART}
{$i SRL\SRL.simba}
{$i SRL/SRL/skill/woodcutting.simba}
{$i sps/sps.simba}
{$i SRL/SRL/Misc/Debug.simba}

{===================================================================

Instructions:
1. Start by IVY (This script was written for CastleWars but it should work
elsewhere.
2. Make sure hatchet is equiped
3.Leave bot to work it's magic
4. Check every now and again as Simba hasn't done all Randoms!

XtraIVY

Release Date : 17/02/2012

Author : xtrapsp

Support: [url]http://villavu.com/forum/showthread.php?t=75528[/url]

Changelog:
06/03/2012 - Theres been a huge SRL Update so I'm learning source. Tweaking parts of code!
23/02/2012 - Changed around with the Nest Settings
20/02/2012 - Cleaned up script a bit + Setup script for addons
17/02/2012 - Chopping done.
18/02/2012 - Added Various antiban.
19/02/2012 - Added elements which aren't in use yet.


===================================================================}

Const
SRLStats_Username = '';
SRLStats_Password = '';
NumbOfPlayers= 1;
StartPlayer= 0;
Debug = True;


procedure DeclarePlayers;

begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;

with Players[0] do
begin
Name := 'xtrapsp';
Pass := '';
Nick := '';
Pin := '';
BoxRewards := ['amp'];
lampSkill := SKILL_WOODCUTTING;
Member := True;
Active := True;
end;

end;

function ClickNest: Boolean;
var
x, y, i, h : Integer;
TPA : TPointArray;
ATPA : T2DPointArray;
begin
if not LoggedIn then Exit;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.15, 0.27);

FindColorsSpiralTolerance(x, y, TPA, 5727592, MSX1, MSY1, MSX2, MSY2, 21);

ATPA := SplitTPAEx(TPA, 5, 5);

writeln('TPA split into ' + tostr(length(ATPA)) + ' parts.');

if (Length(TPA) = 0) then
begin
writeln('The TPA was empty, no colours found.');
Exit;
end;

SortATPASize(ATPA, True);
h := High(ATPA);
//writeln('ATPA is ' +tostr(h));
for i := 0 to h do
begin
Writeln('Length: ' + IntToStr(Length(ATPA[i])));
MiddleTPAEx(ATPA[i], x, y);
MMouse(x, y, 4, 4);
if WaitUpText('est', 100) then
begin
Writeln('Found Nest!');
Mouse(x, y, 2, 2, True);
Result := True;
Wait(8000 + Random(16000));
end else
Writeln('Couldn''t find the right uptext for a Nest.');
wait (100 + Random(1000));
Makecompass('N');
end;

SetColorSpeed2Modifiers(0.2, 0.2);//Don't forget to reset back to default.
ColorToleranceSpeed(1);
end;


Procedure AFK;
begin
if not loggedIn then Exit;
Case Random (100) Of
1..15 : Wait(1000 + Random (3050));
16..24 : Wait (1340 + Random (1093));
25..45: Wait (1211 + Random (6000));
46..47: Wait (20000 + Random (10000)); // This looks like you've gone to get a drink
48..67: BoredHuman;
end;
end;

Procedure Birdsnest2;
var
x, y: Integer; //IsChatBoxTextAnyLine(Text: string; TextCol: Integer): Boolean;
begin
if IsChatBoxTextAnyLine('A bird', 255) Then
begin
FindObjEx(x, y, ['ake B', 'Bird', 'nest'], [2767422, 2961972, 3818051], 5, 50, 191, 149, 354, 252);
Mouse(x, y, 0, 0, True);
Wait(1500+Random(500))
end;
end;

procedure Invfull_bank;
var
myPath:TPointArray;
BankSymbol,x,y:integer;
begin
if not LoggedIn then exit else
FindNormalRandoms;
SetColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.02, 0.07);
if InvFull Then begin
Writeln('Inventory full. Attempting to walk to bank in Castle Wars');
SPS_Setup(RUNESCAPE_SURFACE,['3_10','4_10']);//SPS Areas
myPath :=[ Point(1503, 4368), Point(1564, 4365), Point(1606, 4366),
Point(1635, 4355), Point(1643, 4324), Point(1648, 4300),
Point(1645, 4286), Point(1628, 4279), Point(1605, 4280),
Point(1595, 4309), Point(1575, 4280), Point(1597, 4311)];//Path
SPS_WalkPath(myPath);
BankSymbol := DTMFromString('mggAAAHicY2NgYAhmYmCIAOIgIPYB4kAgjgRiRUYGBjkg'+
'lgJiBSBWB2JlIC4KEmY4cOAAw5bFrmCagYGR4fvbtwzYA'+
'DNYFjuGAAC7xwyd');
if FindDTM(BankSymbol,x, y,1, 1, 200, 200) then
begin
Writeln('looking for DTM Symbol');
Mouse(x,y,1,1,True);
While (IsMoving) do
begin
repeat
OpenBankChestEdge(SRL_BANK_CW);
Until(BankScreen); //there's no failsafe here, but it's fine standards wise
DepositAll;
end;
Writeln('Attempting to walk to back to IVY');
SPS_Setup(RUNESCAPE_SURFACE,['3_10','4_10','3_11']);//SPS Areas
myPath := [Point(1592, 4279), Point(1635, 4279), Point(1645, 4314),
Point(1647, 4351), Point(1594, 4385), Point(1543, 4410),
Point(1517, 4372), Point(1534, 4368), Point(1505, 4370),
Point(1519, 4369), Point(1522, 4372), Point(1514, 4375),
Point(1509, 4372), Point(1518, 4372), Point(1510, 4365),
Point(1528, 4373)];
SPS_WalkPath(myPath);
(* We revert back to the defaults here. *)
SetColorSpeed2Modifiers(0.2, 0.2);
SetColorToleranceSpeed(1);
end;
end;
end;

function ClickIVY: Boolean;
var
x, y, i, h : Integer;
TPA : TPointArray;
ATPA : T2DPointArray;
begin
if not LoggedIn then Exit;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.02, 0.7);
FindColorsSpiralTolerance(x, y, TPA, 4619873, MSX1, MSY1, MSX2, MSY2, 11);
ATPA := SplitTPAEx(TPA, 10, 10);
DebugATPA(ATPA, 'aptatest');

if (Length(ATPA) = 0) then
begin
writeln('Could not find IVY colour');
Exit;
end;
SortATPAFromMidPoint(ATPA, Point(MSCX, MSCY));
h := High(ATPA);
for i := 0 to h do
begin
Writeln('Length: ' + IntToStr(Length(ATPA[i])));
MiddleTPAEx(ATPA[i], x, y);
MMouse(x, y, 4, 4);
if WaitUpText('vy', 100) then
begin
Writeln('Found Ivy!');
Mouse(x, y, 2, 2, True);
Result := True;
Wait(8000 + Random(16000));
AFK;
ClickNest;
end else
Writeln('Couldn''t find the right uptext for IVY.');
wait (100 + Random(1000));
end;
SetColorSpeed2Modifiers(0.2, 0.2);//Don't forget to reset back to default.
ColorToleranceSpeed(1);
end;

procedure x_Stats_Commit;
var
Gained: Integer;
begin
stats_IncVariable('Woodcutting EXP', (Gained));
Stats_Commit;
Writeln('Updated SRL Stats')
end;

Procedure ProgressReport;
var
startEXP, newExp, Gained : Integer;
begin
startExp := Players[CurrentPlayer].Integers[0];
newExp := GetXPBarTotal;
Gained := newExp - startExp;
WriteLn('Exp gained: ' + ToStr(Gained));
x_Stats_Commit;
end;

Procedure Antiban_Upgrade;
var
I: Integer;
CurrentCompassDegree: Extended;
begin
I := Random(1000);
case (I) of
0..99 :
begin
GameTab(tab_Stats);
HoverSkill('ccWoodcutting', False);
GameTab(28);
end;
100..200 :
begin
SleepAndMoveMouse(7000 + Random(500));
MakeCompass(CurrentCompassDegree-18+Random(32));
end;
200..210 :
begin
GameTab(Tab_Stats);
MakeCompass(CurrentCompassDegree-2+Random(34));
Wait(3000 + Random(500));
GameTab(28);
end;
211..220 :
begin
BoredHuman;
MakeCompass('N');
end;
221..300 :
begin
GameTab(Tab_Stats);
Wait(100 + Random(1000));
end;
end;
end;

Procedure FindNest_old;
var
X, Y: Integer;
Begin
if not LoggedIn then
Exit;
FindNormalRandoms;

If FindObjCustom(x, y, ['Ne', 'st'], [3290938,3883332], 5) Then
begin
Mouse( x, y, 2, 2, True);
Writeln('Found a nest... Attempting to pickup');
MakeCompass(10 + random(50));
end;
End;

begin
SMART_Server := 1;
SetupSRL;
DeclarePlayers;
LoginPlayer;
ToggleXPBar(True);
Players[CurrentPlayer].Integers[0] := GetXPBarTotal;
Writeln('Your using XtraIvy V 2.00');
Writeln('Please report any bugs on the thread');
Writeln('Thanks for using the most flawless IVY script on Simba :)');
MakeCompass('N');
Repeat
FindNormalRandoms;
ClickIVY;
ClickNest;
Case Random (77) Of
1..15 : Antiban_Upgrade;
end;
ClickNest
until(Not LoggedIn);
End.

xtrapsp

2012-04-06 05:02:41

From: nickrules
That would just replace your current clicknest function.

here's the "full" thing:
program xtraivy;

//{$DEFINE SMART}
{$i SRL\SRL.simba}
{$i SRL/SRL/skill/woodcutting.simba}
{$i sps/sps.simba}
{$i SRL/SRL/Misc/Debug.simba}

{===================================================================

Instructions:
1. Start by IVY (This script was written for CastleWars but it should work
elsewhere.
2. Make sure hatchet is equiped
3.Leave bot to work it's magic
4. Check every now and again as Simba hasn't done all Randoms!

XtraIVY

Release Date : 17/02/2012

Author : xtrapsp

Support: [url]http://villavu.com/forum/showthread.php?t=75528[/url]

Changelog:
06/03/2012 - Theres been a huge SRL Update so I'm learning source. Tweaking parts of code!
23/02/2012 - Changed around with the Nest Settings
20/02/2012 - Cleaned up script a bit + Setup script for addons
17/02/2012 - Chopping done.
18/02/2012 - Added Various antiban.
19/02/2012 - Added elements which aren't in use yet.


===================================================================}

Const
SRLStats_Username = '';
SRLStats_Password = '';
NumbOfPlayers= 1;
StartPlayer= 0;
Debug = True;


procedure DeclarePlayers;

begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;

with Players[0] do
begin
Name := 'xtrapsp';
Pass := '';
Nick := '';
Pin := '';
BoxRewards := ['amp'];
lampSkill := SKILL_WOODCUTTING;
Member := True;
Active := True;
end;

end;

function ClickNest: Boolean;
var
x, y, i, h : Integer;
TPA : TPointArray;
ATPA : T2DPointArray;
begin
if not LoggedIn then Exit;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.15, 0.27);

FindColorsSpiralTolerance(x, y, TPA, 5727592, MSX1, MSY1, MSX2, MSY2, 21);

ATPA := SplitTPAEx(TPA, 5, 5);

writeln('TPA split into ' + tostr(length(ATPA)) + ' parts.');

if (Length(TPA) = 0) then
begin
writeln('The TPA was empty, no colours found.');
Exit;
end;

SortATPASize(ATPA, True);
h := High(ATPA);
//writeln('ATPA is ' +tostr(h));
for i := 0 to h do
begin
Writeln('Length: ' + IntToStr(Length(ATPA[i])));
MiddleTPAEx(ATPA[i], x, y);
MMouse(x, y, 4, 4);
if WaitUpText('est', 100) then
begin
Writeln('Found Nest!');
Mouse(x, y, 2, 2, True);
Result := True;
Wait(8000 + Random(16000));
end else
Writeln('Couldn''t find the right uptext for a Nest.');
wait (100 + Random(1000));
Makecompass('N');
end;

SetColorSpeed2Modifiers(0.2, 0.2);//Don't forget to reset back to default.
ColorToleranceSpeed(1);
end;


Procedure AFK;
begin
if not loggedIn then Exit;
Case Random (100) Of
1..15 : Wait(1000 + Random (3050));
16..24 : Wait (1340 + Random (1093));
25..45: Wait (1211 + Random (6000));
46..47: Wait (20000 + Random (10000)); // This looks like you've gone to get a drink
48..67: BoredHuman;
end;
end;

Procedure Birdsnest2;
var
x, y: Integer; //IsChatBoxTextAnyLine(Text: string; TextCol: Integer): Boolean;
begin
if IsChatBoxTextAnyLine('A bird', 255) Then
begin
FindObjEx(x, y, ['ake B', 'Bird', 'nest'], [2767422, 2961972, 3818051], 5, 50, 191, 149, 354, 252);
Mouse(x, y, 0, 0, True);
Wait(1500+Random(500))
end;
end;

procedure Invfull_bank;
var
myPath:TPointArray;
BankSymbol,x,y:integer;
begin
if not LoggedIn then exit else
FindNormalRandoms;
SetColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.02, 0.07);
if InvFull Then begin
Writeln('Inventory full. Attempting to walk to bank in Castle Wars');
SPS_Setup(RUNESCAPE_SURFACE,['3_10','4_10']);//SPS Areas
myPath :=[ Point(1503, 4368), Point(1564, 4365), Point(1606, 4366),
Point(1635, 4355), Point(1643, 4324), Point(1648, 4300),
Point(1645, 4286), Point(1628, 4279), Point(1605, 4280),
Point(1595, 4309), Point(1575, 4280), Point(1597, 4311)];//Path
SPS_WalkPath(myPath);
BankSymbol := DTMFromString('mggAAAHicY2NgYAhmYmCIAOIgIPYB4kAgjgRiRUYGBjkg'+
'lgJiBSBWB2JlIC4KEmY4cOAAw5bFrmCagYGR4fvbtwzYA'+
'DNYFjuGAAC7xwyd');
if FindDTM(BankSymbol,x, y,1, 1, 200, 200) then
begin
Writeln('looking for DTM Symbol');
Mouse(x,y,1,1,True);
While (IsMoving) do
begin
repeat
OpenBankChestEdge(SRL_BANK_CW);
Until(BankScreen); //there's no failsafe here, but it's fine standards wise
DepositAll;
end;
Writeln('Attempting to walk to back to IVY');
SPS_Setup(RUNESCAPE_SURFACE,['3_10','4_10','3_11']);//SPS Areas
myPath := [Point(1592, 4279), Point(1635, 4279), Point(1645, 4314),
Point(1647, 4351), Point(1594, 4385), Point(1543, 4410),
Point(1517, 4372), Point(1534, 4368), Point(1505, 4370),
Point(1519, 4369), Point(1522, 4372), Point(1514, 4375),
Point(1509, 4372), Point(1518, 4372), Point(1510, 4365),
Point(1528, 4373)];
SPS_WalkPath(myPath);
(* We revert back to the defaults here. *)
SetColorSpeed2Modifiers(0.2, 0.2);
SetColorToleranceSpeed(1);
end;
end;
end;

function ClickIVY: Boolean;
var
x, y, i, h : Integer;
TPA : TPointArray;
ATPA : T2DPointArray;
begin
if not LoggedIn then Exit;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.02, 0.7);
FindColorsSpiralTolerance(x, y, TPA, 4619873, MSX1, MSY1, MSX2, MSY2, 11);
ATPA := SplitTPAEx(TPA, 10, 10);
DebugATPA(ATPA, 'aptatest');

if (Length(ATPA) = 0) then
begin
writeln('Could not find IVY colour');
Exit;
end;
SortATPAFromMidPoint(ATPA, Point(MSCX, MSCY));
h := High(ATPA);
for i := 0 to h do
begin
Writeln('Length: ' + IntToStr(Length(ATPA[i])));
MiddleTPAEx(ATPA[i], x, y);
MMouse(x, y, 4, 4);
if WaitUpText('vy', 100) then
begin
Writeln('Found Ivy!');
Mouse(x, y, 2, 2, True);
Result := True;
Wait(8000 + Random(16000));
AFK;
ClickNest;
end else
Writeln('Couldn''t find the right uptext for IVY.');
wait (100 + Random(1000));
end;
SetColorSpeed2Modifiers(0.2, 0.2);//Don't forget to reset back to default.
ColorToleranceSpeed(1);
end;

procedure x_Stats_Commit;
var
Gained: Integer;
begin
stats_IncVariable('Woodcutting EXP', (Gained));
Stats_Commit;
Writeln('Updated SRL Stats')
end;

Procedure ProgressReport;
var
startEXP, newExp, Gained : Integer;
begin
startExp := Players[CurrentPlayer].Integers[0];
newExp := GetXPBarTotal;
Gained := newExp - startExp;
WriteLn('Exp gained: ' + ToStr(Gained));
x_Stats_Commit;
end;

Procedure Antiban_Upgrade;
var
I: Integer;
CurrentCompassDegree: Extended;
begin
I := Random(1000);
case (I) of
0..99 :
begin
GameTab(tab_Stats);
HoverSkill('ccWoodcutting', False);
GameTab(28);
end;
100..200 :
begin
SleepAndMoveMouse(7000 + Random(500));
MakeCompass(CurrentCompassDegree-18+Random(32));
end;
200..210 :
begin
GameTab(Tab_Stats);
MakeCompass(CurrentCompassDegree-2+Random(34));
Wait(3000 + Random(500));
GameTab(28);
end;
211..220 :
begin
BoredHuman;
MakeCompass('N');
end;
221..300 :
begin
GameTab(Tab_Stats);
Wait(100 + Random(1000));
end;
end;
end;

Procedure FindNest_old;
var
X, Y: Integer;
Begin
if not LoggedIn then
Exit;
FindNormalRandoms;

If FindObjCustom(x, y, ['Ne', 'st'], [3290938,3883332], 5) Then
begin
Mouse( x, y, 2, 2, True);
Writeln('Found a nest... Attempting to pickup');
MakeCompass(10 + random(50));
end;
End;

begin
SMART_Server := 1;
SetupSRL;
DeclarePlayers;
LoginPlayer;
ToggleXPBar(True);
Players[CurrentPlayer].Integers[0] := GetXPBarTotal;
Writeln('Your using XtraIvy V 2.00');
Writeln('Please report any bugs on the thread');
Writeln('Thanks for using the most flawless IVY script on Simba :)');
MakeCompass('N');
Repeat
FindNormalRandoms;
ClickIVY;
ClickNest;
Case Random (77) Of
1..15 : Antiban_Upgrade;
end;
ClickNest
until(Not LoggedIn);
End.


Can I ask why ClickNest is at the bottom twice sorry? It's confusing me a bit :)

It works now though :) Ty

edit: Here's something interesting it doesn't move onto ClickIVY; After, it keeps looking for the nest. That means I have an issue with my End Else doesn't it?

masterBB

2012-04-06 05:09:58

Cause that was already the case in your code?

xtrapsp

2012-04-06 06:13:33

From: masterBB
Cause that was already the case in your code?


Hey Master,

Sorry I'm not quite sure what your referencing to?

    ClickNest;
Case Random (77) Of
1..15 : Antiban_Upgrade;
end;
ClickNest

This part?

nickrules

2012-04-06 09:49:34

From: xtrapsp
Hey Master,

Sorry I'm not quite sure what your referencing to?

    ClickNest;
Case Random (77) Of
1..15 : Antiban_Upgrade;
end;
ClickNest

This part?


He's saying that Clicknest is called twice in what I pasted, because it's what you had in your original code. So yes, that part.


edit: Here's something interesting it doesn't move onto ClickIVY; After, it keeps looking for the nest. That means I have an issue with my End Else doesn't it?

Break out of the loop after you find it ;)

xtrapsp

2012-04-06 13:23:09

From: nickrules
He's saying that Clicknest is called twice in what I pasted, because it's what you had in your original code. So yes, that part.



Break out of the loop after you find it ;)


Ahh :P I get ya now. And breaking out of the loop is difficult when I removed the repeats and I dunno why it keeps repeating just that function… I'm obviously missing something obvious… it's staring at me in the face :P