From: THE MAYOR
@unhappy egg
If you maximise scar, the progress report will be in the bottom left corner.
Yeah, I know that but its not there only one time it was there. I've looked all over I know where it usually is but it's not there which I find odd. Heres what my script looks like (I edited it a little)
[==============================================================================}
{.include srl/srl.scar}
{=========================Records & Vars DONT TOUCH!===========================}
type
InvRec = record
Exists: boolean;
UpText: string;
StackSize: integer;
end;
Spec = record
CanUse: Boolean;
Time, Percent: Integer;
WeapPercent, TimesUsed: integer;
end;
FUsers = record
Special: Spec;
Setup: Boolean;
Melee, Range, Magic: Boolean;
Food, FoodAte: integer;
SkillIs: string;
RunDir: string;
AmmoEquip: string;
Combat: array of array of string;
Training: string;
MobHP: integer;
Colors: array of Integer;
Names: array of string;
XP, Pickups, Kills, Ammo: integer;
Buried, AmmoPH, PlayTime: integer;
XPpH: integer;
PickupNames: TStringArray;
PickupColors: TIntegerArray;
ProtectedItems: array of string;
InvOptions: array of boolean;
Inv: array [1..28] of InvRec;
end;
var
NAF: array [0..99] of FUsers;
TStats: FUsers;
{------------------------------------------------------------------------------}
{===============================Player Setup===================================}
{------------------------------------------------------------------------------}
const
//SRL Stats
MySRLID = '';
MySRLPassword = '';
//Anti-Ban Settings
LogoutEvery = 90000;
TakeBreaks = false;
TakeSleeps = false;
//Fight Settings
ClickToMobMM = false;
RightClickOnly = false;
SpecAttack = false;
procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(1);
CurrentPlayer := 0;
Players[0].Name := '*******;
Players[0].Pass := 'r*********';
Players[0].Nick := '********';
Players[0].Active := True;
NAF[0].Training := 'strength';//What skill to lvl/train?
NAF[0].RunDir := 's';//Run away direction on low health
NAF[0].Colors := [11845310,5263446,11385016];//Monster Colors
NAF[0].Names := ['inotaur'];//Monster Name(s)
NAF[0].PickupColors := [];//Pickup colors
NAF[0].PickupNames := [''];//Pickup Option Names
NAF[0].AmmoEquip := '';//Ammo to equip
NAF[0].ProtectedItems := [''];//Items to not drop?
NAF[0].InvOptions := [false, false];// [Bury bones?, Drop non-protected items?]
end;
{------------------------------------------------------------------------------}
{========================Don't touch Below this!===============================}
{------------------------------------------------------------------------------}
var
ArrowStartAmount, StartXP: integer;
LogoutTime, AttackTime, RoundTime, BreakTime, EquipTime: integer;
NRandomsTime: integer;
const
DebugName = 'Nautilus';
Version = '0.2.0';
procedure LogoutSeq(reason: string); forward;
procedure ScriptNews;
var
i, len: Integer;
news: string;
begin
Status('Getting NEWS...');
try
news := GetPage('http://narcle.100webspace.net/' + DebugName + '/NEWS.txt');
if news = '' then
begin
Writeln('#@ Failed to get News');
Exit;
end;
Writeln('#@ NEWS ' + Between('{da}', '{te}', news) + ' | Online version: ' + Between('{ver}', '{sion}', news));
len := strtoint(Between('{len}', '{gth}', news));
for i := 0 to len do
Writeln('## ' + Between('{' + inttostr(i) + '}', '{' + inttostr(i + 1) + '}', news));
except
Writeln('#@ Failed to get News');
Exit;
end;
end;
procedure NarcSig;
var
I, II: integer;
s: string;
begin
ChangeReportWidth(255);
for I := 0 to 57 do
begin
clearreport;
for II := 0 to 5 do
Addtoreport(s + '||');
wait(20);
if I < 29 then
s := s + ' '
else
delete(s, Length(s), 1);
end;
for I := 1 to 29 do
begin
ClearReport;
AddtoReport(Left(' _ _ _ ', I));
AddtoReport(Left('| \ | | made by | | ', I));
AddtoReport(Left('| \| | __ _ _ __ ___| | ___ ', I));
AddtoReport(Left('| . ` |/ _` | ''__/ __| |/ _ \', I));
AddtoReport(Left('| |\ | (_| | | | (__| | __/', I));
AddtoReport(Left('|_| \_|\__,_|_| \___|_|\___|', I));
wait(40);
end;
AddtoReport(DebugName + ' v' + Version);
end;
procedure NarclesINI;
begin
SRLid := MySRLId;
SRLpassword := MySRLPassword;
if not (MySRLID = '') and not (MySRLPassword = '') then
begin
if (ReadINI('NarclesINI', 'SRLid', AppPath + 'Chars.ini') = '') then
begin
writeln('#@ Your SRL id & password for SRL-stats has been stored in Chars.ini');
writeln('## To update this just put in new MySRLid & MySRLpassword and push play');
writeln('## After this is done you won''t have to put it in again for newer versions');
end;
WriteINI('NarclesINI', 'SRLid', MySRLID, AppPath + 'Chars.ini');
WriteINI('NarclesINI', 'SRLpassword', MySRLPassword, AppPath + 'Chars.ini');
end;
if not (ReadINI('NarclesINI', 'SRLid', AppPath + 'Chars.ini') = '') then
begin
SRLid := ReadINI('NarclesINI', 'SRLid', AppPath + 'Chars.ini');
SRLPassword := ReadINI('NarclesINI', 'SRLpassword', AppPath + 'Chars.ini');
writeln('#@ SRL id & password loaded from ini file.');
end;
end;
function ArrInStr(Str: string; Arr: TStringArray): boolean;
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;
function MLeftClick(x, y: integer): Boolean;
begin
HoldMouse(x, y, True);
Wait(80 + Random(60));
GetMousePos(x, y);
ReleaseMouse(x, y, True);
try
Result := FindColor(x, y, 255, x - 10, y - 10, x + 10, y + 10);
except
end;
end;
function GetFights(var ATPA: T2DPointArray): Boolean;
var
G, R, TPA: Tpointarray;
begin
FindColorsTolerance(G, 65280, MSX1, MSY1, MSX2, MSY2, 0);
FindColorsTolerance(R, 255, MSX1, MSY1, MSX2, MSY2, 0);
TPA := CombineTPA(G, R);
if Length(TPA) > 0 then
begin
ATPA := SplitTPAEx(TPA, 31, 6);
SortATPAFrom(ATPA, Point(MSCX, MSCY - 15));
Result := True;
end;
end;
function IsFightAt(x, y: Integer): Boolean;
var
P: TPoint;
i, H: Integer;
ATPA: T2DPointArray;
begin
if not GetFights(ATPA) then
Exit;
H := High(ATPA);
for i := 0 to H do
begin
P := MiddleTPA(ATPA[i]);
if PointInbox(Point(x, y), IntToBox(P.x - 20, P.y - 5, P.x + 20, P.y + 40)) then
begin
Result := true;
Exit;
end;
end;
end;
function InFight: Boolean;
var
G, R, TPA: Tpointarray;
begin
FindColorsTolerance(G, 65280, 233, 134, 282, 172, 0);
FindColorsTolerance(R, 255, 233, 134, 282, 172, 0);
TPA := CombineTPA(G, R);
Result := High(TPA) > 10;
end;
function FightOnScreen: Boolean;
var
i, H: integer;
P: TPoint;
ATPA: T2DPointArray;
begin
if not GetFights(ATPA) then
Exit;
H := High(ATPA);
for i := 0 to H do
begin
P := MiddleTPA(ATPA[i]);
if not PointInBox(P, IntToBox(233, 134, 282, 172)) then
begin
Result := High(ATPA[i]) > 20;
if Result then
Exit;
end;
end;
end;
function GetArrowCount: integer;
begin
GameTab(5);
Result := GetAmount(666, 249);
end;
function RangeInFight: boolean;
var
T, A: integer;
begin
A := GetArrowCount;
T := GetSystemTime + 2667;
repeat
wait(100);
Result := GetArrowCount < A;
if InFight then
Result := true;
until Result or (GetSystemTime > T);
end;
procedure Antiban;
var
C: integer;
begin
if not LoggedIn then
Exit;
C := Random(90);
if C < 5 then
Status('AntiBan...');
case C of
0: wait(1000 + random(10000));
1:
begin
RandomMovement;
SetAngle(true);
SetAngle(true);
end;
2: HoverSkill(NAF[currentplayer].SkillIs, false);
3: PickUpMouse;
4: BoredHuman;
end;
if C < 5 then
Status('');
end;
function NWait(Time: Integer): Boolean;
var
i, T: Integer;
begin
if not LoggedIn then
Exit;
if Time = 0 then
T := 1
else
T := Time;
for i := 1 to T do
begin
if (GetSystemTime > NRandomsTime) then
begin
Result := FindNormalRandoms;
NRandomsTime := Getsystemtime + 90000 + random(30000);
end;
if FindTalk or FindNonInventoryRandoms then
begin
FindInventoryRandoms;
Result := true;
end;
if Result then
Break;
if Time = 0 then
Exit
else
Wait(200 + Random(50));
end;
end;
procedure InvCheck;
var
i: integer;
begin
for i := 1 to 28 do
begin
if NAF[CurrentPlayer].Inv[i].Exists then
if not ExistsItem(i) then
NAF[CurrentPlayer].Inv[i].Exists := false;
if ExistsItem(i) then
NAF[CurrentPlayer].Inv[i].StackSize := Amount('inv', i);
if NAF[CurrentPlayer].Inv[i].Exists then
Continue;
if ExistsItem(i) then
begin
NAF[CurrentPlayer].Inv[i].Exists := true;
MMouseItem(i) wait(150 + random(50));
NAF[CurrentPlayer].Inv[i].UpText := rs_GetUpText;
end;
end;
end;
function InvCountText(S: string): integer;
var
i: integer;
begin
for i := 1 to 28 do
begin
if Pos(S, NAF[CurrentPlayer].Inv[i].UpText) > 0 then
Result := Result + 1;
end;
end;
function InvEat: boolean;
var
i, x, y: integer;
begin
for i := 1 to 28 do
if (Pos('Eat', NAF[CurrentPlayer].Inv[i].UpText) > 0) then
begin
MMouseItem(i);
Wait(150 + random(50));
if IsUpText('Eat') then
begin
GetMousePos(x, y);
Mouse(x, y, 0, 0, false);
wait(25 + random(25));
if ChooseOption('Eat') then
begin
NAF[CurrentPlayer].Inv[i].Exists := false;
Result := true;
InvCheck;
Exit;
end;
end;
end;
end;
function InvEquipAmmo: boolean;
var
i, x, y: integer;
begin
for i := 1 to 28 do
if (Pos(LowerCase(NAF[CurrentPlayer].AmmoEquip), LowerCase(NAF[CurrentPlayer].Inv[i].UpText)) > 0) then
begin
MMouseItem(i);
Wait(150 + random(50));
if (Pos(LowerCase(NAF[CurrentPlayer].AmmoEquip), LowerCase(rs_GetUpText)) > 0) then
begin
GetMousePos(x, y);
Mouse(x, y, 0, 0, false);
wait(25 + random(25));
if ChooseOption('ield') then
begin
NAF[CurrentPlayer].Inv[i].Exists := false;
Result := true;
InvCheck;
Exit;
end;
end;
end;
end;
function InvBury: integer;
var
i, x, y: integer;
begin
for i := 1 to 28 do
if (Pos('bone', LowerCase(NAF[CurrentPlayer].Inv[i].UpText)) > 0) then
begin
MMouseItem(i);
Wait(150 + random(50));
if (Pos('bone', LowerCase(rs_GetUpText)) > 0) then
begin
GetMousePos(x, y);
Mouse(x, y, 0, 0, false);
wait(25 + random(25));
if ChooseOption('ury') then
begin
NAF[CurrentPlayer].Inv[i].Exists := false;
Result := Result + 1;
Inc(ReportVars[5]);
NWait(1);
FindNormalRandoms;
NWait(1);
end;
end;
end;
InvCheck;
end;
function InvDrop: integer;
var
i, x, y: integer;
begin
for i := 1 to 28 do
if not ArrInStr(NAF[CurrentPlayer].Inv[i].UpText, NAF[CurrentPlayer].ProtectedItems) then
begin
MMouseItem(i);
Wait(150 + random(50));
if not ArrInStr(rs_GetUpText, NAF[CurrentPlayer].ProtectedItems) then
begin
GetMousePos(x, y);
Mouse(x, y, 0, 0, false);
wait(25 + random(25));
if ChooseOption('rop') then
begin
NAF[CurrentPlayer].Inv[i].Exists := false;
Result := Result + 1;
wait(400 + random(200));
end;
end;
end;
InvCheck;
end;
procedure EquipAmmo;
begin
if not (NAF[CurrentPlayer].AmmoEquip = '') then
if (GetSystemTime > EquipTime) then
begin
InvEquipAmmo;
EquipTime := GetSystemTime + RandomRange(60000, 120000);
end;
end;
function AutoCastPoint(i: integer): TPoint;
var
ModX, ModY: integer;
begin
if (i < 1) or (i > 16) then
begin
srl_Warn('AutoCastPoint', 'Incorrect index: ' + IntToStr(i), warn_AllVersions);
Exit;
end;
ModX := i mod 4;
if ModX = 0 then
ModX := 4;
ModY := (i - 1) / 4 + 1;
Result.x := 542 + ModX * 40;
Result.y := 176 + ModY * 62;
end;
function SetUpAutoCast(AutoSpell: string; Defensive: Boolean): Boolean;
var
P, M: TPoint;
SpellNum, Color: integer;
begin
GameTab(1);
case Defensive of
True: Mouse(660, 260, 56, 32, True);
False: Mouse(660, 320, 56, 32, True);
end;
Wait(1000 + Random(500));
case LowerCase(AutoSpell) of
'wind strike', '1': SpellNum := 1;
'water strike', '2': SpellNum := 2;
'earth strike', '3': SpellNum := 3;
'fire strike', '4': SpellNum := 4;
'wind bolt', '5': SpellNum := 5;
'water bolt', '6': SpellNum := 6;
'earth bolt', '7': SpellNum := 7;
'fire bolt', '8': SpellNum := 8;
'wind blast', '9': SpellNum := 9;
'water blast', '10': SpellNum := 10;
'earth blast', '11': SpellNum := 11;
'fire blast', '12': SpellNum := 12;
'wind wave', '13': SpellNum := 13;
'water wave', '14': SpellNum := 14;
'earth wave', '15': SpellNum := 15;
'fire wave', '16': SpellNum := 16;
else
begin
srl_Warn('SetUpAutoCast', 'Incorrect Spell: ' + AutoSpell, warn_AllVersions);
Exit;
end;
end;
P := AutoCastPoint(SpellNum);
case ((P.x - 542) / 40) of
1: Color := 12632764;
2: Color := 16349818;
3: Color := 307460;
4: Color := 225773;
end;
if FindColor(M.x, M.y, Color, P.x - 12, P.y - 12, P.x + 12, P.y + 12) then
begin
Mouse(P.x - 6, P.y - 6, 12, 12, True);
Wait(500 + Random(500));
Result := True;
end
else
Mouse(692, 450, 22, 10, true);
end;
procedure WeaponLookup(var WeaponArr: array of array of string);
var
x, y, i, ii, T: integer;
Xarr, Yarr: array of integer;
TB: TBox;
TP: TPointArray;
begin
Xarr := [595, 680, 595, 680];
Yarr := [270, 270, 325, 325];
GameTab(1);
SetArrayLength(WeaponArr, 4);
for i := 0 to 3 do
begin
SetArrayLength(WeaponArr[i], 4);
MMouse(Xarr[i], Yarr[i], 12, 12);
T := GetSystemTime + 3000;
repeat
Wait(200);
if GetSystemTime > T then
Exit;
until FindColor(x, y, 10551295, 540, 205, 750, 465);
wait(200);
GetClientDimensions(TB.X2, TB.Y2);
TB := IntToBox(0, 0, TB.X2, TB.Y2);
FindColorsTolerance(TP, 10551295, TB.X1, TB.Y1, TB.X2, TB.Y2, 0);
if Length(TP) = 0 then
Exit;
TB := GetTPABounds(TP);
TB.Y1 := TB.Y1 + 1;
for ii := 0 to 3 do
begin
WeaponArr[i][ii] := LowerCase(GetTextAtEx(TB.X1 + 1, TB.Y1, 0, SmallChars, False, True, 0, 1, - 1, 30, False, tr_AlphaNumericChars));
TB.Y1 := TB.Y1 + 13;
end;
if (GetLetters(WeaponArr[0][0]) = '') then
begin
Writeln('Weapon-Lookup failed, SCAR might of lost window focus. [Restart SCAR for SMART]');
Exit;
end;
end;
end;
function SetCombat(Kind: string): boolean;
var
i, ii: integer;
begin
for i := 0 to 3 do
for ii := 0 to 3 do
if (Pos(Lowercase(Kind), Lowercase(NAF[CurrentPlayer].Combat[i][ii])) > 0) then
begin
Result := SetFightMode(i + 1);
NAF[CurrentPlayer].SkillIs := kind;
Exit;
end;
end;
function SpecialPercent: integer;
var
z: Integer;
TPA: TPointArray;
begin
GameTab(1);
z := GetColorToleranceSpeed;
ColorToleranceSpeed(1);
FindColorsTolerance(TPA, 2985515, 572, 427, 712, 428, 80);
ColorToleranceSpeed(z);
result := Round(GetArrayLength(TPA) / 283.0 * 100.0);
end;
function SpecialAttack: boolean;
var
SP: integer;
UseSpecial: boolean;
begin
if not SpecAttack then
Exit;
if not NAF[CurrentPlayer].Special.CanUse then
Exit;
if NAF[CurrentPlayer].Special.Time < 1 then
begin
SP := SpecialPercent;
NAF[CurrentPlayer].Special.Time := GetSystemTime + (Round(100.0 - SP / 10.0) * 31000);
end;
if GetSystemTime >= NAF[CurrentPlayer].Special.Time then
begin
SP := SpecialPercent;
if NAF[CurrentPlayer].Special.TimesUsed = 1 then
NAF[CurrentPlayer].Special.WeapPercent := NAF[CurrentPlayer].Special.Percent - SP;
NAF[CurrentPlayer].Special.Percent := SP;
if NAF[CurrentPlayer].Special.TimesUsed < 1 then
UseSpecial := true;
if (NAF[CurrentPlayer].Special.Percent >= NAF[CurrentPlayer].Special.WeapPercent) and (NAF[CurrentPlayer].Special.TimesUsed > 0) then
UseSpecial := true;
end;
if UseSpecial then
begin
GameTab(1);
if SpecialPercent > 18 then
begin
Mouse(634, 421, 16, 4, true);
Result := True;
NAF[CurrentPlayer].Special.TimesUsed := NAF[CurrentPlayer].Special.TimesUsed + 1;
end;
end;
end;
procedure SetupPlayer;
var
Mode, i: integer;
begin
if not LoggedIn then
Exit;
FindNormalRandoms;
Status('Setting up player: ' + Players[CurrentPlayer].Name + '...');
MouseSpeed := RandomRange(11, 16);
SetAngle(true);
SetAngle(true);
GetAllLevels;
if not NAF[CurrentPlayer].Setup then
begin
InvCheck;
NAF[currentplayer].Food := InvCountText('Eat');
NAF[currentplayer].Setup := true;
writeln('Food = ' + inttostr(NAF[CurrentPlayer].Food));
NAF[CurrentPlayer].Special.CanUse := SpecialPercent > 7;
WeaponLookup(NAF[CurrentPlayer].Combat);
for i := 0 to 3 do
begin
if ArrInStr('ranged', NAF[CurrentPlayer].Combat[i]) then
NAF[CurrentPlayer].Range := true;
if ArrInStr('magic', NAF[CurrentPlayer].Combat[i]) then
NAF[CurrentPlayer].Magic := true;
end;
if not (NAF[CurrentPlayer].Magic or NAF[CurrentPlayer].Range) then
NAF[CurrentPlayer].Melee := true;
end;
if NAF[CurrentPlayer].Melee then
begin
case NAF[CurrentPlayer].Training of
'attack': Mode := 1;
'strength': Mode := 2;
'defence', 'defense': Mode := 3;
'shared', 'controlled': Mode := 4;
'even':
begin
if (Players[CurrentPlayer].level[3] <= Players[CurrentPlayer].level[1]) and (Players[CurrentPlayer].level[3] <= Players[CurrentPlayer].level[2]) then
Mode := 3;
if (Players[CurrentPlayer].level[1] <= Players[CurrentPlayer].level[3]) and (Players[CurrentPlayer].level[1] <= Players[CurrentPlayer].level[2]) then
Mode := 1;
if (Players[CurrentPlayer].level[2] <= Players[CurrentPlayer].level[1]) and (Players[CurrentPlayer].level[2] <= Players[CurrentPlayer].level[3]) then
Mode := 2;
end;
'pure':
begin
if Players[CurrentPlayer].level[2] < 15 then
Mode := 2
else if Players[CurrentPlayer].level[1] < 30 then
Mode := 1
else if Players[CurrentPlayer].level[2] < 25 then
Mode := 2
else if Players[CurrentPlayer].level[1] < 40 then
Mode := 1
else
Mode := 2;
end;
end;
case Mode of
1:
if not SetCombat('attack') then
if not SetCombat('strength') then
SetCombat('defence');
2:
if not SetCombat('strength') then
if not SetCombat('attack') then
SetCombat('defence');
3:
if not SetCombat('defence') then
if not SetCombat('strength') then
SetCombat('attack');
4:
if not SetCombat('shared') then
if not SetCombat('strength') then
if not SetCombat('attack') then
SetCombat('defence');
end;
end;
if NAF[CurrentPlayer].Range then
begin
case NAF[CurrentPlayer].Training of
'accurate': SetFightMode(1);
'rapid': Setfightmode(2);
'longrange': Setfightmode(3);
'even': Setfightmode(2);
end;
NAF[CurrentPlayer].SkillIs := 'range';
ArrowStartAmount := GetArrowCount;
EquipTime := GetSystemTime + RandomRange(60000, 120000);
if (ArrowStartAmount <= 100) then
begin
LogoutSeq('Low ammo count! (below 100)');
exit;
end;
end;
if NAF[CurrentPlayer].Magic then
begin
if not SetUpAutoCast(NAF[CurrentPlayer].Training, false) then
LogoutSeq('Out of runes or Magic lvl to low');
NAF[CurrentPlayer].SkillIs := 'magic';
end;
Retaliate(True);
SetRun(True);
StartXP := GetXP(NAF[CurrentPlayer].SkillIs);
MarkTime(RoundTime);
MarkTime(AttackTime);
LogoutTime := GetSystemTime + RandomRange((LogoutEvery - 2) * 60000, (LogoutEvery + 2) * 60000);
end;
function ScriptRunTime: string;
var
H, M, S: integer;
begin
ConvertTime(gettimerunning, H, M, S);
result := inttostr(H) + 'h:' + inttostr(M) + 'm:' + inttostr(S) + 's';
end;
procedure Report;
var
CurXP, I, H, M, S: integer;
begin
CurXP := GetXP(NAF[CurrentPlayer].SkillIs);
if (CurXP > StartXP) then
ReportVars[0] := CurXP - StartXP;
ReportVars[1] := Round(ReportVars[1] * 0.70);
NAF[CurrentPlayer].XP := NAF[CurrentPlayer].XP + ReportVars[0];
NAF[CurrentPlayer].Kills := NAF[CurrentPlayer].Kills + ReportVars[1];
NAF[CurrentPlayer].Pickups := NAF[CurrentPlayer].Pickups + ReportVars[2];
NAF[CurrentPlayer].Buried := NAF[CurrentPlayer].Buried + ReportVars[5];
NAF[CurrentPlayer].PlayTime := NAF[CurrentPlayer].PlayTime + TimeFromMark(RoundTime);
ConvertTime(NAF[CurrentPlayer].PlayTime, H, M, S);
NAF[CurrentPlayer].XPpH := Round(NAF[CurrentPlayer].XP / (H + M / 60.0));
if NAF[CurrentPlayer].Range then
begin
ReportVars[4] := ArrowStartAmount - GetArrowCount;
NAF[CurrentPlayer].Ammo := NAF[CurrentPlayer].Ammo + ReportVars[4];
NAF[CurrentPlayer].AmmoPH := Round(NAF[CurrentPlayer].Ammo / (H + M / 60.0));
TStats.Ammo := TStats.Ammo + ReportVars[4];
end;
TStats.XP := TStats.XP + ReportVars[0];
TStats.Kills := TStats.Kills + ReportVars[1];
TStats.Pickups := TStats.Pickups + ReportVars[2];
TStats.FoodAte := TStats.FoodAte + ReportVars[3];
Disguise(ScriptRunTime);
if (HowManyPlayers = 1) then
begin
writeln('*********************************************');
writeln(Padr('| Nautilus by Narcle | ' + ScriptRunTime, 44) + '|');
writeln('*********************************************');
writeln(Padr('| Kills: ' + Inttostr(NAF[CurrentPlayer].Kills), 22) + Padr('| XP/Hour: ' + Inttostr(NAF[CurrentPlayer].XPpH), 22) + '|');
writeln(Padr('| XP Gained: ' + Inttostr(NAF[CurrentPlayer].XP), 22) + Padr('| Food Ate: ' + Inttostr(NAF[CurrentPlayer].FoodAte), 22) + '|');
writeln(Padr('| Pick Ups: ' + Inttostr(NAF[CurrentPlayer].PickUps), 22) + Padr('| TtL: ', 22) + '|');
if NAF[CurrentPlayer].Range then
writeln(Padr('| Ammo Used: ' + Inttostr(NAF[CurrentPlayer].Ammo), 22) + Padr('| Ammo/Hour: ' + Inttostr(NAF[CurrentPlayer].AmmoPH), 22) + '|');
writeln('*********************************************');
writeln('');
end;
if (HowManyPlayers > 1) then
begin
Writeln('*******************************************************************************');
Writeln(Padr('| - Multi - Player - Nautilus by Narcle_| Run Time: ' + ScriptRunTime, 77) + ' |');
Writeln('*******************************************************************************');
Writeln('| # | Nick | Active | Kills | XP Gained | XP/Hour | Pick-ups | Ammo | Food | ');
Writeln('| -- | ALL | Totals | ' + Padr(IntToStr(TStats.Kills), 6) + ' | ' + Padr(IntToStr(TStats.XP), 9) + + ' | ------- | ' + Padr(inttostr(TStats.Pickups), 8) + ' | ' + Padr(IntToStr(TStats.Ammo), 5) + + ' | ' + Padr(IntToStr(TStats.FoodAte), 4) + ' |');
for I := 0 to HowManyPlayers - 1 do
begin
Writeln('| ' + Padl(IntToStr(i), 2) + ' | ' + Padr(Players[i].Nick, 4) + ' | ' + Padr(BoolToStr(Players[i].Active), 6) + ' | ' + + Padr(IntToStr(NAF[i].Kills), 6) + ' | ' + Padr(IntToStr(NAF[i].XP), 9) + ' | ' + + Padr(IntToStr(NAF[i].XPpH), 7) + ' | ' + Padr(IntToStr(NAF[i].PickUps), 8) + ' | ' + + Padr(IntToStr(NAF[i].Ammo), 5) + ' | ' + Padr(IntToStr(NAF[i].FoodAte), 4) + ' |');
end;
Writeln('*******************************************************************************');
end;
SendSRLReport;
end;
procedure LogoutSeq(reason: string);
var
BreakFor, T, H, M, S: integer;
begin
Report;
if (reason = '') then
begin
if (HowManyPlayers = 1) then
begin
Logout;
BreakFor := RandomRange(5000, 90000);
writeln(inttostr(BreakFor / 1000) + ' second break.');
MarkTime(T);
repeat
ConvertTime(BreakFor - TimeFromMark(T), H, M, S) Disguise(inttostr(M) + 'm:' + inttostr(S) + 's Break');
wait(1000);
until (BreakFor < TimeFromMark(T)) LogoutTime := GetSystemTime + RandomRange((LogoutEvery - 2) * 60000, (LogoutEvery + 2) * 60000);
Disguise(ScriptRunTime);
end;
nextplayer(true);
end
else
begin
writeln(reason + ', ' + Players[CurrentPlayer].Name + ' is now inactive.');
nextplayer(false);
end;
SetupPlayer;
end;
function TakeABreak: boolean;
var
H, M, S, BreakFor, T: integer;
begin
if (GetSystemTime >= BreakTime) then
begin
result := true;
BreakFor := RandomRange(15 * 60000, 45 * 60000);
ConvertTime(BreakFor, H, M, S);
Report;
Writeln('Break for: ' + inttostr(M) + 'm:' + inttostr(S) + 's');
Logout;
MarkTime(T);
repeat
ConvertTime(BreakFor - TimeFromMark(T), H, M, S) Disguise(inttostr(M) + 'm:' + inttostr(S) + 's Break');
wait(1000);
until (BreakFor < TimeFromMark(T)) BreakTime := GetSystemTime + RandomRange(60 * 60000, 180 * 60000);
LogoutTime := GetSystemTime + RandomRange((LogoutEvery - 2) * 60000, (LogoutEvery + 2) * 60000);
Disguise(ScriptRunTime);
NextPlayer(true);
SetupPlayer;
end;
end;
function TakeASleep(SleepTime: string): boolean;
var
H, M, S, ms: Word;
SleepH, SleepM, SleepFor, Hr, Mr, Sr, T: integer;
begin
SleepH := StrToInt(Left(SleepTime, 2));
SleepM := StrToInt(Right(SleepTime, 2));
DecodeTime(Now, H, M, S, ms);
if (H = SleepH) and (M > SleepM) then
begin
Result := true;
Report;
SleepFor := RandomRange(540 * 60000, 900 * 60000);
ConvertTime(SleepFor, Hr, Mr, Sr);
Writeln('Sleep for: ' + inttostr(Hr) + 'h:' + inttostr(Mr) + 'm:' + inttostr(Sr) + 's');
Logout;
MarkTime(T);
repeat
ConvertTime(SleepFor - TimeFromMark(T), Hr, Mr, Sr);
Disguise(inttostr(Hr) + 'h:' + inttostr(Mr) + 'm:' + inttostr(Sr) + 's Sleep');
wait(1000);
until (SleepFor < TimeFromMark(T)) BreakTime := GetSystemTime + RandomRange(45 * 60000, 180 * 60000);
LogoutTime := GetSystemTime + RandomRange((LogoutEvery - 2) * 60000, (LogoutEvery + 2) * 60000);
Disguise(ScriptRunTime);
NextPlayer(true);
SetupPlayer;
end;
end;
procedure ClearTPAsInBox(var TPA: TPointArray; Box: TBox);
var
i, H: integer;
begin
H := High(TPA);
for i := 0 to H do
if PointInBox(TPA[i], Box) then
begin
try
Swap(TPA[i], TPA[H]);
SetArrayLength(TPA, H);
i := i - 1;
H := High(TPA);
except
end;
end;
end;
procedure ClearATPAsInBox(var ATPA: T2DPointArray; Box: TBox);
var
i, H: integer;
begin
H := High(ATPA);
for i := 0 to H do
ClearTPAsInBox(ATPA[i], Box);
end;
function ChooseCount(Names: TStringArray): integer;
var
x, y, Ymod, T: integer;
B: TBox;
P: TPointArray;
i, H, ii, C: integer;
begin
T := GetSystemTime;
GetClientDimensions(B.X2, B.Y2);
B.x1 := 0;
B.y1 := 0;
FindColorsTolerance(P, 4674653, B.X1, B.Y1, B.X2, B.Y2, 0);
if Length(P) = 0 then
Exit;
B := GetTPABounds(P);
H := High(Names);
C := Round((B.Y2 - B.Y1 - 22) / 15);
Ymod := B.Y1 + 4;
for i := 0 to C do
begin
Ymod := Ymod + 15;
if FindText(x, y, 'ake', upchars, B.X1, Ymod - 2, B.X2, Ymod + 17) then
for ii := 0 to H do
if FindText(x, y, Names[ii], upchars, B.X1, Ymod - 2, B.X2, Ymod + 17) then
begin
Result := Result + 1;
Break;
end;
end;
end;
function ItemsOnScreen: integer;
var
i: integer;
TPA: TPointArray;
begin
FindColorsSpiralTolerance(MMCX, MMCY, TPA, 2105598, MMX1, MMY1, MMX2, MMY2, 0);
if Length(TPA) < 1 then
Exit;
RAaSTPA(TPA, 3);
for i := 0 to High(TPA) do
if InAbstractBox(590, 63, 656, 63, 646, 100, 600, 100, TPA[i].x, TPA[i].y) then
Result := Result + 1;
end;
function ClusterColorsATPA(Colors: TIntegerArray; Size: integer): T2DPointArray;
var
H, i, cts: integer;
TPA: TPointArray;
begin
cts := GetColorToleranceSpeed;
ColorToleranceSpeed(1);
H := High(Colors);
SetArrayLength(Result, H + 1);
for i := 0 to H do
FindColorsSpiralTolerance(MSCX, MSCY, Result[i], Colors[i], MSX1, MSY1, MSX2, MSY2, 4);
ColorToleranceSpeed(cts);
try
TPA := MergeATPA(Result);
ClearSameIntegersAndTPA(Colors, TPA);
except
Exit;
end;
if GetArrayLength(TPA) < 1 then
Exit;
Result := SplitTPAEx(TPA, Size, Size);
SortATPAFrom(Result, Point(MSCX, MSCY));
end;
Function SpiralMouseOut(Sx, Sy, Time: integer; UpText: String; Dist: Extended; LeftClick: Boolean): Boolean;
var
angle, angleINC, r: extended;
x, y, T: integer;
P, M: TPoint;
begin
angle:= (5.283 + random(3));
angleINC := 0.2618;
r := Dist * angle;
x := Round(r * cos(angle));
y := Round(r * sin(angle));
T := GetSystemTime + Time;
repeat
P := Point(x + Sx, y + Sy);//256, 167
if (P.x > 4) and (P.x < 516) and (P.y > 4) and (P.y < 338) then
begin
MMouse(P.x, P.y, 1, 1);
wait(30+random(20));
if IsUpText(UpText) then
begin
GetMousePos(M.x, M.y);
Mouse(M.x, M.y, 0, 0, LeftClick);
wait(250 + random(150));
Result := true;
end;
end else
Exit;
angle := angle + angleINC;
r:= Dist * angle;
x:= Round(r * cos(angle));
y:= Round(r * sin(angle));
until(Result) or (GetSystemTime > T);
end;
function PickUpTPA(Colors: TIntegerArray; Names: TStringArray): integer;
var
i, i1, H, CC: integer;
TP: Tpoint;
TPA: Tpointarray;
ATPA: T2DPointArray;
begin
if not LoggedIn then
Exit;
try
if (Colors[0] < 1) then
Exit;
except
Exit;
end;
if ItemsOnScreen < 1 then
Exit;
ATPA := ClusterColorsATPA(Colors, 18);
ClearATPAsInBox(ATPA, InttoBox(235, 140, 280, 200));
TPA := MergeATPA(ATPA);
ATPA := TPAtoATPA(TPA, 18);
H := High(ATPA);
Status('Searching for items to pickup...');
for i := 0 to H do
begin
if ItemsOnScreen < 1 then
Break;
TP := MiddleTPA(ATPA[i]);
if (TP.x < 10) and (TP.y < 10) then
Continue;
MMouse(TP.x, TP.y, 1, 1);
Wait(150 + random(50));
if IsUpText('ake') then
begin
GetMousePos(TP.x, TP.y);
Mouse(TP.x, TP.y, 0, 0, False);
wait(25 + random(25));
CC := ChooseCount(Names);
if CC = 0 then
Continue;
for i1 := 0 to CC - 1 do
begin
if i1 > 0 then
SpiralMouseOut(250, 167, 3500+random(500), 'ake', 1.4, false);
begin
Inc(Result);
Inc(ReportVars[2]);
FFlag(0);
wait(300 + random(150));
if (i1 = 0) and (CC > 1) then
Wait(400 + random(200));
end;
if CC = 1 then
Break;
if InFight then
Exit;
end;
if (Result > 0) then
begin
InvCheck;
Exit;
end;
end;
end;
end;
procedure HpCheck;
begin
if not (LoggedIn) or (HPPercent > 50) then
Exit;
if (HPPercent <= 50) then
begin
Status('HP low doing checks...');
if NAF[currentplayer].Food > 0 then
if not (InvEmpty) then
begin
if InvEat then
begin
NAF[currentplayer].FoodAte := NAF[currentplayer].FoodAte + 1;
NAF[currentplayer].Food := NAF[currentplayer].Food - 1;
ReportVars[3] := ReportVars[3] + 1;
end;
end;
if (NAF[CurrentPlayer].Food < 1) then
begin
if (HPPercent < 25) then
if (InFight) then
begin
Status('Running away HP% < 25...');
RunAway(NAF[currentplayer].RunDir, true, 1, 10000 + random(2000));
end;
repeat
Status('HP is ' + inttostr(HPPercent) + '%');
NWait(4);
case random(5) of
0: BoredHuman;
1: RandomMovement;
end;
if not LoggedIn or (GetSystemTime > LogoutTime) then
Exit;
until (HPPercent > 50);
end;
end;
if (HPpercent > 50) then
Status('HP is above ' + inttostr(HPPercent) + '%, we''re good to go!');
end;
function MobTPAs: TPointArray;
var
TPA: TPointArray;
begin
FindColorsSpiralTolerance(MMCX, MMCY, TPA, 195836, MMCX - 35, MMCY - 35, MMCX + 35, MMCY + 35, 0);
if Length(TPA) < 1 then
Exit;
RAaSTPA(TPA, 4);
SortTPAFrom(TPA, IntToPoint(MMCX, MMCY));
result := TPA;
end;
function MobsOnScreen: integer;
var
i: integer;
mTPA: TPointArray;
begin
mTPA := MobTPAs for i := 0 to High(mTPA) do
if InAbstractBox(590, 63, 656, 63, 646, 100, 600, 100, mTPA[i].x, mTPA[i].y) then
result := result + 1;
end;
function MobFinder: boolean;
var
mTPA: TPointArray;
mAng: Integer;
begin
mTPA := MobTPAs;
if Length(mTPA) < 1 then
begin
result := false;
Exit;
end;
if (Distance(mTPA[0].x, mTPA[0].y, MMCX, MMCY) > 17) then
begin
if ClickToMobMM then
begin
Mouse(mTPA[0].x - 2, mTPA[0].y - 2, 5, 5, true);
FFlag(1);
end
else
begin
result := false;
exit;
end;
end
else
begin
mAng := Round(Degrees(ArcTan2(mTPA[0].Y - MMCY, mTPA[0].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));
end;
if (MobsOnScreen > 0) then
result := true;
end;
procedure SitAndWait;
var
T: integer;
begin
MarkTime(T);
repeat
Status('Sit & Wait...');
if not LoggedIn then
Exit;
NWait(2);
AntiBan;
HpCheck;
if ClickToMobMM then
if (Length(MobTPAs) > 0) then
Exit;
until (TimeFromMark(T) > 60000) or (MobsOnScreen > 0)
end;
function WaitFight: boolean;
var
T: integer;
begin
MarkTime(T);
if NAF[CurrentPlayer].Melee then
begin
while not InFight and (TimeFromMark(T) < 5000) do
wait(100);
begin
Status('Killing Monster...');
repeat
NWait(1);
HpCheck;
Result := not InFight;
until Result or (not LoggedIn) or (not FightOnScreen);
end;
end;
if NAF[CurrentPlayer].Range or NAF[CurrentPlayer].Magic then
begin
Status('Killing Monster...');
while not InFight and (TimeFromMark(T) < 15000) do
wait(100);
repeat
NWait(1);
HpCheck;
Result := not InFight;
until Result or (not LoggedIn) or (not FightOnScreen);
end;
Status('Fight Ended.');
end;
function FightTPA(Names: TStringArray; Colors: TIntegerArray; RightClick: Boolean): Boolean;
var
i, H, z, CN: integer;
TP: Tpoint;
TPA: Tpointarray;
ATPA, FaTPA: T2DPointArray;
begin
if not LoggedIn or (MobsOnScreen = 0) then
Exit;
if InFight then
if FightOnScreen then
WaitFight;
Status('Searching...');
ATPA := ClusterColorsATPA(Colors, 40);
try
TPA := MergeATPA(ATPA);
except
Exit;
end;
ClearTPAsInBox(TPA, InttoBox(235, 140, 280, 200));
if GetArrayLength(TPA) < 1 then
Exit;
ATPA := SplitTPAEx(TPA, 40, 40);
SortATPAFrom(ATPA, Point(MSCX, MSCY));
H := High(ATPA);
for i := 0 to H do
begin
if (MobsOnScreen = 0) then
Exit;
TP := MiddleTPA(ATPA[i]);
if IsFightAt(TP.x, TP.y) then
Continue;
MMouse(TP.x, TP.y, 1, 1);
Wait(200 + Random(50));
if IsUpTextMultiCustom(Names) then
begin
GetMousePos(TP.x, TP.y);
if RightClick then
CN := 0
else
CN := Random(2);
case CN of
0:
begin
Mouse(TP.x, TP.y, 0, 0, false);
Wait(25 + random(25));
Result := ChooseOption('tack');
end;
1: Result := MLeftClick(TP.x, TP.y);
end;
if Result then
begin
Status('Attacked');
MarkTime(AttackTime);
NWait(2);
FFlag(0);
ReportVars[1] := ReportVars[1] + 1;
Exit;
end;
end;
end;
end;
procedure NSetup;
var
i, n: integer;
begin
ClearDebug;
ScriptNews;
NarcSig;
wait(100);
Disguise('SRL Loading...');
Status('SRL Loading...');
SetupSRL;
NarclesINI;
if (SRLID = '') or (SRLPassword = '') then
begin
Writeln('');
Writeln('Please register at SRL-stats in the future to');
Writeln('remove this message and the time delay.');
writeln('To set up a SRL stats ID go here: http://www.stats.srl-forums.com');
Writeln(' -Regards Narcle');
n := 15;
repeat
Disguise(inttostr(n) + ' Seconds to start.');
wait(999);
n := n - 1;
until (n = 0)
end;
ScriptID := '967';
DeclarePlayers;
Disguise('Nautilus Start');
for i := 0 to HowManyPlayers - 1 do
begin
if (NAF[i].Training = '') then
NAF[i].Training := 'even'
else
NAF[i].Training := LowerCase(NAF[i].Training);
if (NAF[i].RunDir = '') then
NAF[i].RunDir := 's'
else
NAF[i].RunDir := NAF[i].RunDir;
if (NAF[i].Names[0] = '') then
NAF[i].Names := ['ttack']
else
NAF[i].Names := NAF[i].Names;
end;
BreakTime := GetSystemTime + RandomRange(60 * 60000, 150 * 60000);
LogoutTime := GetSystemTime + RandomRange((LogoutEvery - 2) * 60000, (LogoutEvery + 2) * 60000);
if not LoggedIn then
LoginPlayer;
SetupPlayer;
Disguise('Fighting...');
end;
begin
NSetup;
repeat
if not LoggedIn then
LoginPlayer;
PickUpTPA(NAF[CurrentPlayer].PickupColors, NAF[CurrentPlayer].PickupNames);
if (MobsOnScreen = 0) then
if not MobFinder then
SitAndWait;
SpecialAttack;
if FightTPA(NAF[CurrentPlayer].Names, NAF[CurrentPlayer].Colors, RightClickOnly) then
WaitFight;
HpCheck;
EquipAmmo;
if InvFull then
begin
if NAF[CurrentPlayer].InvOptions[0] then
InvBury;
if NAF[CurrentPlayer].InvOptions[1] then
InvDrop;
end;
if (TimeFromMark(AttackTime) >= 180000) then
LogoutSeq('Couldn''t find monsters');
if (GetSystemTime > LogoutTime) then
LogoutSeq('');
if TakeSleeps then
if TakeBreaks then
TakeABreak;
Antiban;
FindNormalRandoms;
until (false);
end.