Smarter Child
2009-08-29 03:15:21
How Long have You Played Runescape?
4 Year(s)
Are you affilated in anyway with Jagex LTD?
No
Were you Referred to SRL?
What is your general programming knowledge?
Well i know basic web design, and i have learned some java/delphi.
Are you a member of any other communities?
Not really.
Tell us about yourself…
Please show us one (or multiple) of your scripts.
My other reflection one i released:
I just posted both, but if one of them look crappy, please don't let it make your vote biased.
Thanks~
~Smarter Child
Edit: Sorry about the bad looking instruction box at top of script. IDK what happened :confused:
Edit2: Forgot to credit Tad for his wonderful reflection walking functions. So credits to Tad for that~ :D
4 Year(s)
Are you affilated in anyway with Jagex LTD?
No
Were you Referred to SRL?
What is your general programming knowledge?
Well i know basic web design, and i have learned some java/delphi.
Are you a member of any other communities?
Not really.
Tell us about yourself…
From: Smarter Child
im 13, i like soccer, i like scripting, plan on releasing more scripts. I want to be come a big help to this community :)
Don't play as much of runescape as i used too. I like Scar :p
Please show us one (or multiple) of your scripts.
[scar]program New;
{.include SRL\SRL.Scar}
{=========================================================================]
[ ___ ___ ]
[ / __) / __) ]
[ \__ \( (__ ]
[ (___/ \___) ]
[ ]
[ NAME : Flawless FightCaver ]
[ WRITER : Smarter Child ]
[ CATEGORY : Fighting ]
[ DESCRIPTION : AFKs in fight caves, gets u xp and tokkul ]
[ USAGE : Color ]
[ NOTES : Position player right at cave entrance ]
[ CONTACT : Me @ [email]wowplayermaster@hotmail.com[/email] (mail) ]
[ Version : 0.1 ]
[ Status : Alpha stages ]
[=========================================================================]
[ Instructions ]
[=========================================================================]
[ 1. Have your display settings set to 32 bit TRUE color. ]
[ 2. Fill out DeclarePlayers. ]
[ (For further instructions on how to fill it out, visit this thread: ]
[ [url]http://www.villavu.com/forum/showthread.php?t=5410[/url]) ]
[ 3. Please make sure your player is at the cave ]
[ 4. Make sure you have a weapon/bow + arrows equipped ]
[ 5. Start script! ]
[=========================================================================}
Const
Username = ''; //Players username.
Password = ''; //Players password.
Nick = ''; //Players nick [3-4 letters of username].
Range = true; //Would you like the script to range[must set fight style to range too]
FightStyle = 'range'; //Valid Styles are: 'attack','strength','shared','defense','range'\\
{ BankTheTokkul = false; //REMOVED MAY ADD LATER }
PickupTheArrows = false; //Would you like to pickup the arrows?[STABLE]
Special = true; //Would you like the script to occasionally use special attack?
Prayer = false; //Would you like the script to turn on prayers now and then in fight caves?
Runz = 15; //How many runs b4 sleeping for about 30-50 minutes.
Potion = false; //Drink potions now and then in the fight caves
MaxPot = 4; //Max times to drink the potion? [leave as 0 if potion = false]
//---------------------------------------------------------------------------------------------------------------------------\\
//---------------------------------------------------------------------------------------------------------------------------\\
//----------------------------------------------DO NOT TOUCH BELOW-----------------------------------------------------------\\
//---------------------------------------------------------------------------------------------------------------------------\\
//---------------------------------------------------------------------------------------------------------------------------\\
var
Tokkul, runs, Arrows, specials, entrytries, xTokkul, runsEx, PotsDrank, Pot, sleeps, levels: integer;
Const Version = '0.1'; //DO NOT CHANGE
Procedure GetVer;
Var
Ver: string;
begin
Status('Checking Version..');
Ver := GetPage('http://fightcaver.freehostia.com/FightCaveVersion.txt');
if Ver = Version then
begin
ClearDebug;
Writeln('Script is up-to-date');
end;
if Ver <> Version then
begin
ClearDebug;
Writeln('Script is OUTDATED.');
Writeln('New Version: ');
end;
end;
{*******************************************************************************
function FindBank: boolean;
By: Smarter Child
Description: Finds and clicks the TzHaar banker.
*******************************************************************************}
Function FindBanker: boolean;
var
GetCTS, rx, ry, tx, ty, h: integer;
TPA: TPointArray;
aTPA: T2DPointArray;
I: integer;
begin
GetCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.06, 1.83);
rx := MSCX;
ry := MSCY; //Declare "r" variable to the center of the client.
if FindColorsSpiralTolerance(MSCX, MSCY, TPA, 3505344, MSX1, MSY1, MSX2, MSY2, 22)then
begin
Writeln('Banker found');
aTPA := SplitTPAEx(TPA, 25, 20);
H := High(aTPA);
For I := 0 to H do
begin
if Length(TPA[i])=0 then Exit;
if MiddleTPAEx(TPA, tx, ty)then
begin
writeln('clicking..');
MMouse(tx, ty, 2, 2);
Wait(100 + Random(200) - random(50));
if IsUpText('TzHaar')then
begin
Mouse(tx, ty, 3, 3, true);
Result := true;
ColorToleranceSpeed(GetCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
end;
end;
end;
end;
if(not(FindColorsSpiralTolerance(MSCX, MSCY, TPA, 3505344, MSX1, MSY1, MSX2, MSY2, 22)))then
begin
Writeln('Couldn''t find banker');
Result := false;
ColorToleranceSpeed(GetCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
end;
end;
{*******************************************************************************
Procedure LoadDTM;
By: Smarter Child
Description: Loads all DTMs into memory.
*******************************************************************************}
Procedure LoadDTM;
begin
Tokkul := DTMFromString('78DA639CC2CCC060CAC8800CACCCCC18FE036' +
'99828E36CA01A3D5435E6C6C61039989A25403596A86A0C141450D58' +
'0ECB24755E3E160C22089ACA603A8C61C550D4C16AE663E508D217E3' +
'50084C0087F');
Arrows := DTMFromString('78DA63546260609064400142EC0C0CFF81342' +
'310FF070246901A75543582509A114683E41551D5F0A1ABD10112' +
'12A86AB8D1D5180209013435CC0C0CFCC86AA430CDE1634433471' +
'C48A8E07733008F240748');
Pot := DTMFromString('78DA63DCCFCCC020C4C8800C548BFB18FE036' +
'990E87F2060DC0D542383AA06220B2381F409A01A49026A8E03D5' +
'881250B38F198987502380AC6607508D207E7300FA8F0B47');
end;
{*******************************************************************************
Procedure FreeMemory;
By: Smarter Child
Description: Frees all DTMs from memory.
*******************************************************************************}
Procedure FreeMemory;
begin
FreeDTM(Tokkul);
FreeDTM(Arrows);
FreeDTM(Pot);
end;
{*******************************************************************************
Function CountTokkul: integer;
By: Smarter Child
Description: Counts and stores tokkul value in xTokkul.
*******************************************************************************}
Function CountTokkul: integer;
begin
xTokkul := ItemAmount('inv', 'dtm', Tokkul, []);
Result := xTokkul;
end;
{*******************************************************************************
function BankTokkul: boolean;
By: Smarter Child
Description: Banks tokkul, if tokkul isn't found it exits and continues.
*******************************************************************************
Function BankTokkul: boolean;
var
tx, ty: integer;
begin
CountTokkul;
if BankTheTokkul = false then exit;
Status('Banking...');
repeat
FindBanker;
until(BankScreen);
if BankScreen then
begin
Writeln('Bank = open');
Wait(500 + Random(500));
LoadDTM;
if FindDTM(Tokkul, tx, ty, MIX1, MIY1, MIX2, MIY2)then
begin
MMouse(tx, ty, 3, 3);
Wait(500 + Random(750));
if IsUpText('okkul')then
begin
Wait(RandomRange(250, 650) + Random(500));
Mouse(tx, ty, 2, 2, false);
Wait(RandomRange(650, 750) + Random(750));
if ChooseOption('eposit All')then
begin
Writeln('Banked Tokkul');
CloseBank;
FreeMemory;
Result := true;
end;
end;
end;
if(not(FindDTM(Tokkul, tx, ty, MIX1, MIY1, MIX2, MIY2)))then
begin
CloseBank;
Result := false;
FreeMemory;
Exit;
end;
end;
end;
}
{*******************************************************************************
function InCave: boolean;
By: Smarter Child
Description: Detects if you are in the fight caves, can be a little laggy :P.
*******************************************************************************}
Function InCave: boolean;
var sx, sy: integer;
begin
SymbolAccuracy := 0.8;
Result := (not(FindSymbol(sx, sy, 'bank')))or
(not(FindSymbol(sx, sy, 'minigame')))
end;
{*******************************************************************************
function EnterCave: boolean;
By: Smarter Child
Description: Enters fight cave, will change compass if required.
*******************************************************************************}
Function EnterCave: boolean;
var
x, y, i, dg: integer;
TPA, tempTPA, TPAs: TPointArray;
aTPA : T2DPointArray;
TP: TPoint;
begin
if InCave then exit;
dg := Round(rs_GetCompassAngleDegrees);
if(not(InRange(dg, 200, 150)))then
MakeCompass(180 + Random(20) - RandomRange(10, 20));
SetAngle(false);
FindColorsSpiralTolerance(x, y, tempTPA, 9474460, MSX1, MSY1, MSX2, MSY2, 25);
FindColorsSpiralTolerance(x, y, TPA, 8487563, MSX1, MSY1, MSX2, MSY2, 35);
if(not(Length(TPA) > 0)) or (not(Length(tempTPA) > 0)) then
Exit;
TPAs := CombineTPA(tempTPA, TPA);
ATPA := SplitTPA(TPAs, 22);
SortATPASize(ATPA, True);
for i := 0 to High(ATPA) do
begin
TP := MiddleTPA(ATPA[i]);
MMouse(TP.x, TP.y, 6, 6);
Wait(Random(350 + Random(350)));
if IsUpText('ave') or IsUpText('TzHaar') then
begin
Mouse(TP.x, TP.y, 5, 5, false);
if ChooseOption('nter')then
Result := True;
inc(runs);
inc(runsEx);
Exit;
end;
end;
if(not(FindColorsSpiralTolerance(x, y, TPA, 9474460, MSX1, MSY1, MSX2, MSY2, 15))) or
(not(FindColorsSpiralTolerance(x, y, tempTPA, 8487563, MSX1, MSY1, MSX2, MSY2, 25)))then
Result := false;
inc(entrytries);
Exit;
end;
{*******************************************************************************
function SetStyle integer;
By: Smarter Child
Description: Loads the fight stlye according to the const.
*******************************************************************************}
Function SetStyle: integer;
begin
Case FightStyle of
'attack': Result := 1;
'strength': Result := 2;
'shared': Result := 3;
'defense': Result := 4;
'range': Result := 0;
end;
end;
{*******************************************************************************
Procedure Terminate(reason: string);
By: Smarter Child
Description: Logs out and terminates script according to reason.
*******************************************************************************}
Procedure Terminate(reason: string);
begin
//Proggy;
Writeln('Logging out..');
Logout;
Writeln('Termination Reason: ' + reason);
TerminateScript;
end;
Procedure Declare;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
Players[0].Name := Username;
Players[0].Pass := Password;
Players[0].Nick := Nick;
Players[0].Active := True;
end;
{*******************************************************************************
function ColorArrow: integer;
By: Smarter Child
Description: Autocolors ground arrows in fight caves.
*******************************************************************************}
Function ColorArrow: integer;
var
ArrowColor, rx, ry, HGC, i, r, g, b: integer;
GC: TIntegerArray;
dTPA: TPointArray;
H, S, L: Extended;
x, y, z: extended;
begin
ArrowColor := 990081;
// Writeln('Original Color := ' + IntToStr(ArrowColor)); Was only for testing purposes.
rx := MSCX;
ry := MSCY; //Declares the "r" variable to the center of the main screen.
FindColorsSpiralTolerance(rx, ry, dTPA, ArrowColor, MSX1, MSY1, MSX2, MSY2, 25);
if Length(dTPA)=0 then exit;
GC := GetColors(dTPA);
HGC := High(GC);
For i := 0 to HGC do
begin
ColorToRGB(GC[i], R, G, B);
ColorToHSL(GC[i], H, S, L);
ColorToXYZ(GC[i], X, Y, Z); //YEAH I KNOW WTF, BUT IT WORKS <3.
if (R >= 103) and (R <= 154) and (G >= 21) and (G <= 32) and (B >= 12) and (B <= 18) then
if (H >= 1.63) and (H <= 1.76) and (S >= 77.76) and (S <= 80.02) and (L >= 22.92) and (L <= 33.35) then
if (X >= 6.05) and (X <= 13.75) and (Y >= 3.53) and (Y <= 7.81) and (Z >= 0.73) and (Z <= 1.33) then
begin
Writeln('Arrow Color: ' + IntToStr(GC[i]));
Result := GC[i];
Exit;
end;
end;
end;
{*******************************************************************************
function PickupArrows: boolean;
By: Smarter Child
Description: Picks up the arrows on the ground in the fightcaves.
*******************************************************************************}
Function PickupArrows: boolean;
var
x, y: integer;
begin
if not loggedin then exit;
if PickupTheArrows = false then exit;
if FindColor(x, y, ColorArrow, MSX1, MSY1, MSX2, MSY2)then
begin
MMouse(x, y, 2, 2);
Wait(500 + Random(500));
if IsUpText('rrow')then
begin
Wait(100 + Random(300));
Case Random(3)of
0: begin
Mouse(x, y, 2, 2, false);
Wait(100 + Random(100));
if ChooseOption('ake')then
Result := true;
end;
1: begin
Mouse(x, y, 2, 2, true);
Wait(500 + Random(500));
Result := true;
end;
2: begin
HoldMouse(x, y, true);
Wait(500 + Random(750));
ReleaseMouse(x, y, true);
Result := true;
end;
end;
end;
end;
end;
{function PickupArrows: Boolean;
var
x, y, i: integer;
aTPA: T2DPointArray;
TPA: TPointArray;
begin
Result := False;
if not LoggedIn then exit;
if PickupTheArrows = false then exit;
if FindColorsSpiralTolerance(x, y, TPA, 00, MSX1, MSY1, MSX2, MSY2, 15)then
begin
writeln('col found');
aTPA := SplitTPAEx(TPA, 50, 50);
for i := 0 to High(ATPA) do
begin
MiddleTPAEx(ATPA[i], x, y);
MMouse(x, y, 2, 2);
if IsUpText('rrow') then
begin
Wait(100 + Random(200));
case Random(2) of
0: begin
Mouse(x, y, 2, 2, False);
Wait(400 + Random(200));
ChooseOption('ick');
WriteLn('picked up arrows');;
Break;
Result := true;
end;
1: begin
Mouse(x, y, 2, 2, True);
Wait(100 + Random(100));
WriteLn('picked up arrows');
Break;
Result := true;
end;
end;
end;
end;
end;
end; }
{*******************************************************************************
Function FindArrowsMS(var TPA: TPointArray): boolean;
By: Smarter Child
Description: Results true if detects Arrows on the mainscreen.
*******************************************************************************}
Function FindArrowMS(var TPA: TPointArray): boolean;
begin
Result := FindColors(TPA, ColorArrow, MSX1, MSY1, MSX2, MSY2);
end;
{*******************************************************************************
Function DoPickupArrows: boolean;
By: Smarter Child
Description: Picks up the arrows if PickupTheArrows is true.
*******************************************************************************}
Function DoPickupArrows: boolean;
var
z: integer;
TPA: TPointArray;
begin
if PickupTheArrows = false then exit;
marktime(z);
Alert('Picking up the arrows');
setangle(false);
repeat
PickupArrows;
until((not(FindArrowMS(TPA))) or (TimeFromMark(z) > 20000))
if(not(FindArrowMS(TPA))) or (TimeFromMark(z) > 20000)then
Result := true;
end;
{*******************************************************************************
Function EquipArrows(where: string): boolean;
By: Smarter Child
Description: Will equip the arrows if they are not already equipped.
*******************************************************************************}
Function EquipArrows(where: string): boolean;
var
x, y: integer;
begin
Case where of
'OutOfCave': begin
if Range = false then exit;
if(not(WearingItem(4)))then
begin
LoadDTM;
Writeln('Equipping arrows');
GameTab(tab_inv);
if FindDTM(Arrows, x, y, MIX1, MIX2, MIY1, MIY2) or FindColorTolerance(x, y, 668758, MIX1, MIY1, MIX2, MIY2, 20)then
begin
Writeln('Arrows found');
GameTab(tab_inv);
MMouse(x, y, 3, 3);
if IsupText('rrow')then
begin
Wait(500 + Random(500));
Mouse(x, y, 2, 2, true);
FreeMemory;
Result := true;
end else
if(not(FindDTM(Arrows, x, y, MIX1, MIX2, MIY1, MIY2))) or (not(FindColorTolerance(x, y, 668758, MIX1, MIY1, MIX2, MIY2, 20)))then
begin
if(not(WearingItem(4)))then
Result := false;
Writeln('Failed to equip arrows');
FreeMemory;
Terminate('No arrows');
end;
end;
end;
if WearingItem(4)then
begin
Writeln('Arrows are equipped');
Result := true;
GameTab(tab_inv);
exit;
end;
end;
'InCave': begin
if Range = false then exit;
LoadDTM;
GameTab(tab_inv);
if FindDTM(Arrows, x, y, MIX1, MIX2, MIY1, MIY2) or FindColorTolerance(x, y, 668758, MIX1, MIY1, MIX2, MIY2, 20)then
begin
writeln('Equipping Arrow In Inv');
MMouse(x, y, 2, 2);
if IsUpText('rrow')then
begin
Wait(200 + Random(200));
Mouse(x, y, 2, 2, true);
FreeMemory;
Result := true;
end else
if(not(FindDTM(Arrows, x, y, MIX1, MIX2, MIY1, MIY2))) or (not(FindColorTolerance(x, y, 668758, MIX1, MIY1, MIX2, MIY2, 20)))then
begin
writeln('No arrows - they must be equipped then');
Result := false;
exit;
end;
end;
end;
end;
end;
{*******************************************************************************
function UseSpecial: boolean;
By: Smarter Child
Description: Uses special attack.
*******************************************************************************}
Function UseSpecial: boolean;
var
TPA: TPointArray;
colx, coly: integer;
begin
if Special = false then exit;
if not (InCave) then exit;
if FindColorsTolerance(TPA, 4162877, 564, 410, 612, 444, 10)then
begin
Writeln('Special is availabe');
MouseBox(579, 421, 701, 430, 1);
if FindColorTolerance(colx, coly, 1055619, 1158, 643, 1167, 651, 10)then
begin
Writeln('used special!!');
Inc(Specials);
Result := true;
end;
end;
end;
{*******************************************************************************
function UsePrayer: boolean;
By: Smarter Child/ Idea from Harry's script
Description: Switches on prayer, idea of using if/then/else from Harry.
*******************************************************************************}
Procedure UsePrayer;
var
PrayLvl, P: integer;
PrayColor: string;
begin
if Prayer = false then exit;
if (not(InCave))then exit;
P := GetMMLevels('prayer', PrayColor);
PrayLvl := GetSkillLevel('prayer');
if PrayColor = 'Red' then exit;
Case (LowerCase(FightStyle)) of
'attack','strength','shared','defense':
begin
if PrayLvl > 3 then MouseBox(603, 231, 620, 251, 1)else//Burst of Strength
if PrayLvl > 6 then MouseBox(635, 233, 654, 249, 1)else//Clarity of Thought
if PrayLvl > 12 then MouseBox(696, 264, 623, 290, 1); //Superhuman Strength
if PrayLvl > 15 then MouseBox(632, 269, 658, 286, 1)else//Improved Reflexes
if PrayLvl > 30 then MouseBox(712, 308, 729, 324, 1)else//Ultimate Strength
if PrayLvl > 33 then MouseBox(561, 342, 582, 359, 1);//Incredible Reflexes
end;
'range':
begin
if PrayLvl > 7 then MouseBox(672, 234, 691, 249, 1)else//Sharp Eye
if PrayLvl > 25 then MouseBox(597, 305, 619, 320, 1)else//Hawk Eye
if PrayLvl > 43 then MouseBox(562, 380, 579, 396, 1);//Eagle Eye
end;
end;
end;
Function UsePotion: boolean;
var
c, x, y: integer;
begin
if(not(incave))then exit;
if Potion = false then exit;
if c >= MaxPot then exit;
LoadDtm;
if FindDTM(Pot, x, y, MIX1, MIY1, MIX2, MIY2)then
begin
Wait(500 + Random(500));
MMouse(x, y, 2, 2);
if IsUpText('otion')then
begin
wait(200 + random(600));
case random(2)of
0: begin
Mouse(x, y, 2, 2, false);
ChooseOption('rink');
Result := true;
Writeln('Drank Potion');
inc(c);
inc(potsdrank);
FreeMemory;
end;
1: begin
Mouse(x, y, 3, 3, true);
Result := true;
Writeln('Drank Potion');
inc(c);
Inc(PotsDrank);
FreeMemory;
end;
end;
end;
if(not(IsUpText('otion')))then
begin
Result := false;
FreeMemory;
C := MaxPot;
exit;
end;
end;
if(not(FindDTM(Pot, x, y, MIX1, MIY1, MIX2, MIY2)))then
begin
Result := false;
// FreeMemory;
C := MaxPot;
exit;
end;
end;
{*******************************************************************************
Procedure CBHover;
By: Smarter Child
Description: Hovers over cb skill according to your fight style.
*******************************************************************************}
Procedure CBHover;
begin
Case (LowerCase(FightStyle))of
'range': begin
Writeln('Range hover');
HoverSkill('range', false);
end;
'attack': begin
Writeln('attack hover');
HoverSkill('attack', false);
end;
'strength': begin
Writeln('Strength hover');
HoverSkill('strength', false);
end;
'defense': begin
Writeln('Defense hover');
HoverSkill('defense', false);
end;
'shared': begin
Writeln('shared hover');
Case Random(3) of
0: HoverSkill('attack', false);
1: HoverSkill('strength', false);
3: HoverSkill('defense', false);
end;
end;
end;
end;
{*******************************************************************************
Procedure RWait;
By: Smarter Child
Description: Waits random time.
*******************************************************************************}
Procedure RWait; //only a few options, so i don't use much in the script..
begin
Case Random(50) of
0..10: Wait(750 + Random(750));
11..20: Wait(865 + Random(100));
21..30: Wait(Random(750) + Random(750));
31..40: Wait(Random(1500) + Random(50));
41..50: Wait(500);
end;
end;
{*******************************************************************************
procedure sc_Play;
By: Smarter Child
Description: Antiban method.
*******************************************************************************}
Procedure sc_Play;
begin
Case Random(45) of
0: begin
SetAngle(true);
Wait(750 + Random(750));
MakeCompass(180);
Wait(200 + Random(150));
MakeCompass(1 + Random(20) - Random(20));
Wait(500 + random(600));
end;
1: begin
MakeCompass(-1 + Random(200) - RandomRange(200, Random(50)));
Wait(800 + 750 - Random(500));
SetAngle(false);
Wait(750 + Random(200));
SetAngle(true);
Wait(500 + RandomRange(200, 400));
RandomMovement;
end;
2: begin
MMouse(MSCX - Random(500), MSCY + Random(600), 50, 50);
Wait(2000 - RandomRange(500, 750));
MakeCompass(270 - Random(180) + RandomRange(20, 50));
end;
3: begin
setrun(true);
Wait(500 + Random(999));
setrun(false);
MakeCompass(-1 + Random(20) - RandomRange(15, 20));
Wait(200 + random(200));
MakeCompass(90 + Random(20) - RandomRange(5, 15));
Wait(100 - Random(50) + Random(1000));
MakeCompass('N');
end;
4: begin
// SleepAndMoveMouseSmooth(5000);
GameTab(1);
Wait(2000 - Random(500));
GameTab(2);
Wait(900 + RandomRange(200, 350));
GameTab(tab_Inv);
end;
5: begin
BoredHuman;
Wait(500 + Random(740));
RandomRClick;
end;
6,7: begin
MouseSpeed := RandomRange(10, 20);
MMouse(-303 + Random(100), 162 + RandomRange(200, 500) - Random(100), 25, 25);
Wait(500 + Random(750));
MMouse(Random(600), Random(600), 25, 25);
Wait(5000 - RandomRange(2000, 4000));
MMouse(MSCX - Random(200), MSCY - Random(300), 30, 30);
end;
8: begin
MMouse(MIX1 + Random(75) - random(25),MIX2 + RandomRange(10, 90) - Random(15), 15, 15);
Rwait;
end;
end;
end;
{*******************************************************************************
Procedure QAntiban;
By: Smarter Child
Description: Quick Antiban Method.
*******************************************************************************}
Procedure QAntiban;
begin
//r;
case Random(50) of
0..4: Boredhuman;
5..10: SleepAndMoveMouse(5000);
10..15: RandomRClick;
end;
end;
{*******************************************************************************
Procedure sc_RandomCompass
By: Smarter Child
Description: Randomly moves compass.
*******************************************************************************}
Procedure sc_RandomCompass;
begin
Writeln('Performing random compass movements');
case random(4) of
0:MakeCompass(0 + Random(90) - Random(90));
1:MakeCompass(90 + Random(180) - Random(180));
2:MakeCompass(RandomRange(0, 356));
end;
end;
{*******************************************************************************
function r_tab: boolean
By: Smarter Child
Description: Clicks any tab, then sets it back to the invetory.
*******************************************************************************}
Function r_Tab: boolean;
begin
result := GameTab(RandomRange(1, 16));
Rwait;
GameTab(tab_inv);
end;
{*******************************************************************************
Procedure AB;
By: Smarter Child
Description: Variety of Antiban methods.
*******************************************************************************}
Procedure AB;
begin
Case Random(75)of
0, 20: QAntiban;
5: sc_RandomCompass;
15: sc_Play;
30: UseSpecial;
7: CBHover;
end;
end;
{
Procedure WhileCave;
begin
Retaliate(true);
SetFightMode(SetStyle);
if EnterCave then
begin
Writeln('Performing in-cave functions...');
While InCave Do
begin
AB;
DoPickupArrows;
EquipArrows('InCave');
// UsePrayer;
//Proggy;
end;
end;
end; }
{*******************************************************************************
function HandleChat: boolean;
By: Smarter Child
Description: Handles the chat with tzhaar dude.
*******************************************************************************}
Function HandleChat: boolean;
var
czx, czy: integer;
begin
if FindColorTolerance(czx, czy, 4146314, MIX1, MIY1, MIX2, MIY2, 25) or FindBlackChatMessage('ell done') or FindBlackChatMessage('in the cave')then
begin
ClickToContinue;
Writeln('Handled chat');
Result := true;
end;
if(not(FindColorTolerance(czx, czy, 4146314, MIX1, MIY1, MIX2, MIY2, 15))) or (not(FindBlackChatMessage('ell done'))) or (not(FindBlackChatMessage('in cave')))then
begin
Writeln('No text!');
Result := false;
end;
end;
{*******************************************************************************
Procedure Sleeping;
By: Smarter Child
Description: Sleeps based on your runz in the fight caves.
*******************************************************************************}
Procedure Sleeping;
var
t, minute: integer;
begin
minute := 60000;
if runsEx >= Runz then
begin
runsEx := 0;
t := (minute*30 + RandomRange(minute*10, minute*30));
if LoggedIn then
begin
Writeln('Sleeping...');
Disguise('Sleeping..');
Players[CurrentPlayer].Active := true;
Logout;
Sleep(t);
Inc(sleeps);
LoginPlayer;
end;
end;
end;
Procedure LevelUp;
begin
if not loggedin then exit;
if not incave then exit;
if FindNPCChatText('ongratulations', Clickleft)then inc(levels);
end;
Procedure Proggy;
begin
Writeln('==========================================================');
Writeln(' FLAWLESS FIGHTCAVER ');
Writeln('==========================================================');
Writeln('+ Script has ran for: ' + TimeRunning);
Writeln('+ You have done: ' + IntToStr(runs) + ' runs in the fightcaves');
Writeln('+ Your FightStyle: ' + FightStyle);
Writeln('+ You have earned: ' + IntToStr(xTokkul) + ' tokkul');
Writeln('+ You have gained: ' + IntToStr(levels) + ' ' + FightStyle + ' levels');
Writeln('==========================================================');
Writeln('+ Thanks for using my script +');
Writeln('++++++++++++++++++++++++++++++++++++++++++++++++++++++++++');
Writeln('++++++++++++++++++++ By Smarter Child ++++++++++++++++++++');
Writeln('++++++++++++++++++++++++++++++++++++++++++++++++++++++++++');
end;
{
Procedure LoopIt;
begin FAIL LOOP
Case Players[CurrentPlayer].Loc of
'start': begin
Sleeping;
EquipArrows('OutOfCave');
Retaliate(True);
SetFightMode(SetStyle);
if EnterCave then
Players[CurrentPlayer].Loc := 'cave';
end;
'cave': begin
Writeln('Incave stuff..');
While InCave do
begin
DoPickupArrows;
EquipArrows('InCave');
Case Random(2) of
0: AB;
//UsePrayer;
end;
if(not(InCave))then Players[CurrentPlayer].Loc := 'handle';
end;
end;
'talk': begin
HandleChat;
Players[CurrentPlayer].Loc := 'start'
end;
end;
end;
}
Procedure Loopey;
begin
Sleeping;
EquipArrows('OutOfCave');
Retaliate(true);
if EnterCave then
begin
While InCave do
begin
LevelUp;
DoPickupArrows;
case Random(20) of
1, 5: AB;
2: UsePotion;
10: EquipArrows('InCave');
end;
if not incave then
begin
Handlechat;
Proggy;
end;
end;
end;
end;
begin
SetupSRL;
ActivateClient;
Wait(500);
Declare;
LoginPlayer;
repeat
Loopey;
until(AllPlayersInactive);
if AllPlayersInactive then Terminate('inactive');
end.My other reflection one i released:
program fish;
{.Include SRL\SRL\Misc\Smart.Scar}
{.Include SRL\SRL.Scar}
{.Include SRL\SRL\Reflection\Reflection.Scar}
{=========================================================================]
[ ___ ___ ]
[ / __) / __) ]
[ \__ \( (__ ]
[ (___/ \___) ]
[ ]
[ NAME : Karamja Fisher & Seller ]
[ WRITER : Smarter Child ]
[ CATEGORY : Fishing (FFA) ]
[ DESCRIPTION : Fishes Lobs/Swordies and sells them to store ]
[ USAGE : Reflection/Color ]
[ NOTES : Position players at karamja dock ]
[ CONTACT : Me @ [email]wowplayermaster@hotmail.com[/email] (mail) ]
[ MULTIPLAYER : Yes ]
[ SMART : Yes, it uses reflection, duh :P ]
[ Version : 2.0 ]
[ Status : Alpha stages ]
[=========================================================================]
[ Instructions ]
[=========================================================================]
[ 1. Have your display settings set to 32 bit TRUE color. ]
[ 2. Fill out DeclarePlayers. ]
[ (For further instructions on how to fill it out, visit this thread: ]
[ [url]http://www.villavu.com/forum/showthread.php?t=5410[/url]) ]
[ 3. Please make sure your players are at the dock ]
[ 4. Make sure you have a lobster pot or harpoon with you ]
[ 5. Start script! ]
[=========================================================================}
Const // ___
ScriptVersion = '2.0'; // Serves no purpose [-.-]
// [ U ]
var
x, y : integer;
Loads, Fishes, Lobsters, Tuna, Swordfish: integer;
DLoads, Switches: integer;
Const
LoadsB4Switch = 5; //Loads b4 switch, if your single player it will merely logout and relogin
procedure Smart; //Change Smart to how you like, if needed.
begin
Smart_Members := FALSE; //Are you on a member world? True = yes / False = no
Smart_Signed := true; //Do you wish to run RS signed? True = yes / False = no
Smart_Server := 77; //What world do you wish to run this script on [recommended world : low amount of players]
Smart_SuperDetail := false; //Do you wish to use Smart with Super Detail? True = yes / False = no
end;
procedure DeclarePlayers;
begin
HowManyPlayers := 1; //How many players will be used in the script
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0; //Which player will start first?
Players[0].Name :='';
Players[0].Pass :='';
Players[0].Nick :=''; //Nick 3 - 4 letters in the username
Players[0].Strings[0] := 'age'; //'age' = Cage fishing(lobsters), 'arpoon' = Harpoon fish(swordies/tuna)
Players[0].Active := True; //Will it be used in the script?
{
Players[1].Name :='';
Players[1].Pass :='';
Players[1].Nick :=''; //Nick 3 - 4 letters in the username
Players[1].Strings[0] := 'arpoon'; //'age' = Cage fishing(lobsters), 'arpoon' = Harpoon fish(swordies)
Players[1].Active := True; //Will it be used in the script?
Players[2].Name :='';
Players[2].Pass :='';
Players[2].Nick :=''; //Nick 3 - 4 letters in the username
Players[2].Strings[0] := 'age'; //'age' = Cage fishing(lobsters), 'arpoon' = Harpoon fish(swordies)
Players[2].Active := True; //Will it be used in the script?
Players[3].Name :='';
Players[3].Pass :='';
Players[3].Nick :=''; //Nick 3 - 4 letters in the username
Players[3].Strings[0] := 'arpoon'; //'age' = Cage fishing(lobsters), 'arpoon' = Harpoon fish(swordies)
Players[3].Active := True; //Will it be used in the script?
Players[4].Name :='';
Players[4].Pass :='';
Players[4].Nick :=''; //Nick 3 - 4 letters in the username
Players[4].Strings[0] := 'age'; //'age' = Cage fishing(lobsters), 'arpoon' = Harpoon fish(swordies)
Players[4].Active := True; //Will it be used in the script?
}
end;
Function SetPos(AngleOrDir: string): boolean;
begin
case AngleOrDir of
'Angle': begin
R_SetAngle(True);
Result := true;
end;
'Dir': begin
R_MakeCompass('n');
Result := true;
end;
'Both': begin
SetPos('Angle');
SetPos('Dir');
end;
end;
end;
Procedure Antiban;
begin
if not LoggedIn then Exit;
case Random(200) of
0..4:RandomRClick;
19..30:SleepAndMoveMouse(7000);
31..56:RandomRClick;
57:BoredHuman;
58..59: MakeCompass(Random(50));//HoverSkill('random',False);
60:RandomMovement;
61:Wait(1500 + Random(750));
62:begin
SetAngle(false);
Wait(Random(560 + Random(450)));
MakeCompass('W');
Wait(Random(560 + Random(450)));
SetAngle(true);
MakeCompass('N');
end;
end;
end;
Procedure RWait;
begin
Case Random(50) of
0..10: Wait(750 + Random(750));
11..20: Wait(865 + Random(100));
21..30: Wait(Random(750) + Random(750));
31..40: Wait(Random(1500) + Random(50));
41..50: Wait(500);
end;
end;
Procedure QAntiban;
begin
//r;
case Random(50) of
0..4: Boredhuman;
5..10: SleepAndMoveMouse(5000);
10..15: RandomRClick;
end;
end;
Procedure RCompass;
begin
Case Random(25)of
0: begin
Rwait;
MakeCompass('E');
RWait;
MakeCompass('N');
end;
1: begin
Rwait;
MakeCompass('S');
Rwait;
MakeCompass('N');
end;
2: begin
Rwait;
MakeCompass('W');
Rwait;
MakeCompass('N');
end;
3: begin
MakeCompass('E');
Rwait;
MakeCompass('S');
RWait;
MakeCompass('W');
Rwait;
RWait;
MakeCompass('N');
end;
end;
end;
{
Procedure RAngle;
begin
Case Random(2) of
0:
}
function DockPath: TPointArray;
begin
Result := [Point(2906, 3149), Point(2907, 3150), Point(2908, 3151),
Point(2911, 3152), Point(2913, 3154), Point(2914, 3155),
Point(2916, 3157), Point(2918, 3160), Point(2919, 3162),
Point(2920, 3165), Point(2922, 3168), Point(2922, 3170),
Point(2923, 3173), Point(2924, 3176), Point(2924, 3179)];
end;
function ShopPath: TPointArray;
begin
Result := [Point(2924, 3174), Point(2922, 3171), Point(2921, 3169),
Point(2919, 3167), Point(2917, 3166), Point(2916, 3164),
Point(2915, 3162), Point(2915, 3160), Point(2914, 3157),
Point(2914, 3155), Point(2914, 3152), Point(2911, 3151),
Point(2908, 3149), Point(2906, 3148)];
end;
{
Procedure DebugPath(Path: TPointArray);
var s: string;
begin
s := tPtArrayToStrEx(Path, ', ');
Writeln('Loading Tile - ' + S);
end;
}
Procedure CountFish;
begin
Lobsters := Lobsters + R_CountItems(378);
Players[CurrentPlayer].Integers[2] := Players[CurrentPlayer].Integers[2] + R_CountItems(378);//lobbies per player
Tuna := Tuna + R_CountItems(360); //o
Players[CurrentPlayer].Integers[3] := Players[CurrentPlayer].Integers[3] + R_CountItems(360);//tuna per player
Swordfish := Swordfish + R_CountItems(372);
Players[CurrentPlayer].Integers[4] := Players[currentplayer].integers[4] + R_CountItems(372);//swordies per player
Fishes := Lobsters + Tuna + Swordfish;
end;
{*******************************************************************************
function CutDownPath(Path: TPointArray; Index : Integer) : TPointArray;
By: Tad
Description: Cuts down a TPointArray so only tiles after the Index and on the MM
are left in the result.
*******************************************************************************}
function CutDownPath(Path: TPointArray; Index : Integer) : TPointArray;
var
i, Size, j : integer;
begin
Size := 0;
for i:=Index+1 to High(Path) do
if TileOnMM(Path[i]) then
Inc(Size)
else
break;
SetArrayLength(result, Size);
j := 0;
for i:=Index+1 to High(Path) do
if TileOnMM(Path[i]) then
begin
result[j] := Path[i];
Inc(j);
if j > High(result) then exit;
end else
break;
end;
{*******************************************************************************
function DistMore(Tiles: TPointArray; MinDist: Integer): TPointArray;
By: Tad
Description: Returns a TPointArray taken from Tiles that contains the TPoints
that are further away than MinDist.
*******************************************************************************}
function DistMore(Tiles: TPointArray; MinDist: Integer): TPointArray;
var
i, j, Size: integer;
begin
for i:=0 to High(Tiles) do
if DistanceFrom(Tiles[i]) > MinDist then
Inc(Size);
SetArrayLength(result, Size);
j := 0;
for i:=0 to High(Tiles) do
if DistanceFrom(Tiles[i]) > MinDist then
begin
result[j] := Tiles[i];
Inc(j);
end;
end;
{*******************************************************************************
function NextGoodTile(Path: TPointArray; CurIndex: Integer; var NTile: TPoint): boolean;
By: Tad
Description: Puts a random, clickable, yet efficient (more than 3 tiles away,
if possible) tile into NTile and returns whether a suitable tile was found.
*******************************************************************************}
function NextGoodTile(Path: TPointArray; CurIndex: Integer; var NTile: TPoint): boolean;
var
i : integer;
AvailTiles, PosTiles : TPointArray;
begin
result := false;
if TileOnMM(Path[High(Path)]) then
begin
result := true;
NTile := Path[High(Path)];
end;
AvailTiles := CutDownPath(Path, CurIndex);
if GetArrayLength(AvailTiles) = 0 then Exit;
result := true;
for i:=8 downto 3 do
begin
PosTiles := DistMore(AvailTiles, i);
if GetArrayLength(PosTiles) <> 0 then break;
end;
if GetArrayLength(PosTiles) <> 0 then
NTile := PosTiles[random(GetArrayLength(PosTiles))]
else
NTile := AvailTiles[random(GetArrayLength(AvailTiles))];
end;
{*******************************************************************************
function R_WalkPath(Path: TPointArray; Randomness: Integer): boolean;
By: Tad
Description: Walks a path of tiles stores in Path
*******************************************************************************}
function R_WalkPath(Path: TPointArray; Randomness: Integer): boolean;
var
i, t, l, fails: integer;
NTile, D : TPoint;
begin
NTile := NextTile(Path, 10);
i := TileToIndex(NTile, Path);
fails := 0;
l := GetSystemTime;
while (i < High(Path)) and (fails < 20) do
begin
// AntiRandoms;
if (Path[i].x = Path[i+1].x) and (Path[i].y = Path[i+1].y) then
begin
Inc(i);
Continue;
end;
t := GetSystemTime;
while not (NextGoodTile(Path, i, NTile)) and (GetSystemTime - t < 20000) do
wait(200+random(100));
if NextGoodTile(Path, i, NTile) then
if WalkToTile(NTile, Randomness, 17+random(10)) then
i := TileToIndex(NTile, Path)
else
Inc(fails)
else
Inc(fails);
end;
result := fails < 20;
if result then
begin
MarkTime(t);
if not GetFlag(D) then Exit;
repeat
if not GetFlag(D) then break;
if DistanceFrom(D) < 2 then break;
if not CharacterMoving then break;
until(TimeFromMark(t) > 30000);
end;
end;
Function Fish: boolean;
Var
FS: TNPC;
FishingSpot: TPoint;
begin
GameTab(tab_inv);
SetPos('Both');
if FindNPC(324, FS)then
begin
{ if(not(TileOnMS(FS.Tile, 0)))then
Writeln('Walking to fishing spot');
WalkToTile(FS.Tile, 1, 0);
} FishingSpot := TileToMS(FS.Tile, 0);
Wait(500 + Random(200));
MMouse(FishingSpot.x, FishingSpot.y, 3, 3);
Wait(199 + RandomRange(100, 400));
if IsUpText('ishing')then
begin
GetMousePos(FishingSpot.x, FishingSpot.y);
Mouse(FishingSpot.X, FishingSpot.Y, 3, 3, False);
Wait(100 + Random(50));
R_ChooseOption(Players[CurrentPlayer].Strings[0]);
if CharacterAnimating Then
begin
Antiban;
Disguise('Fishing...');
Result := True;
end else
Wait(5000);
if(not(TileOnMS(FS.Tile, 0))) and (not(CharacterAnimating))then
Wait(6);
Result := false;
{ Result := False;
Nextplayer(false);
Exit;}
end;
end; ///532, 533
end;
Function FindSK: boolean;
Var
sK: TNPC;
STile: TPoint;
begin
if FindNPC(532, SK) or FindNPC(533, SK)then
begin
Writeln('SK found');
STile := TileToMS(SK.Tile, 104)
Rwait;
MMouse(STile.X - 5, STile.y, 2, 2);
if R_IsupText('Shop')then
begin
Wait(100 + Random(60));
Mouse(STile.X, STile.Y, 1, 1, false);
Wait(100 + Random(100));
if r_chooseoption('rade')then
begin
Writeln('Shop = vaild');
result := true;
end;
end;
end;
end;
//Quick fix :P
Function ValidateShopScreen: boolean;
begin
MouseSpeed := 25;
repeat
FindSK;
until(FindColorTolerance(x, y, 2070783, MSX1, MSY1, MSX2, MSY2, 15));
if FindColorTolerance(x, y, 2070783, MSX1, MSY1, MSX2, MSY2, 15)then
begin
MouseSpeed := 15;
Writeln('success');
result := true;
end;
//Exit;
end;
Procedure SellFish;
Var { Lobster = 377 / Tuna = 359 / Sworfish = 371 }
ItemSlots: TIntegerArray;
Sell: string;
begin
Sell := 'ell 50'; //change
Disguise('Selling..');
if ValidateShopScreen then
begin
repeat
if InventoryContainsMulti([378, 360, 372], ItemSlots)then
begin
MouseItem(ItemSlots[0], false);
RWait;
r_ChooseOption(Sell);
end;
until((not(InventoryContainsMulti([378, 360, 372], ItemSlots))));
if(not(InventoryContainsMulti([378, 360, 372], ItemSlots)))then Exit;
CloseBank;
end;
end;
Function WhilstFishing: boolean; //Also carries out the Fish function.
var
Tries: integer;
begin
Tries := 0;
Fish;
repeat
if CharacterAnimating then
Case Random(72)of
7, 65: Antiban;
1, 4: QAntiban;
2..4: RCompass;
// 0: if Random(6) = 3 then RAngle;
end;
wait(500);
until(not(CharacterAnimating));
repeat
if(not(CharacterAnimating))then
begin
Fish;
Inc(Tries);
end;
until(InvFull or CharacterAnimating);
if InvFull then
begin
Inc(Loads);
Inc(Players[CurrentPlayer].Integers[5]);
Inc(Players[CurrentPlayer].Integers[6]);
Exit;
end;
{ if Tries >= 900000 then
begin
Writeln('Fishing Failed, next player');
Nextplayer(False);
Result := False;
Exit; }
end;
Procedure Proggy;
var
i : integer;
begin
// CountFish;
Writeln('|==============================================================|');
Writeln('|+-------------------Made By: Smarter Child----------------- +|');
Writeln('|'+ Padl('Script has ran for: ', 34) + TimeRunning + Padl('|', 20));
Writeln('|'+ Padl('Script has done: ', 31) + IntToStr(loads) + ' loads'+ Padl('|', 25));
Writeln('|'+ Padl('Script has caught: ', 33) + IntToStr(Fishes) + ' fish' + Padl('|', 24));
Writeln('|'+ Padl('Script has switched: ', 45) + IntToStr(Switches) + ' times' + Padl('|', 23));
Writeln('|--------------------------------------------------------------|');
for i:=0 to High(Players) do
Writeln('| ' + Players[i].Nick + ': Done: ' + IntToStr(Players[i].Integers[5]) + ' loads, Caught: ' + IntToStr(Players[i].Integers[3]) + ' Tuna, ' + IntToStr(Players[i].Integers[2]) + ' Lobsters, ' + IntToStr(Players[i].Integers[4]) + ' Swordies ' + Padl('|', 4));
Writeln('|--------------------------------------------------------------|');
Writeln('| Post all proggies/comments/suggestions/bugs on script thread |');
Writeln('|==============================================================|');
end;
Procedure Switch;
var minute: integer;
begin
if Players[CurrentPlayer].Integers[6] >= LoadsB4Switch then
begin
Writeln('Loads >= to complete');
Players[CurrentPlayer].Active := true;
Logout;
Minute := 60000;
Sleep(Minute*5 + RandomRange(Minute*2, Minute*10));
Inc(Switches);
Dec(Players[CurrentPlayer].Integers[6]);
NextPlayer(True);
end;
end;
Procedure Terminate;
begin
if AllPlayersInactive then
begin
Writeln('Terminating...');
Writeln('Reason: All players inactive');
if LoggedIn then Logout;
Proggy;
TerminateScript;
end;
end;
Procedure Loop;
begin
Players[CurrentPlayer].Integers[6] := 0;
SetPos('Both');
if(not(InvFull)) then WhilstFishing;
if InvFull then
begin
CountFish;
Proggy;
R_WalkPath(ShopPath, 2);
// WalkToTile(Point(2907, 3148), 1, 0);
if isidle then
begin
SellFish;
MouseSpeed := 15;
Proggy;
R_WalkPath(DockPath, 2);
Switch;
end;
end;
end;
BEGIN
Smart;
SetupSRL;
SetupReflection;
DeclarePlayers;
LoginPlayer;
repeat
Loop;
until(AllPlayersInactive);
Terminate;
END.I just posted both, but if one of them look crappy, please don't let it make your vote biased.
Thanks~
~Smarter Child
Edit: Sorry about the bad looking instruction box at top of script. IDK what happened :confused:
Edit2: Forgot to credit Tad for his wonderful reflection walking functions. So credits to Tad for that~ :D