my first script i hope uall like it shuld work with scar divi3.06 otherwise 3.01
whell here it is.......
{================================================= ========================]
[ Draynor machine ]
[ ]
[ NAME : Draynor machine ]
[ WRITER : pdog ]
[ CATEGORY : Woodcutter ]
[ DESCRIPTION : Will cut and bank willows in Draynor ]
[ USAGE : Start in Draynor Bank read notes below ]
[ AUTOCOLOR : Yes ]
[ ]
[ More Scripts can be found at ]
[ www.Villu-Reborn.com ]
[
[
[
[
this is my script do not in any way repost this
©2007-2008
[================================================== =======================]
[ Instructions. ]
[================================================== =======================]
[ 1. USE Runescape with Low Detail, Very Bright. ]
[ 2. Set your Screen to 32 bit TRUE color. ]
[ 3. Set Playernames and Passwords in the form (comes when started). ]
[ 4. Start script Logged Out / Logged in ]
[ 5. Set Colors or Leave at Zero to autopick ]
[ 6. Have WC Axe in First inventoryslot and more in the bank ]
[ 7. Setup varables from 43-61 ]
[================================================== =======================]
[ 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 ]
[ Dankness --> For the original Willow Whacker ]
[================================================== =======================}
Program WilllowWhacker;
{.include SRL\SRL.SCAR}
{.include SRL\SRL\skill\WoodCutting.scar}
Var
Banked, Loads, AxeMask, StickMask, Broken, LogMask : Integer;
DoWeHaveAxe : Boolean;
NewAxes, MyMark, Dx, Dy : Integer;
WillowColors: Array[1..3] of Integer;
OtherBank: Array[1..5] of Integer;
//************************************************** **********************//
Const
VersionNumber = '1.4'; // Don't touch it
TreeTol = 5; // The tolerance the tree's can have.
WaitTime = 15; // Maximum time to wait before clicking again.
MinutesPerLoad = 5; // Maximum minutes per load.
MaxLoads = 8; // Maximum loads before switching players.
BankLogs = true; // Bank the logs or power chop them ?
BankMethod = 4; // 1=OpenBank; 2=OpenBank3; 3=OpenBankQuiet; 4=OpenMyBank; (my own creation, rather simple)
//************************************************** **********************//
Procedure SetupVars;
Begin
//****** Main Screen 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
//****** Mini-Map Colors ******\\
BankColor := 0; // Leave at zero to autoset
//****** Settings ******\\
MouseSpeed := 10; // Speed of the mouse.
BenMouse := True; // Use human-like mouse movements ?
End;
//*****************DON'T TOUCH BELOW !!!*****************\\
Procedure DeclarePlayers;
Begin
StartPlayers ( true, '' );
End;
//*****************Progress Report*****************\\
procedure ProgressReport;//Credits to fakawi, a part is from the guild raper...
var Active: string;
var i: Integer;
begin
Writeln(' ');
Writeln('<============= Willow machine =============>');
Writeln('<========= -'+VersionNumber+'- Progress Report ==========>');
Writeln('/==========================================\');
Writeln(' Worked for '+ TimeRunning);
Writeln(' Banked '+IntToStr(Banked)+' loads[s].');
Writeln(' Cut Aprox. '+inttostr(Banked*27)+(' logs.'));
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].Level[1])+ ', '+
IntToStr(Players[i].Banked)+' Banked, '+
IntToStr(Players[i].Worked)+' Mins.')
end
Writeln('<======================================== ==>');
end;
//*****************BMP Strings*****************\\
Procedure LoadBMPs;
Begin
StickMask := BitmapFromString(8, 9, 'z78DA33304000373030C00' +
'083477CF0BB04530D312A890700500C5941');
AxeMask := BitmapFromString(9, 7, 'z78DA3330200CDCC000BF08B' +
'57491A7975459525D42BC7AE201000E5B4C8D');
Broken := BitmapFromString(8, 7, 'z78DA3330200CDCC080183598' +
'2A7189E33719BF8DB4D645897F01F7BF4639');
LogMask := BitmapFromString(13, 10, 'z78DA33301805E40037BC8' +
'0BAB6D0C2E5F451494998D02E5471010034299979');
End;
//*****************AutoColor*****************\\
procedure CouldNotFindColors;
begin
WriteLn('ERROR, failed finding colors.')
Writeln('Please run it again or set your own colors.');
TerminateScript;
end;
Function FindTreeColorsIfNeeded(refrencecol,tol,tol2:intege r):boolean; // stolen from moparisbest who stole from stupid3000 i think//Was still intact
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,to l)) 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);
MMouse(xm,ym, 5, 5);
Wait(5+random(5));
If(IsUpText('Chop'))then
Begin
If(SimilarColors(curcolor,refrencecol,tol2))and(oc 1=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;
Function TryOtherBankColor : integer;//Something i made in case it failed finding the bank
Var Number : integer;
Begin
OtherBank[1] := 3786196;
OtherBank[2] := 6809849;
OtherBank[3] := 4903650;
OtherBank[4] := 6414581;
OtherBank[5] := 5689576;
Number := 0;
Repeat;
Number := Number + 1;
If(FindColorTolerance(x, y, OtherBank[Number], MMX1, MMY1, MMX2, MMY2, 25)) Then
Begin
Result := GetColor(x,y);
Writeln('New Bank color is : '+IntToStr(Result));
Break;
End Else;
Begin
If (Number = 5)Then
CouldNotFindColors
End;
Until(Number = 5);
End;
procedure Setcolorsifneeded;//Same, only deleted the find tree symbol...what was it for anyway ?!
//var
// c:integer;
begin
{If Not (FindColor(x, y, BankColor, MMX1, MMY1, MMX2, MMY2)) Then BankColor := 0;
if(BankColor=0)then begin
Status('Finding bank color please Wait...');
while(BankColor=0)do
begin
c:=c+1;
if(BankColor=0)then Begin BankColor:=GetSymbolColor(x,y,'bank'); Break; End;
if(c>20) then CouldNotFindColors;
Wait(Random(50)+500);
end;
end;}
BankColor := TryOtherBankColor;
end;
//*****************Pieces of Banking*****************\\
Procedure Gotobank;//Totally redo this part, was broken like hell...
Begin
If Not(LoggedIn) Then Exit;
If Not (FindColorTolerance(x, y, BankColor, MMX1, MMY1, MMX2, MMY2, 10)) Then
Begin
Writeln('Bank not found, please restart...');
TerminateScript;
If(FindColorTolerance(x, y, BankColor, MMX1, MMY1, MMX2, MMY2, 10)) Then
Begin
Mouse(x, y, 5, 5, true);
FFlag(0);
End;
End;
If(FindColorTolerance(x, y, BankColor, MMX1, MMY1, MMX2, MMY2, 10)) Then
Begin
Mouse(x, y, 5, 5, true);
bank the damn loggs!!!!
FFlag(0);
End;
ToBankers(BankColor,5,0);
FFlag(0);
End;
Procedure goToWillow;//Simple yet affective
Begin
If Not(LoggedIn) Then Exit;
If FindColorTolerance(x,y,BankColor,11,7,759,382,2) Then
Mouse(x-28,y+40,10,10,true);
FFlag(0);
end;
//*****************Banking*****************\\
Function CheckAxe : Boolean;//Made by Sumilion
Begin
GameTab(4);
If(FindBitmapMaskTolerance(AxeMask, X, Y, MIX1, MIY1, MIX2, MIY2, 5, 5)) Then
Begin
Result := true;
End else
Begin
GameTab(5);
Wait(300+Random(200));
If (FindBitmapMaskTolerance(AxeMask, X, Y, MIX1, MIY1, MIX2, MIY2, 5, 5))Then
Begin
Result := true;
Mouse(x, y, 0, 0, true);
End;
End;
End;
Procedure OpenMyBank;
Var
BankMark : Integer;
Begin
MarkTime(BankMark);
Repeat;
If ( BankScreen ) Then Exit;
If (FindObj(x, y, 'ank', 3355448, 10)) Then
Begin
Mouse(x, y, 5, 5, false);
ChooseOption(x, y, 'uick');
Wait(1000+Random(3000));
End;
Until (BankScreen) or (TimeFromMark(BankMark) > 60000)
End;
procedure DankDeposit; //Kept as original.... huh ?!
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(1000+random(500));
end;
i:=i+1;
end;
if Not ( DoWeHaveAxe ) then begin // withdraws new axe from first bank slot and sets new colors
DoWeHaveAxe := true;
Wait(500+Random(500));
If ( FindBitmapMaskTolerance(StickMask, x, y, MIX1, MIY1, MIX2, MIY2, 5, 5) ) Then
Mouse(x, y, 0 ,0, true);
If ( FindBitmapMaskTolerance(AxeMask, x, y, MSX1, MSY1, MSX2, MSY2, 5, 5) ) Then
Begin
Mouse(x, y, 0 ,0, true);
End Else
Begin
Writeln('No more axes on'+Players[CurrentPlayer].Name);
LogOut;
NextPlayer(false);
End;
NewAxes := NewAxes+1;
Writeln(IntToStr(NewAxes));
CloseBank;;
Wait(1500+random(500));
FindAxeHeadColor;
end;
end;
Procedure Banking; // Remained the same, aw, it was working
Begin
If Not(Loggedin) then exit;
Gotobank;
If ( BankMethod = 1 ) Then OpenBank;
If ( BankMethod = 2 ) Then OpenBank3;
If ( BankMethod = 3 ) Then OpenBankQuiet('db');
If ( BankMethod = 4 ) Then OpenMyBank;
OpenMyBank;
wait(500+Random(200));
If (Bankscreen) Then
Begin
Players[CurrentPlayer].Loc:='Banking';
Wait(500+Random(1000))
DankDeposit;
Wait(1000+Random(1000))
If ( BankScreen ) Then CloseBank;
If ( BankScreen ) Then CloseBank;
Wait(1000+Random(1000))
BackToWillow;
Wait(1000)
End Else exit;
end;
//*****************Randoms*****************\\
Function WillowColor : Integer ; Forward;
Function Ent(Ex,Ey : integer): Boolean;//Made by Charmz.
Begin
MMouse(Ex, Ey, 0, 0);
If(FindColorSpiralTolerance(x, y, 3432536, MSX1, MSY1, MSX2, MSY2, 10))then
MMouse(x, y, 0, 0);
If(IsUpText('Chop')) or (IsUpText('Willow')) or (IsUpText('Down'))then
Begin
If(FindColorSpiralTolerance(x, y, 383705, 1, 1, 180, 39, 20))or
(FindColorSpiralTolerance(x, y, 65535, 1, 1, 200, 40, 20))then
Begin
Result:= True;
EntsAvoided:=EntsAvoided + 1;
WriteLn('Ent found, waiting');
Mouse(648, 83, 1, 1, True);
Wait(5000+Random(2000));
End else
Result:= False;
Exit;
End;
End;
Function AxeDamaged:boolean;
begin
GameTab(4);
Result:=FindBitmapMaskTolerance(Broken, x, y, MIX1, MIY1, MIX2, MIY2, 5, 5);
end;
Procedure Randoms;//Original procedure, added some stuff...
begin
If Not(LoggedIn) Then Exit;
FindNormalRandoms;
If (Axedamaged) Then Begin DoWeHaveAxe := false; Banking; End;
FindHead;
If (FindFight) Then RunWhere('N', true);
If (FindDead) Then Begin Logout; NextPlayer(false); Writeln('Player died...'); End;
FindEnt(WillowColor);
FindBirdsNest;
end;
//*****************Chop Procedures(most is wizzups)*****************\\
Function WillowColor : integer;//From Original script.
Var RandomColor:integer;
Begin
Repeat
RandomColor:=random(3)+1;
Until (RandomColor >= 1) or (RandomColor <= 3);
Result:=WillowColors[RandomColor];
End;
Function FindTree(MaxTol:Integer):Boolean;//Stolen from wizzups powerminer, modded by me
Var Tol,Ex,Ey:Integer;
Begin
While (Not (FindColorTolerance(Ex, Ey, WillowColor, MSX1, MSY1, MSX2, MSY2, Tol))
And Not (Tol > MaxTol)) Do
Begin
Tol:=Tol+1;
End;
If ((FindColorTolerance(Ex, Ey, WillowColor, MSX1,MSY1 ,MSX2, MSY2, Tol))
And Not (Tol > MaxTol)) Then Result:=True;
Tol:=1;
Wait(10);
End;
Function StartChopping:Boolean; //Stolen from wizzups powerminer, modded by me
Var
Ex,Ey : Integer;
Begin
If Not (LoggedIn) Then Exit;
If (FindTree(TreeTol)) Then
Begin
If ( BankLogs ) Then
If Not FindColor(x, y, BankColor, MMX1, MMY1, MMX2, MMY2) Then Exit;
Result := True;
If FindObj(Dx, Dy, 'low', WillowColor, TreeTol) Then
Begin
If Not (Ent(Dx, Dy)) Then
Begin
If Random (20) < 18 Then
Begin
Mouse(Dx, Dy, 0, 0, True);
End Else
Begin
Mouse(Dx, Dy, 0, 0, False);
ChooseOption(Ex, Ey, 'own');
End;
If (FlagPresent) Then
Begin
Flag;
Wait(500+Random(500));
End;
MarkTime(Mark);
While (Not (TimeFromMark(Mark) > (1000 * WaitTime))) Do
Begin
Wait(1000);
Randoms;
If Not (IsUpText('low')) Then Break;
If (InvFull) Then Break;
End
End;
End
End;
End;
//************************************************** **********************//
//** DO NOT REMOVE I GIVE FREE SCRIPTS DEAL WITH MY PLUGS **//
//************************************************** **********************//
Procedure DebugStart1;
Begin
Writeln(' _');
Writeln('| __ \ | |');
Writeln('');
Writeln('');
Writeln('');
Writeln('');
Writeln('+ all hail pdogScripts Brings You:');
Writeln('');
Writeln(' Draynor Willow machine ');
End;
Procedure DebugStart2;
Var a:string; i:integer;
Begin
a:='/';
for i:=1 to 42 do a:=a+'=';
a:=a+'\';
writeln(a);
a:='|';
for i:=1 to 8 do a:=a+' ';
a:=a+'Please visit my forums at';
for i:=1 to 9 do a:=a+' ';
a:=a+'|';
writeln(a);
writeln('| WWW.Villu-Reborn.Com |');
a:='\';
for i:=1 to 42 do a:=a+'=';
a:=a+'/';
writeln(a);
End;
Procedure SetupUser; Forward;
Procedure MyMultiPlayer;
Begin
If Not (LoggedIn) Then LoginPlayer;
If (Loads >= MaxLoads) Then Logout;
End;
Procedure SetupClient;
Begin
SetupSRL;
SetupVars;
ClearDebug;
DebugStart1;
DebugStart2;
DeclarePlayers;
ActivateClient;
Wait(1000+Random(2000));
LoadBMPs;
End;
Procedure SetupUser;
Begin
If Not ( LoggedIn ) Then LoginPlayer;
SetRun(true);
PerfectNorth;
Players[CurrentPlayer].Level[1] := GetSkillLevel('woodcutting');
End;
//*****************Main Line*****************\\
Begin
SetupClient;
SetupUser;
If ( BankLogs ) Then SetColorsIfNeeded;
Repeat;
If (LoggedIn) Then
Begin
If ( BankLogs ) Then BackToWillow;
SetupUser;
DoWeHaveAxe := FindAxeHeadColor;
If Not DoWeHaveAxe Then Banking;
FindTreeColorsifneeded(3102800,5,45);
End;
Repeat
MarkTime(MyMark)
Repeat
If Not (LoggedIn) Then Break;
StartChopping;
Until (( InvFull )
Or (TimeFromMark( MyMark ) > 1000 * 60 * MinutesPerLoad))
Or (Not(LoggedIn));
If (BankLogs) Then Banking;
If (Not (BankLogs)) and (LoggedIn) Then
ClickAllItemsBmpMaskTolWait('rop', LogMask, 5, 5, 2);
Banked := Banked+ 1;
Loads := Loads + 1;
Players[CurrentPlayer].Banked := Players[CurrentPlayer].Banked + 1;
ProgressReport;
SRLRandomsReport;
MyMultiPlayer;
Until Not(Loggedin);
Loads := 0;
NextPlayer(true);
Until (false);
End.















