macromacro123
2008-01-08 17:28:02
macromacro123 - SRL Member Application Form
macromacro123
What is the meaning to life?
Where you Referred to SRL? If yes, by whom?
Programming Knowledge
basics of Java
Other Communitys
How Long have You Played Runescape
4 years
Are you affilated in anyway with Jagex LTD?
No Comment
—————————————————–
Please write down a paragraph about Yourself.
I think most of you know a little about me but I have been using scar since two years ago and I learned alot of scripting. My first scripts are in WC and fishing section of junior scripts of SRL. I did a good effort on this and I want to improve my scripts and learn more and more. I also would like to contribute in this community by being part of it. Thanks.
——————————————————
Please Post a Sample of your Work. Only SCAR Scripts Accepted
Here is one of my yew cutters (my first one) that I have been working a while ago. I know I should have used auto-color picker but I need help on this:p so you'll have to set your own color so it'll work. I know it might not be the best yew cutter you've seen but it's a great script that I have reached the running time of 28 hours with 10 players. I want to improve it
so be free to post great comments and ideas!:D
Used SRL coding and stuff. Radial walking, map walking, bank dtm, bmp, antibans(rotation of screen, examining stuff), fail safes etc. great stuff, i think its good stuff for someone at my level.:rolleyes:
PS: I know i use the old FindMMColorTol function but it works great. I will update it to the new rev 9 soon don't worry.
PS: you can also get the RCYew out if its too annoying mouse right clicking around (its sort of an antiban) like that:
procedure ChopYewDown;
begin
GameTab(4);
repeat
if not LoggedIn then Exit;
ChopYew;
//RCYew; <------ using the comment bars (still works great without it)
RotateScreen;
RelocateAtYew;
until InvFull;
end;
program VarrockYewCutter;
{.include SRL/SRL.scar}
{******************************************************************************}
const
DungeonColor = 1842935; // Dungeon symbol color.
PlantColor = 13187; // Plant color under fence under the Yew that is beside the Varrock church.
TreeColor = 97035; // Tree symbol color.
BankColor1 = 4442091; // Bank color 1.
BankColor2 = 88695; // '' '' 2.
{******************************************************************************}
var
x, y, c, t: Integer;
{******************************************************************************}
procedure DeclarePlayers;
begin
NumberOfPlayers(2); // Can add more if wanted.
Players[0].Name := '';
Players[0].Pass := '';
Players[0].Nick := '';
Players[0].Active := True;
Players[0].Integers[0] := 3; // Loads to do.
Players[1].Name := '';
Players[1].Pass := '';
Players[1].Nick := '';
Players[1].Active := True;
Players[1].Integers[0] := 3;
NickNameBMP := CreateBitmapMaskFromText(Players[CurrentPlayer].Nick, UpChars);
end;
{******************************************************************************}
procedure macromacro123;
begin
ClearDebug;
WriteLn('******** ******* ******* ****** *****');
WriteLn('** ** ** ****** ** ** ** **');
WriteLn('** ** ** ** ** ** ** ** **');
WriteLn('** ** ** ******* ******* ** *****');
Wait(500);
WriteLn('******** ******* ******* ****** *****');
WriteLn('** ** ** ****** ** ** ** **');
WriteLn('** ** ** ** ** ** ** ** **');
WriteLn('** ** ** ******* ******* ** *****');
Wait(500);
WriteLn(' ** *** ****');
WriteLn('*** * ** **');
WriteLn(' ** ** *');
WriteLn(' ** **** ***');
Wait(500);
WriteLn(' __________________');
WriteLn('| macromacro123''s |');
WriteLn('|Varrock Yew Cutter|');
WriteLn('| v0.5 |');
WriteLn('|__________________|');
Wait(500);
end;
{******************************************************************************}
procedure SetUpScript;
begin
SetUpSRL;
DeclarePlayers;
end;
{******************************************************************************}
procedure LeftArrow;
begin
Wait(1500 + Random(350));
KeyDown(37);
Wait(500 + Random(1000));
KeyUp(37);
Wait(500 + Random(1000));
end;
{******************************************************************************}
procedure RightArrow;
begin
Wait(1500 + Random(200));
KeyDown(39);
Wait(500 + Random(1000));
KeyUp(39);
Wait(500 + Random(1000));
end;
{******************************************************************************}
function FindMMColorTol(var x, y: Integer; Color, Tol: Integer): Boolean;
begin
Result := FindColorTolerance(x, y, Color, MMX1, MMY1, MMX2, MMY2, Tol);
end;
{******************************************************************************}
function FindBrokenAxe: Boolean;
var
BrokenAxe: Integer;
begin
BrokenAxe := DTMFromString('78DA63F4656260B8C580021C1CE218FE03694' +
'620FE0F048C7E40353718D000231209A48330CDC1501300547387' +
'08350F09A8F106AAB94B408D2B50CD4D026ADC816AAEE3570300B' +
'6A30F3B');
if FindDTM(BrokenAxe, x, y, MIX1, MIY1, MIX2, MIY2) then
begin
Result := True;
WriteLn('******** FOUND BROKEN AXE ********');
WriteFileString(TheFile, '******** FOUND BROKEN AXE ********' + Chr(13));
Players[CurrentPlayer].Loc := 'Broken Axe';
LogOut;
Exit;
end;
FreeDTM(BrokenAxe);
end;
{******************************************************************************}
function HandleFight: Boolean;
begin
if FindFight then
begin
Result := True;
SetRun(True);
if FindMMColorTol(x, y, PlantColor, 5) then
begin
Mouse(x, y, 1, 1, True);
Flag;
WriteLn('Found plant color');
PerfectNorth;
Mouse(643, 100, 4, 4, True);
Flag;
if FindMMColorTol(x, y, TreeColor, 5) then
begin
Mouse(x, y, 4, 4, True);
Flag;
WriteLn('Found tree color');
end;
end;
end;
end;
{******************************************************************************}
function FindYew: Boolean;
begin
if FindColorTolerance(x, y, 4690821, MSX1, MSY1, MSX2, MSY2, 5) then
begin
MMouse(x, y, 0, 0);
Wait(10);
if IsUpText('Yew') then
begin
Result := True;
end;
end;
end;
{******************************************************************************}
procedure EntWait(Time: Integer);
var
t: Integer;
begin
for t := 1 to Time do
begin
Wait(1000);
FindTalk;
HandleFight;
end;
end;
{******************************************************************************}
procedure SolveEnt;
begin
MouseFindNoFlag(MMCX, MMCY, -1, 1);
EntWait(35);
EntsAvoided := EntsAvoided + 1;
end;
{******************************************************************************}
function FindYewEnt: Boolean;
begin
if FindYew then
begin
GetMousePos(x, y);
if FindColorTolerance(x, y, 55769, 85, 15, 115, 15, 20) then
begin
Result := True;
WriteLn('******** FOUND ENT ********');
WriteFileString(TheFile, '******** FOUND ENT ********' + Chr(13));
SolveEnt;
WriteLn('******** ENT AVOIDED ********');
WriteFileString(TheFile, '******** ENT AVOIDED ********' + Chr(13));
end;
end;
end;
{******************************************************************************}
procedure CheckYewEnt;
begin
if FindColorTolerance(x, y, 55769, 85, 15, 115, 15, 20) then
begin
WriteLn('******** FOUND ENT ********');
WriteFileString(TheFile, '******** FOUND ENT ********' + Chr(13));
SolveEnt;
WriteLn('******** ENT AVOIDED ********');
WriteFileString(TheFile, '******** ENT AVOIDED ********' + Chr(13));
end;
end;
{******************************************************************************}
function FindFRandoms: Boolean;
var
i: Integer;
begin
for i := 1 to 3 do
begin
case i of
1: Result := FindYewEnt;
2: Result := HandleFight;
3: Result := FindBrokenAxe;
end;
if Result then
Break;
end;
end;
{******************************************************************************}
procedure FindYRandoms;
begin
FindNormalRandoms;
FindFRandoms;
end;
{******************************************************************************}
procedure YWait(Time: Integer);
var
t: integer;
begin
for t := 1 to Time do
begin
Wait(1000 + Random(400));
FindYRandoms;
end;
end;
{******************************************************************************}
procedure RotateScreen;
var
w: Integer;
za: array [1..8] of Integer;
begin
za[1] := 0;
za[2] := 2000;
za[3] := 1000;
za[4] := 1500;
za[5] := 500;
za[6] := 1000;
za[7] := 0;
za[8] := 500;
w := Random(8) + 1;
begin
case Random(8) of
1: begin FindYRandoms; PickUpMouse; end;
2: begin FindYRandoms; Wait(za[w] + Random(za[w])); end;
3: begin FindYRandoms; FindYRandoms; LeftArrow; end;
4: begin FindYRandoms; FindYRandoms; RightArrow; end;
5: begin FindYRandoms; LeftArrow; end;
6: begin FindYRandoms; RightArrow; end;
7: begin FindYRandoms; Wait(za[w] + Random(za[w])); LeftArrow; end;
8: begin FindYRandoms; Wait(za[w] + Random(za[w])); RightArrow; end;
end;
end;
end;
{******************************************************************************}
procedure WalkToYew;
var
WalkTime: Integer;
begin
if not LoggedIn then Exit;
SetRun(True);
HighestAngle;
RadialRoadWalk(FindVarrockRoadColor, 300, 330, 55, 0, 0);
Flag;
RadialRoadWalk(FindVarrockRoadColor, 0, 30, 45, 0, 0);
Flag;
MarkTime(WalkTime);
repeat
if not LoggedIn then Exit;
LinearRoadWalk(FindVarrockRoadColor, 0, 65, 0, 0);
Flag;
until FindSymbol(x, y, 'dungeon') or
FindMMColorTol(x, y, DungeonColor, 5) or
FindMMColorTol(x, y, PlantColor, 5) and FindMMColorTol(x, y, TreeColor, 5) or
FindSymbol(x, y, 'house') or
(TimeFromMark(Walktime) >= 100000);
if FindSymbol(x, y, 'dungeon') then
begin
MouseFindNoFlag(x + 40, y - 12, 1, 1);
Flag;
WriteLn('Found dungeon symbol');
FindMMColorTol(x, y, PlantColor, 5);
Mouse(x - 8, y - 8, 1, 1, True);
Flag;
WriteLn('Found plant from dungeon symbol');
FindMMColorTol(x, y, TreeColor, 5);
Mouse(x, y, 4, 4, True);
Flag;
WriteLn('Found tree color from dungeon symbol');
Players[CurrentPlayer].Loc := 'Yew';
end else
if FindMMColorTol(x, y, DungeonColor, 5) then
begin
MouseFindNoFlag(x + 40, y - 15, 1, 1);
Flag;
WriteLn('Found dungeon color');
FindMMColorTol(x, y, PlantColor, 5);
Mouse(x - 8, y - 8, 1, 1, True);
Flag;
WriteLn('Found plant from dungeon color');
FindMMColorTol(x, y, TreeColor, 5);
Mouse(x, y, 4, 4, True);
Flag;
WriteLn('Found tree color from dungeon');
Players[CurrentPlayer].Loc := 'Yew';
end else
if FindMMColorTol(x, y, PlantColor, 5) and FindMMColorTol(x, y, TreeColor, 5) then
begin
FindMMColorTol(x, y, PlantColor, 5);
Mouse(x - 8, y - 8, 1, 1, True);
Flag;
WriteLn('Found plant color');
FindMMColorTol(x, y, TreeColor, 5);
Mouse(x, y, 4, 4, True);
Flag;
WriteLn('Found tree color from plant');
Players[CurrentPlayer].Loc := 'Yew';
end else
if FindSymbol(x, y, 'house') then
begin
Mouse(x + 25, y , 4, 4, True);
Flag;
WriteLn('Found house');
FindMMColorTol(x, y, TreeColor, 5);
Mouse(x, y, 4, 4, True);
Flag;
WriteLn('Found tree color from house');
Players[CurrentPlayer].Loc := 'Yew';
end else
if TimeFromMark(WalkTime) >= 100000 then
begin
WriteLn('Could not walk to yew');
Players[CurrentPlayer].Loc := 'Lost';
LogOut;
Exit;
end;
end;
{******************************************************************************}
procedure WalkToBank;
var
WaterTime: Integer;
begin
if not LoggedIn then Exit;
if InvFull then
begin
PerfectNorth;
if FindMMColorTol(x, y, PlantColor, 5) then
begin
Mouse(x - 11, y + 11, 1, 1, True);
Flag;
WriteLn('Found plant color');
repeat
if not LoggedIn then Exit;
LinearRoadWalk(FindVarrockRoadColor, 180, 60, 0, 0);
Flag;
until FindMMColorTol(x, y, BankColor1, 5) or
FindMMColorTol(x, y, BankColor2, 5) or
FindSymbol(x, y, 'training dummy') or
FindSymbol(x, y, 'water') and FindSymbol(x, y, 'archery shop');
if FindMMColorTol(x, y, BankColor1, 5) or FindMMColorTol(x, y, BankColor2, 5) then
begin
Mouse(x, y, 4, 4, True);
Flag;
WriteLn('Found bank colors');
end else
if FindSymbol(x, y, 'training dummy') then
begin
Mouse(x, y, 4, 4, True);
Flag;
WriteLn('Found training dummy');
Wait(250 + Random(50));
Mouse(643, 130, 4, 4, True);
Flag;
end else
if FindSymbol(x, y, 'water') and FindSymbol(x, y, 'archery shop') then
begin
FindSymbol(x, y, 'water');
Mouse(x, y, 4, 4,True);
Flag;
WriteLn('Found water and archery symbol');
Wait(250 + Random(50));
MarkTime(WaterTime);
repeat
Mouse(660, 83, 4, 4, True);
Flag;
until FindMMColorTol(x, y, BankColor1, 5) or
FindMMColorTol(x, y, BankColor2, 5) or
FindSymbol(x, y, 'training dummy') or
(TimeFromMark(WaterTime) >= 100000);
if FindMMColorTol(x, y, BankColor1, 5) or FindMMColorTol(x, y, BankColor2, 5) then
begin
Mouse(x, y, 4, 4, True);
Flag;
end else
if FindSymbol(x, y, 'training dummy') then
begin
Mouse(x, y, 4, 4, True);
Flag;
Wait(250 + Random(50));
Mouse(643, 130, 4, 4, True);
Flag;
end else
if TimeFromMark(WaterTime) >= 100000 then
begin
WriteLn('Didn''t find bank colors or dummy symbol from water symbol');
Players[CurrentPlayer].Loc := 'Lost';
LogOut;
Exit;
end;
end;
end;
end;
end;
{******************************************************************************}
procedure ChopYew;
begin
if FindYew then
begin
GetMousePos(x, y);
CheckYewEnt;
Mouse(x, y, 0, 0, True);
YWait(9 + Random(9));
end;
end;
{******************************************************************************}
procedure RelocateAtYew;
begin
if not FindColorTolerance(x, y, TreeColor, 632, 69, 654, 94, 5) then
begin
FindYRandoms;
if FindMMColorTol(x, y, TreeColor, 5) then
begin
WriteLn('Relocating at yew tree');
Mouse(x, y, 4, 4, True);
Flag;
Exit;
end else
WriteLn('Couldn''t relocate at yew tree');
LogOut;
Exit;
end;
end;
{******************************************************************************}
procedure RCYew;
var
Examine: Integer;
begin
Examine := BitmapFromString2(False, 'a65B2078DAA58E5D0A8030' +
'0C83AF545D7FB647A7EBFD8F64B3810C4411CC43085FDB5022A26' +
'661B42D6169D7702D00C20DEE20529195183983ACB967D9AF1D5D' +
'71C545C2CD3388A1D3D281EC28B5DEA9153B4530A5D4E41066F34' +
'934694C67F757CD5777FE853CDDBEFFF9BF67F0137DE');
MouseSpeed := 8 + Random(6);
MouseBox(5, 5, 513, 336, False);
if FindBitmap(Examine, x, y) then
begin
Mouse(x, y, 1, 1, True);
MouseSpeed := 15;
end else
if not FindBitmap(Examine, x, y) then
begin
MouseSpeed := 15;
Exit;
end;
FreeBitmap(Examine);
end;
{******************************************************************************}
procedure ChopYewDown;
begin
GameTab(4);
repeat
if not LoggedIn then Exit;
ChopYew;
RCYew;
RotateScreen;
RelocateAtYew;
until InvFull;
end;
{******************************************************************************}
procedure ClickBank;
begin
if not LoggedIn then Exit;
if FindSymbol(x, y, 'bank') then
begin
Mouse(x, y, 1, 1, True);
Flag;
WriteLn('Found bank symbol');
Players[CurrentPlayer].Loc := 'Bank';
end else
if FindMMColorTol(x, y, BankColor1, 5) then
begin
Mouse(x, y, 1, 1, True);
Flag;
WriteLn('Found bank primary color');
Players[CurrentPlayer].Loc := 'Bank';
end else
if FindMMColorTol(x, y, BankColor2, 5) then
begin
Mouse(x, y, 1, 1, True);
Flag;
WriteLn('Found bank secondary color');
Players[CurrentPlayer].Loc := 'Bank';
end else
begin
WriteLn('Did not find bank colors or symbol');
Players[CurrentPlayer].Loc := 'Lost';
LogOut;
Exit;
end;
end;
{******************************************************************************}
procedure YFindBank;
var
Bank: Integer;
bla: Extended;
begin
Bank := DTMFromString('78DA6364646060606640017FFE3031C801699' +
'0D47F206064C554F3F52B846684F2199980041B031A6044510300' +
'48F1081A');
if not LoggedIn then Exit;
if FindDTMRotated(Bank, x, y, MMX1, MMY1, MMX2, MMY2, 0, 2 * pi, 0.05, bla) then
begin
Mouse(x ,y, 4, 4, True);
Wait(550 + Random(550));
Flag;
end;
FreeDTM(Bank);
end;
{******************************************************************************}
procedure BankYew;
var
BankTime: Integer;
begin
if not LoggedIn then Exit;
if not BankScreen then
MarkTime(BankTime);
repeat
if not LoggedIn then Exit;
OpenBankGlass('veb', False, False);
until BankScreen or
(TimeFromMark(BankTime) >= 200000);
if BankScreen then
begin
Deposit(2, 28, 2);
CloseBank;
end else
if TimeFromMark(BankTime) >= 200000 then
begin
WriteLn('Could not find bank booth');
Players[CurrentPlayer].Loc := 'Lost';
LogOut;
Exit;
end;
end;
{******************************************************************************}
procedure BankYews;
begin
ClickBank;
YFindBank;
BankYew;
Players[CurrentPlayer].Banked := Players[CurrentPlayer].Banked + 1;
c := c + 1;
t := t + 1;
end;
{******************************************************************************}
procedure PlayerStats;
var
Active: string;
i: Integer;
begin
WriteLn('**************************************');
WriteLn('Name : ' + Players[CurrentPlayer].Name);
WriteLn('Number : ' + IntToStr(CurrentPlayer));
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('Random : ' + Players[CurrentPlayer].Rand);
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 + '. - Banked: ' + IntToStr(Players[i].Banked) + ' Times.' +
' - Worked: ' + IntToStr(Players[i].Worked) + ' Mins.' + ' - Loc: ' + Players[i].Loc + ' - Rand: ' + Players[i].Rand);
end;
WriteLn('**************************************');
end;
{******************************************************************************}
procedure ProgressReport;
begin
SRLRandomsReport;
WriteLn(' __________________');
WriteLn('| macromacro123''s |');
WriteLn('|Varrock Yew Cutter|');
WriteLn('| v0.5 |');
WriteLn('|__________________|');
WriteLn('|Worked: ' + TimeRunning + '.');
WriteLn('|Banked: ' + IntToStr(t) + ' Loads.');
WriteLn('|Chopped: ' + IntToStr(t * 27) + ' Yew logs.');
WriteLn('|__________________|');
end;
{******************************************************************************}
begin
macromacro123;
GetApplication.MINIMIZE;
SetUpScript;
FindRS;
begin
if not LoggedIn then
begin
LoginPlayer;
end;
end;
repeat
repeat
WalkToYew;
ChopYewDown;
WalkToBank;
BankYews;
PlayerStats;
ProgressReport;
until (Players[CurrentPlayer].Integers[0] = c) or (not(LoggedIn));
if Players[CurrentPlayer].Integers[0] = c then
begin
LogOut;
NextPlayer(True);
c := 0;
end else
if not LoggedIn then
begin
NextPlayer(False);
c := 0;
end;
until False;
end.
hopefully will work, else give me ideas to improve it:) Thanks.
——————————————————
<!– END TEMPLATE: formanswers –>