PDA

View Full Version : Draynor Hybrid [Reflection]



Camaro'
10-19-2010, 03:24 AM
Draynor Hybrid - Camaro' Huge thanks to bobzilla for testing!!http://images4.wikia.nocookie.net/__cb20100917030223/runescape/images/6/63/Wc_symbol.PNGhttp://images3.wikia.nocookie.net/__cb20100917030141/runescape/images/e/e4/Fishing_logo_detail.png





Cuts willows or net fishes at draynor village. After two weeks(or whenever I remember close to then) this will be moved to the public.

Stats = http://scriptmanager.freehostia.com/scripts.php?sid=76


http://images4.wikia.nocookie.net/__cb20100917030223/runescape/images/6/63/Wc_symbol.PNGhttp://images3.wikia.nocookie.net/__cb20100917030141/runescape/images/e/e4/Fishing_logo_detail.png


Features



-Each player has a choice to either net fish in draynor and bank or chop willows and bank. The script will recognize what player does what and when to switch!
-Automatic Updating!
-SRL-Stats
-Flexibility between what character does what!
-Antiban, Antirandoms, and multi player!


http://images4.wikia.nocookie.net/__cb20100917030223/runescape/images/6/63/Wc_symbol.PNGhttp://images3.wikia.nocookie.net/__cb20100917030141/runescape/images/e/e4/Fishing_logo_detail.png



-Progress Reports


[============================================]
[ Draynor Hybrid 1.00 ]
[ by Camaro' ]
[============================================]
[ Time Running : 19 Minutes And 45 Seconds ]
[ Total Loads : 5 ]
[ Active Players : 2 ]
[ Anti Bans : 22 ]


[============================================]
[ Draynor Hybrid 1.00 ]
[============================================]
[================================================== =========================]
[ Nick | Active | Player Loads | Current Level | Levels Gained | Type ]
[================================================== =========================]
[ ole | True | 4 | 68 | 0 | WC_WILLOWS ]
[ rop | True | 1 | 31 | 0 | FISH ]
[================================================== =========================]


Manually stopped


http://images4.wikia.nocookie.net/__cb20100917030223/runescape/images/6/63/Wc_symbol.PNGhttp://images3.wikia.nocookie.net/__cb20100917030141/runescape/images/e/e4/Fishing_logo_detail.png


Please download the revamp!
-Download

Bobzilla69
10-19-2010, 03:42 PM
Testing it out now.

Would be nice if i could bait fish

Edit:

Problem with it just standing in bank when it should have walked to fishing spot (possible walking fail)
I manually moved it to fishing spot and it continued fine

Edit:

have script make the screen to its highest angle, its not doing it for me automatically

Edit:

if you have single player once it reaches the number of loads, it will log out and log straight back in.

[============================================]
[ Draynor Hybrid 1.00 ]
[ by Camaro' ]
[============================================]
[ Time Running : 22 Minutes And 35 Seconds ]
[ Total Loads : 6 ]
[ Active Players : 1 ]
[ Anti Bans : 31 ]
[============================================]
[ Draynor Hybrid 1.00 ]
[============================================]
[================================================== ===================]
[ Nick | Active | Player Loads | Current Level | Levels Gained | Type ]
[================================================== ===================]
[ obz | True | 6 | 35 | 0 | FISH ]
[================================================== ===================]

stopped due to mime random
did not detect my level gains

Camaro'
10-19-2010, 06:43 PM
Make sure your reflection is up to date if it does not walk.

Will fix the single player bug and another one within a few hours or so.

Camaro'
10-19-2010, 07:01 PM
Make sure your reflection is up to date if it does not walk.

Will fix the single player bug and another one within a few hours or so.

Version 1.05 Released


Fixed my updater
Fixed single player bug
Added a failsafe

This is the last time anyone will have to re download, I am sorry.

Bobzilla69
10-19-2010, 07:32 PM
Error: Out Of Range at line 396

its in login.simba first script still runs so something went wrong

Camaro'
10-19-2010, 09:16 PM
I assume you are still using one player, if you are in declare players make sure

CurrentPlayer := 0;
and
HowManyPlayers := 1;

Mine works perfectly for one player.

Bobzilla69
10-19-2010, 09:22 PM
I assume you are still using one player, if you are in declare players make sure

CurrentPlayer := 0;
and
HowManyPlayers := 1;

Mine works perfectly for one player.

i feel like such a fool now :duh: i forgot to change currentplayer to 0.

running now and will post results.

one thing is you should add Pin support (easy)

and also support for using bait to fish.

Camaro'
10-19-2010, 09:27 PM
I think bobzilla deserves the SRL Tester Cup, I think thats a cup :)

Single player works, just tested :)

Edit: I don't even know how to bait fish :D


UPDATED To 1.06

Small bug fixes.

It still doesn't SetAngle(True), just manually do that for now ;)

Bobzilla69
10-19-2010, 09:48 PM
this is 1.05 script[============================================]
[ Draynor Hybrid 1.00 ]
[ by Camaro' ]
[============================================]
[ Time Running : 27 Minutes And 53 Seconds ]
[ Total Loads : 7 ]
[ Active Players : 1 ]
[ Anti Bans : 24 ]
[============================================]
[ Draynor Hybrid 1.00 ]
[============================================]
[================================================== ===================]
[ Nick | Active | Player Loads | Current Level | Levels Gained | Type ]
[================================================== ===================]
[ obz | True | 7 | 38 | 1 | FISH ]
[================================================== ===================]
Status: /~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\
Status: | SRL Randoms Report |
Status: | www.villavu.com |
Status: |~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Status: \~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~/
Successfully executed.

will update to 1.06 now and post another proggy

Camaro'
10-19-2010, 09:52 PM
You don't have to, all 1.06 did was make the randomness in the function WalktoBank to 1, and cleaned up Declare players for people to not do the same as you :) None the less, I would like to thank you for being the only one helping on this script.

I am going to run overnight tonight.

and @SRL , I think bob should get the SRL Tester cup

Bobzilla69
10-19-2010, 10:26 PM
to add bait for fishing i think you should be able to do it simply by checking what fishing gear they have (black outline search in inventory), then instead of just clicking fishing spot do a right click and choose option 'bait'.

will edit with longer proggy soon

edit:

[============================================]
[ Draynor Hybrid 1.00 ]
[ by Camaro' ]
[============================================]
[ Time Running : 29 Minutes And 39 Seconds ]
[ Total Loads : 9 ]
[ Active Players : 1 ]
[ Anti Bans : 23 ]
[============================================]
[ Draynor Hybrid 1.00 ]
[============================================]
[================================================== ===================]
[ Nick | Active | Player Loads | Current Level | Levels Gained | Type ]
[================================================== ===================]
[ obz | True | 9 | 39 | 1 | FISH ]
[================================================== ===================]
Status: /~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\
Status: | SRL Randoms Report |
Status: | www.villavu.com |
Status: |~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Status: \~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~/
Successfully executed.

accidentally stopped it :( was on its last load as well

Camaro'
10-19-2010, 10:53 PM
Ha nice:)

Well, if you set the loads to 10, it will do 10 + Random(3).

I don't know why Levels gained some times works and some times doesn't.

Bobzilla69
10-20-2010, 03:52 PM
Hey,

thought i would help you out my making it bait fish as well.

the only thing it wont do if bank the fish it catches, i dont know how you do that bit so if you wouldnt mind adding it.

program New;

{$DEFINE SMART}
{$DEFINE REFLECTION}
{$I SRL/SRL.scar}
{$I SRL/SRL/MISC/Reports.scar}
{$I Reflection/Reflection.simba}
{$I SRL\SRL\Misc\Stats.scar}


const
Debug = False;


Version = '1.06'; //Dont Touch
COLOR_WILLOW = 4481105;//Dont Touch
COLOR_FISH = 11248543;//Dont Touch

//Enjoy!

//All bugs should now be fixed! :)


var
Fish, Axe, Willow: Integer;
Bans, Loads, PLoads: Integer;
DoAction : String;


DraynorBankTile: TTile;
DraynorFishTile: TTile;
DraynorTreeTile: TTile;



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

Stats_UserID := '';
Stats_Password := '';

with Players[0] do
begin
Name := '';
Pass := '';
Nick := '';
BoxRewards := ['Coins']; // Box Reward
Active := True; // Active ?
Strings[1] := 'FISH_BAIT'; //WC_WILLOWS or FISH_NET or FISH_BAIT
Integers[1] := 10; //Loads before switch/break
end;

end;

procedure Write(S: String);
begin
if (Debug) then

Writeln(TheTime + ': '+S+'');
end;

procedure Antiban;
begin
if Random(20) = 11 then
begin
MMouse(Random(500), Random(500), 0, 0);
Inc(Bans);
Exit;
end;
if Random(25) = 11 then
begin
MakeCompass(RandomRange(20, 350));
Wait(1000 + Random(2000));
MakeCompass('n');
Inc(bans);
Exit;
end;
if Random(44) = 11 then
begin
if (DoAction = 'Willow') then
HoverSkill('Woodcutting', false)
else
HoverSkill('Fishing', False);
inc(bans);
Exit;
end;
end;


function GetObject(HueMod, SatMod: Extended; Color, X1, Y1, X2, Y2, Tolerance, W, H: Integer; Close, Big: Boolean; Uptexts: TStringArray): Boolean;
//Sort Type
//1 - TPAToATPA | 2 - SplitTPA

//Close = True will sort the ATPA closest from you, False = Furthest
//Big = SortATPASize(True);

var
TPA: TPointArray;
X, Y, I, A, CTS: Integer;
ATPA : T2DPointArray;
TB: TBox;
begin
if not LoggedIn then Exit;
if (DoAction = 'Fish_Net') or (DoAction = 'Fish_Bait')then
Write('Fishing...');
if (DoAction = 'Willow') then
Write('Chopping...');
CTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(HueMod, SatMod);
FindColorsTolerance(TPA, Color, X1, Y1, X2, Y2, Tolerance);

SetColorSpeed2Modifiers(0.2, 0.2);
ColorToleranceSpeed(CTS);
if (Length(TPA) < 1) then
begin
Result := False;
Write('Failed finding the correct object');
Exit;
end;
ATPA := TPAToATPAEx(TPA, W, H);

SortATPAFrom(ATPA, Point(MSCX, MSCY));
A := High(ATPA);
for I := 0 to A do
begin
MiddleTPAEx(ATPA[I], X, Y);
TB := GetTPABounds(ATPA[I]);
if (TB.X2 - TB.X1 >= W - 5) and (TB.Y2 - TB.Y1 >= H - 5) then
begin
MMouse(X, Y, 5, 5);
if WaitUpTextMulti(UpTexts, 125) then
begin
GetMousePos(X, Y);
If DoAction = 'Fish_Net' then
begin
Mouse(X, Y, 0, 0, True);
end;

If DoAction = 'Fish_Bait' then
begin
Mouse(X, Y, 0, 0, False);
WaitOption('ait', 125);
end;

If DoAction = 'Willow' then
begin
Mouse(X, Y, 0, 0, True);
end;

FFlag(0);
Wait(500 + Random(500));
FFlag(0);
Wait(500 + Random(500));
Result := True;
Write('Found Object');
Exit;
end;
end;
end;
end;

function FindObject(Obj: string): Boolean;
begin
case Obj of
'Willow': Result := GetObject(0.18, 0.28, COLOR_WILLOW, MSX1, MSY1, MSX2, MSY2, 14, 30, 30, True, True, ['ill', 'low']);//MSI's values
'Fish_Net': Result := GetObject(0.23, 0.36, COLOR_FISH, MSX1, MSY1, MSX2, MSY2, 8, 17, 17, True, True, ['et', 'ish']);//MSI's values
'Fish_Bait': Result := GetObject(0.23, 0.36, COLOR_FISH, MSX1, MSY1, MSX2, MSY2, 8, 17, 17, True, True, ['et', 'ish']);
end;
end;

function FindItemBL(Inv, Item: Integer): Boolean;
var
Outline, x, y, i, Tuna: Integer;
TB: TBox;
begin
TB := InvBox(Inv);
Outline := 0;
for x := TB.x1 to TB.x2 do
for y := TB.y1 to TB.y2 do
if(GetColor(x, y) = SRL_OUTLINE_BLACK)then
Inc(Outline);
Result := (Outline = Item);

end;

function FindItemSlotBL(Item: Integer): Integer;
var
I : Integer;

begin
for I := 1 to 28 do
begin
if (FindItemBL(I, Item)) then
begin
Result := (I);
Exit;
end;
end;
end;

function ClickBank: boolean;
var T : TTile;
I : Integer;
X, Y :integer;
begin
T := GetMyPos;
if (Distance(T.X, T.Y, DraynorBankTile.X, DraynorBankTile.Y) < 4) then
begin
I := Round(RS_GetCompassAngleDegrees);
if (not(InRange(I, 348, 360)) and (not(InRange(I, 0, 17))))then
ClickNorth(True);
MouseBox(216, 90, 237, 205, 3);
if WaitUpText('ank', 100) then
begin
GetMousePos(x, y);
Mouse(x, y, 0, 0, False);
ChooseOption('uick');
Wait(1000 + Random(1000));
end;
end;
end;




function Bank: Boolean;
var T: Integer;
TB, TB2, TB3: Integer;
FS: Integer;
begin
if not InvFull then Exit;
if not LoggedIn then Exit;
FindNormalRandoms;
Marktime(T);

repeat
if (BankScreen) then
Break;
if (FS < 7) then
begin
if (not(ClickBank)) then
begin
Inc ( FS );
Wait(500 + Random(500));
Continue;
end else
begin
FFlag(0);
Wait(1000 + Random(1000));
if (BankScreen) then
Break;
end;
end else
begin
OpenBankQuiet('db');
FFlag(0);
Wait(1000 + Random(1000));
if (BankScreen) then
Break;
end;

until (TimeFromMark(T) > 120000)
if (TimeFromMark(T) > 120000) then
begin
Write('Bank failed');
Exit;
end;
TB := FindItemSlotBL(Fish);
TB2 := FindItemSlotBL(Willow);
if (TB > 0) and (TB < 29) then
begin
MouseItem(TB, False);
if WaitOption('ll', 400) then
begin
Wait(1500 + Random(900));
TB3 := FindItemSlotBL(Fish);
if (TB3 > 0) and (TB3 < 29) then
begin
MouseItem(TB3, False);
if WaitOption('ll', 400) then
begin
Wait(1500 + Random(900));
Result := True;
Inc(PLoads);
Inc(Loads);
Inc(Players[CurrentPlayer].Integers[20]);
Inc(Stats_CustomVars[1]);
if (DoAction = 'Fish_Net') or (DoAction = 'Fish_Bait') then
IncEx(Stats_CustomVars[3], 27)
else
IncEx(Stats_CustomVars[2], 27);
if (Random(2) = 1) then CloseBank;
Exit;
end;
end;
end;
end;
if (TB2 > 0) and (TB2 < 29) then
begin
MouseItem(TB2, False);
if WaitOption('All', 400) then
begin
Wait(500 + Random(500));
Result := True;
Inc(PLoads);
Inc(Loads);
Inc(Players[CurrentPlayer].Integers[20]);
Inc(Stats_CustomVars[1]);
if (DoAction = 'Fish_Net') or (DoAction = 'Fish_Bait') then
IncEx(Stats_CustomVars[3], 27)
else
IncEx(Stats_CustomVars[2], 27);
if (Random(2) = 1) then CloseBank;
Exit;
end;
end;
end;

function WalkToTrees: Boolean;

begin
if not LoggedIn then Exit;
Write('Walking to trees');


Result := WalkToTile(DraynorTreeTile, 2, 0);
if (not(Result)) then
begin
if (WalkToTile(DraynorBankTile, 0, 0)) then
Result := WalkToTile(DraynorTreeTile, 2, 0);
end;
FFlag(10);
while (IsMoving) do
Wait(200 + Random(200));
end;

function WalkToFish: Boolean;

begin
if not LoggedIn then Exit;
Write('Walking to fish');
Result := WalkToTile(DraynorFishTile, 2, 0);
if (not(Result)) then
begin
if (WalkToTile(DraynorBankTile, 0, 0)) then
Result := WalkToTile(DraynorFishTile, 2, 0);
end;
FFlag(10);
while (IsMoving) do
Wait(200 + Random(200));

end;

function WalkToBank: Boolean;

begin
if not LoggedIn then Exit;
Write('Walking to bank');
Result := WalkToTile(DraynorBankTile, 1, 0);
FFlag(16);
while (IsMoving) do
Wait(200 + Random(200));
end;


procedure TimerCheck;
begin
repeat
if (GetAnimation < 1) then
Break;
if (InvFull) then
Break;
Wait(750 + Random(1000));
if (Random(4) = 1) then
Antiban;
FindNormalRandoms;
until (False)
end;

procedure GetSkill(start: boolean);
begin
GameTab(TAB_STATS);
if (DoAction = 'Willow') then
begin
Players[CurrentPlayer].Integers[25] := GetSkillLevel('Woodcutting');
if (start) then
Players[CurrentPlayer].Integers[23] := GetSkillLevel('Woodcutting');
end;
if (DoAction = 'Fish_Net') or (DoAction = 'Fish_Bait') then
begin

Players[CurrentPlayer].Integers[25] := GetSkillLevel('Fishing');
if (start) then
Players[CurrentPlayer].Integers[23] := GetSkillLevel('Fishing');
end;
end;


procedure SetPlayer;
begin
MakeCompass('N');
SetAngle(True);
if (Players[CurrentPlayer].Strings[1] = 'WC_WILLOWS') then
DoAction := 'Willow';

if (Players[CurrentPlayer].Strings[1] = 'FISH_NET') then
DoAction := 'Fish_Net';

if (Players[CurrentPlayer].Strings[1] = 'FISH_BAIT') then
DoAction := 'Fish_Bait';

if (Players[CurrentPlayer].Integers[20] = 0) then
GetSkill(True)
else
GetSkill(False);
Players[CurrentPlayer].Integers[1] := Players[CurrentPlayer].Integers[1] + Random(3);
//Players[CurrentPlayer].Integers[1] := 1;
end;

{************************************************* ******************************
procedure UpdateStats;
By: IceFire908.
Description: Updates all online stats with some insurance against huge invalid numbers.
************************************************** *****************************}

procedure UpdateStats;
var
I: Byte;
begin
for I := 1 to 20 do
if (not (InRange(Stats_CustomVars[I], 0, 9999))) then
begin
WriteLn('********************** WARNING Stats_CustomVars[' + IntToStr(I) + '] := ' + IntToStr(Stats_CustomVars[I]) + '; is too large!');
Stats_CustomVars[I] := 0;
end;
SRLRandomsReport;
Stats_SendReport;
Stats_ManageAccounts;
end;

procedure Proggy;
var I : Integer;
begin
ClearDebug;

//int 20 = player loads
//int 25 = current level in wc/fish
//int 23 = start level in wc/ fish
//int 25 - int 23 = levels gained
//Loads amount of loads in all
//bans amount of antibans done


SRLProgressReport(ResultDebugBox, 'Draynor Hybrid', 'Camaro''', '1.00',
['Time Running', 'Total Loads', 'Active Players', 'Anti Bans'],
[TimeRunning, Loads, PlayersActive, Bans ]);
Players[CurrentPlayer].Integers[66] := (Players[CurrentPlayer].Integers[25] - Players[CurrentPlayer].Integers[23] );

SRLPlayerReport(
ResultDebugBox, 0, False,
[False, False, False, False, False, False],
['Player Loads', 'Current Level', 'Levels Gained', 'Type'],
[], [20, 25, 66], [1], []
);
UpdateStats;

end;

procedure ScriptTerminate;
begin
if LoggedIn then
GetSkill(False);

Proggy;
end;

procedure SetGlobals;
begin
Fish := 141;
Axe := 76;
Willow := 85;
DraynorBankTile := Tile(3092, 3242);
DraynorFishTile := Tile(3086, 3230);
DraynorTreeTile := Tile(3087, 3234);
end;

procedure Update;
var
LatestScript,latestversion : string;
FileNum : integer;
begin
latestversion := GetPage('http://fmerlocations.googlecode.com/svn/trunk/ver.txt');
if StrToFloatDef(latestversion, 0.1) <= StrToFloatDef(Version, 0.1) then // <3 EvilChicken! for StrToFloatDef idea I leech'd from his G.A.R.
begin
writeln('Script up to date! :)');
Wait(750);
Exit;
end;
wait(1000);
if StrToFloatDef(latestversion, 0.1) <= StrToFloatDef(Version, 0.1) then // <3 EvilChicken! for StrToFloatDef idea I leech'd from his G.A.R.
begin
writeln('Script up to date! :)');
Wait(750);
exit;
end;
Writeln('Please wait while I auto download you the newest version of the script.');
LatestScript := GetPage('http://fmerlocations.googlecode.com/svn/trunk/script.txt');
FileNum := RewriteFile(ScriptPath + 'Draynor Hybrid [' + (LatestVersion) + '].simba', true);
WriteFileString(FileNum, LatestScript);
CloseFile(FileNum);
Writeln('Script has been updated successfully.');
Writeln('It is located at: ' + 'Draynor Hybrid [' + (LatestVersion) + '].simba');
Writeln('Please close this script and open it and use it.');
TerminateScript;
end;

var I : Integer;



begin
Update;
Smart_Server := 80;
Smart_Signed := true;
SetupSRL;

SetGlobals;
DeclarePlayers;
Stats_ScriptID := '76';
LoginPlayer;
SetPlayer;


repeat

if (Random(10) = 4) then
GetSkill(false);
if (pLoads > Players[CurrentPlayer].Integers[1] - 1) then
begin
if (BankScreen) then
CloseBank;


Wait(500 + Random(500));
GetSkill(False);

if (PlayersActive < 2) then
begin

Logout;
Proggy;
TerminateScript;
end;

NextPlayer(True);
Wait(5000 + Random(5000));
SetPlayer;
pLoads := 0;
end;
if (not(InvFull)) then
if (DoAction = 'Fish_Net') or (DoAction = 'Fish_Bait') then
WalkToFish;
if (not(InvFull)) then
if (DoAction = 'Willow') then
WalkToTrees;

repeat
if (InvFull) then Break;
if (DoAction = 'Fish_Net') then
if FindObject('Fish_Net') then
TimerCheck;
if (DoAction = 'Fish_Bait') then
if FindObject('Fish_Bait') then
TimerCheck;
if (DoAction = 'Willow') then
if FindObject('Willow') then
TimerCheck;
FindNormalRandoms;
if (Random(3) = 1) then
Antiban;
Wait(150 + Random(150));
until InvFull
if (InvFull) then
begin
WalkToBank;
Bank;
end;
Proggy;
Wait(350 + Random(350));
FindNormalRandoms;
if (not(LoggedIn)) then
begin
NextPlayer(false);
PLoads := 0;
end;
until (InvFull)


end.

changes should be easy to see if not just ask

Camaro'
10-21-2010, 11:28 AM
I will add bait option when I get some time, I still have to test yours, but I may have a different way of adding so I may just rewrite it :)

Bobzilla69
10-21-2010, 12:35 PM
yeh sure np, i just thought i would try and quickly do it to help.

looking forward to testing it once it up

Camaro'
10-21-2010, 09:06 PM
yeh sure np, i just thought i would try and quickly do it to help.

looking forward to testing it once it up

Add a quick banking and test yours, if you can test that all script options, work, and multiplayer flawlessly then I will add yours :)

Bobzilla69
10-21-2010, 09:19 PM
i am not sure how to do the banking, i haven't used the method of finding item you have. point me in the direction and i will have a look tomorrow

Camaro'
10-21-2010, 11:30 PM
i am not sure how to do the banking, i haven't used the method of finding item you have. point me in the direction and i will have a look tomorrow

Blacklists, basically what it does is it counts each items number of pixels with the black color around each item If the current slot it is checking has the same number of pixels as lets say the global variable Fish, then it has found the correct item.

Bobzilla69
10-22-2010, 12:21 PM
[============================================]
[ Draynor Hybrid 1.00 ]
[ by Camaro' ]
[============================================]
[ Time Running : 27 Minutes And 56 Seconds ]
[ Total Loads : 7 ]
[ Active Players : 3 ]
[ Anti Bans : 22 ]
[============================================]
[ Draynor Hybrid 1.00 ]
[============================================]
[================================================== =========================]
[ Nick | Active | Player Loads | Current Level | Levels Gained | Type ]
[================================================== =========================]
[ obz | True | 2 | 41 | 0 | FISH_BAIT ]
[ erb | True | 2 | 69 | 0 | WC_WILLOWS ]
[ obz | True | 3 | 39 | 0 | FISH_NET ]
[================================================== =========================]

seems to work well with my changes.

program New;

{$DEFINE SMART}
{$DEFINE REFLECTION}
{$I SRL/SRL.scar}
{$I SRL/SRL/MISC/Reports.scar}
{$I Reflection/Reflection.simba}
{$I SRL\SRL\Misc\Stats.scar}


const
Debug = False;


Version = '1.06'; //Dont Touch
COLOR_WILLOW = 4481105;//Dont Touch
COLOR_FISH = 11248543;//Dont Touch

//Enjoy!

//All bugs should now be fixed! :)


var
Axe, Willow, Fish_Sardine, Fish_Herring, Fish_Rod, Fish_Net: Integer;
Bans, Loads, PLoads: Integer;
DoAction : String;

DraynorBankTile: TTile;
DraynorFishTile: TTile;
DraynorTreeTile: TTile;



procedure DeclarePlayers;
begin
HowManyPlayers := 3;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;

Stats_UserID := '';
Stats_Password := '';

with Players[0] do
begin
Name := '';
Pass := '';
Nick := '';
BoxRewards := ['Coins']; // Box Reward
Active := True; // Active ?
Strings[1] := 'FISH_BAIT'; //WC_WILLOWS or FISH_NET or FISH_BAIT
Integers[1] := 1; //Loads before switch/break
end;

with Players[1] do
begin
Name := '';
Pass := '';
Nick := '';
BoxRewards := ['Coins']; // Box Reward
Active := True; // Active ?
Strings[1] := 'WC_WILLOWS'; //WC_WILLOWS or FISH_NET or FISH_BAIT
Integers[1] := 1; //Loads before switch/break
end;

with Players[2] do
begin
Name := '';
Pass := '';
Nick := '';
BoxRewards := ['Coins']; // Box Reward
Active := True; // Active ?
Strings[1] := 'FISH_NET'; //WC_WILLOWS or FISH_NET or FISH_BAIT
Integers[1] := 1; //Loads before switch/break
end;

end;

procedure Write(S: String);
begin
if (Debug) then

Writeln(TheTime + ': '+S+'');
end;

procedure Antiban;
begin
if Random(20) = 11 then
begin
MMouse(Random(500), Random(500), 0, 0);
Inc(Bans);
Exit;
end;
if Random(25) = 11 then
begin
MakeCompass(RandomRange(20, 350));
Wait(1000 + Random(2000));
MakeCompass('n');
Inc(bans);
Exit;
end;
if Random(44) = 11 then
begin
if (DoAction = 'Willow') then
HoverSkill('Woodcutting', false)
else
HoverSkill('Fishing', False);
inc(bans);
Exit;
end;
end;


function GetObject(HueMod, SatMod: Extended; Color, X1, Y1, X2, Y2, Tolerance, W, H: Integer; Close, Big: Boolean; Uptexts: TStringArray): Boolean;
//Sort Type
//1 - TPAToATPA | 2 - SplitTPA

//Close = True will sort the ATPA closest from you, False = Furthest
//Big = SortATPASize(True);

var
TPA: TPointArray;
X, Y, I, A, CTS: Integer;
ATPA : T2DPointArray;
TB: TBox;
begin
if not LoggedIn then Exit;
if (DoAction = 'Fish_Net') or (DoAction = 'Fish_Bait')then
Write('Fishing...');
if (DoAction = 'Willow') then
Write('Chopping...');
CTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(HueMod, SatMod);
FindColorsTolerance(TPA, Color, X1, Y1, X2, Y2, Tolerance);

SetColorSpeed2Modifiers(0.2, 0.2);
ColorToleranceSpeed(CTS);
if (Length(TPA) < 1) then
begin
Result := False;
Write('Failed finding the correct object');
Exit;
end;
ATPA := TPAToATPAEx(TPA, W, H);

SortATPAFrom(ATPA, Point(MSCX, MSCY));
A := High(ATPA);
for I := 0 to A do
begin
MiddleTPAEx(ATPA[I], X, Y);
TB := GetTPABounds(ATPA[I]);
if (TB.X2 - TB.X1 >= W - 5) and (TB.Y2 - TB.Y1 >= H - 5) then
begin
MMouse(X, Y, 5, 5);
if WaitUpTextMulti(UpTexts, 125) then
begin
GetMousePos(X, Y);
If DoAction = 'Fish_Net' then
begin
Mouse(X, Y, 0, 0, True);
end;

If DoAction = 'Fish_Bait' then
begin
Mouse(X, Y, 0, 0, False);
WaitOption('ait', 125);
end;

If DoAction = 'Willow' then
begin
Mouse(X, Y, 0, 0, True);
end;

FFlag(0);
Wait(500 + Random(500));
FFlag(0);
Wait(500 + Random(500));
Result := True;
Write('Found Object');
Exit;
end;
end;
end;
end;

function FindObject(Obj: string): Boolean;
begin
case Obj of
'Willow': Result := GetObject(0.18, 0.28, COLOR_WILLOW, MSX1, MSY1, MSX2, MSY2, 14, 30, 30, True, True, ['ill', 'low']);//MSI's values
'Fish_Net': Result := GetObject(0.23, 0.36, COLOR_FISH, MSX1, MSY1, MSX2, MSY2, 8, 17, 17, True, True, ['et', 'ish']);//MSI's values
'Fish_Bait': Result := GetObject(0.23, 0.36, COLOR_FISH, MSX1, MSY1, MSX2, MSY2, 8, 17, 17, True, True, ['et', 'ish']);
end;
end;

function FindItemBL(Inv, Item: Integer): Boolean;
var
Outline, x, y, i, Tuna: Integer;
TB: TBox;
begin
TB := InvBox(Inv);
Outline := 0;
for x := TB.x1 to TB.x2 do
for y := TB.y1 to TB.y2 do
if(GetColor(x, y) = SRL_OUTLINE_BLACK)then
Inc(Outline);
Result := (Outline = Item);

end;

function FindItemSlotBL(Item: Integer): Integer;
var
I : Integer;

begin
for I := 1 to 28 do
begin
if (FindItemBL(I, Item)) then
begin
Result := (I);
Exit;
end;
end;
end;

function ClickBank: boolean;
var T : TTile;
I : Integer;
X, Y :integer;
begin
T := GetMyPos;
if (Distance(T.X, T.Y, DraynorBankTile.X, DraynorBankTile.Y) < 4) then
begin
I := Round(RS_GetCompassAngleDegrees);
if (not(InRange(I, 348, 360)) and (not(InRange(I, 0, 17))))then
ClickNorth(True);
MouseBox(216, 90, 237, 205, 3);
if WaitUpText('ank', 100) then
begin
GetMousePos(x, y);
Mouse(x, y, 0, 0, False);
ChooseOption('uick');
Wait(1000 + Random(1000));
end;
end;
end;




function Bank: Boolean;
var T: Integer;
TB, TB2, TB3, TB4: Integer;
FS: Integer;
begin
if not InvFull then Exit;
if not LoggedIn then Exit;
FindNormalRandoms;
Marktime(T);

repeat
if (BankScreen) then
Break;
if (FS < 7) then
begin
if (not(ClickBank)) then
begin
Inc ( FS );
Wait(500 + Random(500));
Continue;
end else
begin
FFlag(0);
Wait(1000 + Random(1000));
if (BankScreen) then
Break;
end;
end else
begin
OpenBankQuiet('db');
FFlag(0);
Wait(1000 + Random(1000));
if (BankScreen) then
Break;
end;

until (TimeFromMark(T) > 120000)
if (TimeFromMark(T) > 120000) then
begin
Write('Bank failed');
Exit;
end;

if Players[CurrentPlayer].Strings[1] = 'FISH_NET' then
begin
TB := FindItemSlotBL(Fish_Net);
if (TB > 0) and (TB < 29) then
begin
MouseItem(TB, False);
if WaitOption('ll', 400) then
begin
Wait(1500 + Random(900));
TB := FindItemSlotBL(Fish_Net);
if (TB > 0) and (TB < 29) then
begin
MouseItem(TB, False);
if WaitOption('ll', 400) then
begin
Wait(1500 + Random(900));
Result := True;
Inc(PLoads);
Inc(Loads);
Inc(Players[CurrentPlayer].Integers[20]);
Inc(Stats_CustomVars[1]);
IncEx(Stats_CustomVars[3], 27)
if (Random(2) = 1) then CloseBank;
Exit;
end;
end;
end;
end;
end;

if Players[CurrentPlayer].Strings[1] = 'FISH_BAIT' then
begin
TB3 := FindItemSlotBL(Fish_Sardine);
if (TB3 > 0) and (TB3 < 29) then
begin
MouseItem(TB3, False);
if WaitOption('ll', 400) then
begin
Wait(1500 + Random(900));
TB4 := FindItemSlotBL(Fish_Herring);
if (TB4 > 0) and (TB4 < 29) then
begin
MouseItem(TB4, False);
if WaitOption('ll', 400) then
begin
Wait(1500 + Random(900));
Result := True;
Inc(PLoads);
Inc(Loads);
Inc(Players[CurrentPlayer].Integers[20]);
Inc(Stats_CustomVars[1]);
IncEx(Stats_CustomVars[3], 26)
if (Random(2) = 1) then CloseBank;
Exit;
end;
end;
end;
end;
end;

if Players[CurrentPlayer].Strings[1] = 'WC_WILLOWS' then
begin
TB2 := FindItemSlotBL(Willow);
if (TB2 > 0) and (TB2 < 29) then
begin
MouseItem(TB2, False);
if WaitOption('All', 400) then
begin
Wait(500 + Random(500));
Result := True;
Inc(PLoads);
Inc(Loads);
Inc(Players[CurrentPlayer].Integers[20]);
Inc(Stats_CustomVars[1]);
IncEx(Stats_CustomVars[2], 27);
if (Random(2) = 1) then CloseBank;
Exit;
end;
end;
end;
end;

function WalkToTrees: Boolean;

begin
if not LoggedIn then Exit;
Write('Walking to trees');

Result := WalkToTile(DraynorTreeTile, 2, 0);
if (not(Result)) then
begin
if (WalkToTile(DraynorBankTile, 0, 0)) then
Result := WalkToTile(DraynorTreeTile, 2, 0);
end;
FFlag(10);
while (IsMoving) do
Wait(200 + Random(200));
end;

function WalkToFish: Boolean;

begin
if not LoggedIn then Exit;
Write('Walking to fish');
Result := WalkToTile(DraynorFishTile, 2, 0);
if (not(Result)) then
begin
if (WalkToTile(DraynorBankTile, 0, 0)) then
Result := WalkToTile(DraynorFishTile, 2, 0);
end;
FFlag(10);
while (IsMoving) do
Wait(200 + Random(200));

end;

function WalkToBank: Boolean;

begin
if not LoggedIn then Exit;
Write('Walking to bank');
Result := WalkToTile(DraynorBankTile, 1, 0);
FFlag(16);
while (IsMoving) do
Wait(200 + Random(200));
end;


procedure TimerCheck;
begin
repeat
if (GetAnimation < 1) then
Break;
if (InvFull) then
Break;
Wait(750 + Random(1000));
if (Random(4) = 1) then
Antiban;
FindNormalRandoms;
until (False)
end;

procedure GetSkill(start: boolean);
begin
GameTab(TAB_STATS);
if (DoAction = 'Willow') then
begin
Players[CurrentPlayer].Integers[25] := GetSkillLevel('Woodcutting');
if (start) then
Players[CurrentPlayer].Integers[23] := GetSkillLevel('Woodcutting');
end;
if (DoAction = 'Fish_Net') or (DoAction = 'Fish_Bait') then
begin

Players[CurrentPlayer].Integers[25] := GetSkillLevel('Fishing');
if (start) then
Players[CurrentPlayer].Integers[23] := GetSkillLevel('Fishing');
end;
end;


procedure SetPlayer;
begin
MakeCompass('N');
SetAngle(True);
if (Players[CurrentPlayer].Strings[1] = 'WC_WILLOWS') then
DoAction := 'Willow';

if (Players[CurrentPlayer].Strings[1] = 'FISH_NET') then
DoAction := 'Fish_Net';

if (Players[CurrentPlayer].Strings[1] = 'FISH_BAIT') then
DoAction := 'Fish_Bait';

if (Players[CurrentPlayer].Integers[20] = 0) then
GetSkill(True)
else
GetSkill(False);
Players[CurrentPlayer].Integers[1] := Players[CurrentPlayer].Integers[1] + Random(3);
//Players[CurrentPlayer].Integers[1] := 1;
end;

{************************************************* ******************************
procedure UpdateStats;
By: IceFire908.
Description: Updates all online stats with some insurance against huge invalid numbers.
************************************************** *****************************}

procedure UpdateStats;
var
I: Byte;
begin
for I := 1 to 20 do
if (not (InRange(Stats_CustomVars[I], 0, 9999))) then
begin
WriteLn('********************** WARNING Stats_CustomVars[' + IntToStr(I) + '] := ' + IntToStr(Stats_CustomVars[I]) + '; is too large!');
Stats_CustomVars[I] := 0;
end;
SRLRandomsReport;
Stats_SendReport;
Stats_ManageAccounts;
end;

procedure Proggy;
var I : Integer;
begin
ClearDebug;

//int 20 = player loads
//int 25 = current level in wc/fish
//int 23 = start level in wc/ fish
//int 25 - int 23 = levels gained
//Loads amount of loads in all
//bans amount of antibans done


SRLProgressReport(ResultDebugBox, 'Draynor Hybrid', 'Camaro''', '1.00',
['Time Running', 'Total Loads', 'Active Players', 'Anti Bans'],
[TimeRunning, Loads, PlayersActive, Bans ]);
Players[CurrentPlayer].Integers[66] := (Players[CurrentPlayer].Integers[25] - Players[CurrentPlayer].Integers[23] );

SRLPlayerReport(
ResultDebugBox, 0, False,
[False, False, False, False, False, False],
['Player Loads', 'Current Level', 'Levels Gained', 'Type'],
[], [20, 25, 66], [1], []
);
UpdateStats;

end;

procedure ScriptTerminate;
begin
if LoggedIn then
GetSkill(False);

Proggy;
end;

procedure SetGlobals;
begin
Fish_Sardine := 44
Fish_Herring := 71
//Fish_Bait := 91 //this is for one bait ( need to find a way to allow for stacked item)
Fish_Rod := 134
Fish_Net := 141;
Axe := 76;
Willow := 85;
DraynorBankTile := Tile(3092, 3242);
DraynorFishTile := Tile(3086, 3230);
DraynorTreeTile := Tile(3087, 3234);
end;

procedure Update;
var
LatestScript,latestversion : string;
FileNum : integer;
begin
latestversion := GetPage('http://fmerlocations.googlecode.com/svn/trunk/ver.txt');
if StrToFloatDef(latestversion, 0.1) <= StrToFloatDef(Version, 0.1) then // <3 EvilChicken! for StrToFloatDef idea I leech'd from his G.A.R.
begin
writeln('Script up to date! :)');
Wait(750);
Exit;
end;
wait(1000);
if StrToFloatDef(latestversion, 0.1) <= StrToFloatDef(Version, 0.1) then // <3 EvilChicken! for StrToFloatDef idea I leech'd from his G.A.R.
begin
writeln('Script up to date! :)');
Wait(750);
exit;
end;
Writeln('Please wait while I auto download you the newest version of the script.');
LatestScript := GetPage('http://fmerlocations.googlecode.com/svn/trunk/script.txt');
FileNum := RewriteFile(ScriptPath + 'Draynor Hybrid [' + (LatestVersion) + '].simba', true);
WriteFileString(FileNum, LatestScript);
CloseFile(FileNum);
Writeln('Script has been updated successfully.');
Writeln('It is located at: ' + 'Draynor Hybrid [' + (LatestVersion) + '].simba');
Writeln('Please close this script and open it and use it.');
TerminateScript;
end;

var I : Integer;



begin
Update;
Smart_Server := 38;
Smart_Signed := true;
SetupSRL;

SetGlobals;
DeclarePlayers;
Stats_ScriptID := '76';
LoginPlayer;
SetPlayer;


repeat

if (Random(10) = 4) then
GetSkill(false);
if (pLoads > Players[CurrentPlayer].Integers[1] - 1) then
begin
if (BankScreen) then
CloseBank;


Wait(500 + Random(500));
GetSkill(False);

if (PlayersActive < 2) then
begin

Logout;
Proggy;
TerminateScript;
end;

NextPlayer(True);
Wait(5000 + Random(5000));
SetPlayer;
pLoads := 0;
end;
if (not(InvFull)) then
if (DoAction = 'Fish_Net') or (DoAction = 'Fish_Bait') then
WalkToFish;
if (not(InvFull)) then
if (DoAction = 'Willow') then
WalkToTrees;

repeat
if (InvFull) then Break;
if (DoAction = 'Fish_Net') then
if FindObject('Fish_Net') then
TimerCheck;
if (DoAction = 'Fish_Bait') then
if FindObject('Fish_Bait') then
TimerCheck;
if (DoAction = 'Willow') then
if FindObject('Willow') then
TimerCheck;
FindNormalRandoms;
if (Random(3) = 1) then
Antiban;
Wait(150 + Random(150));
until InvFull
if (InvFull) then
begin
WalkToBank;
Bank;
end;
Proggy;
Wait(350 + Random(350));
FindNormalRandoms;
if (not(LoggedIn)) then
begin
NextPlayer(false);
PLoads := 0;
end;
until (InvFull)


end.

Only think i have not done is add pin support

Camaro'
10-23-2010, 02:33 AM
Tomorrow when I get time I will definitely make some quick changes, give you the credits and update!

Bobzilla69
10-23-2010, 09:01 AM
happy to help, i am sure you can improve what i have done. its a good script

Camaro'
10-23-2010, 05:41 PM
happy to help, i am sure you can improve what i have done. its a good script

Thanks, will add it some time today :)

BraK
10-24-2010, 01:18 PM
Camaro' Do you mind if I steal your updater it looks pretty nice. ;)

~BraK

Camaro'
10-24-2010, 03:29 PM
Camaro' Do you mind if I steal your updater it looks pretty nice. ;)

~BraK


No problem, just make sure you leave EvilChickens credits in there as well, I don't remember why I have credits for him(cause its like a year old this updater) but I have them for a reason :)

EvilChicken!
10-31-2010, 10:39 AM
Moved as requested. :)

Camaro'
10-31-2010, 03:07 PM
Moved as requested. :)

Thanks :)

Camaro'
11-11-2010, 05:00 PM
Thanks :)

Bump :)

Nikize
11-13-2010, 08:15 PM
[Hint] (170:3): Variable 'I' never used at line 169
[Hint] (170:3): Variable 'TUNA' never used at line 169
[Hint] (198:10): Variable 'Result' never used at line 197
[Hint] (434:5): Variable 'I' never used at line 433
[Hint] (508:5): Variable 'I' never used at line 507
Compiled succesfully in 750 ms.
Please wait while I auto download you the newest version of the script.
Script has been updated successfully.
It is located at: Draynor Hybrid [1.06].simba
Please close this script and open it and use it.
Successfully executed.

So reopening the script doesnt help, my Simba is up to date.

Camaro'
11-15-2010, 11:43 AM
[Hint] (170:3): Variable 'I' never used at line 169
[Hint] (170:3): Variable 'TUNA' never used at line 169
[Hint] (198:10): Variable 'Result' never used at line 197
[Hint] (434:5): Variable 'I' never used at line 433
[Hint] (508:5): Variable 'I' never used at line 507
Compiled succesfully in 750 ms.
Please wait while I auto download you the newest version of the script.
Script has been updated successfully.
It is located at: Draynor Hybrid [1.06].simba
Please close this script and open it and use it.
Successfully executed.

So reopening the script doesnt help, my Simba is up to date.
Just remove the line


Update;

from the main loop.

krayzie420
01-21-2011, 03:30 AM
Hey I tried running this script on simba (fully updated reflec,srl) and I instantly get this message
Exception in Script: Unable to find file 'SRL\SRL\Misc\Stats.scar' used from ''
Don't know what to do

Camaro'
01-25-2011, 10:23 PM
Hey I tried running this script on simba (fully updated reflec,srl) and I instantly get this message
Exception in Script: Unable to find file 'SRL\SRL\Misc\Stats.scar' used from ''
Don't know what to do

Updated the script! Please check the first post! :)