TRiLeZ
2009-04-23 06:56:24
4 Year(s)
Are you affilated in anyway with Jagex LTD?
No
Were you Referred to SRL?
What is your general programming knowledge?
Java, C, C++, C#, PHP, HTML
Are you a member of any other communities?
MoparIsTheBest, MoparScape Forums, Scion Bot, RS Bot, Otaku Studios
Tell us about yourself…
From: TRiLeZ
I am a teenager that has fun in gaming and likes to hang out with friends. I think its fun to make GFX, programs, and scar scripts.
In the summer time I like to go camping and fishing =D
Please show us one (or multiple) of your scripts.
program CowFighter;
{.Script Info:
# ScriptName = Cow Fighter v3 [SMART]
# Author = TRiLeZ
# Description = A simple cow fighter that picks up bones and burries them.
# Version = 3
# Date = 4/10/09
Instructions:
Setup:
1. Fill in the Const secttion
2. Fill in the DeclarePlayers procedure
3. Run the script!
4. Sit back and let it auto
Info:
-Must be where cows are
-Only bring 3 items
-Walks back from dead!
-Attack the cows under fally!
-Needs Reflection!
Help:
-Report Bugs to me by PM on SRL Forums! (My username is TRiLeZ)
Possible Combat Styles:
-Attack, Strength, Defence, Even, Mage, MageDef, Accurate, Rapid,
LongRange
/Script Info}
{.Include SRL/SRL/Misc/Smart.Scar}
{.include srl/srl.scar}
{.include srl/srl/skill/ranging.scar}
{.include srl/srl/misc/worldswitcher.scar}
{.include srl/srl/reflection/Reflection.scar}
var
x,y,i,q: Integer;
gCowKill,gBones,gModsTRiLeZ,gDeathsTRiLeZ,gStartXP,gNowXP,gTxp,gArrowsUsed,gArrows: Integer;
const
SmartWorld = 154;//Change to world you want to auto on
LampSkillz = '';//If finds a lamp, it will use with this skill.
Username = ''; //Name used to id you on my stats website
procedure DeclarePlayers;
begin
HowManyPlayers := 1;// Change this accordingly
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
Players[0].Name :=''; // Character Name
Players[0].Pass :=''; // Character Pass
Players[0].Nick :=''; // Nickname 3 - 4 Letter's of char name
Players[0].Active := True; // To be ran in the script?
Players[0].Strings[1] := ''; // Combat Styles - See line 24
Players[0].Strings[2] := ''; // The skill to record XP gain
Players[0].Strings[3] := '';// Only if using Mage or MageDef! Type in spell name in undercase letters!
{
Players[1].Name :=''; // Character Name
Players[1].Pass :=''; // Character Pass
Players[1].Nick :=''; // Nickname 3 - 4 Letter's of char name
Players[1].Active := True; // To be ran in the script?
Players[1].Strings[1] := ''; // Combat Styles - See line 24
Players[1].Strings[2] := ''; // The skill to record XP gain
Players[1].Strings[3] := '';// Only if using Mage or MageDef! Type in spell name in undercase letters!
}
{
Players[2].Name :=''; // Character Name
Players[2].Pass :=''; // Character Pass
Players[2].Nick :=''; // Nickname 3 - 4 Letter's of char name
Players[2].Active := True; // To be ran in the script?
Players[2].Strings[1] := ''; // Combat Styles - See line 24
Players[2].Strings[2] := ''; // The skill to record XP gain
Players[2].Strings[3] := '';// Only if using Mage or MageDef! Type in spell name in undercase letters!
}
{
Players[3].Name :=''; // Character Name
Players[3].Pass :=''; // Character Pass
Players[3].Nick :=''; // Nickname 3 - 4 Letter's of char name
Players[3].Active := True; // To be ran in the script?
Players[3].Strings[1] := ''; // Combat Styles - See line 24
Players[3].Strings[2] := ''; // The skill to record XP gain
Players[3].Strings[3] := '';// Only if using Mage or MageDef! Type in spell name in undercase letters!
}
end;
{*******************************************************************************
function PostReport(ScriptName, Website, Proggy : String): Boolean;
By: Camo Kyle & Floor66
Description: Posts the Progress Report to my database which you can see
*******************************************************************************}
function PostReport(ScriptName, Website, Proggy : string): Boolean;
var
Dbase : string;
Client : Integer;
begin
Client := InitializeHTTPClient(False, False);
ClearPostData(Client);
Wait(10);
AddPostVariable(Client, 'proggy', Proggy);
AddPostVariable(Client, 'scn', ScriptName);
Dbase := PostHTTPPageEx(Client, Website);
FreeHTTPClient(Client);
Result := true;
end;
procedure SetUpAutoCast(AutoSpell: string; Defensive: Boolean); //Works better than the srl one
begin
GameTab(1);
case Defensive of
True: Mouse(690, 270, 8, 8, True);
False: Mouse(695, 330, 8, 8, True);
end;
Wait(1200);
case LowerCase(AutoSpell) of
'wind strike': Mouse(583,240,1,1,true);
'water strike': Mouse(624,240,1,1,true);
'earth strike': Mouse(663,240,1,1,true);
'fire strike': Mouse(703,240,1,1,true);
'wind bolt': Mouse(584,299,1,1,true);
'water bolt': Mouse(625,299,1,1,true);
'earth bolt': Mouse(664,299,1,1,true);
'fire bolt': Mouse(704,299,1,1,true);
'wind blast': Mouse(582,363,1,1,true);
'water blast': Mouse(624,363,1,1,true);
'earth blast': Mouse(663,363,1,1,true);
'fire blast': Mouse(703,363,1,1,true);
'wind wave': Mouse(585,424,1,1,true);
'water wave': Mouse(625,424,1,1,true);
'earth wave': Mouse(664,424,1,1,true);
'fire wave': Mouse(704,424,1,1,true);
end;
Wait(1200);
end;
procedure SetCStyle;
begin
GameTab(1);
case Players[CurrentPlayer].Strings[1] of
'Strength': SetFightMode(2);
'Attack': SetFightMode(1);
'Defence': SetFightMode(4);
'Even': SetFightMode(3);
'Mage': SetUpAutoCast(Players[CurrentPlayer].Strings[3], false);
'MageDef': SetUpAutoCast(Players[CurrentPlayer].Strings[3], true);
'Accurate': Mouse(602, 272,0,0,true);
'Rapid': Mouse(677, 273,0,0,true);
'LongRange': Mouse(602, 319,0,0,true);
end;
end;
procedure NowEXP;
begin
gNowXp := (GetXP(Players[CurrentPlayer].Strings[2]));
end;
procedure ProgressReport;
begin
if not LoggedIn then exit;
ClearDebug;
if (HowManyPlayers = 1) then
begin
Writeln('****************************************************************************');
Writeln('Cow Fighter v3 [SMART] by TRiLeZ ' + ' Used by: ' + Username);
Writeln('****************************************************************************');
Writeln('Running Time: '+TimeRunning);
Writeln('Killed: '+inttostr(gCowKill)+' Cows.');
Writeln('Xp Gained: '+inttostr(gTxp));
Writeln('Bones Picked Up: '+inttostr(gBones));
Writeln('Mods Found: '+inttostr(gModsTRiLeZ)+' Mods.');
Writeln('Deaths: '+inttostr(gDeathsTRiLeZ));
if (Players[CurrentPlayer].Strings[1] = 'Accurate') or
(Players[CurrentPlayer].Strings[1] = 'Rapid') or
(Players[CurrentPlayer].Strings[1] = 'LongRange') then
Writeln('Arrows Used: '+inttostr(gArrowsUsed));
Writeln('****************************************************************************');
end;
if (HowManyPlayers > 1) then
begin
Players[CurrentPlayer].Integers[1]:= Players[CurrentPlayer].Integers[1] + gCowKill;
gCowKill:= 0;
Players[CurrentPlayer].Integers[2]:= gNowXp-gStartXp;
Players[CurrentPlayer].Integers[3]:= Players[CurrentPlayer].Integers[3] + gBones;
gBones:= 0;
Players[CurrentPlayer].Integers[4]:= Players[CurrentPlayer].Integers[4] + gModsTRiLeZ;
gModsTRiLeZ:= 0;
Players[CurrentPlayer].Integers[5]:= Players[CurrentPlayer].Integers[5] + gDeathsTRiLeZ;
gDeathsTRiLeZ:= 0;
Players[CurrentPlayer].Integers[6]:= Players[CurrentPlayer].Integers[5] + gArrowsUsed;
Writeln('********************************************************************');
Writeln('Cow Fighter v3 [SMART] by TRiLeZ ' + ' Used by: ' + Username);
Writeln('********************************************************************');
Writeln('| Nick | Killed | XP Gained | Bones | Mods | Deaths | Arrows Used |');
Writeln(' ******** ******** *********** ******* ****** ******** *************');
for i:= 0 to HowManyPlayers-1 do
begin
Writeln('| '+Padr(Players[i].Nick, 7)+'| '+Padr(IntToStr(Players[i].Integers[1]),7)+'| '
+Padr(IntToStr(Players[i].Integers[2]),10)+'| '+Padr(IntToStr(Players[i].Integers[3]),6)+'| '
+Padr(IntToStr(Players[i].Integers[4]),5)+'| '+Padr(IntToStr(Players[i].Integers[5]),7)+'| '
+Padr(IntToStr(Players[i].Integers[6]),12)+'| ');
end;
Writeln('**********************************************************************');
Writeln(' Total Running Time: '+TimeRunning);
Writeln('**********************************************************************');
end;
end;
end;
procedure FindDoor;
var
P,Door: TPoint;
begin
Status('Finding Door');
if FindObject(P,8695) then
begin
Door:= TileToMsEx(Tile(3039,3296),15);
Mouse(Door.x+15,Door.y-30,4,4,false);
Wait(400+Random(200));
ChooseOption('Open');
Exit;
end else
if not FindObject(P,8695) and FindObject(P,8696) then
begin
Writeln('Door Not Found! Exiting!');
Logout;
end;
end;
procedure RandomEmote;
begin
if not IsInteractingWithMe('Cow') then
begin
GameTab(12);
case Random(20) of
0: Mouse(569,232,5,5,true);
1: Mouse(613,232,5,5,true);
2: Mouse(654,232,5,5,true);
3: Mouse(701,232,5,5,true);
4: Mouse(569,282,5,5,true);
5: Mouse(613,282,5,5,true);
6: Mouse(654,282,5,5,true);
7: Mouse(701,282,5,5,true);
8: Mouse(569,332,5,5,true);
9: Mouse(613,332,5,5,true);
10: Mouse(654,332,5,5,true);
11: Mouse(701,332,5,5,true);
12: Mouse(569,382,5,5,true);
13: Mouse(613,382,5,5,true);
14: Mouse(654,382,5,5,true);
15: Mouse(701,382,5,5,true);
16: Mouse(569,332,5,5,true);
17: Mouse(613,332,5,5,true);
18: Mouse(654,332,5,5,true);
19: Mouse(701,332,5,5,true);
end;
WaitForAnim(1000);
While (GetAnimation > 0) do wait(20);
end;
end;
procedure AntiBan;
begin
if not LoggedIn then Exit;
case Random(6+random(2)) of
0: wait(500+random(3000));
1: begin
case Random(2) of
0: HoverSkill('random', false);
1: begin
HoverSkill('random', false);
GetMousePos(x,y);
Mouse(x,y,5,5,true);
Wait(1000+random(500));
Mouse(498,21,8,8,false);
if not ChooseOption('Close') then
Mouse(449,51,8,8,true);
end;
end;
end;
2: PickUpMouse;
3: BoredHuman;
4: RandomRClick;
5: RandomEmote;
end;
end;
procedure Intro;
begin
ClearReport;
ChangeReportWidth(300);
AddtoReport(' _ _ _ _ _ _ _ _ _ _ _ _ _');
Wait(500);
AddtoReport('|_ _|| |_| ||_|| | | O_||__ /');
Wait(500);
AddtoReport(' | | | _ \ | || |_ | \_ / /_');
Wait(500);
AddtoReport(' |_| |_| \_\|_||_ _||_ _| /_ _ |');
Wait(500);
AddtoReport('Cow Fighter v3 [SMART] By TRiLeZ');
Disguise('Cow Fighter v3 [SMART]');
Status('Running...');
end;
procedure SetupScript;
var
v: string;
begin
SmartSetUpEx(SmartWorld, False, True, False);
Wait(3000);
SetTargetDC(SMARTGetDC);
ActivateClient;
v:= GetPage('http://scardevreflection.googlecode.com/svn/trunk/RSBuild.txt');
if not (RSBuild = StrToInt(GetNumbers(v))) then UpdateHooks;
DeclarePlayers;
LoginPlayer;
Wait(800);
end;
procedure SetupPlayer;
begin
q:= 1;
KeyDown(VK_Up);
SetRun(True);
gStartXp := (GetXP(Players[CurrentPlayer].Strings[2]));
if (Players[CurrentPlayer].Strings[1] = 'Accurate') or
(Players[CurrentPlayer].Strings[1] = 'Rapid') or
(Players[CurrentPlayer].Strings[1] = 'LongRange') then
begin
gArrows:= ArrowAmount;
end;
end;
function DeathWalkPath: TPointArray;
begin
Result := [Point(3227, 3219), Point(3229, 3219), Point(3232, 3227), Point(3222, 3238),
Point(3209, 3238), Point(3195, 3238), Point(3180, 3236), Point(3166, 3233), Point(3150, 3229),
Point(3134, 3228), Point(3119, 3227), Point(3106, 3236), Point(3105, 3248), Point(3093, 3249),
Point(3079, 3251), Point(3072, 3265), Point(3059, 3276), Point(3043, 3275), Point(3033, 3286),
Point(3039, 3295)];
end;
procedure WalkFromDead;
var
I: Integer;
Path: TPointArray;
begin
gDeathsTRiLeZ := gDeathsTRiLeZ + 1;
Status('Walking back to cows from death');
Logout;
LoginPlayer;
SetRun(true);
Path := DeathWalkPath;
for i:=0 to High(Path) do
begin
WalkToTile(Path[i], 0, 3);
if (i = High(Path)) then break;
while(not TileOnMM(Path[(i+1)]))do
Wait(RandomRange(50, 150));
end;
Mouse(579,224,0,0,false);
ChooseOption('Wield');
Mouse(620,229,0,0,false);
ChooseOption('Weild');
Mouse(662,228,0,0,true);
ChooseOption('Weild');
MakeCompass('N');
OpenDoor;
Wait(400+Random(200));
Mouse(608,42,4,4,true);
SetAngle(true);
Flag;
Mouse(91,493,0,0,true);
Flag;
Wait(2000+Random(200));
end;
function FindDeadTRiLeZ: Boolean;
begin
Result := False;
if ChatBoxTextExists('black','Oh dear, you are dead!') then
begin
Result := True;
SaveToChatLog;
if (SRL_Procs[srl_OnFindDead] <> nil) then
SRL_Procs[srl_OnFindDead]();
TakeScreen('Found Dead');
WalkFromDead;
end;
end;
function FindModTRiLeZ: Boolean;
var
tx, ty: Integer;
begin
if (not UseFindMod) or (not LoggedIn) then exit;
if (BmpMod = 0) or (BmpAdmin = 0) then LoadSRLBitMaps;
if (FindColorTolerance(tx, ty, 14737632, MCX1, MCY1, MCX1 + 40, MCY2, 15)) or
(FindColorTolerance(tx, ty, 589815, MCX1, MCY1, MCX1 + 40, MCY2, 15)) then
if (FindBitmapToleranceIn(bmpMod, tx, ty, MCX1, MCY1, MCX1 + 40, MCY2, 15)) or
(FindBitmapToleranceIn(bmpAdmin, tx, ty, MCX1, MCY1, MCX1 + 40, MCY2, 15)) then
begin
Result := True;
AddToSRLLog('******** FOUND MOD ********');
AddToReport('******** FOUND MOD ********');
TakeScreen('Found mod');
TypeSend('Hoy');
gModsTRiLeZ:= gModsTRiLeZ + 1;
SaveToChatLog;
if (SRL_Procs[srl_OnFindMod] <> nil) then
SRL_Procs[srl_OnFindMod]();
if (LogoutOnMod) then
begin
Players[CurrentPlayer].Rand := 'Found Mod';
repeat
Logout;
Wait(1500 + Random(500));
until not (LoggedIn);
Wait((60000) + Random(60000));
LoginPlayer;
end;
end;
FreeBitmap(bmpMod);
FreeBitmap(bmpAdmin);
end;
function FindRandoms: Boolean;
var
Int: Integer;
begin
for Int := 1 to 7 do
begin
case Int of
1: Result := SolveTeleportRandoms;
2: Respond;
3: Result := FindDeadTRiLeZ;
4: Result := FindLamp(LampSkillz);
5: Result := RC;
6: Result := FindModTRiLeZ;
7: if (SRL_Procs[srl_OnRandomCall] <> nil) then
SRL_Procs[srl_OnRandomCall]();
end;
if Result then
begin
if High(Players[CurrentPlayer].BoxRewards) > -1 then
UseRewardBox;
if (SRL_Procs[srl_OnFindRandom] <> nil) then
SRL_Procs[srl_OnFindRandom]();
Break;
end;
end;
end;
procedure ArrowCheck;
begin
if (Players[CurrentPlayer].Strings[1] = 'Accurate') or
(Players[CurrentPlayer].Strings[1] = 'Rapid') or
(Players[CurrentPlayer].Strings[1] = 'LongRange') then
begin
Wait(200+random(100));
if (ArrowAmount = 0) then
begin
Writeln('No arrows left to continue');
if IsInteractingWithMe('Cow') then
begin
GameTab(5);
Mouse(587,304,10,10,true);
repeat
wait(20);
until not IsInteractingWithMe('Cow');
end;
Logout;
Exit;
end else
gArrowsUsed:= (gArrows-ArrowAmount);
end;
end;
procedure MageCheck;
begin
if (Players[CurrentPlayer].Strings[1] = 'Mage') or
(Players[CurrentPlayer].Strings[1] = 'MageDef') then
begin
repeat
Wait(20);
if not IsInteractingWithMe('Cow') then
begin
Writeln('You dont have enough runes to continue');
Logout;
Exit;
end;
until (GetAnimation = 1162);
end;
end;
function CowInFight: Boolean;
var
X1,Y1,X2,Y2,cx,cy: Integer;
begin
GetMousePos(cx,cy);
X1:=cx-45;
Y1:=cy-45;
X2:=cx+45;
Y2:=cy+45;
if FindColorSpiralTolerance(cx,cy,255,X1,Y1,X2,Y2,10)
or FindColorSpiralTolerance(cx,cy,65280,X1,Y1,X2,Y2,10)
or FindColorSpiralTolerance(cx,cy,192,X1,Y1,X2,Y2,10)
or FindColorSpiralTolerance(cx,cy,16728128,X1,Y1,X2,Y2,10) then
Result:= True
else
Result:= False;
end;
procedure AttackCow;
begin
FindDeadTRiLeZ;
FindModTRiLeZ;
repeat
if (not LoggedIn) then exit;
FindRandoms;
FindDeadTRiLeZ;
ArrowCheck;
Status('Finding Cow');
if FindObjCustom(x,y,['Cow'], [8760772,11646651,5265252,3952985,7240330,4941444], 1) then
begin
MMouse(x,y,3,3);
if not CowInFight then
begin
if IsInteractingWithMe('Cow') then Break;
Mouse(x,y,0,0,False);
if IsInteractingWithMe('Cow') then Break;
if ChooseOption('Attack') then
begin
FindDeadTRiLeZ;
FindModTRiLeZ;
FindRandoms;
WaitToMove(800);
if CharacterMoving then wait(10);
WaitForAnim(1600);
while (GetAnimation > 0) do wait(10);
end;
end;
end
else
wait(200+random(150));
until IsInteractingWithMe('Cow');
Status('Fighting Cow');
MageCheck;
FindRandoms;
NowEXP;
AntiBan;
repeat
ArrowCheck;
wait(10);
until not IsInteractingWithMe('Cow');
gCowKill:= gCowKill+1;
end;
procedure BuryBones;
var
x,y,Bones: Integer;
begin
GameTab(4);
Wait((100)+ Random(80));
Bones := DTMFromString('78DA63CC616260F8C18002CE1C3DCAC00AA41' +
'981F83F10306600D57C475573E2E001B81A10602C06AAF989AA66' +
'FFB6ADA86A32816AFEA1AA99337102AA9A7CA09ACFA86AF66DD98' +
'2A20600F06D15CE');
repeat
if FindDTM(Bones,x,y,MIX1,MIY1,MIX2,MIY2) then
begin
Mouse(x,y,3,3,false);
ChooseOption('Bury');
Wait(650+random(200));
end;
Wait(400+Random(200));
until not FindDTM(Bones,x,y,MIX1,MIY1,MIX2,MIY2);
FreeDTM(Bones);
end;
procedure PickupBones;
begin
if (Players[CurrentPlayer].Strings[1] = 'Attack') or
(Players[CurrentPlayer].Strings[1] = 'Strength') or
(Players[CurrentPlayer].Strings[1] = 'Defence') or
(Players[CurrentPlayer].Strings[1] = 'Even') then
begin
if InvCount = 28 then BuryBones;
MakeCompass('n');
if FindColorSpiralTolerance(x,y,1319583,184, 100,339, 253, 4) then Mouse(x,y,4,4,false);
if FindText(x,y,'Bones',upchars,115,93,373,337) then
begin
Mouse(x,y,1,1,true);
gBones := gBones+1;
end;
wait(650+random(150));
end;
end;
procedure CheckBreak;
begin
if HowManyPlayers = 1 then
begin
if (gCowKill = (q*25)) then
begin
Status('Taking a 15-100 second break and switching worlds');
Logout;
Wait(15000+random(100000));
OpenWorldScreen;
SelectWorld(RandomWorld(false,false));
LoginPlayer;
q:= q+1;
end;
end;
if HowManyPlayers > 1 then
begin
if (Players[CurrentPlayer].Integers[1] = (q*25)) then
begin
Status('Taking a 15-100 second break and switching worlds');
Logout;
Wait(15000+random(100000));
RandomWorld(false,false);
LoginPlayer;
q:= q+1;
end;
end;
end;
procedure MainLoop;
begin
repeat
SetupPlayer;
SetCStyle;
repeat
if (not LoggedIn) then break;
FindRandoms;
Antiban;
FindLamp(LampSkillz);
FindDeadTRiLeZ;
AttackCow;
Wait(2500);
PickupBones;
ProgressReport;
SetRun(true);
CheckBreak;
until (not LoggedIn);
Status('Running...');
if (not LoggedIn) then
begin
if (CurrentPlayer = HowManyPlayers-1) then Break;
NextPlayer(false);
end;
until(false);
Postreport('Cow Fighter v3 [SMART]', 'http://stats.trilez.comuf.com/add.php', GetDebugText);
end;
begin
SetupSRL;
Intro;
ClearDebug;
SetupScript;
MainLoop;
end.