SRL Archive - Archive

Metho D - SRL Member Application Form


Method

2007-10-21 23:31:01

<!– BEGIN TEMPLATE: formanswers –>
Metho D - SRL Member Application Form
Metho D

What is the meaning to life?


Where you Referred to SRL? If yes, by whom?
no


Programming Knowledge
No

Other Communitys
Inactive, but on Sythe, Fagex, Zybez, etc.

How Long have You Played Runescape
Been around RuneScape for about 5 years, on and off

Are you affilated in anyway with Jagex LTD?
No
—————————————————–
Please write down a paragraph about Yourself.

I've always liked programming and scripting but have only very recently gotten into SCAR scripting. I really like it a lot and hopefully by continuing to learn I'll have the opportunity to give back to the community. This is my second application to SRL Members, and I think I've improved a great deal since last time. I hope you, the current SRL Members, agree with me. Thanks for the opportunity!

——————————————————
Please Post a Sample of your Work. Only SCAR Scripts Accepted

{===================================================================]
[ Rimmington Chop 'N' Sell ]
[ ]
[ NAME : Rimmington Willow Chopper & Seller ]
[ WRITER : Metho D ]
[ CATEGORY : Woodcutting ]
[ DESCRIPTION : Chops and Sells Logs in Rimmington ]
[ USAGE : Start at the willows in Rimmington ]
[ AUTOCOLOR : Yes ]
[ NOTES : None so far. ]
[ CONTACT : [email]scottyr00g@gmail.com[/email] ]
[ SRL Used : 4 (rev 5) ]
[ Released : None Yet ]
[ ]
[===================================================================]
[ Instructions ]
[===================================================================]
[ 1. Use Runescape with Low Detail, Very Bright. ]
[ 2. Set your Screen to 32 bit TRUE color. ]
[ 3. Use SRL 4 rev 5 and SCAR 3.12. ]
[ 4. Setup Constants and Players. ]
[ 5. Place Players at the Willows or Falador East Bank. ]
[ 6. Hit Run and Begin Smashing! ]
[===================================================================]
[ Credits ]
[===================================================================]
[ SRL Team & Community : For the great include and tutorials. ]
[ pwnaz0r : For the main loop tutorial. ]
[ bobbohobbo + YoHoJo : For the ent checking procedure. ]
[ WT-Fakawi : For the FindFastRandoms procedure. ]
[ IronTeapot : For the idea to do this script. ]
[===================================================================}

program RimmingtonChopSell;
{.include SRL\SRL.scar}
{.include SRL/SRL/skill\Woodcutting.scar}

//------------------------Adjustable Parameters-------------------------------//
const
StartPlayer = 0; // Which player to start with
NumLoads = 5; // Number of loads for each player
PTimeOut = 30; // Max minutes per player
LTimeOut = 8; // Max minutes per load
TTimeOut = 3; // Max minutes before switching trees
MySRLID = ''; // Your SRL ID
MySRLPassword = ''; // Your SRL Password
RemoteMaster = ''; // Name of RC Master if you have one.
RemoteLoc = ''; // Location of RC Master if you have one.
//----------------------------------------------------------------------------//
VersionNumber = '1.0'; //Do not change
//----------------------------------------------------------------------------//

var
WillowDTM, EntsDodged, Logs, TempCount, Loads, PlayerLoads, TreeTime: Integer;

{*******************************************************************************
procedure DeclarePlayers;
By: SRL
Description: Stores the player information
*******************************************************************************}

procedure DeclarePlayers;
begin
HowManyPlayers := 5;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := StartPlayer;

Players[0].Name := ''; //Username
Players[0].Pass := ''; //Password
Players[0].Nick := ''; //3-4 letters of Username (Username becomes erna)
Players[0].Active := True; //Are you using this character?

Players[1].Name := '';
Players[1].Pass := '';
Players[1].Nick := '';
Players[1].Active := True;

Players[2].Name := '';
Players[2].Pass := '';
Players[2].Nick := '';
Players[2].Active := True;

Players[3].Name := '';
Players[3].Pass := '';
Players[3].Nick := '';
Players[3].Active := True;

Players[4].Name := '';
Players[4].Pass := '';
Players[4].Nick := '';
Players[4].Active := True;

NickNameBMP := CreateBitmapMaskFromText(Players[CurrentPlayer].Nick, UpChars);
end;

{*******************************************************************************
procedure LoadDTMs;
By: Metho D
Description: Loads the Willow DTM used in the script
*******************************************************************************}

procedure LoadDTMs;
begin
WillowDTM := DTMFromString('78DA63CC63626078C28002BC5DA419FE03694' +
'620FE0F048CA540353719D000231209A4CB806A1E1250530D54F3' +
'82809A02A09A7704D42403D5BC25A0260ED35F186A92806AEEE25' +
'7030059ED1056');
end;

{*******************************************************************************
procedure CountItemDTMs;
By: Metho D
Description: Counts the number of logs in the inventory
*******************************************************************************}

function CountItemDTMs(DTM: Integer): Integer;
var
i, x, y: Integer;
TB: TBox;
begin
if(not(LoggedIn)) then
Exit;
GameTab(4);
TempCount := 0;
for i := 1 to 28 do
begin
TB := InvBox(i);
if(ExistsItem(i)) then
if(FindDTM(DTM, x, y, TB.x1, TB.y1, TB.x2, TB.y2)) then
Inc(Result);
end;
TempCount := Result;
end;

{*******************************************************************************
procedure FixMiscStuff;
By: Metho D
Description: Sets the compass to North/Highest Angle and fixes the chats
*******************************************************************************}

procedure FixMiscStuff;
begin
if(not(LoggedIn)) then
Exit;
PerfectNorth;
SetChat('on', 1);
SetChat('friends', 2);
SetChat('friends', 3);
end;

{*******************************************************************************
function FindFastRandoms;
By: WT-Fakawi
Description: Checks for Randoms
*******************************************************************************}

function FindFastRandoms : Boolean;
var
i: Integer;
begin
for I := 1 to 11 do
begin
case I of
1: if FindDead then
Result := True;
2: if FindMod then
Result := True;
3: if FindMime then
Result := True;
4: if FindMaze then
Result := True;
5: if FindQuiz then
Result := True;
6: if FindTalk then
Result := True;
7: begin
if NoGameTab then
begin
Result := True;
Players[CurrentPlayer].loc := 'No GameTab';
Logout;
Exit;
end;
end;
9 : if RC then
Result := True;
10 : if FindFight then
begin
Result := True;
RunAwayDirection('N');
RunBack;
end;
11: if FindTalk then
Result := True;
end;
Wait(1);
end;
end;

{*******************************************************************************
procedure EntFinder;
By: YoHoJo, modded by bobbohobbo
Description: Checks for an Ent
*******************************************************************************}

procedure EntFinder;
var
EX, EY: integer;
FX, FY: integer;
SafeEntWait: LongInt;
begin
if (not(LoggedIn)) then
Exit;
begin
status('Searching for Ent');
if
(FindObjCustom(EX, EY, ['Tree', 'Willow', 'Oak'], [4690821], 5)) then
begin
MMouse(EX, EY, 0, 0)
if FindColorTolerance(FX, FY, 55769, 85, 15, 115, 15, 20) then
begin
Writeln('Ent Found!');
MouseFindFlag(645, 83, 2, 2);
MarkTime(SafeEntWait)
repeat
FTWait(5)
FindNormalRandoms;
if not (LoggedIn) then
Exit;
until TimeFromMark(SafeEntWait) > 29000 + Random(10000)
EntsDodged := EntsDodged + 1;
end;
end;
end;
end;

{*******************************************************************************
procedure FindRandoms;
By: Metho D
Description: Checks for quite a few randoms
*******************************************************************************}

procedure FindRandoms;
begin
if(not(LoggedIn)) then
Exit;
FindTalk;
FindFastRandoms;
FindNormalRandoms;
EntFinder;
end;

{*******************************************************************************
procedure ChopThemLogs;
By: Metho D
Description: Chops the willows while checking for ents
*******************************************************************************}

procedure ChopThemLogs(TreeTimeOut: Integer);
var
cx, cy, t, r: Integer;
begin
if(not(LoggedIn)) then
Exit;
if(not(FindAxe)) then
begin
Players[CurrentPlayer].Active := False;
Logout;
Exit;
end;
t := 0;
repeat
Inc(t);
if(t >= 3) then
begin
Players[CurrentPlayer].Active := False;
Logout;
Break;
end;
status('Finding tree');
if(not(FindObj(cx, cy, 'illow', 3560528, 15))) then
begin
r := 3 - t;
Writeln('Could not find tree, trying '+IntToStr(r)+' more times');
end else
begin
EntFinder;
Mouse(cx, cy, 2, 2, true);
GetMousePos(cx, cy);
repeat
status('Waiting for full inv, random, or tree to fall');
FTWait(8);
EntFinder;
FindRandoms;
until(InvFull) or (not(IsUpText('illow'))) or (TimeFromMark(TreeTime) >= TreeTimeOut);
end;
until(InvFull) or (TimeFromMark(TreeTime) >= TreeTimeOut);
end;

{*******************************************************************************
procedure WalkToStore;
By: Metho D
Description: Walks to the general store
*******************************************************************************}

procedure WalkToStore;
var
x, y: Integer;
TempAcc: Extended;
begin
if(not(LoggedIn)) then
Exit;
if(not(RadialWalk(FindRoadColor, 320, 350, 70, 1, 1))) then
begin
Writeln('Trying blind click');
Mouse(608, 25, 3, 3, true);
Flag;
end else
Flag;
if(FindSymbol(x, y, 'store')) then
begin
Mouse(x -3, y-2, 1, 1, true);
Flag;
end else
begin
TempAcc := SymbolAccuracy;
SymbolAccuracy := 0.5;
if(FindSymbol(x, y, 'store')) then
Mouse(x - 3, y - 2, 1, 1, true);
Flag;
SymbolAccuracy := TempAcc;
end;
end;


{*******************************************************************************
procedure FindShopKeeper;
By: Metho D
Description: Looks for the Shop Keeper in Rimmington General Store
*******************************************************************************}

procedure FindShopKeeper;
var
cx, cy, t: Integer;
begin
repeat
if(not(LoggedIn)) then
Exit;
status('Looking for Shop Assistant');
repeat
t := t + 1;
wait(50);
until(FindObj(cx, cy, 'ssistant', 2768960, 5)) or (t >= 10);
if(t >= 10) then
begin
Players[CurrentPlayer].Active := False;
Logout;
Exit;
end;
Mouse(cx, cy, 2, 2, false);
ChooseOption('rade');
Flag;
wait(500 + random(500));
until(FindColor(cx, cy, 2070783, 173, 33, 250, 47));
end;

{*******************************************************************************
procedure SellLogs;
By: Metho D
Description: Sells the willow logs
*******************************************************************************}

procedure SellLogs;
var
cx, cy, a: Integer;
begin
CountItemDTMs(WillowDTM);
status('Selling our logs');
repeat
if(FindDTM(WillowDTM, cx, cy, MIX1, MIY1, MIX2, MIY2)) then
begin
a := a + 1;
Mouse(cx, cy, 1, 1, False);
ChooseOption('ell 10');
wait(500 + random(100));
end;
until(not(FindDTM(WillowDTM, cx, cy, MIX1, MIY1, MIX2, MIY2))) or (a >= 10);
if(a >= 10) then
begin
Players[CurrentPlayer].Active := False;
Logout;
Exit;
end;
CloseWindow;
Logs := Logs + TempCount;
Players[CurrentPlayer].Integers[1] := Players[CurrentPlayer].Integers[1] + TempCount;
Loads := Loads + 1;
Players[CurrentPlayer].Integers[0] := Players[CurrentPlayer].Integers[0] + 1;
end;

{*******************************************************************************
procedure WalkBackToWillows;
By: Metho D
Description: Heads back to the willow trees
*******************************************************************************}

procedure WalkBackToWillows;
var
TreesDTM, x, y: Integer;
begin
if(not(LoggedIn)) then
Exit;
if(not(RadialWalk(FindRoadColor, 120, 140, 50, 1, 1))) then
begin
Writeln('Trying blind click');
Mouse(683, 116, 1, 1, true);
Flag;
end else
Flag;
TreesDTM := DTMFromString('78DA636C61626048644001ADB3CC19FE03694' +
'620FE0F048C75403531A86A1C2B6419B8A06A4000AC2603538D08' +
'B29A56EC6A50CCE905AA89465563912A8EA2060087690E48');
if(DTMRotated(TreesDTM, x, y, MMX1, MMY1, MMX2, MMY2)) then
begin
Mouse(x, y, 1, 1, true);
Flag;
end else
begin
Writeln('Couldn''t find the trees. Setting player to false');
Players[CurrentPlayer].Active := False;
Logout;
end;
FreeDTM(TreesDTM);
end;

{*******************************************************************************
procedure ProgressReport;
By: Metho D
Description: Gives a general summary of script, player report, and sends stats
*******************************************************************************}

procedure ProgressReport;
var
i: Integer;
Active: string;
begin
GetAllLevels;
ClearDebug;
if(Players[CurrentPlayer].Active) then
Active := 'In Use'
else
Active := 'Inactive';
Writeln(' ');
Writeln('<============== '+VersionNumber+' Progress Report ==============>');
Writeln('************************************************');
Writeln(' Worked for '+TimeRunning);
Writeln(' Logs cut '+IntToStr(Logs));
Writeln(' Loads done '+IntToStr(Loads));
if(EntsDodged > 0) then Writeln(' Ents dodged '+IntToStr(EntsDodged));
Writeln('************************************************');
Writeln(' Name : '+Players[CurrentPlayer].Nick);
Writeln(' Number : '+IntToStr(CurrentPlayer));
Writeln(' Worked for : '+IntToStr(Players[CurrentPlayer].Worked));
Writeln(' Logs cut : '+IntToStr(Players[CurrentPlayer].Integers[0]));
Writeln(' Loads done : '+IntToStr(Players[CurrentPlayer].Integers[1]));
Writeln('************************************************');

for i := 0 to HowManyPlayers - 1 do
begin
if Players[i].Active then
Active := 'True'
else
Active := 'False';
Writeln(IntToStr(i)+': '+Players[i].Nick+' = '+Active+'; W - '+IntToStr(Players[i].Worked)
+'C - '+IntToStr(Players[i].Integers[0])+' Logs; '+IntToStr(Players[i].Integers[1])
+' Loads; W Lvl - '+IntToStr(Players[i].Level[20]));
end;
Writeln('<=================================================>');
SRLRandomsReport;
end;

{*******************************************************************************
procedure SetupScript;
By: Metho D
Description: Sets up the necessary functions/procedures/variables at beginning
*******************************************************************************}

procedure SetupScript;
begin
SetupSRL;
DeclarePlayers;
CheckUserNicks;
LoadDTMs;
Loads := 0; Logs := 0; PlayerLoads := 0;
if(MySRLID <> '') then
SRLID := MySRLID;
if(MySRLPassword <> '') then
SRLPassword := MySRLPassword;
RCMaster := RemoteMaster;
RCLoc := RemoteLoc;
if(not(LoggedIn)) then
LoginPlayer;
end;

{*******************************************************************************
function AllPlayersAreFalse;
By: pwnaz0r (his script(s) use the same idea)
Description: Detects if all of our players are false or not
*******************************************************************************}

function AllPlayersAreFalse: Boolean;
var
i: Integer;
begin
for i := 0 to HowManyPlayers - 1 do
if(Players[i].Active) then
Break;
Result := True;
end;

procedure PlayerLoop(TimePerPlayer, TimePerLoad, TimePerTree: Integer);
var
PlayerTime, LoadTime: Integer;
begin
repeat
if(not(LoggedIn)) then LoginPlayer;
begin
MarkTime(PlayerTime);
FixMiscStuff;
repeat
if(not(LoggedIn)) then Break;
begin
MarkTime(LoadTime);
repeat
if(not(LoggedIn)) then Break;
begin
MarkTime(TreeTime);
repeat
if(not(LoggedIn)) then Break;
if(InvFull) then Break;
ChopThemLogs(TimePerTree);
until(TimeFromMark(TreeTime) >= TimePerTree) or (InvFull);
end;
if(TimeFromMark(LoadTime) >= TimePerLoad) then Break;
until(InvFull);
WalkToStore;
FindShopKeeper;
SellLogs;
WalkBackToWillows;
ProgressReport;
end;
if(TimeFromMark(PlayerTime) >= TimePerPlayer) then Break;
until(PlayerLoads = NumLoads);
end;
PlayerLoads := 0;
if(not(LoggedIn)) then
NextPlayer(False)
else
NextPlayer(True);
FixMiscStuff;
until(AllPlayersAreFalse);
FreeDTM(WillowDTM);
end;

//****************************************************************************//
// MAIN LOOP //
//****************************************************************************//

begin
SetupScript;
ProgressReport;
PlayerLoop(PTimeOut * 1000, LTimeOut * 1000, TTimeout * 1000);
end.

Special thanks to pwnaz0r for the main loop tutorial as well as Bobarkinator, Widget, and NewToAutoing for helping me improve the script.

——————————————————
<!– END TEMPLATE: formanswers –>

pwnaz0r

2007-10-21 23:38:44

are you sure thats not my allplayersarefalse? Just like mine. Exactly, even standards.

Method

2007-10-22 00:14:53

I had another AllPlayersAreFalse that used counting variables, but I read in another thread that I didn't need them so I shortened it to what it is now. I've added you to the credits in that function, though.

IronTeapot

2007-10-22 01:06:38

Yes. I dont even know if it works, but i like the coding :P

Rikje

2007-10-22 02:49:38

good fail saves! :) something that most of the poeple forgot.
i like you're coding. yes:)

MasterKill

2007-10-22 03:22:44

all looks good.

yes from me

HellBoyz

2007-10-22 03:55:13

[INDENT]While i glance through the whole script, :rolleyes: well i seen some standards was imply in the script and then i go through the compilation progress and the result, :(h): yes it's compile perfectly and what i think in the first place it will be a great script.[/INDENT]

[INDENT]So, :stirthepot: lets try on running it first before anything. But :duh: OMG:duh: the script do run and i'm impress. But wait, he check the tree and he cut the tree but why he walk to store when the inventory was not full? and he just cut for me the one single willow logs. Hey is this the right step? Nvm we will check it later and let it be for a while.:rolleyes: [/INDENT]

[INDENT]Now, :stirthepot: he try to go to store and yes he found the store but why checking outside the symbol and it walk outside the store? Well gone through the script, it said you need click x-3 and y-2 in the Minimap so find for me at least it found the store assistant. [/INDENT]

[INDENT]Wow, :duh: the store screen open up, i think he will sell my only single one willow logs there. What i can do now is wait but… hey 1 minutes passout and i didn't see any selling activity why is stop? so check the debug log and it said :confused: 'Access violation in … …'. What happened?[/INDENT]

[INDENT]Don't worry lets try:stirthepot: to see the script more detail this time… and i found this[/INDENT]


repeat
status('Waiting for full inv, random, or tree to fall');
FTWait(8);
EntFinder;
FindRandoms;
until(InvFull) or (not(IsUpText('illow'))) or (TimeFromMark(TreeTime) >= TreeTimeOut);

[INDENT]This was the thing cause me chop my one single lonely willow log in bag [/INDENT]


begin
TempAcc := SymbolAccuracy;
SymbolAccuracy := 0.5;
if(FindSymbol(x, y, 'store')) then
Mouse(x - 3, y - 2, 1, 1, true);
Flag;
SymbolAccuracy := TempAcc;
end;

[INDENT]This was cause me clicking outside the store[/INDENT]

function CountItemDTMs(DTM: Integer): Integer;
var
i, x, y: Integer;
TB: TBox;
begin
if(not(LoggedIn)) then
Exit;
GameTab(4);
TempCount := 0;
for i := 1 to 28 do
begin
TB := InvBox(i);
if(ExistsItem(i)) then
if(FindDTM(DTM, x, y, TB.x1, TB.y1, TB.x2, TB.y2)) then
Inc(Result);
end;
TempCount := Result;
end;

[INDENT]This was cause me can't find my willow logs and 'access violation error[/INDENT]

[INDENT]Finally, although i've not tested the WalkBackToWillows procedure i assume hopefully it work i think :( So, i'll hold up my vote for the mean time…[/INDENT]

Timer

2007-10-22 07:20:23

yes.

looks great. exsept for some little errors.

rogeruk

2007-10-22 08:12:15

Looking great isnt everything.

 until(InvFull) or (not(IsUpText('illow'))) or (TimeFromMark(TreeTime) >= TreeTimeOut);

So your keeping the mouse constantly on the willow tree?. Nice antiban.

procedure CountItemDTMs;
By: Metho D

Looks pretty much like this.. apart from you have added a useless TempCount := Result; ?

function CountItemDTM(DTM: Integer): Integer;//Based off of the
var //one in srl for bmps
i, x, y: Integer;
TB: Tbox;
begin
GameTab(4);
for i := 1 to 28 do
begin
TB := InvBox(i);
if ExistsItem(i) then
if FindDTM(DTM, x, y, TB.x1, TB.y1, TB.x2, TB.y2) then// Thanks 4 the input
Inc(Result);
end;
end;

Holding vote

King of Knives

2007-10-22 08:38:35

CountItemDTM doesn't work. Or atleast, it didn't for me last time I checked.

Except for that, I think it looks pretty good.

EDIT: I also know that this guy is pretty good at helping people, which is a quality I give a lot for.

PS: Yes

-Knives

rogeruk

2007-10-22 09:58:32

If it doesn't work then why say yes to the script? lol.

Method

2007-10-22 10:49:54

I'm sorry about the cutting not working. I'm going to work to fix that today and edit this post with a fix, hopefully.

gerauchert

2007-10-22 10:53:31

i vote yes

he has shown that he knows enough about scripting ex:

- Failsafes
- multiplayer
- Radial Walking
- Antiban
- standards

So what if his script is a lil buggy? He knows how to script and he will learn how to kink out the bugs better if he is a member.

Good work keep it up ;)

Rikje

2007-10-22 10:57:13

From: Metho D
I'm sorry about the cutting not working. I'm going to work to fix that today and edit this post with a fix, hopefully.


you may not edit you're apply after you posted…
just post the fix.

n3ss3s

2007-10-22 11:13:07

*morpheus : I've been expecting you Metho D *

Definite yes from me, and a '+' because your code seems very well organized.

Method

2007-10-22 12:39:03

Okay, I think I've fixed the problems (going to store with 1 log + walking back), so here's the updated script:

EDIT: Oh, and I also re-added my anti-ban procedure that I had before.

{===================================================================]
[ Rimmington Chop 'N' Sell ]
[ ]
[ NAME : Rimmington Willow Chopper & Seller ]
[ WRITER : Metho D ]
[ CATEGORY : Woodcutting ]
[ DESCRIPTION : Chops and Sells Logs in Rimmington ]
[ USAGE : Start at the willows in Rimmington ]
[ AUTOCOLOR : Yes ]
[ NOTES : None so far. ]
[ CONTACT : [email]scottyr00g@gmail.com[/email] ]
[ SRL Used : 4 (rev 5) ]
[ Released : None Yet ]
[ ]
[===================================================================]
[ Instructions ]
[===================================================================]
[ 1. Use Runescape with Low Detail, Very Bright. ]
[ 2. Set your Screen to 32 bit TRUE color. ]
[ 3. Use SRL 4 rev 5 and SCAR 3.12. ]
[ 4. Setup Constants and Players. ]
[ 5. Place Players at the Willows or Falador East Bank. ]
[ 6. Hit Run and Begin Smashing! ]
[===================================================================]
[ Credits ]
[===================================================================]
[ SRL Team & Community : For the great include and tutorials. ]
[ pwnaz0r : For the main loop tutorial. ]
[ bobbohobbo + YoHoJo : For the ent checking procedure. ]
[ WT-Fakawi : For the FindFastRandoms procedure. ]
[ IronTeapot : For the idea to do this script. ]
[===================================================================}

program RimmingtonChopSell;
{.include SRL\SRL.scar}
{.include SRL/SRL/skill\Woodcutting.scar}

//------------------------Adjustable Parameters-------------------------------//
const
StartPlayer = 0; // Which player to start with
NumLoads = 5; // Number of loads for each player
PTimeOut = 30; // Max minutes per player
LTimeOut = 8; // Max minutes per load
TTimeOut = 3; // Max minutes before switching trees
MySRLID = ''; // Your SRL ID
MySRLPassword = ''; // Your SRL Password
RemoteMaster = ''; // Name of RC Master if you have one.
RemoteLoc = ''; // Location of RC Master if you have one.
//----------------------------------------------------------------------------//
VersionNumber = '1.0'; //Do not change
//----------------------------------------------------------------------------//

var
EntsDodged, Logs, TempCount, Loads, PlayerLoads, TreeTime: Integer;

{*******************************************************************************
procedure DeclarePlayers;
By: SRL
Description: Stores the player information
*******************************************************************************}

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

Players[0].Name := ''; //Username
Players[0].Pass := ''; //Password
Players[0].Nick := ''; //3-4 letters of Username (Username becomes erna)
Players[0].Active := True; //Are you using this character?

{Players[1].Name := '';
Players[1].Pass := '';
Players[1].Nick := '';
Players[1].Active := True;

Players[2].Name := '';
Players[2].Pass := '';
Players[2].Nick := '';
Players[2].Active := True;

Players[3].Name := '';
Players[3].Pass := '';
Players[3].Nick := '';
Players[3].Active := True;

Players[4].Name := '';
Players[4].Pass := '';
Players[4].Nick := '';
Players[4].Active := True;}

NickNameBMP := CreateBitmapMaskFromText(Players[CurrentPlayer].Nick, UpChars);
end;

{*******************************************************************************
procedure CountItemDTMs;
By: rotflmfwao
Description: Counts the number of logs in the inventory
*******************************************************************************}

function CountItemDTMs(DTM: Integer): Integer;
var
i, x, y: Integer;
TB: TBox;
begin
if(not(LoggedIn)) then
Exit;
GameTab(4);
TempCount := 0;
for i := 1 to 28 do
begin
TB := InvBox(i);
if(ExistsItem(i)) then
if(FindDTM(DTM, x, y, TB.x1, TB.y1, TB.x2, TB.y2)) then
Inc(Result);
end;
TempCount := Result;
end;

{*******************************************************************************
procedure FixMiscStuff;
By: Metho D
Description: Sets the compass to North/Highest Angle and fixes the chats
*******************************************************************************}

procedure FixMiscStuff;
begin
if(not(LoggedIn)) then
Exit;
PerfectNorth;
SetChat('on', 1);
SetChat('friends', 2);
SetChat('friends', 3);
end;

{*******************************************************************************
function FindFastRandoms;
By: WT-Fakawi
Description: Checks for Randoms
*******************************************************************************}

function FindFastRandoms : Boolean;
var
i: Integer;
begin
for I := 1 to 11 do
begin
case I of
1: if FindDead then
Result := True;
2: if FindMod then
Result := True;
3: if FindMime then
Result := True;
4: if FindMaze then
Result := True;
5: if FindQuiz then
Result := True;
6: if FindTalk then
Result := True;
7: begin
if NoGameTab then
begin
Result := True;
Players[CurrentPlayer].loc := 'No GameTab';
Logout;
Exit;
end;
end;
9 : if RC then
Result := True;
10 : if FindFight then
begin
Result := True;
RunAwayDirection('N');
RunBack;
end;
11: if FindTalk then
Result := True;
end;
Wait(1);
end;
end;

{*******************************************************************************
procedure EntFinder;
By: YoHoJo, modded by bobbohobbo
Description: Checks for an Ent
*******************************************************************************}

procedure EntFinder;
var
EX, EY: integer;
FX, FY: integer;
SafeEntWait: LongInt;
begin
if (not(LoggedIn)) then
Exit;
begin
status('Searching for Ent');
if
(FindObjCustom(EX, EY, ['Tree', 'Willow', 'Oak'], [4690821], 5)) then
begin
MMouse(EX, EY, 0, 0)
if FindColorTolerance(FX, FY, 55769, 85, 15, 115, 15, 20) then
begin
Writeln('Ent Found!');
MouseFindFlag(645, 83, 2, 2);
MarkTime(SafeEntWait)
repeat
FTWait(5)
FindNormalRandoms;
if not (LoggedIn) then
Exit;
until TimeFromMark(SafeEntWait) > 29000 + Random(10000)
EntsDodged := EntsDodged + 1;
end;
end;
end;
end;

{*******************************************************************************
procedure FindRandoms;
By: Metho D
Description: Checks for quite a few randoms
*******************************************************************************}

procedure FindRandoms;
begin
if(not(LoggedIn)) then
Exit;
FindTalk;
FindFastRandoms;
FindNormalRandoms;
EntFinder;
end;

{*******************************************************************************
procedure AntiBan;
By: SRL
Description: Makes sure we don't get banned ;-)
*******************************************************************************}

procedure AntiBan;
begin
if(not(LoggedIn)) then
Exit;
case Random(100) of
0: RandomRClick;
1: AlmostLogout;
2: HoverSkill('Woodcutting', False);
3: BoredHuman;
4: PickUpMouse;
5: HoverSkill('Cooking', False);
6: BoredHuman;
7: PickUpMouse;
8: RandomRClick;
9: HoverSkill('Smithing', False);
10: RandomRClick;
11: BoredHuman;
12: PickUpMouse;
13: HoverSkill('Crafting', False);
14: BoredHuman;
end;
end;

{*******************************************************************************
function TreeGone;
By: From Timothegreat, modded by Metho D
Description: Checks to see if the tree is gone
*******************************************************************************}

function TreeGone(x, y: Integer): Boolean;
begin
MMouse(x, y, 1, 1);
if(IsUpText('alk')) then
Result := True;
end;


{*******************************************************************************
procedure ChopThemLogs;
By: Metho D
Description: Chops the willows while checking for ents
*******************************************************************************}

procedure ChopThemLogs(TreeTimeOut: Integer);
var
cx, cy, ax, ay, t, r, Tree: Integer;
begin
if(not(LoggedIn)) then
Exit;
t := 0;
repeat
Inc(t);
if(t >= 3) then
begin
Players[CurrentPlayer].Active := False;
Logout;
Break;
end;
status('Finding tree');
if(not(FindObj(cx, cy, 'illow', 3560528, 15))) then
begin
r := 3 - t;
Writeln('Could not find tree, trying '+IntToStr(r)+' more times');
end else
begin
t := 0;
EntFinder;
Mouse(cx, cy, 0, 0, true);
GetMousePos(cx, cy);
repeat
status('Waiting for full inv, random, or tree to fall');
FTWait(8);
AntiBan;
EntFinder;
FindRandoms;
until(InvFull) or (TreeGone(cx, cy)) or (TimeFromMark(TreeTime) >= TreeTimeOut);
end;
until(InvFull) or (TimeFromMark(TreeTime) >= TreeTimeOut);
end;

{*******************************************************************************
procedure WalkToStore;
By: Metho D
Description: Walks to the general store
*******************************************************************************}

procedure WalkToStore;
var
x, y: Integer;
TempAcc: Extended;
begin
if(not(LoggedIn)) then
Exit;
if(not(RadialWalk(FindRoadColor, 320, 350, 65, 1, 1))) then
begin
Writeln('Trying blind click');
Mouse(608, 25, 3, 3, true);
Flag;
end else
Flag;
if(FindSymbol(x, y, 'store')) then
begin
Mouse(x - 1, y - 2, 1, 1, true);
Flag;
end else
begin
TempAcc := SymbolAccuracy;
SymbolAccuracy := 0.5;
if(FindSymbol(x, y, 'store')) then
Mouse(x - 3, y - 2, 1, 1, true);
Flag;
SymbolAccuracy := TempAcc;
end;
end;


{*******************************************************************************
procedure FindShopKeeper;
By: Metho D
Description: Looks for the Shop Keeper in Rimmington General Store
*******************************************************************************}

procedure FindShopKeeper;
var
cx, cy, t: Integer;
begin
repeat
if(not(LoggedIn)) then
Exit;
status('Looking for Shop Assistant');
repeat
t := t + 1;
wait(50);
until(FindObj(cx, cy, 'ssistant', 2768960, 5)) or (t >= 10);
if(t >= 10) then
begin
Players[CurrentPlayer].Active := False;
Logout;
Exit;
end;
Mouse(cx, cy, 2, 2, false);
ChooseOption('rade');
Flag;
wait(500 + random(500));
until(FindColor(cx, cy, 2070783, 173, 33, 250, 47));
end;

{*******************************************************************************
procedure SellLogs;
By: Metho D
Description: Sells the willow logs
*******************************************************************************}

procedure SellLogs;
var
cx, cy, a, WillowDTM: Integer;
begin
WillowDTM := DTMFromString('78DA63CC63626078C28002BC5DA419FE03694' +
'620FE0F048CA540353719D000231209A4CB806A1E1250530D54F3' +
'82809A02A09A7704D42403D5BC25A0260ED35F186A92806AEEE25' +
'7030059ED1056');

CountItemDTMs(WillowDTM);
status('Selling our logs');
repeat
if(FindDTM(WillowDTM, cx, cy, MIX1, MIY1, MIX2, MIY2)) then
begin
a := a + 1;
Mouse(cx, cy, 1, 1, False);
ChooseOption('ell 10');
wait(500 + random(100));
end;
until(not(FindDTM(WillowDTM, cx, cy, MIX1, MIY1, MIX2, MIY2))) or (a >= 10);
if(a >= 10) then
begin
Players[CurrentPlayer].Active := False;
Logout;
Exit;
end;
CloseWindow;
Logs := Logs + TempCount;
Players[CurrentPlayer].Integers[1] := Players[CurrentPlayer].Integers[1] + TempCount;
Loads := Loads + 1;
Players[CurrentPlayer].Integers[0] := Players[CurrentPlayer].Integers[0] + 1;
FreeDTM(WillowDTM);
end;

{*******************************************************************************
procedure WalkBackToWillows;
By: Metho D
Description: Heads back to the willow trees
*******************************************************************************}

procedure WalkBackToWillows;
var
TreesDTM, x, y: Integer;
begin
if(not(LoggedIn)) then
Exit;
if(not(RadialWalk(FindRoadColor, 120, 140, 50, 1, 1))) then
begin
Writeln('Trying blind click');
Mouse(683, 116, 1, 1, true);
Flag;
end else
Flag;
Mouse(644, 103, 2, 2, true);
Flag;
TreesDTM := DTMFromString('78DA639CC4C4C050C38002DEBC79C3F01F483' +
'302F17F2060EC05AA294555A3972AC6C0055503028C7D40354D04' +
'D44C03AA6924A0663E504D317E35008C7A0FE9');
if(DTMRotated(TreesDTM, x, y, MMX1, MMY1, MMX2, MMY2)) then
begin
Mouse(x, y, 1, 1, true);
Flag;
end else
begin
Writeln('Couldn''t find the trees. Setting player to false');
Players[CurrentPlayer].Active := False;
Logout;
end;
FreeDTM(TreesDTM);
end;

{*******************************************************************************
procedure ProgressReport;
By: Metho D
Description: Gives a general summary of script, player report, and sends stats
*******************************************************************************}

procedure ProgressReport;
var
i: Integer;
Active: string;
begin
GetAllLevels;
ClearDebug;
if(Players[CurrentPlayer].Active) then
Active := 'In Use'
else
Active := 'Inactive';
Writeln(' ');
Writeln('<============== '+VersionNumber+' Progress Report ==============>');
Writeln('************************************************');
Writeln(' Worked for '+TimeRunning);
Writeln(' Logs cut '+IntToStr(Logs));
Writeln(' Loads done '+IntToStr(Loads));
if(EntsDodged > 0) then Writeln(' Ents dodged '+IntToStr(EntsDodged));
Writeln('************************************************');
Writeln(' Name : '+Players[CurrentPlayer].Nick);
Writeln(' Number : '+IntToStr(CurrentPlayer));
Writeln(' Worked for : '+IntToStr(Players[CurrentPlayer].Worked));
Writeln(' Logs cut : '+IntToStr(Players[CurrentPlayer].Integers[0]));
Writeln(' Loads done : '+IntToStr(Players[CurrentPlayer].Integers[1]));
Writeln('************************************************');

for i := 0 to HowManyPlayers - 1 do
begin
if Players[i].Active then
Active := 'True'
else
Active := 'False';
Writeln(IntToStr(i)+': '+Players[i].Nick+' = '+Active+'; W - '+IntToStr(Players[i].Worked)
+'C - '+IntToStr(Players[i].Integers[0])+' Logs; '+IntToStr(Players[i].Integers[1])
+' Loads; W Lvl - '+IntToStr(Players[i].Level[20]));
end;
Writeln('<=================================================>');
SRLRandomsReport;
end;

{*******************************************************************************
procedure SetupScript;
By: Metho D
Description: Sets up the necessary functions/procedures/variables at beginning
*******************************************************************************}

procedure SetupScript;
begin
SetupSRL;
DeclarePlayers;
CheckUserNicks;
Loads := 0; Logs := 0; PlayerLoads := 0;
if(MySRLID <> '') then
SRLID := MySRLID;
if(MySRLPassword <> '') then
SRLPassword := MySRLPassword;
RCMaster := RemoteMaster;
RCLoc := RemoteLoc;
ActivateClient;
if(not(LoggedIn)) then
LoginPlayer;
end;

{*******************************************************************************
function AllPlayersAreFalse;
By: Metho D
Description: Detects if all of our players are false or not
*******************************************************************************}

function AllPlayersAreFalse: Boolean;
var
i: Integer;
begin
for i := 0 to HowManyPlayers - 1 do
if(Players[i].Active) then
Break;
Result := True;
end;

procedure PlayerLoop(TimePerPlayer, TimePerLoad, TimePerTree: Integer);
var
PlayerTime, LoadTime: Integer;
begin
repeat
if(not(LoggedIn)) then LoginPlayer;
begin
MarkTime(PlayerTime);
FixMiscStuff;
repeat
if(not(LoggedIn)) then Break;
begin
MarkTime(LoadTime);
repeat
if(not(LoggedIn)) then Break;
begin
MarkTime(TreeTime);
repeat
if(not(LoggedIn)) then Break;
if(InvFull) then Break;
ChopThemLogs(TimePerTree);
until(TimeFromMark(TreeTime) >= TimePerTree) or (InvFull);
end;
if(TimeFromMark(LoadTime) >= TimePerLoad) then Break;
until(InvFull);
WalkToStore;
FindShopKeeper;
SellLogs;
WalkBackToWillows;
ProgressReport;
end;
if(TimeFromMark(PlayerTime) >= TimePerPlayer) then Break;
until(PlayerLoads = NumLoads);
end;
PlayerLoads := 0;
if(not(LoggedIn)) then
NextPlayer(False)
else
NextPlayer(True);
FixMiscStuff;
until(AllPlayersAreFalse);
end;

//****************************************************************************//
// MAIN LOOP //
//****************************************************************************//

begin
SetupScript;
ProgressReport;
PlayerLoop(PTimeOut * 1000 * 60, LTimeOut * 1000 * 60, TTimeout * 1000 * 60);
end.

Method

2007-10-22 17:39:52

I accidentally left an account name and password in the previous post, and I'm appalled to see that someone stole the account. I can't believe an SRL Member or above would do something like this. I'd like to request that you please return the account.

pwnaz0r

2007-10-22 17:53:12

Wow, an SRL Member. Can you tell us about what time it was between? I will get someone to check the times of the thread viewed.

Method

2007-10-22 17:54:28

I'm not positive, but it was probably in the time zone of around an hour or two after the post with the updated script in it.

pwnaz0r

2007-10-22 17:56:15

I will personally give you one of my accounts if its not returned. Sorry metho…

Method

2007-10-22 17:57:53

It wasn't really an account that I played on much, but it was my first main account with around 1400 skill total, so I will miss it. I'm currently running a password query on it right now, and hopefully a Moderator or Admin could help figure out who might have stolen it. Thanks for your help. :)

Lalaji

2007-10-22 18:27:49

Yes. i like the script.

Bobarkinator

2007-10-22 22:55:50

Good script, and I'm glad you took my advice.

I vote yes.

I don't know who would take your account, but it was probably some leecher member.

pwnaz0r

2007-10-22 23:14:25

11 - 2, nice job. In?

HellBoyz

2007-10-23 04:03:45

Nice you manage to change it and all run well. Congrats.

King of Knives

2007-10-23 08:58:23

Did someone seriously steal your account? That is SO low for an SRL Member. Personally, I would do as Santa_Clause always does. Send the poster a new pass.

If you're lucky, some SRL-Member CHANGED the pass, and forgot to give you the new.

I'm sad to hear, but atleast you, most likely from the current results, get SRL Member.

-Knives

Method

2007-10-23 10:36:02

From: King of Knives
Did someone seriously steal your account? That is SO low for an SRL Member. Personally, I would do as Santa_Clause always does. Send the poster a new pass.

If you're lucky, some SRL-Member CHANGED the pass, and forgot to give you the new.

I'm sad to hear, but atleast you, most likely from the current results, get SRL Member.

-Knives


I did get the account back after sending in a password query (stupid automated system not working), so it's back in my possession now. Thanks for all the votes, everyone! :)

rogeruk

2007-10-23 10:40:54

From: Metho D
I did get the account back after sending in a password query (stupid automated system not working), so it's back in my possession now. Thanks for all the votes, everyone! :)


Damn, sorry to hear that happened Metho D. Glad you have recovered it. Was it your proper main? items taken or anything?

Voted yes, script isnt perfect but who's is?. Your understanding is great.

Method

2007-10-23 11:23:51

From: rogeruk
Damn, sorry to hear that happened Metho D. Glad you have recovered it. Was it your proper main? items taken or anything?

Voted yes, script isnt perfect but who's is?. Your understanding is great.


It was my first and highest-leveled main to date, but I have another account with most of the valuable items from the old one. One of the two rune axes I did have was sold, though, so I'll have to get another one to keep the bank space (members items are still in there even though it's F2P). Oh well, I learned to make sure to keep my valuable information out of scripts.

Thank you for the comment, by the way. :)

rogeruk

2007-10-23 13:27:54

Offtopic is a little, its always a good idea to have two scripts on the go for the same script if u get me.

OakBanker2.9.scar
OakBanker2.9Dev.scar

Dev contains my usernames and passwords, if you update it, delete usernames and pass's and save as new version with no dev on the end :P.

Method

2007-10-23 13:29:42

Right, I didn't really do that for this script because it was just a quick(ish) fix, but I will remember that for the future. Thanks. :)

pwnaz0r

2007-10-23 22:34:32

From: pwnaz0r
In?


???

sorry for the impatience but this guy should be in here for the new MSI Comp.

Negaal

2007-10-24 02:20:57

From: Metho D
I accidentally left an account name and password in the previous post, and I'm appalled to see that someone stole the account. I can't believe an SRL Member or above would do something like this. I'd like to request that you please return the account.


Wow, an account stealer in members…some admin should see in what time someone was viewing this thread…

Anyways i like your coding like others, i didn't noticed other bugs in chopping, but your failsafes aren't reseted in some places…

just a example:

procedure blah;
begin
repeat
if not findthat then inc(z);
else
Dothis;
until(z = 10) or(blahblah);
if z >= 10 then players.(currentplayer)active := false; logout;
end;(

lets say its chopping procedure, when it doesnt find tree some 9 times, still chops full inv, sell them to shop, comes backs to chopping and doesnt find tree again 1 time then it logs out… you forgot to reset counter value…
you did it in some procedures but not in 1, you mised it somewhere…
anyways yes


edit: it was in selling to shop procedure

Method

2007-10-24 17:09:50

Thanks for the heads-up.

Dan Cardin

2007-10-24 17:13:39

dan cardin votes yes :)

pwnaz0r

2007-10-25 19:15:24

Wow, has this app been forgotten? bottom of list lol

mat_de_b

2007-10-25 20:19:00

won't it auto accept itself soon?

pwnaz0r

2007-10-25 20:34:44

From: mat_de_b
won't it auto accept itself soon?


yeah, a few days too late.

HellBoyz

2007-10-25 21:55:58

Ya, I'm facing that before, been forgotten in the list.

Question, why can we shorten the poll timing so the decision can make fast?

RAM

2007-10-26 01:44:52

Well, just so everyone knows…there are a few reasons for the waiting period…to get to know the applicant a bit better….but what alot of people don't realize, is that extensive back ground checks are performed in this time period as well…..cross checking IP Address, emails etc…to make sure they don't correspond with other users that we might not wish to have access to SRL members…..we also check to see if they are active in other communities and their attitude and reputation there as well…..

All of this is to insure that Everyone that has achieved SRL Member status, that their hard work is not compromised by a hasty decision to let someone in, that hasn't been examined on all of the aforementioned security checks….

My last bit of advice to you Metho-D ….Please be sure to read this when you get a chance ;)

Sticky: Read Before Voting...
BenLand100

Best regards,

~RAM

Ashur2Good

2007-10-26 01:52:44

From: Metho D
It wasn't really an account that I played on much, but it was my first main account with around 1400 skill total, so I will miss it. I'm currently running a password query on it right now, and hopefully a Moderator or Admin could help figure out who might have stolen it. Thanks for your help. :)



Not if they find out that you make scripts here :P. But anyway, i voted yes. I like your style :)


P.S: I thought they made offtopic quotes? :S

-Ashur:stirthepot:

WT-Fakawi

2007-10-26 03:56:18

In.