Dankness
2006-02-18 19:53:17
Well this is my first public release SRL script, it has not fully been tested but its only version 1.00 i just figured we needed more scripts out using SRL. anyways please post bugs and problems or progress reports in this thread.
{=========================================================================]
[ Draynor Willow Whacker ]
[ ]
[ NAME : Draynor Willow Whacker ]
[ WRITER : Dankness ]
[ CATEGORY : Woodcutter ]
[ DESCRIPTION : Will cut and bank willows in Draynor ]
[ USAGE : Start in Draynor Bank read notes below ]
[ AUTOCOLOR : Yes ]
[ ]
[ More Scripts maybe found at ]
[ http://www.freewebs.com/danknessscripts/ ]
[=========================================================================]
[ Instructions. ]
[=========================================================================]
[ 1. USE Runescape with Low Detail, Very Bright. ]
[ 2. Set your Screen to 32 bit TRUE color. ]
[ 3. Set Playernames and Passwords in DeclarePlayers. ]
[ 4. Start script Logged Out! ]
[ 5. Set Colors or Leave at Zero to autopick ]
[ 6. Have WC Axe in First inventoryslot and more in First bank slot ]
[ 7. Setup varables from 41-50 ]
[=========================================================================]
[ Credits to : ]
[ Kaitneiks --> For SCAR and everything else ]
[ WT-Fakawi --> For SRL and the SRL Community ]
[ MoparisBest --> For his execellent scripts and contributions ]
[ Stupid3000 --> For his SSI2 include and his other execellent scripts ]
[=========================================================================}
program WilllowCutterBanker;
{.include SRL\SRL.SCAR}
{.include srl\srl\skill\woodcutting.scar}
{.include srl\srl\misc\certerbreaker.scar}
var At:integer;
treecolor,banked,choptime:integer;
newaxes,waittime,startplayer:integer;
willowcolors:array[1..3] of integer;
//************************************************************************//
Const VersionNumber = '1.0'; // Compliant with Rev 200+
//************************************************************************//
Procedure SetupVars;
begin
//****** Mini-Map Colors ******\\
WillowColors[1]:=0; // Leave at zero to autoset
WillowColors[2]:=0; // Leave at zero to autoset
WillowColors[3]:=0; // Leave at zero to autoset
//****** Main-Screen Colors ******\\
TreeColor :=0; // Leave at zero to autoset
BankColor :=0; // Leave at zero to autoset
StartPlayer :=0; // Player Number to start at
HowManyPlayers :=6; // Set Number of Players here.
WaitTime :=5000; // how long to wait before clicking next tree
end;
Procedure DeclarePlayers;
begin
NumberOfPlayers(HowManyPlayers); // Sets the Players Array Length;
CurrentPlayer:=StartPlayer; // CurrentPlayer = Array Index
Players[0].Name :='';
Players[0].Pass :='';
Players[0].Nick :='';
Players[0].Loc :='Loc1';
Players[0].Skill:='';
Players[0].Active:=True;
// Uncomment however many players u need or add more players if you want
{
Players[1].Name :='';
Players[1].Pass :='';
Players[1].Nick :='';
Players[1].Loc :='Loc1';
Players[1].Skill:='';
Players[1].Active:=True;
Players[2].Name :='';
Players[2].Pass :='';
Players[2].Nick :='';
Players[2].Loc :='Loc1';
Players[2].Skill:='';
Players[2].Active:=True;
Players[3].Name :='';
Players[3].Pass :='';
Players[3].Nick :='';
Players[3].Loc :='Loc1';
Players[3].Skill:='';
Players[3].Active:=True;
Players[4].Name :='';
Players[4].Pass :='';
Players[4].Nick :='';
Players[4].Loc :='Loc1';
Players[4].Skill:='';
Players[4].Active:=True;
Players[5].Name :='';
Players[5].Pass :='';
Players[5].Nick :='';
Players[5].Loc :='Loc1';
Players[5].Skill:='';
Players[5].Active:=True;
}
writeln(inttostr(HowManyPlayers)+' Players');
end;
//************************************************************************//
procedure PlayerStats;
var Active: string;
var i: Integer;
begin
writeln('**********************************************');
writeln('Name : '+ Players[CurrentPlayer].Name);
writeln('Number : '+ inttostr(CurrentPlayer));
writeln('Mining Level : '+ inttostr(Players[CurrentPlayer].MiningLevel));
writeln('Select Skill : '+ Players[CurrentPlayer].Skill);
writeln('Worked for : '+ inttostr(Players[CurrentPlayer].Worked)+' minutes.');
writeln('Banked : '+ inttostr(Players[CurrentPlayer].Banked) + ' times.');
if Players[CurrentPlayer].Active=True then Active:='True' else Active:='False';
writeln('Active : '+ Active);
writeln('Location : '+ Players[CurrentPlayer].loc);
writeln('**********************************************');
for i := 0 to HowManyPlayers-1 do
begin
if Players[i].Active=True then Active:='True' else Active:='False';
writeln( (inttostr(i))+' : '+Players[i].name+ ' = '+Active+'. - Lvl : '+inttostr(Players[i].MiningLevel)+
'. - B :'+inttostr(Players[i].Banked)+' Times.'+
' - : '+IntToStr(Players[i].Worked)+' mins.'+' - Loc: '+Players[i].loc);
end
writeln('**********************************************');
end;
//************************************************************************//
procedure ProgressReport;
begin
begin
WriteLn(' ');
writeln('<============== Dankness Willow Cutter ==============>');
WriteLn('<============== -'+VersionNumber+'- Progress Report ===============>');
Writeln('Worked for '+ TimeRunning);
WriteLn('Banked '+IntToStr(banked)+' loads[s].');
Writeln('Gained Aprox. '+inttostr(banked*27*67)+(' Xp so far.'));
writeln('Cut Aprox. '+inttostr(banked*27)+(' logs.'));
WriteLn('Random Event Report:');
if(fights>0)then WriteLn(' Fought '+IntToStr(fights)+' Time[s].');
if(talks>0)then WriteLn(' Talked to '+IntToStr(talks)+' Random event[s].');
if(lamps>0)then WriteLn(' Used lamps '+IntToStr(lamps)+' Time[s].');
if(doctors>0)then WriteLn(' Solved '+IntToStr(doctors)+' Fords[s].');
if(frogs>0)then WriteLn(' Solved '+IntToStr(frogs)+' Frog[s].');
if(certers>0)then WriteLn(' Solved '+IntToStr(certers)+' Certer[s].');
if(AxeAttaches>0)then WriteLn(' Attached '+IntToStr(AxeAttaches)+' Axehead[s].');
if(boxes>0)then WriteLn(' Solved '+IntToStr(boxes)+' Box[es].');
if(demons>0)then WriteLn(' Solved '+IntToStr(demons)+' Demon[s].');
if(newaxes>0)then WriteLn(' Withdrawn '+IntToStr(newaxes)+' New Axe[s].');
if(logs>0)then WriteLn(' Logged in '+IntToStr(logs)+' Time[s].');
if(EntsAvoided>0) then writeln(' Avoided '+inttostr(EntsAvoided)+' Tree Ent[s].');
WriteLn('<=====================================================>');
end;
PlayerStats;
end;
/////////////////////////////////////////////////////////////////////////////////////////////////////
// AutoColor Finding Procedures //
/////////////////////////////////////////////////////////////////////////////////////////////////////
procedure CouldNotFindColors;
begin
WriteLn('ERROR, script could not find colors, please run the script again'
+' or set your own colors.');
TerminateScript;
end;
Function FindTreeColorsifneeded(refrencecol,tol,tol2:integer):boolean; // stolen from moparisbest who stole from stupid3000 i think
var
c,a,b,xm,ym,curcolor:integer;
oc1,oc2,oc3:boolean;
begin
if((WillowColors[1]=0)or(WillowColors[2]=0)or(WillowColors[3]=0))then
begin
if(FindColorTolerance(x,y,refrencecol,3,3,515,338,tol))then//Find tree close
begin
if(FindObj(x,y,'Chop',refrencecol,tol))then
begin
a:=1;
GetMousePos(x,y);
xm:=x;
ym:=y;
repeat
xm:=xm+a;
ym:=ym+b;
curcolor:=GetColor(xm,ym);
MoveMouseSmooth(xm,ym);
wait(5+random(5));
if(IsUpText('Chop'))then begin
if(SimilarColors(curcolor,refrencecol,tol2))and(oc1=false)then
begin
WillowColors[1]:=curcolor;
oc1:=true;
end;
if(SimilarColors(curcolor,refrencecol,tol2))and
(not(curcolor=WillowColors[1]))and(oc2=false)then
begin
WillowColors[2]:=curcolor;
oc2:=true;
end;
if(SimilarColors(curcolor,refrencecol,tol2))and
(not(curcolor=WillowColors[1]))and
(not(curcolor=WillowColors[2]))and(oc3=false)then
begin
WillowColors[3]:=curcolor;
oc3:=true;
end;
end;
if(not(IsUpText('Chop')))then
begin
c:=c+1;
xm:=x;
ym:=y
MMouse(xm,ym,1,1);
wait(200+random(100)+random(100))
if(c=1)then a:=-1;
if(c=2)then begin a:=0;b:=-1;end;
if(c=3)then begin a:=0;b:=2;end;
end;
until((oc1)and(oc2)and(oc3))or(c>=4);
end;
end;
if(WillowColors[1]>0)and(WillowColors[2]>0)and(WillowColors[3]>0)then result:=true;
end;
end;
procedure Setcolorsifneeded;
var
c:integer;
begin
if(BankColor=0)then begin
Status('Finding bank color please Wait...');
while(BankColor=0)do
begin
c:=c+1;
if(BankColor=0)then BankColor:=GetSymbolColor(x,y,'bank');
if(c>20) then CouldNotFindColors;
Wait(Random(50)+500);
end;
end;
if(TreeColor=0)then begin
status('Finding Tree color please Wait...');
while(TreeColor=0)do
begin
c:=c+1;
if(treecolor=0)then treecolor:=GetSymbolColor(x,y,'tree');
if(c>20) then CouldNotFindColors;
Wait(Random(50)+500);
end;
end;
end;
//************************************************************************//
procedure Gotobank;
begin
if (not(loggedin)) then exit;
status('Going to Bank =) ');
Players[CurrentPlayer].Loc:='Going to Bank';
if findcolortolerance(x,y,BankColor,569,0,716,155,2) then
mouse(x-random(2),y+random(2),2,2,true)
flag;
tobankers(BankColor,5,0);
flag;
end;
procedure backtowillow;
begin
if (not(loggedin)) then exit;
Players[CurrentPlayer].Loc:='Back to Willows';
status('Back to Willows =) ');
if findcolortolerance(x,y,BankColor,11,7,759,382,2) then
mouse(x-28-random(3),y+40+random(2),2,2,true)
flag;
end;
//************************************************************************//
//** DO NOT REMOVE I GIVE FREE SCRIPTS DEAL WITH MY PLUGS **//
//************************************************************************//
procedure tagline1;
begin
writeln(' _____ _');
writeln('| __ \ | |');
writeln('| | | | __ _ _ __ | | ___ __ ___ ___ ___');
writeln('| | | |/ _` | ''_ \| |/ / ''_ \ / _ \/ __/ __|');
writeln('| |__| | (_| | | | | <| | | | __/\__ \__ \');
writeln('|_____/ \__,_|_| |_|_|\_\_| |_|\___||___/___/');
writeln(' Scripts Brings You');
writeln('');
writeln(' Draynor Willow Whacker ');
end;
procedure tagline2;
var a:string; i:integer;
begin
a:='/';
for i:=1 to 44 do a:=a+'=';
a:=a+'\';
writeln(a);
a:='|';
for i:=1 to 9 do a:=a+' ';
a:=a+'Please visit my forums at';
for i:=1 to 10 do a:=a+' ';
a:=a+'|';
writeln(a);
writeln('| http://www.freewebs.com/danknessscripts/ |');
a:='\';
for i:=1 to 44 do a:=a+'=';
a:=a+'/';
writeln(a);
end;
procedure setup;
begin
SetupSRL;
tagline1;
wait(3000);
setupvars;
tagline2;
wait(3000);
end;
//************************************************************************//
procedure DankDeposit;
var i,e:integer;
begin
i:=1;
while(i<6) do
begin
if (i=5) and (e<8) then
begin
i:=0;
e:=e+1;
end;
if(FindColor(x,y,65536,(569+42*i),(213+36*e),(569+42*i+31),(213+36*e+30)))then
begin
Mouse(574+((42-1)*i),218+((36-1)*e),20,20,false);
chooseoption(x,y,'All');
wait(200+random(50));
end;
i:=i+1;
end;
if (getcolor(588,218)<>head3) then begin // withdraws new axe from first bank slot and sets new colors
Deposit(1,28,1);
Withdraw(1,1,1);
newaxes:=newaxes+1;
closewindow;
wait(1500+random(500));
FindAxeHeadColor;
end;
end;
Procedure Banking;
begin
if (not(loggedin)) then exit;
Gotobank;
OpenBank;
wait(500);
if (bankscreen) then begin
Players[CurrentPlayer].Loc:='Banking';
wait(2000)
DankDeposit;
wait(3000+random(1000))
closewindow;
wait(2000)
backtowillow;
banked:=banked+1
wait(1000)
end else exit;
end;
Procedure AntiEnt;
begin;
if(FindColorTolerance(x,y,1854748,85,15,115,15,10))then
begin
At:=0
Writeln('Found an Ent!');
At:=At+1;
mouse(695,103,2,2,true);
flag;
if findcolortolerance(x,y,BankColor,11,7,759,382,2) then
mouse(x-28-random(3),y+40+random(2),2,2,true);
Players[CurrentPlayer].Loc:='Running from Fight';
wait(2000)
end;
end;
///////////////////////////////////////////////////////////////////
procedure towillocenter;
begin
Players[CurrentPlayer].Loc:='At Willows';
if findcolortolerance(x,y,BankColor,11,7,759,382,2) then
mouse(x-28-random(3),y+40+random(2),10,10,true);
flag;
end;
Function AxeDamaged:boolean;
begin
result:=getcolor(595,220)=4345174;
end;
/////////////////////////////////////////////////////////////////////
Procedure Randoms;
begin
if (not(loggedin)) then exit;
if Findname Then FindTalk;
if FindNewBox then Logout;
CloseWindow;
ClickToContinue;
FindLamp('mining');
FindDead;
FindMod;
FindMime;
FindMaze;
FindQuiz;
FindFrog;
FindDoctor;
FindBox;
FindDemon;
talktorand;
finddoctor;
talktorand;
if (axedamaged) then banking;
findhead;
AntiEnt;
end;
/////////////////////////////////////////////////////////////////
function willowcolor:integer;
var ri:integer;
begin
repeat
ri:=random(3)+1;
until (ri>=1) or (ri<=3);
result:=willowcolors[ri];
end;
procedure StartChopping;
begin
if (not(loggedin)) then exit;
FindTreeColorsifneeded(3102800,5,45);
repeat
findent(willowcolor);
repeat
if (findmscolor(x,y,willowcolor)) then mouse(x,y,5,5,false);
wait(300+random(300));
until (chooseoption(x,y,'Chop'));
MarkTime(ChopTime);
findent(willowcolor);
repeat
wait(1000+random(1000));
randoms;
until (TimeFromMark(Choptime)>=Waittime);
until (inventoryfull) or (not(loggedin));
end;
////////////////////////////////////////////////////////////////////
begin
Setup;
DeclarePlayers;
loginplayer;
setcolorsifneeded;
repeat
FindAxeHeadColor;
repeat
StartChopping;
Banking;
ProgressReport;
until (not(loggedin));
nextplayer(false);
until (false);
end.