SRL Archive - Outdated / Broken

Moo


NiCbaZ

2009-05-12 14:58:37

Moo is a script i had a long time ago.

Big credits to Narcle for lots of fighting functions.

Its really scrappy code, forgive me for that please.

[PHP] program Moo;
{.include SRLSRLMiscSmart.scar}
{.include SRl/SRl.scar}
{.include srl/srl/reflection/reflection.scar}


{===================================================================]
[ NicBaz Cow KiLLeRR & BaNkEr ]
[ ]
[ NAME : NicBaz Cow KiLLeRR ]
[ WRITER : Nicbaz. ]
[ CATEGORY : Fighting ]
[ DESCRIPTION : Kills Cows AAnd Banks The Hides ]
[ USAGE : Start In Fally East Bank ]
[ AUTOCOLOR : Yes. ]
[ SRL Used : 4.0, Revision 22. ]

[ ]
[===================================================================]
[ Instructions. ]
[===================================================================]
[ 1. Use RuneScape with Low Detail, Very Bright. ]
[ 2. Set your Screen to 32 bit TRUE color. ]
[ 3. Setup lines below. ]
[ 4. Start in Fally East Bank ]
[ 5. Start script Logged Out. ]
[ 6. POST ALL PROGGIES IN THE THREAD! ]
[ ]
[===================================================================]
[ Some more info: ]
[ 1. This script is not the fastest one out there it is made to run ]
[ for a long time so dw if its not that fast. ]
[===================================================================]
[===================================================================]
[ Future Updates. ]
[===================================================================]
[ 1. Sleeping ]
[ 2. More Random Walking ]
[ 3. Better Banking ]
[===================================================================]
[ Const ]
[===================================================================]
[===================================================================]
}const //]
SmartWorld = 109; //]
Loads = 20; // Loads NextPlayer //]
StatsUser = ''; //]
StatsPass = ''; //]
{===================================================================]
[1.0- Relesed To Public ]
[===================================================================}


{-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
procedure DeclarePlayers;
By: Nicbaz
Description: Declare The Players for the login Array.
Status: Good
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-}
var
LoadsLeft,clays,cooks,Meh: integer;
L : string;

procedure DeclarePlayers;
begin
HowManyPlayers:= 3; // number of players
CurrentPlayer:= 0; // starting player

{Green out or Delete unused slots}

NumberOfPlayers(HowManyPlayers);

Players[0].Name :='';
Players[0].Pass :='';
Players[0].Nick :='';
Players[0].Active:= True;
Players[0].Integers[2]:= 3; // fighting style

end;

procedure PlayerLoop; forward;
{-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
procedure DeclarePlayers;
By: Nicbaz
Description: Declare The Players for the login Array.
Status: Good
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-}

function AllPlayersInactive1: boolean;
var
p: integer;
begin
for p:= 0 to HowManyPlayers - 1 do
if Players[p].Active then exit;
result:= true;
end;


{-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
procedure showCurrentScreen;
By: Munk
Description: Debugs the SMART screen
Status: yeahhh
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-}
procedure showCurrentScreen;
var
w,h,bmp:integer;
begin

try
getClientDimensions(w,h);
displayDebugImgWindow(766,504);
bmp:=bitmapFromString(w,h,'');
CopyClientToBitmap(bmp,0,0,w,h);
safeCopyCanvas(GetBitmapCanvas(bmp),GetDebugCanvas,0,0,w,h,0,0,w,h);
except
writeln('couldnt copy canvas');
end;

freeBitMap(bmp);
end;

{-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
procedure DeclarePlayers;
By: Nicbaz
Description: Declare The Players for the login Array.
Status: Good
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-}
procedure SwitchPlayers(Active:boolean);
var
thenextplayer,thelastplayer:integer;
Start: boolean;
begin
Logout;
Players[CurrentPlayer].Active:= Active;
TheNextPlayer:= CurrentPlayer + 1;
TheLastPlayer:= HowManyPlayers - 1;

if (TheNextPlayer <= TheLastPlayer)then
begin
CurrentPlayer:= CurrentPlayer + 1;
end else
begin
CurrentPlayer:= 0;
end;

if not(Players[CurrentPlayer].Active)then
begin
repeat
CurrentPlayer:= random(HowManyPlayers);
until(Players[CurrentPlayer].Active)or(AllPlayersInactive1);
end;

if AllPlayersInactive1 then
begin
writeln('All Players False');
TerminateScript;
end;

start:= true;
LoadsLeft:= Loads;
LoginPlayer;
wait(random(500));
SetAngle(True);
wait(random(500));
end;
{-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Function IsBankTabOpen(WichTab:String) : Boolean
By: Nicbaz
Description: Returns True if your tab is open
Status: Good
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-}
function IssBankTabOpen(WhichTab: Integer) : Boolean;
begin
Result := (GetColor(64 + (WhichTab - 1) * 49, 56) = 2896954 );
end;
{-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
function BankTab(NumberOfTab: Integer): Boolean;
By: Nicbaz
Description: Changes to the tab you select
Status: Good
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-}
function BankkTab(NumberOfTab: Integer): Boolean;
begin

if (NumberOfTab <1) or (NumberOfTab > 9) then
begin
srl_Warn('BankTab',inttostr(NumberOfTab)+' BankTab does not exist',warn_AllVersions);
Result := False;
Exit;
end;

if (IssBankTabOpen(NumberOfTab)) then
Exit;
MouseBox(34 + (NumberOfTab - 1) * 50, 54, 34 + (NumberOfTab - 1) * 50, 75, 1);
end;

{-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
procedure BoredHuman1;
By: Wt-Fawki Modded By Nicbaz
Description: Changes to the tab you select
Status: Good
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-}
procedure BoredHuman1;
var
i, x, y: Integer;
Deg: Variant;
begin
Deg := rs_GetCompassAngleDegrees;

for i := 1 to 2+random(3) do
begin
MMouse(Random(MSX2), Random(MSY2), 0, 0);
if IsUpText('opti') then
begin
GetMousePos(x, y);
Mouse(x, y, 0, 0, False);
ChooseOption('Examine');
end;
FindNormalRandoms;
case Random(4) of
0: SendArrowSilentWait(((Random(2) * 2) + 1), 20 + Random(200));
1: SendArrowSilentWait(((Random(2) * 2)), 20 + Random(200));
2: SendArrowSilentWait(((Random(2) * 2) + 1), 200 + Random(200));
3: SendArrowSilentWait(((Random(2) * 2)), 20 + Random(200));
end;
FindNormalRandoms;
end;
if (Deg <> 0) then
MakeCompass(IntToStr(Round(Deg)))
else
MakeCompass('N');

end;
{-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
procedure Proggie;
By: Nicbaz % fr0zen
Description: Proggie
Status: Good
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-}
procedure Proggie;
var
s: string;
i, File: integer;
begin
Writeln('');
s := '-––•(·-><-·)•–––';
for i := 1 to Length(TimeRunning) + 16 do
Insert('¤', s, 9);
Writeln(s);

Writeln('-––•(·->' + PadL(PadR('NicBaZ Cow KiLLeRR', Length(s)/2 + 2), Length(s) - 16) + '<-·)•–––');
Writeln('-––•(·->' + PadL(PadR('¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯', Length(s)/2 + 3), Length(s) - 16) + '<-·)•–––');
If Clays > 0 then
Writeln(PadR('-––•(·-> Hides Colected: ' + IntToStr(Clays), Length(s) - 9) + ' <-·)•–––');
If Cooks > 0 then
Writeln(PadR('-––•(·-> Loads Done: ' + IntToStr(Cooks), Length(s) - 9) + ' <-·)•–––');
Writeln('-––•(·-> Time Running: ' + TimeRunning + ' <-·)•–––');
Writeln(s);
Disguise(PadR('-•(·-> Loads Done: ' + IntToStr(Cooks), Length(s) - 9) + ' <-·)•–––');
if FileExists(ScriptPath + 'NicBaZ DrUiD KiLLeRR Reports.txt') then
Begin
File := OpenFile(ScriptPath + 'NicBaZ DrUiD KiLLeRR Reports.txt', false);
ReadFileString(File, s, FileSize(File));
CloseFile(File);
File := LastPos(TheDate(1), s);
if File > 0 then
Begin
File := RewriteFile(ScriptPath + 'NicBaZ DrUiD KiLLeRR Reports.txt', false);
Delete(s, LastPos(TheDate(1), s) - 1, Length(s));
WriteFileString(File, s);
CloseFile(File);
end;
end;

s := '-––•(·-><-·)•–––';

for i := 1 to Length(TimeRunning) + 16 do
Insert('¤', s, 9);
WriteINI(TheDate(1) + ', ' + TheTime, s, '', ScriptPath + 'NicBaZ Cow KiLLeRR Reports.txt');
WriteINI(TheDate(1) + ', ' + TheTime, '-––•(·->' + PadL(PadR('NicBaZ Cow KiLLeRR', Length(s)/2 + 2), Length(s) - 16) + '<-·)•–––', '', ScriptPath + 'NicBaZ Cow KiLLeRR Reports.txt');
WriteINI(TheDate(1) + ', ' + TheTime, '-––•(·->' + PadL(PadR('¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯', Length(s)/2 + 3), Length(s) - 16) + '<-·)•–––', '', ScriptPath + 'NicBaZ Cow KiLLeRR Reports.txt');
If Clays > 0 then
WriteINI(TheDate(1) + ', ' + TheTime, PadR('-––•(·-> Hides Got: ' + IntToStr(Clays), Length(s) - 9) + ' <-·)•–––', '', ScriptPath + 'NicBaZ Cow KiLLeRR Reports.txt');
If Cooks > 0 then
WriteINI(TheDate(1) + ', ' + TheTime, PadR('-––•(·-> Loads Done: ' + IntToStr(Cooks), Length(s) - 9) + ' <-·)•–––', '', ScriptPath + 'NicBaZ Cow KiLLeRR Reports.txt');
WriteINI(TheDate(1) + ', ' + TheTime, '-––•(·-> Time Running:', TimeRunning + ' <-·)•–––', ScriptPath + 'NicBaZ Cow KiLLeRR Reports.txt');
Delete(s, 1, 1);
WriteINI(TheDate(1) + ', ' + TheTime, '', s, ScriptPath + 'NicBaZ Cow KiLLeRR Reports.txt');
File := OpenFile(ScriptPath + 'NicBaZ Cow KiLLeRR Reports.txt', false);
ReadFileString(File, s, FileSize(File));
CloseFile(File);
s := Replace(s, '=', ' ');
File := RewriteFile(ScriptPath + 'NicBaZ Cow KiLLeRR Reports.txt', false);
WriteFileString(File, s);
CloseFile(File);
end;


{-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
procedure NoBan;
By: Nicbaz
Description: Anti-Ban
Status: Good
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-}
procedure NoBan;
begin
Writeln('Peforming AntiBan');
if isFkeyDown(12) then showCurrentScreen;

case random(5) of
0:
begin
Exit;
RandomRClick;
Wait(2000+random(800));
end;
1:
begin
PickUpMouse;
BoredHuman1;
end;
2: BoredHuman1;
3,4: Wait(4000+random(2000));
end;

FindNormalRandoms;
end;

{-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
function WalkToPath(Path: TPointArray; DoTile: Integer): Boolean;
By: Nicbaz
Description: Walks the path.
Status: Good
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-}
function WalkToPath(Path: TPointArray; DoTile: Integer): Boolean;
var
I: integer;
begin
for I := DoTile to High(Path) do
begin
if not (WalkToTile(Path[i],0 , 0)) then
Exit;
flag;
end;
Result := True;
FindNormalRandoms;
End;

{-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
function WalkThroughPath(Path: TPointArray): Boolean;;
By: Nicbaz
Description: Walks the path.
Status: Good
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-}
function WalkThroughPath(Path: TPointArray): Boolean;
begin
if not (WalkToPath(Path, 0)) then
begin
writeln('path some how is off');
Result:= False;
Exit;
end;
Result := True;
FindNormalRandoms;
End;

{-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
function Walk(where: string): boolean;
By: Nicbaz
Description: Loads the tiles and walks.
Status: Good
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-}
function Walk(where: string): boolean;
var
Tiles: TPointArray;

begin
SetAngle(True);
case where of
'ToGate':
begin
case random(2) of
0:
begin
Tiles := [Point(3007, 3349), Point(3007, 3336), Point(3006, 3325),
Point(3012, 3318), Point(3024, 3317), Point(3031, 3314)];
end;
1:
begin
Tiles := [Point(3007, 3350), Point(3007, 3338), Point(3008, 3328),
Point(3006, 3318), Point(3015, 3314), Point(3025, 3316),
Point(3031, 3314)];
end;
end;
end;
'ToBank':
begin
case random(2) of
0:
begin
Tiles := [Point(3024, 3317), Point(3014, 3317), Point(3006, 3326),
Point(3007, 3338), Point(3006, 3349), Point(3013, 3356)];
end;
1:
begin
Tiles := [Point(3023, 3320), Point(3015, 3317), Point(3008, 3323),
Point(3007, 3336), Point(3006, 3350), Point(3011, 3355)];
end;
end;
end;
'CowsToGate':
begin
Tiles := [Point(3032, 3310)];
end;

'dead':
begin
Tiles:=[Point(3231, 3217), Point(3233, 3224), Point(3228, 3229),
Point(3224, 3238), Point(3220, 3247), Point(3216, 3257),
Point(3216, 3265), Point(3213, 3275), Point(3202, 3278),
Point(3192, 3282), Point(3178, 3285), Point(3165, 3287),
Point(3153, 3293), Point(3144, 3293), Point(3135, 3294),
Point(3124, 3296), Point(3115, 3294), Point(3105, 3293),
Point(3095, 3292), Point(3088, 3288), Point(3079, 3289),
Point(3075, 3283), Point(3069, 3276), Point(3059, 3276),
Point(3048, 3275), Point(3036, 3275), Point(3027, 3276),
Point(3017, 3275), Point(3010, 3278), Point(3006, 3288),
Point(3005, 3301), Point(3007, 3312), Point(3006, 3321),
Point(3006, 3332), Point(3006, 3342), Point(3011, 3355)];
end;
end;

if WalkThroughPath(Tiles) then
Result:= True;
FindNormalRandoms;
end;
{-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
function FindGate: boolean;
By: Nicbaz
Description: Find Obects with reflection.
Status: Good
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-}
function FindGate: boolean;
var
xx : TPoint;
Tiles : TPointArray;
begin
Tiles:= [Point(3032,3311)];

SetAngle(True);
if L = 'Z' then
if (DistanceFrom(Tiles[0]) > 1) then
begin
WalkToTile(Tiles[0], 0, 0);
FFlag(0);
Wait(400);
end;

if FindObject(xX,7052) then
Exit;

if FindObject(xX,7050) then
Writeln(' Found ');


XX:= TileToMS(XX, 0);

if L = 'Z' then
begin
Mouse(xX.X + 5, xX.Y - 14, 5, 5, false);
end else
begin
Mouse(xX.X + 5, xX.Y - 20, 5, 5, false);
end;

Wait(200 + Random(10));
Result:= ChooseOption('pen');
Flag;
FindNormalRandoms;
end;

{-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
function Banking: Boolean;
By: Nicbaz
Description: Banks
Status: Good
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-}
function Banking: Boolean;
var
z,y ,p: integer;

begin
if openbankfast('feb') then
begin
wait(500+random(200));
wait(500+random(200));
z:= InvCount;
if z > 5 then

repeat
Deposit(1,28,true);
p:= p+ 1;
y:= InvCount;
if y < 5 then
Break;
if z > 5 then
Break;

until false;
Result:= True;
CloseBank;
end;
Clays:= Clays + 28;
Cooks:= Cooks + 1;
end;
{-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
function OpenDoor : Boolean;
By: Nicbaz
Description: Opens The Door
Status: Good
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-}
function OpenGate(where : Integer): Boolean;
var
Zz: integer;
Tiles: TpointArray;
begin
Tiles:= [Point(2564,3356),Point(2564,3356)]
MarkTime(zz);

R_MakeCompass('n');
if not R_loggedin then
LoginPlayer;

case where of
2: L:= 'Z';
1: L:= '';
end;

begin
repeat
if not FindGate then
begin
Result:= False;
Writeln('GateOpen');
Exit;
end else
begin
Writeln(' Through Gate');
Result:= True;
Break;
end;
if TimeFromMark(Zz) > 300000 then
begin
Result:= False;
Exit;
Wait(500+random(200));
end;
until(false);
end;
end;

{-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Function MehBreakTorz: Boolean;
By: Nicbaz / Narlce
Description: Opens The Door
Status: Good
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-}
Function MehBreakTorz: Boolean;
var
BreakFor,T,H,Oh,S : integer;
begin
Result:= False;

if TimeFromMark(meh) > 10*60000+random(5*60000) then
begin
Writeln(Players[CurrentPlayer].Name + (' : Sleeping '));
BreakFor:= (2*60000+random(3*60000));
Result:= True;
Logout;
ConvertTime(BreakFor, H, Oh, S);
MarkTime(T);
WriteLn(Players[CurrentPlayer].Name + ': Break for: '+inttostr(oh)+ 'm:' +inttostr(S)+ 's');

Repeat
ConvertTime(BreakFor - TimeFromMark(T), H, oh, S)
Disguise(inttostr(oh)+ 'm:' +inttostr(S)+ 's Break');
wait(1000);
until (BreakFor < TimeFromMark(T))

T:= 0;
Meh:= 0;
BreakFor:= 0;
MarkTime(Meh);
begin
LoginPlayer;
end;
end;
end;
{-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Function MehBreakTorz: Boolean;
By: Nicbaz / Narlce
Description: Opens The Door
Status: Good
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-}
function MultiUTWait(UpText: array of string): Boolean;//Yes idea from munk ;)
var
T: integer;
begin
T := GetSystemTime + 500;

Repeat
wait(25+random(25));
Result := IsUpTextMultiCustom(UpText);
until Result or (GetSystemTime > T);

end;
{-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
function StrInArr(Str: string; StrArr: TStringArray): Boolean;
By: Narlce
Description: Opens The Door
Status: Good
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-}
function ArrInStr(Str: string; Arr: TStringArray): boolean;//One in SCAR isn't the same
var
i, L, H: integer;
begin
L := Low(Arr);
H := High(Arr);

for i := L to H do
if ( Pos(LowerCase(Arr[i]), LowerCase(Str)) > 0 ) then
begin
Result := true;
Exit;
end;

end;
{-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
procedure SortNPCsByNames(Names: TStringArray; var NPCs: array of TNPCEx);//Fixed by LeeLokHin
By: Narlce
Description: Opens The Door
Status: Good
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-}
procedure SortNPCsByNames(Names: TStringArray; var NPCs: array of TNPCEx);//Fixed by LeeLokHin
var
i, H: integer;
begin
If Length(NPCs) < 1 then
Exit;
if not (Low(NPCs) = 0) then
Exit;
H := High(NPCs);

for i := 0 to H do
if not ArrInStr(NPCs[i].Name, Names) then
begin
try
Swap(NPCs[i], NPCs[H]);
SetArrayLength(NPCs, H);
i := i - 1;
H := High(NPCs);
except
end;
end;

end;

{-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Function FindDead: boolean;
By: Nicbaz
Description: Finds The Npc
Status: Good
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-}
Function FindDeads: boolean;
var
Tilesz: Tpoint;

begin
Tilesz:= Point(3219, 3217);
Result:= False;
Result:= (DistanceFrom(Tilesz) < 5);
end;

{-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Function ReflectionFind: boolean;
By: Narcle
Description: Finds The Npc
Status: Good
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-}
Function ReflectionFind: boolean;
var
Dist, mAng: integer;
M, Me: TPoint;
NPCs: array of TNPCEx;
begin
if not LoggedIn then
Exit;
FindNormalRandoms;
Status('Searching...');

NPCs := SortNPCsEx(GetNPCsEx);
SortNPCsByNames(['Cow'], NPCs);

If Length(NPCs) < 1 then
begin
Status('Failed to Find NPCs...');
Exit;
end;

Me := GetMyPos;
if TileOnMSEx(NPCs[0].Tile, Round(NPCs[0].Height / 2)) then
begin
Result := true;
Exit;
end;

M := TileToPoint(NPCs[0].Tile);
Dist := Distance(Me.x, Me.y, M.x, M.y);
if (Dist < 8) then
begin
M := TileToMM(M);
mAng := Round(Degrees(ArcTan2(M.Y - MMCY, M.X - MMCX)) + 90 + rs_GetCompassAngleDegrees);
If (mAng < 0) Then
mAng := mAng + 360;
If (mAng > 360) Then
mAng := mAng - 360;
mAng := RandomRange(mAng - 20, mAng + 20);
MakeCompass(inttostr(mAng));
Result := TileOnMSEx(NPCs[0].Tile, Round(NPCs[0].Height / 2));
if Result then
Exit;
end;

if (Dist < 17) then
begin
WalkToTile(M, 1, random(5));
Result := true;
Exit;
end;
end;
{-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Procedure WieldAll;
By: Nicbaz
Description: Wileds All;
Status: Good
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-}
Procedure WieldAll;
var
I: Integer;
X: Tbox;
begin
for i:= 1 to 28 do
begin
X := InvBox(I);
MMouse(X.X1, X.Y1, 8,2);
if IsUpText('ield') then
Mouse(X.X1, X.Y1, 8,8,true);
end;
end;
{-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
function InBlackArea(Tile: TTile): boolean;
By: Narlce
Description: Black List
Status: Good
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-}
function InBlackArea(Tile: TTile): boolean;
begin
Result:= PointInBox(TileToPoint(Tile), (IntToBox(3023,3313,3038,3319)));
end;

{-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
function GetMyPos:TPoint;
By: BenLand100 / Nicbaz
Description: Calculates your x,y position or [somehugenumber] if not
logged in
{-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-}
function GetMyPosz:TTile;
var
me: Integer;
begin
me := SmartGetFieldObject(0,MyPlayer);
Result.x := SmartGetFieldInt(0,BaseX) + SmartGetFieldInt(me, CurrentX) shr 7;
Result.y := SmartGetFieldInt(0,BaseY) + SmartGetFieldInt(me, CurrentY) shr 7;
SmartFreeObject(me);
end;

{-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
function ReflectionAttack: boolean;
By: Narlce
Description: Acctacks the Npc's
Status: Good
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-}
function ReflectionAttack: boolean;
var
i, L: integer;
M: TPoint;
Click, GoClick: Boolean;
NPCs: array of TNPCEx;
K : TPointArray;

begin
if not ReflectionFind then
Exit;
NPCs := SortNPCsEx(GetNPCsEx);
SortNPCsByNames(['Cow'], NPCs);
L := High(NPCs);
k:= [Point(3032,3315),Point(3031,3307)];
for i := 0 to L do
begin
if NPCs[i].InFight then
Continue;
If InBlackArea(NPCs[i].Tile) then
ConTinue;

If InBlackArea(GetMyPosz) then
begin
WalkToTile(K[0],0,0);
OpenGate(1);
WalkToTile(K[1],6,0);
end;

if not TileOnMSEx(NPCs[i].Tile, Round(NPCs[i].Height / 2)) then
Continue;
M := TileToMSEx(NPCs[i].Tile, Round(NPCs[i].Height / 2));
MMouse(M.x, M.y, 5, 5);
if NPCs[i].IsMoving then
GoClick := true;
if MultiUTWait(['ow']) then
GoClick := true;
if GoClick then
begin
GetMousePos(M.x, M.y);
if NPCs[i].IsMoving then
Click := true
else
Click := RBool;
if Click then
begin
Mouse(M.x, M.y, 0, 0, false)
wait(75+random(25));
Result := ChooseOption('tack');
end else
begin
Mouse(M.x, M.y,2,2,true);
Result := true;
end;
if Result then
begin
Status('Attacked...');
FFlag(0);
wait(800+random(333));
Exit;
end;
end;
end;
end;
{-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Function r_FightOnScreen: boolean;//Reflection Style!
By: Narlce
Description: Finds Fight on Screen
Status: Good
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-}
Function r_FightOnScreen: boolean;//Reflection Style!
var
i, H: integer;
NPCs: array of TNPCEx;
begin
NPCs := GetNPCsEx;
H := High(NPCs);
for i := 0 to H do
if TileOnMSEx(NPCs[i].Tile, Round(NPCs[i].Height/2)) then
if (NPCs[i].HPRatio > 0) then
begin
Result := true;
Exit;
end;
end;
{-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Function r_InFight: Boolean;//Go Jukka Go!
By:Jukka
Description: FindFight
Status: Good
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-}
Function r_InFight: Boolean;//Go Jukka Go!
Var
T: Integer;
Me: TMe;
Begin
If(Not LoggedIn)Then Exit;
T := GetSystemTime;
Repeat
Wait(10);
Me := GetMe;
Result := Me.Animation > 0;
if isFkeyDown(12) then showCurrentScreen;
Until (Result) or (Not r_FightOnScreen) or (GetSystemTime - T > 2667);
End;
{-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Function WaitFight: Boolean;//Go Jukka Go!
By: Jukka
Description: Waits for fight to go
Status: Good
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-}
Function WaitFight: Boolean;//Go Jukka Go!
Begin
If(Not LoggedIn)Then Exit;
Status('Fighting...');
Repeat
Wait(10);
Result := Not r_InFight;
Until (Result) or (Not LoggedIn);
FindNormalRandoms;
End;

{-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
function PikcHides;
By: Nicbaz
Description: Gets hides
Status: Good
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-}
function PickHides: Boolean;
var
Items: Array of TGroundItem;
M: TPoint;
i: integer;
begin
if not FindGroundItems(Items, [1739], 12) then
begin
Exit;
end else
begin
for i := 0 to High(Items) do
begin
if not TileOnMS(Items[i].Tile, 2) then
Break;
if TileOnMS(Items[i].Tile, 2) then
begin
M := TileToMS(Items[i].Tile, 2);
Mouse(M.x, M.y, 3, 3, false);
wait(25+random(25));
if ChooseOption('ide') then
begin
FFlag(0);
wait(300+random(150));
end;
end;
end;
end;
end;

{-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
function FindDruid: boolean;
By: Nicbaz
Description: Finds the druid
Status: Good
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-}
function FightCow: boolean;
var
x: integer;

begin
Setangle(True);
repeat

if InvFull then
Exit;

if ReflectionAttack then
begin
WaitFight;
end else
Wait(100);

Wait(500+random(400));

PickHides;

case random(10) of
5: Noban;
end;

if MehBreakTorz then
Writeln('Had a Break');

If FindDeads Then
begin
WieldAll;
Walk('dead');
Banking;
if walk('ToGate') then
if not OpenGate(1) then
Writeln(' Gate Open ');
end;

until InvFull or Not LoggedIn;
end;
{-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
function RandomWorld: String;
By: Nicbaz / sego
Description: Fights Druids
Status: Good
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-}
function RandomWorld: String;
var
Worlds: TIntegerArray;
begin
Worlds := [31,104,111,117,145,110];
result := 'world'+IntToStr(Worlds[Random(high(Worlds))]);
end;

{-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
procedure PlayerLoop;
By: Nicbaz
Description: Loops the player
Status: Good
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-}
procedure PlayerLoop;
begin
if not LoggedIn then
Exit;
repeat
if not ReflectionAttack then
begin
SetRun(True);
Wait(2000+random(600));
if walk('ToGate') then
if not OpenGate(1) then
Writeln(' Gate Open ');
end;

FightCow;

SetRun(True);

if OpenGate(2) then
Writeln(' Gate Open ');
if not walk('ToBank') then
begin
Logout;
NextPlayer(False);
Exit;
end else
begin
if Banking then
wait(1000+random(300));
end;
proggie;
LoadsLeft:= LoadsLeft - 1;
SendSrlReport;
until(LoadsLeft = 0)or(not LoggedIn);
SwitchPlayers(true);
end;

Procedure GrabCurrentPos;
var
Pozs : TPoint;

begin
Pozs:= GetMyPos;
Writeln(IntToStr(Pozs.X)+' Hi '+ IntToStr(pozs.Y));
end;

begin
SMARTSetupEx(110, False, True, False);
Wait(5000);
SetTargetDC(SmartGetDC);
repeat
wait(100);
until(SmartGetColor(253, 233)<>1118604);
SetupSRL;
LoadsLeft:= Loads;
ScriptID := '889';
DeclarePlayers;
proggie;
SRLID := StatsUser;
SRLPassword :=StatsPass;
LoginPlayer;
GrabCurrentPos;
MarkTime(Meh);
repeat
PlayerLoop;
until false;
end.
[/PHP]

marpis

2009-05-12 15:41:28

It has FTWait :o

NiCbaZ

2009-05-12 16:21:50

Mmm?

Nava2

2009-05-12 16:31:40

I'm thinking you need to update this :p

NiCbaZ

2009-05-13 01:41:57

I had tested it on my laptop , but i had like a 2 month old reflection rev :p

Soz guys il update 2nite.