Method
2007-10-21 23:31:01
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 –>