SCAR Code:
{=========================================================================]
[ Varrock Yew Chopper. ]
[ ]
[ NAME : Varrock Yew Chopper. ]
[ WRITER : Omgwoot ]
[ CATEGORY : Woodcutting ]
[ DESCRIPTION : Gathers Yews in East Varrock. ]
[ USAGE : Yew gathering. ]
[ AUTOCOLOR : Yes ]
[ NOTES : Start in Varrock east bank. ]
[ CONTACT : ... ]
[ OTHER INFO : Please inform me of any bugs. I plan to update ]
[ the tree finder. ]
[ ]
[=========================================================================]
[ ]
[=========================================================================]
[ 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. SET HOWMANYPLAYERS inside DeclarePlayers ]
[=========================================================================}
program Varrockyewchopper;
var axe1, axe2, axe3, treec, logxs, loadsx, bankx, integer1, yewcolor: integer; whr: boolean;
{.include SRL/SRL.scar}
{.include SRL/SRL/Skill/woodcutting.scar}
//******************** Set These Constants if Needed *******************//
const StartPlayer = 0; // Determines who will play first
//**********************RuneScape Constants*******************************//
//************************************************************************//
const VersionNumber = '1'; // Compliant with Rev 568+
//************************************************************************//
procedure DeclarePlayers;
begin
HowManyPlayers := 6; // Set Number of Players here.
NumberOfPlayers(HowManyPlayers); // Sets the Players Array Length;
CurrentPlayer := StartPlayer; // CurrentPlayer = Array Index
Players[0].Name := '';
Players[0].Pass := '';
Players[0].Nick := '';
Players[0].Loc := '';
Players[0].Skill := '';
players[0].integer1 := 1; // Loads to do
Players[0].Active := True;
Players[1].Name := '';
Players[1].Pass := '';
Players[1].Nick := '';
Players[1].Loc := 'Loc1';
Players[1].Skill := '';
players[1].integer1 := 1;
Players[1].Active := True;
Players[2].Name := '';
Players[2].Pass := '';
Players[2].Nick := '';
Players[2].Loc := 'Loc1';
Players[2].Skill := '';
players[2].integer1 := 1;
Players[2].Active := True;
Players[3].Name := '';
Players[3].Pass := '';
Players[3].Nick := '';
Players[3].Loc := 'Loc1';
Players[3].Skill := '';
players[3].integer1 := 1;
Players[3].Active := True;
Players[4].Name := '';
Players[4].Pass := '';
Players[4].Nick := '';
Players[4].Loc := 'Loc1';
Players[4].Skill := '';
players[4].integer1 := 1;
Players[4].Active := True;
Players[5].Name := '';
Players[5].Pass := '';
Players[5].Nick := '';
Players[5].Loc := 'Loc1';
Players[5].Skill := '';
players[5].integer1 := 1;
Players[5].Active := True;
writeln(inttostr(HowManyPlayers) + ' Players');
end;
//************************************************************************//
procedure SetUp;
begin
SetupSRL;
DeclarePlayers;
if (not (loggedin)) then LoginPlayer;
RoadColor := 0;
WaterColor := 0;
BankColor := 0;
yewcolor := 3168336;
end;
//************************************************************************//
procedure bankers;
var
banker: Integer;
a: Extended;
begin
banker := DTMFromString('78DA63EC626260886640017FFE3031B002694' +
'620FE0F048CFD986ABE7E6580AB0101C636A09A18DCE680D580EC' +
'4A4455D3DDD688A2060017180F2D');
FindDTMRotated(banker, x, y, 0, 0, 700, 700, 0, 360, 0.01, a);
Mouse(x, y, 0, 0, true);
end;
//************************************************************************//
function AttachaHead: Boolean; //from srl, edited by me
var
AxeHandleDTM, AxeHeadDTM: Integer;
Reequip: Boolean;
begin
AxeHandleDTM := DTMFromString('78DA637465626078C48002CA2379191E02694' +
'620FE0F048C0E40352F19D000231209A4ED806A3E1150E30454F3' +
'86801A2FA09AEB04D47800D5DC23A0C616A8E61D01358E4035EF0' +
'9A80185CF03FC6A00E1CD105C');
AxeHeadDTM := DTMFromString('78DA63CC62626078C180021C2312191E02694' +
'620FE0F048C694035CF18D000231209A473816A9E12A1E6150135' +
'A94035AF09A801B9F9090135994498930C54F392809A3CCCF0415' +
'70300FB8311DF');
if (whr = false) then
begin
GameTab(5);
Wait(200 + Random(200));
Mouse(592, 297, 2, 2, True);
Wait(2000 + Random(800));
Reequip := True;
end;
GameTab(4);
if (FindDTM(AxeHeadDTM, x, y, 550, 200, 745, 465)) and
(FindDTM(AxeHandleDTM, x, y, 550, 200, 745, 465)) then
begin
if (FindDTM(AxeHeadDTM, x, y, 550, 200, 745, 465)) then
begin
Mouse(x, y, 3, 3, True);
Wait(600 + Random(400));
end;
if (FindDTM(AxeHandleDTM, x, y, 550, 200, 745, 465)) then
begin
Mouse(x, y, 3, 3, True);
Wait(500 + Random(200));
AxeAttaches := AxeAttaches + 1;
Result := True;
WriteLn('Attached Axe Head!');
GameTab(4);
MakeCompass('N');
end;
if (Reequip = True) then
begin
Wait(3000);
if (FindColor(x, y, axe1, 554, 205, 743, 465)) then
Mouse(x, y, 5, 5, True);
end;
end;
FreeDTM(AxeHandleDTM);
FreeDTM(AxeHeadDTM);
end;
function FindaHead: Boolean; //from srl, edited by me
var
c, AxeHeadDTM, Tries, x, y: Integer;
hStart: Boolean;
begin
AxeHeadDTM := DTMFromString('78DA63CC62626078C180021C2312191E02694' +
'620FE0F048C694035CF18D000231209A473816A9E12A1E6150135' +
'A94035AF09A801B9F9090135994498930C54F392809A3CCCF0415' +
'70300FB8311DF');
GameTab(4);
Result := True;
c := CreateBitmapMaskFromText('You do not have an axe', SmallChars);
if (FindBitmapMaskTolerance(c, x, y, 17, 410, 495, 452, 10, 85)) then
begin
if ((whr = true) and
not (GetColor(590, 220) = axe1) or
not (GetColor(587, 219) = axe2) or
not (GetColor(588, 218) = axe3)) then
hStart := True;
if (whr = false) then
begin
GameTab(5);
Wait(200 + Random(200));
if not (GetColor(597, 294) = axe1) or
not (GetColor(600, 295) = axe2) or
not (GetColor(599, 298) = axe3) then
begin
hStart := True;
Mouse(592, 297, 2, 2, True);
Wait(1000);
end;
end;
end;
if (hStart = True) then
begin
Result := False;
Tries := 0;
repeat
if not LoggedIn then Exit;
if (FindDTM(AxeHeadDTM, x, y, 550, 200, 745, 465)) then
Break;
if not (FindObjMulti('Take', axe1, axe2, axe3, 5)) then
begin
Tries := Tries + 1;
WriteLn('Axe head not found. Taken ' + IntToStr(tries) + ' tries');
Status('Axe Head not found - Rotating Screen');
KeyDown(VK_LEFT);
Wait(1000 + Random(1000));
KeyUp(VK_LEFT);
Wait(400 + Random(300));
if not FindObjMulti('Take', axe1, axe2, axe3, 5) then
begin
Status('Axe Head not found - Moving to Red Dot');
x := 648;
y := 83;
FindColorSpiral(x, y, 241, 570, 5, 725, 155)
Mouse(x + 3, y + 3, 2, 2, True);
Flag;
Wait(500 + Random(300));
end;
end;
if FindObjMulti('Take', axe1, axe2, axe3, 5) then
begin
Status('Found Axe Head');
WriteLn('Axe head was found. Picking it up');
Wait(450 + Random(400));
GetMousePos(x, y);
Mouse(x, y, 0, 0, True);
Flag;
Wait(500 + Random(300));
end;
until (tries > 9) or
(FindDTM(AxeHeadDTM, x, y, 550, 200, 745, 465))
if not (tries > 9) then
if (AttachHead) then
Result := True;
end;
FreeBitmap(c);
FreeDTM(AxeHeadDTM);
end;
//************************************************************************//
procedure axecheck;
var axex: integer;
begin
cleardebug;
axex := DTMFromString('78DA63F4636260B8CD80025C63D2181238191' +
'81881ECFF40C0E80F547383010D302291403A08A8E6166E35601C' +
'0C54738F809A40A09A0704D480DCF390801A5FA09AFB04D47803D' +
'5DC25A0C6830835EE44D8E50654F384801A17A09A1704D43803D5' +
'BC26A0C60EA8E60301354E4035EFA860972BFEB401C200A40E19A' +
'A');
gametab(4);
wait(1000);
if finddtm(axex, x, y, 0, 0, 700, 700) then begin
axe1 := getcolor(x, y)
axe2 := getcolor(x + 1, y + 1)
axe3 := getcolor(x + 1, y - 1)
writeln('axe is in inventory.')
writeln('axe colors are as follows: ')
whr := true;
writeln(inttostr(axe1) + ' ' + inttostr(axe2) + ' ' + inttostr(axe3))
end;
if whr = false then
begin
gametab(5);
wait(1000);
if finddtm(axex, x, y, 0, 0, 700, 700) then begin
axe1 := getcolor(x, y)
axe2 := getcolor(x + 1, y + 1)
axe3 := getcolor(x + 1, y - 1)
writeln('axe is in equipped.')
writeln('axe colors are as follows: ')
writeln(inttostr(axe1) + ' ' + inttostr(axe2) + ' ' + inttostr(axe3))
end;
end;
end;
//************************************************************************//
procedure FindRandoms;
begin
FindNormalRandoms;
if Findname then FindTalk;
if findfight then
begin
makecompass('N');
mouse(655, 31, 0, 0, true);
wait(5000);
findsymbol(x, y, 'rare trees');
mouse(x, y, 0, 0, true);
end;
if findmod = true then
begin
logout;
wait(60000 * 2);
loginplayer;
end;
if (FindColorTolerance(x, y, 120276, 86, 7, 126, 19, 5)) then
begin
mouse(649, 83, 0, 0, true);
repeat
wait(1000);
until
not (FindColorTolerance(x, y, 120276, 86, 7, 126, 19, 5));
end;
if FindEnt(yewcolor) = true then
begin
mouse(649, 83, 0, 0, true);
repeat
wait(1000);
until
findent(yewcolor) = false;
end;
end;
//************************************************************************//
procedure findcbox(c, t, rx, ry, ex, ey: integer);
begin
FindColorTolerance(x, y, c, rx + 5, ry + 5, ex + 5, ey + 5, t);
end;
//************************************************************************//
procedure fwait;
var flagx: integer;
begin
flagx := DTMFromString('78DA639CCAC4C060C98002FE436946180D52E' +
'38EAAE658180BAA9A69986A628D0551D5F403D5D813B06B02508D' +
'1D013593806A6C08A89986E92F0CF74C26C22E9039B6F8CD01008' +
'2190F87');
repeat
wait(100);
until
not (finddtm(flagx, x, y, 0, 0, 700, 700));
end;
//************************************************************************//
procedure totree;
var N: integer;
begin
makecompass('N');
bankers;
wait(random(1000));
setrun(true);
gametab(4);
RadialRoadWalk(FindVarrockRoadColor, 693, 698, 66, 0, 0);
flag;
repeat
findrandoms;
findcbox(6456, 2555, 649 - 5, 53 - 5, 657 - 5, 62 - 5);
mouse(x, y, 0, 0, true);
flag;
until
findsymbol(x, y, 'rare trees');
mouse(x, y, 0, 0, true);
flag;
players[currentplayer].loc := 'Yew trees.';
end;
//************************************************************************//
procedure fromtree;
begin
setrun(false);
makecompass('S');
gametab(4);
sendarrowwait(3, 5);
wait(random(500));
repeat
findrandoms;
findcbox(6456, 2555, 639 - 5, 45 - 5, 661 - 5, 64 - 5);
mouse(x, y, 0, 0, true);
flag;
until
findsymbol(x, y, 'bank');
mouse(x, y, 0, 0, true);
flag;
players[currentplayer].loc := 'Bank.';
end;
//*************************************************************************//
procedure tree;
begin
GameTab(4);
repeat
wait(5000);
if FindObjMultiText(x, y, 'Yew', 'Cho', 'ee', yewColor, 5) then
begin
MMouse(x, y, 3, 3);
end;
if (FindColorTolerance(x, y, 120276, 86, 7, 126, 19, 5)) then
begin
Wait((20000));
end;
if (IsUpText('Yew')) then
begin
Mouse(x, y, 2, 2, true);
end;
wait(5000);
FindRandoms;
FindaHead;
until
invcount = 28;
end;
//*************************************************************************//
procedure bank;
var logx: integer;
begin
logx := DTMFromString('78DA632C66626078CA80023C4C39192630323' +
'00011C37F20602C04AAB9C38006189148209D0554F39E809A02A0' +
'9A0F04D43400D5BC26A0A61EA8E60901353540350F09A8A906AAB' +
'949404D3250CD73026AD2816A1EE0570300EB9212B3');
makecompass('S');
lowestangle;
openbank3;
wait(random(500));
fixbank;
wait(random(500));
finddtm(logx, x, y, 560, 210, 739, 458);
mouse(x, y, 0, 0, false);
chooseoption(x, y, 'All');
closebank;
players[currentplayer].banked := players[currentplayer].banked + 1;
end;
//************************************************************************//
procedure mainloop2;
begin
repeat
highestangle;
totree;
wait(random(500));
repeat
tree
findrandoms;
wait(2000);
until
invfull
fromtree;
bank;
loadsx := loadsx + 1;
until
loadsx = players[currentplayer].integer1;
end;
//*************************************************************************//
procedure depositelogs;
begin
makecompass('S');
lowestangle;
openbank3;
wait(random(500));
fixbank;
wait(random(500));
finddtm(logxs, x, y, 560, 210, 739, 458);
mouse(x, y, 0, 0, false);
chooseoption(x, y, 'All');
closebank;
highestangle;
end;
//*************************************************************************//
procedure PlayerStats;
var Active: string;
var i: Integer;
begin
writeln('**********************************************');
writeln('Name : ' + Players[CurrentPlayer].Name);
writeln('Number : ' + inttostr(CurrentPlayer));
writeln('Worked for : ' + inttostr(scripttime(2)) + ' 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 +
'. - B :' + inttostr(Players[i].Banked) + ' Times.' +
' - : ' + IntToStr(Players[i].Worked) + ' mins.' + ' - Loc: ' + Players[i].loc);
end
writeln('**********************************************');
end;
//*************************************************************************//
procedure ProgressReport;
begin
begin
WriteLn(' ');
WriteLn('<============== -' + VersionNumber + '- Progress Report ===============>');
SRLRandomsReport;
Writeln(' ');
end;
PlayerStats;
end;
//*************************************************************************//
procedure brightnessnchat;
begin
//chat
mmouse(30, 487, 0, 0);
getmousepos(x, y);
repeat
mouse(x, y, 0, 0, true);
wait(1000);
until
findcolor(x, y, 255, 38, 476, 74, 500);
//
mmouse(157, 487, 0, 0);
getmousepos(x, y);
repeat
wait(1000);
mouse(x, y, 0, 0, true);
until
findcolor(x, y, 255, 158, 479, 202, 500);
//
mmouse(297, 488, 0, 0);
getmousepos(x, y);
repeat
wait(1000);
mouse(x, y, 0, 0, true);
until
findcolor(x, y, 255, 306, 477, 345, 499);
//brightness
gametab(11);
if (findcolor(x, y, 9981222, 705, 221, 720, 236)) then gametab(4)
else
if (not (findcolor(x, y, 9981222, 705, 221, 720, 236))) then
begin
mouse(715, 228, 0, 0, true);
gametab(4);
end;
end;
//*************************************************************************//
//
// Main Event Loop
//
//*************************************************************************//
begin
Setup;
activateclient;
repeat
axecheck;
brightnessnchat;
logxs := DTMFromString('78DA632C66626078CA80023C4C39192630323' +
'00011C37F20602C04AAB9C38006189148209D0554F39E809A02A0' +
'9A0F04D43400D5BC26A0A61EA8E60901353540350F09A8A906AAB' +
'949404D3250CD73026AD2816A1EE0570300EB9212B3');
//if finddtm(logxs, x, y, 560, 210, 739, 458)then depositelogs;
mainloop2;
if loadsx = players[currentplayer].integer1 then
logout;
ProgressReport;
until (false);
nextplayer(true);
end.