SCAR Code:
{ ---------------------------------------------------------------------------- ]
[ ..::CowHider::.. ]
[ ---------------------------------------------------------------------------- ]
[ ..:: DESCRIPTION ::.. ]
[ ]
[ Kills cows and gathers hides, eventually banks 'em ]
[ ---------------------------------------------------------------------------- ]
[ ..:: SUPPORTED SKILLS ::.. ]
[ ]
[ o Strength ]
[ o Attack ]
[ o Defense ]
[ o Balance ]
[ ---------------------------------------------------------------------------- ]
[ ..:: SETUP INSTRUCTIONS ::.. ]
[ ]
[ o Log out at Lumbridge Cows, across from chicken pen. ]
[ o Fill in lines 41 through 46 ]
[ o Set up characters on lines 62 through 84 ]
[ o Do not Change Anything in the Script Itself. Hit the Run Button Now! ]
[ ---------------------------------------------------------------------------- ]
[ Scripted by Tails111: Credit to Many people, will specify on release ]
[ ---------------------------------------------------------------------------- }
Program CowHider;
{.include SRL\SRL.Scar}
{.include SRL\SRL\Skill\Fighting.Scar}
var
Chicken : array[0..2] of Integer;
Chickens, CowHideDTM, MMWater, CIndex, Exp, Bone, Display : Integer;
SwitchMark, IntTime, TakeCount, CaMark : Integer;
Const
VerNumber = '1.0'; // Version Number
StartPlayer = 0; // Player to start
BuryBones = False; // Do you want to bury bones? Not Recomended
GambleBox = False; // Set this to true if your computer is experiencing lag
BanSafety = 10; // Lower for more ban prevention
Extensive = True; // Detailed player information
iPlay = 10; // Minutes until switch player
HitColor = 192;
MissedColor = 16728128;
FightTimeOut = 10000;
CalTime = 60000;
{ ---------------------------------------------------------------------------- ]
[ Procedure DeclarePlayers - Declares Players. ]
[ ---------------------------------------------------------------------------- }
Procedure DeclarePlayers;
Begin
HowManyPlayers:= 4;
NumberOfPlayers(HowManyPlayers);
Players[0].Name :='Username';
Players[0].Pass :='Password';
Players[0].Nick :='Nickname';
Players[0].Integer1 := 1; //1 - 4 fightmode.
Players[0].Active := True;
Players[1].Name :='';
Players[1].Pass :='';
Players[1].Nick :='';
Players[1].Integer1 := 1; //1 - 4 fightmode.
Players[1].Active := True;
Players[2].Name :='';
Players[2].Pass :='';
Players[2].Nick :='';
Players[2].Integer1 := 1; //1 - 4 fightmode.
Players[2].Active := True;
Players[3].Name :='';
Players[3].Pass :='';
Players[3].Nick :='';
Players[3].Integer1 := 1; //1 - 4 fightmode.
Players[3].Active := True;
end;
{ ---------------------------------------------------------------------------- ]
[ Procedure Intro - Name, version number. ]
[ ---------------------------------------------------------------------------- }
Procedure Intro;
Begin
ClearDebug;
Status('Script Created by Tails111');
Writeln(' Ver '+VerNumber+' Cow Hider ');
ReportVars[0] := ReportVars[0] + 1;
end;
{ ---------------------------------------------------------------------------- ]
[ Procedure LoadAll - Loads chicken, feather, and water. By: WhiteShadow ]
[ ---------------------------------------------------------------------------- }
Procedure LoadAll ;
Begin
Cow[0]:= 3949132;
Cow[1]:= 11975616;
Cow[2]:= 9541532;
CowHideDTM := DTMFromString('78DA637463666060616240063BD6AE01D38C5' +
'03EA30350CD77460654C088AAC61CD31C0C35CE40350204D4F802' +
'D5F01350130854C34A84393F09B8D90AA8E62F7E35000C8C078C');
MMWater := BitmapFromString(2, 2, '6277A56277A56277A56277A5');
Bone := BitmapFromString(4, 4, '000001000001000001D2CCCC9B9' +
'090A19595CEC7C79B909089807FDED9D9CAC3C29A8E8E000001C7' +
'BFBFA99D9D000001');
end;
{ ---------------------------------------------------------------------------- ]
[ Function AttackType - Sets attack type. ]
[ ---------------------------------------------------------------------------- }
Function AttackType : String;
Begin
case Players[CurrentPlayer].Integer1 of
1 : Result:= 'attack';
2 : Result:= 'strength';
3 : Result:= 'hitpoints';
4 : Result:= 'defence';
end;
end;
{ ---------------------------------------------------------------------------- ]
[ Function InFight - Determines if your still fighting. By: WT-Fakawi ]
[ ---------------------------------------------------------------------------- }
Function InFightAt(x, y: Integer):Boolean;
var
dx, dy: Integer;
begin
if ( FindColor(dx, dy, GreenStatusColor, x - 20, y - 10, x + 20, y + 10) or
FindColor(dx, dy, RedStatusColor, x - 20, y - 10, x + 20, y + 10) or
FindColor(dx, dy, MissedColor, x - 20, y - 10, x + 20, y + 10) or
FindColor(dx, dy, HitColor, x - 20, y - 10, x + 20, y + 10) ) then
Result:=True;
end;
{ ---------------------------------------------------------------------------- ]
[ Function FindCow - Finds Cow and attacks. By: WT-Fakawi EDITED by Tails111 ]
[ ---------------------------------------------------------------------------- }
Function FindCow : Boolean;
var CBx,CBy: Integer;
Begin
For CIndex:=0 to 2 do
Begin
if FindColorSpiralTolerance(CBx, CBy, Chicken[CIndex], MSX1, MSY1, MSX2, MSY2, 15) then
Begin
MMouse(CBx, CBy, 0, 0);
if IsUpTextMulti('Co','ow','w') then
Begin
Mouse(CBx, CBy, 0, 0, True);
Flag;
wait(5000+random(4000));
if (InChatMulti('alr', 'und ',' att')) then
Begin
Result:=True;
Exit;
end;
if (InChatMulti('ome', 'one ',' ing')) then
Begin
Result:=False;
Exit;
end;
end;
end;
end;
end;
{ ---------------------------------------------------------------------------- ]
[ Procedure FightWait - Waits for the fight. By: WT-Fakawi ]
[ ---------------------------------------------------------------------------- }
Procedure FightWait;
var Mark5, WGC:Integer;
begin
MarkTime(Mark5);
repeat
if(not(LoggedIn))then Exit;
for WGC := 1 to 3 do
begin
wait(1000 + Random(100));
if (TimeFromMark(Mark5) > FightTimeOut + Random ( FightTimeOut / 2 )) then Exit;
end;
until not InFight;
Cows := Cows + 1;
ReportVars[0] := ReportVars[0] + 1;;
end;
{ ---------------------------------------------------------------------------- ]
[ Procedure AntiBan - Ban safety. By: FT-Fawaki ]
[ ---------------------------------------------------------------------------- }
Procedure AntiBann;
var
AntBan : Integer;
Begin
if (not(LoggedIn)) then Exit;
case AntBan of
1: RandomRClickEvery(2 + Random(13));
2: hoverskill('random', false);
3: RotateEvery(20 + Random(10));
4: LeaveScreenEvery(5 + Random(5));
5: HoverEvery(15 + Random(5),'random');
6: PickUpMouse;
7: BoredEvery(9 + Random(24));
8: if ExistsItem ( 1 ) then
DragItem(1, 1+Random(18));
9: GameTab(1 + Random(12));
10: DoEmote(1 + Random(20));
end;
end;
{ ---------------------------------------------------------------------------- ]
[ Function FindRandoms - Deals with all Randoms, Thanks SRL ]
[ ---------------------------------------------------------------------------- }
function FindRandoms : Boolean;
var
i: Integer;
begin
for i := 1 to 17 do
begin
case I of
1: CloseWindow;
2: if FindTalk then
Result := True;
3: if FindDead then
Result := True;
4: if FindMod then
Result := True;
5: if FindMime then
Result := True;
6: if FindMaze then
Result := True;
7: if FindQuiz then
Result := True;
8: if FindDemon then
Result := True;
9: if FindScapeRune then
Result := True;
10: if FindTalk then // Call it twice
Result := True;
11: if FindLamp(LampSkill) then // Maybe we missed it?
Result := True;
12: if (FindNewBox) then
begin
Result := True;
if(GambleBox = True)then
begin
if(not(GambleNewBox))then
LogOut;
end else
SolveBox;
end;
13: if FindTrade then
Result := True;
14: begin
if NoGameTab then
begin
if ( SolveFrog ) then Exit;
Result := True;
Players[CurrentPlayer].loc := 'No GameTab';
Logout;
Exit;
end;
end;
15: SaveToChatLog;
16: if SolvePinball then
Result := True;
17: AntiBann;
end;
wait(1);
end;
end;
{ ---------------------------------------------------------------------------- ]
[ Procedure FindWaits - By: WhiteShadow ]
[ ---------------------------------------------------------------------------- }
procedure FindWait(Ms, R : Integer);//Wait with randoms.
var
WaitTime, DivTime, i : Integer;
begin
WaitTime:= Ms + random(r);
DivTime:= Trunc(WaitTime div 3);
repeat
Wait(DivTime - round(r div 4));
FindRandoms;
if(random(24) = 2)then
SendArrowSilentWait(random(3), 300 + random(200));//Humans tilt alot?
i:= i + 1;
until(i >= 3);
end;
{ ---------------------------------------------------------------------------- ]
[ Procedure Bury - Bury bones ]
[ ---------------------------------------------------------------------------- }
Procedure Bury;
begin
ClickAllItemsBmpTolWait('ury', Bone, 50, 250);
end;
{==============================================================================]
[ Function Bank - Banks cow hides + all other items in inventory ]
[==============================================================================}
{ ---------------------------------------------------------------------------- ]
[ Function CollectItems - Collects Cowhides / Bones. By: WhiteShadow ]
[ ---------------------------------------------------------------------------- }
function CollectItems : Boolean;
var
a : TPoint;
c : Integer;
begin
repeat
c:= c + 1;
if(not(LoggedIn))then Exit;
FindRandoms;
if(FindColorTolerance(a.x, a.y, 7632531, Msx1, Msy1, Msx2, Msy2, 10))or
(FindColorTolerance(a.x, a.y, 10240, Msx1, Msy1, Msx2, Msy2, 10))then
begin
MMouse(a.x, a.y, 0, 0);
if(IsUpText('ake'))then
begin
Result:= True;
Mouse(a.x, a.y, 2, 2, false);
If(InvCount < 28)Then
if(ClickOption('owhid', 1))then
TakeCount:= TakeCount + 1;
Flag;
if(InvCount < 28)then
if (ClickOption('one', 1)) then
TakeCount:= TakeCount + 1;
Flag;
If(InvCount = 28)then
begin
if(BuryBones = True)then
bury;
end
end;
end;
until(InvFull) or (c > 2)
end;
{ ---------------------------------------------------------------------------- ]
[ Procedure xPosition - Anti-Lost. Credits to WhiteShadow ]
[ ---------------------------------------------------------------------------- }
procedure xPosition;
begin
if(TimeFromMark(CaMark) > CalTime)then
begin
MarkTime(CaMark);
MakeCompass('N');
if(random(2) = 0)then
begin
SymbolAccuracy:= 0.4;
if(FindSymbol(x, y, 'fish'))then
MouseFlag(x + 25, y + 5, 5, 5);
end else
begin
if(FindBitmapToleranceIn(MMWater, x, y, Mmx1, Mmy1, Mmx2, Mmy2, 50))then
MouseFlag(x + 25, y - 23, 2, 2);
end;
end;
end;
{ ---------------------------------------------------------------------------- ]
[ Procedure PlayerStats - Detailed Player Stats By: WhiteShadow ]
[ ---------------------------------------------------------------------------- }
procedure PlayerStats;
var
PSActive : String;
i : Integer;
begin
for i := 0 to HowManyPlayers-1 do
begin
if(Players[i].Active = True)then
PSActive:='True'
else
PSActive:='False';
Writeln('#'+IntToStr(i)+' : '+Players[i].name+ ', Active = '+PSActive+', Hides = '+IntToStr(Players[i].Banked));
end
writeln('<|----------------------------------------------|>');
end;
{ ---------------------------------------------------------------------------- ]
[ Procedure ProgReport - Simple Progress Report. ]
[ ---------------------------------------------------------------------------- }
Procedure Report;
Begin
ClearDebug;
Intro;
Exp:= (Chickens*3)*4;
Writeln('<|----------------------------------------------|>');
Writeln(' CowHider ver '+VerNumber+' by Tails111 ');
Writeln(' Worked for: '+ScriptTime2(2));
Writeln(' Killed: '+IntToStr(Cows)+' Cows');
Writeln(' Estimated Exp: '+intToStr(Exp));
Writeln('<|----------------------------------------------|>');
if(Extensive = True)then
PlayerStats;
end;
{ ---------------------------------------------------------------------------- ]
[ Procedure MSC - Adjusts Mouse. Credit to WhiteShadow ]
[ ---------------------------------------------------------------------------- }
procedure MSC;
begin
Writeln('Mouse adjust');
if(random(2) = 0)then
MouseSpeed:= 8 + random(3)
else
MouseSpeed:= 6 + random(4);
BenMouse:= True;
SetTimeOut(60, 'MSC');
Status('');
end;
{ ---------------------------------------------------------------------------- ]
[ Procedure LoadScript - By: WhiteShadow ]
[ ---------------------------------------------------------------------------- }
Procedure LoadScript;
Begin
ClearDebug;
Intro;
SetUpSRL;
LoadAll;
DeclarePlayers;
CurrentPlayer:= StartPlayer;
BenMouse:= True;
MouseSpeed:= 7;
if(not(LoggedIn)) then
LoginPlayer;
MSC;
End;
{ ---------------------------------------------------------------------------- ]
[ The main loop - Self explanitory. Credits to WhiteShadow ]
[ ---------------------------------------------------------------------------- }
Begin
LoadScript;
SetChat('On', 1)
SetChat('Off', 2)
SetChat('Off', 3)
NickNameBMP:= CreateBitmapMaskFromText(Players[CurrentPlayer].Nick, UpChars);
if(LoggedIn)then
begin
SetFightMode(Players[CurrentPlayer].Integer1);
SetRun(True);
GameTab(4);
HighestAngle;
IntTime:= (iPlay * 60000) + random(5 * 60000);
Display:= Round(IntTime / 60000);
Writeln(Players[CurrentPlayer].Name+' will play '+IntToStr(DisPlay)+' minutes');
MarkTime(SwitchMark);
end;
MarkTime(CaMark);
repeat
FindCow;
Wait(50 + random(50));
FightWait;
Wait(50 + random(50));
CollectItems;
CountInvSlot(Players[CurrentPlayer].Banked, 1, 1);
if(not(LoggedIn))then
Break;
xPosition;
CollectItems;
Report;
SRLRandomsReport;
until(TimeFromMark(SwitchMark) > IntTime)
if(LoggedIn)then
NextPlayer(True);
if(not(LoggedIn))then
NextPlayer(False);
End.