SRL Archive - Help and Support

Never had this Warning before.


Narcle

2007-12-19 23:51:06

Line 1: [Warning] (1:1): Calculation always evaluates to False in script


The script still runs… I don't know why it says this. I did change my constants to true/false statements in my script. Instead of having 'off''/'on'. I think that did this? But still this shouldn't result in this kind of warning should it?

I did various other work on the script as well still have no idea whats causing this.

Edit: Heres the script, its my almost finished version of NAF v0.70.
{.Script Info:
# ScriptName = Narcle's Autofight
# Author = Narcle
# Description = Kills any monster: Melee, Ranging & Maging
# Version = 0.70
# Date = 12/16/07
# Comments = Advance fighter
/Script Info}
//|
//| Category: Fighter
//| SRL Version: 4.0 Rev 7
//| SCAR Divi Version: 3.12c & 3.13
//| Extras: Advance progress report, 24/7 options (SleepnBreak), Pick up items/bones/ammo & bury bones
//|_______________________________________________________________________________________________________________||
//|-------------------------------Instructions, Credits & Help info-----------------------------------------------||
//|
//| Instructions:
//| Setup: 1. Make sure you use the Color picker and select 3 colors from monster, and copy/paste them into notepad.
//| 2. Get a HP count of monster for form.
//| 3. Input SRL-stats ID & Password
//| 4. Read the "Need to knows" below.
//| 5. Setup constants
//| 6. Push play!
//|
//| Need to knows:
//| -In the player form (default) is next to each option, meaning you can leave it blank
//| if you want it to use default settings.
//| -Options for "Skill to train" are > strength, attack, defence, whipdefence, even, accurate, rapid or longrange <
//| -Options for "Run Direction" are > n, e, s, w <
//|
//| Auto find colors: This isn't perfect, but it does work, tho I don't recommend it if you want to lvl fast.
//| Make sure your in monster area and a couple are on screen. I suggest turning pickups off if used.
//|
//| Remote Control: I made a custom one for this. Include the code in each command, will only give 1 report every login
//| Commands: Type these words in the msg u send for the corrisponding result
//| Kill ; will reply total kill count
//| combat ; will reply with current combat lvl
//| doing ; will tell either fighting or regening hp
//|
//| Credits:
//| -Precog & Cruel100 for Testing and Suggestions
//| -HyperSecret for posting his SecretFighter script
//| -Rune Hacker for posting his bone pickup/burier
//|
//| Help / Tests Needed:
//| -Ammo pickup
//| -Custom pickup
//| Report anything not working for you. In detail if possible so I can make it work ;)
//| Any suggestions for improving or additionals post on forums. (plz read developments first before suggesting additionals)
//|_______________________________________________________________________________________________________________||
program NAF;
{.include srl/srl.scar}
{.include srl/srl/skill/fighting.scar}
{.include srl/srl/skill/ranging.scar}
{.include srl/srl/skill/magic.scar}
var CustomColors: array of integer; CustomPickups: array of string;
{------------------------------------------------------------------------------}
{===============================Player Setup===================================}
{------------------------------------------------------------------------------}

const
//SRL - Stats
MySRLID = '';
MySRLPassword = '';

UseForm = true;//Use form? [true/false]
DebugMode = false;//debug mode
UseFileLogging = false;//This will keep a record of your fighting on computer.
AutoFindColors = false;//auto find monster colors? Not perfect, but works


//Magic options:
MagicSpell = 1;//1 = Wind Strike, 2 = Water Strike, 3 = Earth Strike, 4 = Fire Strike
MagicStyle = false;//Defensive?

{Pick-up Options}
//Custom Pickup
PickUpPriority = false;

PickupBones = false;//pick up bones?
PickupRunes = false;//Pick up runes?
PickupAmmo = false;//pick up arrows? below this works only if this is on

AmmoType = 'bronze';//type of arrow, bronze-rune [for equiping arrows]
ArrowBoltKnives= 'arrow';//arrows, bolts or Knives? what type of ammo using (for pickup and weilding)
ammoc0 = 857196;//1st color of arrows [857196 is tail color, I think its constant]
ammoc1 = 857196;//2nd color of arrows/bolts




PickupCustom = false;//Add names and colors in DeclarePlayers;

//Remote options: My custom one
DoRemote = false;//turn remote logout on? yes/no (this will automatically set private chat to friends)
remotename = '';//name it will only respond to
remotecode = '???';//password, or code to accept its you
Rlogouttime = 10;//logout for how long till logging back in (minutes +random(60s))

//Sleeping / Breaking options:
SleepOrBreak = 'off';//off, sleep, break or both -use all lowercase
sleepat = 1500;//goes by computer time -> 100 = 1:00am, 130 = 1:30am, 2200 = 10:00pm, etc. <
BreakAt = 300;//Break every ??? -> 100 = 1 hour, 330 = 3 hours 30 mins, etc. <
SleepFor = 2;//1 = 30 mins, 2 = 1hour, 3 = 1h 30m ... 8 = 4 hours, 10 = 5 hours, etc...

procedure DeclarePlayers;
begin
CustomPickups := ['ranarr'];//example= ['rimy','ranarr']
CustomColors := [];//example= ['2130543','1035462']

if not(UseForm) then
begin
HowManyPlayers := 1;//Change this accordinly
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;

Players[0].Name :=''; //Character Name
Players[0].Pass :=''; //Character Pass
Players[0].Nick :=''; //Nickname 3 - 4 Letter's of char name
Players[0].Active:=True; //True if you want this player to be ran in the script, false if not
Players[0].Booleans[0] := false;//Eat food?
Players[0].Booleans[1] := false;//Use Special?
Players[0].Booleans[2] := false;//Toggle Pickups?
Players[0].Integers[0] := 0;//Fighting Type > 0 = melee, 1 = ranging, 2 = magic <
Players[0].Integers[1] := 0;//1st color of monster
Players[0].Integers[2] := 0;//2nd color of monster
Players[0].Integers[3] := 0;//3rd color of monster
Players[0].Integers[4] := 3;//Monster Hitpoints
Players[0].Integers[5] := 9;//Kill monster for? in minutes.
Players[0].Strings[0] := '';//monster name
Players[0].Strings[1] := 'even'; //the skill you want to train > strength, attack, defence, whipdefence, pure, even, accurate, rapid or longrange <
Players[0].Strings[2] := 's';//Player run direction > n, e, s, w <

{
Players[1].Name :=''; //Character Name
Players[1].Pass :=''; //Character Pass
Players[1].Nick :=''; //Nickname 3 - 4 Letter's of char name
Players[1].Active:=True; //True if you want this player to be ran in the script, false if not
Players[1].Booleans[0] := false;//Eat food?
Players[1].Booleans[1] := false;//Use Special?
Players[1].Booleans[2] := false;//Toggle Pickups?
Players[1].Integers[0] := 0;//Fighting Type > 0 = melee, 1 = ranging, 2 = magic <
Players[1].Integers[1] := 0;//1st color of monster
Players[1].Integers[2] := 0;//2nd color of monster
Players[1].Integers[3] := 0;//3rd color of monster
Players[1].Integers[4] := 3;//Monster Hitpoints
Players[1].Integers[5] := 9;//Kill monster for? in minutes.
Players[1].Strings[0] := '';//monster name
Players[1].Strings[1] := 'even'; //the skill you want to train > strength, attack, defence, whipdefence, pure, even, accurate, rapid or longrange <
Players[1].Strings[2] := 's';//Player run direction > n, e, s, w <
}
{
Players[2].Name :=''; //Character Name
Players[2].Pass :=''; //Character Pass
Players[2].Nick :=''; //Nickname 3 - 4 Letter's of char name
Players[2].Active:=True; //True if you want this player to be ran in the script, false if not
Players[2].Booleans[0] := false;//Eat food?
Players[2].Booleans[1] := false;//Use Special?
Players[2].Booleans[2] := false;//Toggle Pickups?
Players[2].Integers[0] := 0;//Fighting Type > 0 = melee, 1 = ranging, 2 = magic <
Players[2].Integers[1] := 0;//1st color of monster
Players[2].Integers[2] := 0;//2nd color of monster
Players[2].Integers[3] := 0;//3rd color of monster
Players[2].Integers[4] := 3;//Monster Hitpoints
Players[2].Integers[5] := 9;//Kill monster for? in minutes.
Players[2].Strings[0] := '';//monster name
Players[2].Strings[1] := 'even'; //the skill you want to train > strength, attack, defence, whipdefence, pure, even, accurate, rapid or longrange <
Players[2].Strings[2] := 's';//Player run direction > n, e, s, w <
}
{
Players[3].Name :=''; //Character Name
Players[3].Pass :=''; //Character Pass
Players[3].Nick :=''; //Nickname 3 - 4 Letter's of char name
Players[3].Active:=True; //True if you want this player to be ran in the script, false if not
Players[3].Booleans[0] := false;//Eat food?
Players[3].Booleans[1] := false;//Use Special?
Players[3].Booleans[2] := false;//Toggle Pickups?
Players[3].Integers[0] := 0;//Fighting Type > 0 = melee, 1 = ranging, 2 = magic <
Players[3].Integers[1] := 0;//1st color of monster
Players[3].Integers[2] := 0;//2nd color of monster
Players[3].Integers[3] := 0;//3rd color of monster
Players[3].Integers[4] := 3;//Monster Hitpoints
Players[3].Integers[5] := 9;//Kill monster for? in minutes.
Players[3].Strings[0] := '';//monster name
Players[3].Strings[1] := 'even'; //the skill you want to train > strength, attack, defence, whipdefence, pure, even, accurate, rapid or longrange <
Players[3].Strings[2] := 's';//Player run direction > n, e, s, w <
}
{
Players[4].Name :=''; //Character Name
Players[4].Pass :=''; //Character Pass
Players[4].Nick :=''; //Nickname 3 - 4 Letter's of char name
Players[4].Active:=True; //True if you want this player to be ran in the script, false if not
Players[4].Booleans[0] := false;//Eat food?
Players[4].Booleans[1] := false;//Use Special?
Players[4].Booleans[2] := false;//Toggle Pickups?
Players[4].Integers[0] := 0;//Fighting Type > 0 = melee, 1 = ranging, 2 = magic <
Players[4].Integers[1] := 0;//1st color of monster
Players[4].Integers[2] := 0;//2nd color of monster
Players[4].Integers[3] := 0;//3rd color of monster
Players[4].Integers[4] := 3;//Monster Hitpoints
Players[4].Integers[5] := 9;//Kill monster for? in minutes.
Players[4].Strings[0] := '';//monster name
Players[4].Strings[1] := 'even'; //the skill you want to train > strength, attack, defence, whipdefence, pure, even, accurate, rapid or longrange <
Players[4].Strings[2] := 's';//Player run direction > n, e, s, w <
}


{------------------------------------------------------------------------------}
{========================Don't touch Below this!===============================}
{------------------------------------------------------------------------------}
end else
begin
SRLPlayerForm(True, ['Eat Food', 'Use Special', 'Toggle Pickups'], ['Fighting Type(0)','Color 1','Color 2','Color 3','Monster Hitpoints','Logout Time (9)'], ['Monster Name', 'Skill to train (even)','Run Direction (s)'], []);
end;
CheckUserNicks;
ScriptID := '418';
SRLid:= MySRLId;
SRLpassword:= MySRLPassword;
end;

const
Version = '0.70';
ScriptINIid = 'NAFFight';
ScriptName = 'Narcle''s AutoFight';
var
foodate,itemspicked,ArrowStartAmount,arrowcount:integer;
CharStartTime,StartXP,FailTimer,RoundTimer:integer;
StatRgiven,reportgave,RemoteStat:integer;
Buried, BonesPicked,RoundTimeStart2:integer;
CurrentFightingType,CurrentColor1,CurrentColor2,CurrentColor3,CurrentMonsterHP,CurrentKillTime:integer;
Hoverskillis,CurrentMonsterName,CurrentRunDir,CurrentStyle,StartTime:string;
Outoffood: Boolean;

procedure NAFOutFight; forward;
procedure LogoutSeq(i:integer); forward;
procedure ProgressReport; forward;
procedure NAFhpcheck; forward;

procedure NarcSig;
begin
Cleardebug;
if (MySRLID = '') then
begin
writeln('Please register at SRL-stats in the future. -Regards Narcle');
wait(5000);
end;
StartTime := TheTime;
Writeln(' _ _ _ ');
Writeln('| \ | | made by | | ');
Writeln('| \| | __ _ _ __ ___| | ___ Narcle''s AutoFight');
Writeln('| . ` |/ _` | __/ __| |/ _ \ v'+Version);
Writeln('| |\ | (_| | | | (__| | __/');
Writeln('|_| \_|\__,_|_| \___|_|\___| '+StartTime);
If (HowManyPlayers = 1) then Writeln('Single-Player Mode') else Writeln('Multi-Player mode; '+IntToStr(HowManyPlayers)+' Players');
ClearReport;
end;

procedure NarclesINI;//something new
var
Killed,XPGained,XPperHour,Timeran:integer;
begin
if not FileExists(AppPath+'\Plugins\NarclesINI.ini') then
begin
WriteINI('NarclesINImain', 'Please dont delete this file -Thank you', 'Narcle', AppPath+'\Plugins\NarclesINI.ini');
WriteINI('NarclesINImain', 'TTimeran', '0', AppPath+'\Plugins\NarclesINI.ini');
Writeln('Thank you for downloading my script.');
Writeln('If you have any problems read/post on the forums.');
Writeln(' -regards Narcle');
WriteINI(ScriptINIid, 'Timeran', '0', AppPath+'\Plugins\NarclesINI.ini');
WriteINI(ScriptINIid, 'YourKills', '0', AppPath+'\Plugins\NarclesINI.ini');
WriteINI(ScriptINIid, 'XPGained', '0', AppPath+'\Plugins\NarclesINI.ini');
WriteINI(ScriptINIid,'CurrentVersion',Version,AppPath+'\Plugins\NarclesINI.ini');
end else
begin
if ReadINI(ScriptINIid, 'Timeran', AppPath+'\Plugins\NarclesINI.ini')='' then WriteINI(ScriptINIid, 'Timeran', '0', AppPath+'\Plugins\NarclesINI.ini');
if ReadINI(ScriptINIid, 'YourKills', AppPath+'\Plugins\NarclesINI.ini')='' then WriteINI(ScriptINIid, 'YourKills', '0', AppPath+'\Plugins\NarclesINI.ini');
if ReadINI(ScriptINIid, 'XPGained', AppPath+'\Plugins\NarclesINI.ini')='' then WriteINI(ScriptINIid, 'XPGained', '0', AppPath+'\Plugins\NarclesINI.ini');
Killed := strtoint(ReadINI(ScriptINIid, 'YourKills', AppPath+'\Plugins\NarclesINI.ini'));
XPGained := strtoint(ReadINI(ScriptINIid, 'XPGained', AppPath+'\Plugins\NarclesINI.ini'));
Timeran := strtoint(ReadINI(ScriptINIid, 'Timeran', AppPath+'\Plugins\NarclesINI.ini'));
if (Timeran > 0) and (XPGained > 0) then XPperHour := XPGained/(Timeran/60) Else XPperHour := 0;
Writeln('Welcome back, you have ran '+ScriptName+' for '+inttostr(Timeran)+' minutes,');
Writeln('Killed '+inttostr(Killed)+' Monsters, Gained '+inttostr(XPGained)+' XP, Average XP/hour: '+inttostr(XPperHour));
if not (ReadINI(ScriptINIid, 'CurrentVersion',AppPath+'\Plugins\NarclesINI.ini') = Version) then
begin
WriteINI(ScriptINIid,'CurrentVersion',Version,AppPath+'\Plugins\NarclesINI.ini');
Writeln('Version '+Version+' update completed.');
end;
end;
wait(3000);
RoundTimeStart2 := getsystemtime;
end;

procedure NarcDebug(ln:string);
begin
if (debugmode) then writeln(thetime+': '+ln);
end;

function ActiveCount:integer;
var i:integer;
begin
for i := 0 to HowManyPlayers-1 do
begin
if Players[i].Active = true then
result := result+1;
end;
end;

procedure HighestBrightness;
var
x,y,SlideButton:integer;
begin
GameTab(11);
SlideButton := DTMFromString('78DA633CC6C4C0F0920105083ACE673002D28' +
'C40FC1F08180F01D5BC4155A3A0610957030260358FD1D4683BA0' +
'AA398DA9465CC516530D9A5D920A3A286A003116104C');
x:= 707;
y:= 228;
If (not FindDTM(SlideButton,x,y,x-25,y-25,x+25,y+25)) then
Mouse(711,233,2,2,true);
FreeDTM(SlideButton);
end;

function MouseInvTextCustom(istextup: TStringArray; option:string; leftclick, IsUp: Boolean;
inv1, inv2, waitfor, times:integer): integer; //by Narcle, improved greatly
var
i,x,y:integer;
begin
gametab(4);
result := 0;
for i := inv1 to inv2 do
if (ExistsItem(i)) then
begin
MMouseItem(i);
GetMousePos(x, y);
wait(200+random(50));
if IsUp then if (IsUpTextMultiCustom(istextup)) then
begin
if (leftclick = true) then
begin
Mouse(x,y,5,5,true)
result := result+1;
if (result = times) then exit;
wait(waitfor+random(100));
end else
begin
Mouse(x,y,5,5,false);
if Chooseoption(option) then result := result+1;
if (result = times) then exit;
wait(waitfor+random(100));
end;
end;
if not(IsUp) then if not(IsUpTextMultiCustom(istextup)) then
begin
if (leftclick = true) then
begin
Mouse(x,y,5,5,true)
result := result+1;
if (result = times) then exit;
wait(waitfor+random(100));
end else
begin
Mouse(x,y,5,5,false);
if Chooseoption(option) then result := result+1;
if (result = times) then exit;
wait(waitfor+random(100));
end;
end;
end;
end;

function InFightNotAttacking: Boolean;//made for my fighters :D very effective
var
x, y : Integer;
begin
Result := ( (FindColor(x, y, 65280, 230, 130, 280, 180) or FindColor(x, y, 255, 230, 130, 280, 180)) and
(not(FindColor(x, y, 65280, 12, 24, 212, 328) or FindColor(x, y, 255, 12, 24, 212, 328))) and
(not(FindColor(x, y, 65280, 290, 12, 509, 328) or FindColor(x, y, 255, 290, 12, 509, 328))) and
(not(FindColor(x, y, 65280, 197, 15, 303, 117) or FindColor(x, y, 255, 197, 15, 303, 117))) and
(not(FindColor(x, y, 65280, 179, 180, 330, 332) or FindColor(x, y, 255, 179, 180, 330, 332))) )
end;

procedure SetChat2(state: string; chat: Integer);//Temporary working one till SRL update
var
x, y, mx, my, Color: Integer;
begin
case chat of
1: mx := 146;
2: mx := 205;
3: mx := 263;
4: mx := 319;
5: mx := 375;
else Exit;
end;
my := 492;
case LowerCase(State) of
'on': begin Color := 65280; State :='On'; end;
'off': begin Color := 255; State :='Off'; end;
'hide': begin Color := 16776960; State :='Hide'; end;
'friends': begin Color := 65535; State :='Friends'; end;
else Writeln('State in SetChat does not exist!');
end;
if not FindColor(x, y, Color, mx - 10, my - 10, mx + 10, my + 10) then
begin
Mouse(mx, my, 8, 8, False);
Wait(450 + Random(175));
ChooseOption(State);
end;
end;

function GetXPof(skill: string; t:integer): integer;
var
p: TPoint;
i, tx, ty, x, y, l, II, WaitT: Integer;
xp, Nums, text2, xpis, typeis : string;
begin
Result := -1;
case t of
1: typeis := 'urrent';
2: typeis := 'level';
3: typeis := 'ainder';
end;
if (not LoggedIn) or (not TabExists(2)) then Exit;
GameTab(2);
if (GetCurrentTab <> 2) then Exit;
p := SkillToCoords(Skill);
if (p.x < 1) then Exit;
MMouse(p.x, p.y+7, 12, 4);
repeat
WaitT := WaitT+1;
wait(100);
if WaitT >= 300 then exit;
until findcolor(x, y, 10551295, 554, 205, 743, 465);
wait(300 + Random(100))
if (not FindColor(x, y, 10551295, MIX1, MIY1, MIX2, MIY2)) then Exit;
if IsTextInAreaEx(x, y, x + 60, y + 60, tx, ty, typeis, 0, SmallChars, False, False, 0, 1, 0) then
xp := GetTextAtEx(tx, ty, 0, SmallChars, False, True, 0, 1, 0, 50, False, tr_AllChars);
for l := 1 to Length(xp) do
begin //replace O's with 0's
if (xp[l] = 'O') then text2 := text2 + '0' else text2 := text2+ xp[l];
end;
Nums := '01234567890';//clear spaces
for I := 1 to Length(Text2) do
begin
for II := 1 to 10 do
begin
if (Copy(text2, I, 1) = Copy(Nums, II, 1)) then
xpis := xpis + Copy(Text2, I, 1);
end;
end;
result := strtoint(xpis);
Status(skill+' = ' +xpis);
end;


function FindObjColorByText(ObjName:string): integer;//made by me
var
xx,yy, MainTimeCount, TimeCount1, TimeCount2, MoP, coloris:integer;
begin
MMouse(258, 180, 1, 1);
MainTimeCount := 1;
GetMousePos(xx, yy);
repeat
repeat
If (MoP = 0) then MMouse(xx,yy-25, 1, 1) else MMouse(xx,yy+25, 1, 1);
GetMousePos(xx, yy);
if IsUpText(ObjName) then
begin
coloris := GetColor(xx,yy);
Writeln('Object color is: '+inttostr(coloris)+' at '+inttostr(xx)+', '+inttostr(yy));
result := coloris;
exit;
end;
TimeCount1 := TimeCount1+1;
until(TimeCount1 = MainTimeCount)
repeat
If (MoP = 0) then MMouse(xx+40,yy, 1, 1) else MMouse(xx-40,yy, 1, 1);
GetMousePos(xx, yy);
if IsUpText(ObjName) then
begin
coloris := GetColor(xx,yy);
Writeln('Object color is: '+inttostr(coloris)+' at '+inttostr(xx)+', '+inttostr(yy));
result := coloris;
exit;
end;
TimeCount2 := TimeCount2+1;
until(TimeCount2 = MainTimeCount)
MainTimeCount := MainTimeCount+1;
TimeCount1 := 0;
TimeCount2 := 0;
if (MoP = 0) then MoP := 1 else MoP := 0;
until(MainTimeCount >= 12)
Writeln('Couldnt find object color!');
result := 0;
end;

function GetArrowCount:integer;//my personal one
var
ACtxt, text2: string;
l:integer;
begin
gametab(5);
wait(50);
ACtxt := Trim(GetTextAtEx(667, 249, 0, StatChars, False, False,
0, 2, -1, 5, True, tr_AlphaNumericChars));
for l := 1 to Length(ACtxt) do
begin
if (ACtxt[l] = 'K') then text2 := text2 + '000' else text2 := text2+ ACtxt[l];
end;
if (clearspaces(text2) = '') then result := 0 else result := strtoint(clearspaces(text2));
end;

procedure Stopban;
begin
if(not(LoggedIn))then Exit;
Status('Antiban...');
begin
case Random(60) of
0: wait(500+random(10000));
1: RandomMovement;
2: HoverSkill(Hoverskillis ,false);
3: PickUpMouse;
4: gametab(4);
5: RandomMovement;
end;
HighestAngle;
end;
end;

var rct,rct2:integer;
Function RandomsCheck(Time: Integer): Boolean;
var
ti,t: Integer;
begin
if time = 0 then Ti := 1 else Ti := time;
begin
for T := 1 to Ti do
begin
if (rct2 = 0) then begin MarkTime(rct); rct2 := 1; end;
if (rct2 = 1) and (TimeFromMark(rct) >= (60000+random(10000))) then
begin
outfight;
FindInventoryRandoms;
if (Invcount = 28) then
begin
MouseInvTextCustom(['ranarr','rune','teel arr','ong bon'], 'rop', false, false, 1, 28, 300, 28);
ArrangeInv;
end;
rct2 := 0;
end;
if FindTalk then
begin
Result := True;
FindNormalRandoms;
end;
if time = 0 then exit;
Wait(200 + Random(50));
end;
end;
end;

procedure OptionsAre;//odd but effective
begin
if Players[CurrentPlayer].Integers[5] = 0 then CurrentKillTime := 9 else CurrentKillTime := Players[CurrentPlayer].Integers[5];
if Players[CurrentPlayer].Strings[2] = '' then CurrentRunDir := 's' else CurrentRunDir := lowercase(Players[CurrentPlayer].Strings[2]);
if Players[CurrentPlayer].Strings[1] = '' then CurrentStyle := 'even' else CurrentStyle := lowercase(Players[CurrentPlayer].Strings[1]);
CurrentColor1 := Players[CurrentPlayer].Integers[1];
CurrentColor2 := Players[CurrentPlayer].Integers[2];
CurrentColor3 := Players[CurrentPlayer].Integers[3];
if (Players[CurrentPlayer].Integers[3]<3) then CurrentMonsterHP :=3 else CurrentMonsterHP := Players[CurrentPlayer].Integers[3];
CurrentMonsterName := Players[CurrentPlayer].Strings[0];
CurrentFightingType := Players[CurrentPlayer].Integers[0];
If (CurrentPlayer > 0) and (Players[CurrentPlayer].Integers[1]=0) then
begin
CurrentColor1 := Players[0].Integers[0];
CurrentColor2 := Players[0].Integers[1];
CurrentColor3 := Players[0].Integers[2];
CurrentMonsterName := Players[0].Strings[0];
CurrentMonsterHP := Players[0].Integers[3];
end;
If AutoFindColors then
begin
CurrentColor1 := FindObjColorByText(CurrentMonsterName);
wait(2000+random(3000));
CurrentColor2 := FindObjColorByText(CurrentMonsterName);
wait(2000+random(3000));
CurrentColor3 := FindObjColorByText(CurrentMonsterName);
wait(2000+random(3000));
Players[CurrentPlayer].Integers[21] := 1;
if ((CurrentColor1 + CurrentColor2 + CurrentColor3) = 0) then
begin
Players[CurrentPlayer].Integers[21] := 0
Players[CurrentPlayer].Integers[22] := Players[CurrentPlayer].Integers[22] + 1;
if (Players[CurrentPlayer].Integers[22] >= 3) then
begin
Writeln('Failed to get colors, '+Players[CurrentPlayer].Name+' is now inactive.');
LogoutSeq(0);
end else LogoutSeq(1);
end;
end;
end;

Procedure HPNameColorCheck;
begin
if (CurrentColor1 = 0) or (CurrentColor2 = 0) or (CurrentColor3 = 0) then
begin
Logout;
Writeln('Error: Please enter 3 monster colors for player(s).');
terminatescript;
end;
if CurrentMonsterName = '' then
begin
Logout;
Writeln('Error: Please enter monster name(s) for player(s).');
terminatescript;
end;
if CurrentMonsterHP = 0 then
begin
Logout;
Writeln('Error: Please enter monster HP(s) for player(s).');
terminatescript;
end;
end;

procedure NAFset;
Var
x,y,Mode:integer;
begin
if (not(LoggedIn)) then LoginPlayer;
Status('Setting up player: '+Players[CurrentPlayer].Name+'...')
OptionsAre;
HPNameColorCheck;
GetAllLevels;
GameTab(1);
mode := 0;
if not (CurrentFightingType=2) then
begin
case CurrentStyle of
'attack': mode := 1;
'strength': mode := 2;
'defence': mode := 3;
'accurate' : begin
SetFightMode(1);
Hoverskillis := 'range';
end;
'whipdefence' : begin
Setfightmode(3);
Hoverskillis := 'defence';
end;
'rapid' : begin
Setfightmode(2);
Hoverskillis := 'range';
end;
'longrange': begin
Setfightmode(3)
Hoverskillis := 'range';
end;
'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: begin SetfightMode(1); Hoverskillis := 'attack'; end;
2: begin SetfightMode(2); Hoverskillis := 'strength'; end;
3: begin SetfightMode(4); Hoverskillis := 'defence'; end;
end;
end;
if (CurrentFightingType=2) then
begin
SetUpAutoCast(inttostr(MagicSpell), MagicStyle);
Hoverskillis := 'magic';
end;
Retaliate(True);
SetChat2('off', 1);
If (doremote) then SetChat2('friends', 2) else SetChat2('off', 2);
SetChat2('off', 3);
SetChat2('off', 4);
SetChat2('off', 5);
SetRun(True);
HighestBrightness;
if not findcolortolerance(x, y, 10172937, 697, 220, 718, 238, 10) then Mouse(708, 229, 5, 5, true);
if (doremote) then
if (GetColor(695, 385) = 1974404) then
Mouse(695, 375, 15, 10, True);
if (CurrentFightingType=1) then
begin
ArrowStartAmount:=GetArrowCount;
If (ArrowStartAmount <= 200) then
begin
LogoutSeq(0);
exit;
end;
if (pickupammo) then
begin
if (lowercase(ArrowBoltKnives) = 'arrows') then MouseInvTextCustom([AmmoType+' arrow'], 'Weild', false, true, 1, 28, 200, 1);
if (lowercase(ArrowBoltKnives) = 'bolts') then MouseInvTextCustom([AmmoType+' bolt'], 'Weild', false, true, 1, 28, 200, 1);
if (lowercase(ArrowBoltKnives) = 'knives') then MouseInvTextCustom([AmmoType+' kni'], 'Weild', false, true, 1, 28, 200, 1);
end;
end;
Startxp := GetXPof(Hoverskillis,1);
HighestAngle;
outoffood := false;
reportgave := 0;
CharStartTime := Getsystemtime+random(30000);
MarkTime(FailTimer);
MarkTime(RoundTimer);
ClearReport;
ChangeReportWidth(284);
AddtoReport('/~~~' +Scriptname+' v'+Version+' ~~\');
AddtoReport('|________Made by Narcle_________|');
AddtoReport('| Active Players: '+inttostr(ActiveCount)+' False: '+inttostr(HowManyPlayers-ActiveCount)+' |');
AddtoReport('Current Player: '+Players[Currentplayer].Name);
end;

var TArrowAmount,Txp,TKilled,TFoodate,TBonesPicked,TBuried,Tarrowcount,Titemspicked:integer;
procedure ProgressReport;
Var
XPpH, CurRemXP, CurXP, CurAU, XPn, TLm, Killed, I,H,M,S,RoundTime2:integer;
Active,Str1,Str2,Str3,Str4,Str5:string;
begin
if not(loggedin) then loginplayer;
begin
ConvertTime(gettimerunning, H, M, S);
CurXP := GetXPof(Hoverskillis,1);
if (HowManyPlayers = 1) then CurRemXP := GetXPof(Hoverskillis,3);
if ( (CurXP > Startxp) and (CurXP > 0) and (Startxp > 0) ) then XPn := CurXP-Startxp else XPn := 0;
If ( (XPn > 0) ) then Killed := (XPn/(4*CurrentMonsterHP)) else Killed := 1;
TKilled := TKilled+killed;
Txp := (Txp+XPn);//total xp
if (HowManyPlayers = 1) and (CurRemXP>0) and (Txp > 0) then TLm := (CurRemXP)/(Txp/(H*60+m)) else TLm := 1;
if (txp>0) and (HowManyPlayers = 1) then XPpH := (Txp*60)/(H*60+m) else XPpH := 0;
if (CurrentFightingType=1) then if (ArrowStartAmount > GetArrowCount) and (GetArrowCount > 0) then CurAU := ArrowStartAmount - GetArrowCount else CurAU := 0; //current arrows used
if (CurrentFightingType=1) then TArrowAmount := TArrowAmount+CurAU;
TFoodate := TFoodate + foodate;
TBonesPicked := TBonesPicked + BonesPicked;
TBuried := TBuried + Buried;
Tarrowcount := Tarrowcount + arrowcount;
Titemspicked := Titemspicked + itemspicked;
if (HowManyPlayers = 1) then
begin
Cleardebug;
Writeln('|_Single Player__Narcle''s AutoFight v'+Version+' by Narcle___|');
Writeln('| Ran: ' + inttostr(H) + 'h:' + inttostr(M) + 'm:' + inttostr(S)+'s Current Time: '+TheTime+' Start Time: '+StartTime+' |');
WriteLn('| A:'+IntToStr(Players[currentplayer].level[1])+', S:'+IntToStr(Players[currentplayer].level[2])+', D:'+
+IntToStr(Players[currentplayer].level[3])+', R:'+IntToStr(Players[currentplayer].level[4])+
+' Total Kills: '+ inttostr(TKilled)+', Total XP Gained: '+ inttostr(Txp)+', Kills Round: '+ inttostr(Killed)+', XP Round: '+ inttostr(XPn));
WriteLn('| XP/hour: '+inttostr(XPpH)+ ', Estimated time to '+Capitalize(hoverskillis)+' level: '+inttostr((Tlm/60))+' Hour(s) & '+inttostr(tlm-(((Tlm/60)*60)))+' Minutes');
If (CurrentFightingType=1) then writeln('| Ammo remaining: '+inttostr(GetArrowCount)+', Total Ammo used: '+
+inttostr(TArrowAmount)+', Ammo Used/hour: '+inttostr((TArrowAmount*60)/(H*60+m)));
If (CurrentFightingType=1) and (txp>0) then writeln('| XP/ammo:'+inttostr(Txp/TArrowAmount)+', Estimated Ammo Time Remaining: '+
+inttostr(GetArrowCount/((TArrowAmount*60)/(H*60+m)))+' Hour(s) & '+
+inttostr( ((GetArrowCount*60)/((TArrowAmount*60)/(H*60+m)))-((GetArrowCount/((TArrowAmount*60)/(H*60+m)))*60) )+' Minutes'); //Think I could make this equation bigger? lol
If (TBonesPicked > 0) then Str1 := ('Bones picked: '+ inttostr(TBonesPicked) +' Buried: '+inttostr(TBuried)+' | ');
If (Titemspicked > 0) then Str2 := ('Pick ups: ' + inttostr(Titemspicked)+' | ');
If (Tarrowcount > 0)then Str3 := ('Ammo Pickups: '+inttostr(Tarrowcount)+' | ');
If (TFoodate > 0) then Str4 := ('Food ate: '+inttostr(TFoodate)+' | ');
If (StatRgiven > 0) then Str5 := ('Reports given: ' + inttostr(StatRgiven)+' | ');
if (StatRgiven > 0) or (TFoodate > 0) or (Tarrowcount > 0) or
(Titemspicked > 0) or (TBonesPicked > 0) then WriteLn('| '+Str1+Str2+Str3+Str4+Str5);
end;
if (HowManyPlayers > 1) then
begin
Players[currentplayer].Integers[11] := Players[currentplayer].Integers[11] + XPn;
Players[currentplayer].Integers[12] := Players[currentplayer].Integers[12] + killed;
Players[currentplayer].Integers[13] := Players[currentplayer].Integers[13] + CurAU;
Players[currentplayer].Integers[14] := Players[currentplayer].Integers[14] + itemspicked;
Players[currentplayer].Integers[15] := Players[currentplayer].Integers[15] + foodate;
Players[currentplayer].Integers[31] := Players[currentplayer].Integers[31] + TimeFromMark(RoundTimer);
if (Players[currentplayer].Integers[11]>0) and (Players[currentplayer].Integers[31]>0) then
Players[currentplayer].Integers[32] := ((Players[currentplayer].Integers[11]*3600)/(Players[currentplayer].Integers[31]/1000)) else Players[currentplayer].Integers[32] := 0;
ClearDebug;
Writeln('|_Multi-Player__Narcle''s AutoFight v'+Version+' by Narcle___|');
Writeln('| Ran: ' + inttostr(H) + 'h:' + inttostr(M) + 'm:' + inttostr(S)+'s Current Time: '+TheTime+' Start Time: '+StartTime+' |');
WriteLn('| Totals: XP Gained; '+ inttostr(Txp)+', Kills; '+ inttostr(TKilled)+', Food ate; '+inttostr(TFoodate)+', Pickups; '+inttostr(Titemspicked)+', Ammo used; '+inttostr(Tarrowcount)+' |');
writeln(' ________________________________________________________________________________________________');
Writeln('| # | Nick | Active | A S D R | XP gained | Kills | XP/hour | Food ate | Pick-ups | Ammo Used |');
For I := 0 to HowManyPlayers - 1 do
begin
if Players[i].Active=True then Active := 'True' else Active := 'False';
Writeln('| '+IntToStr(I)+' | '+Players[i].Nick+' | '+Active+' | '+IntToStr(Players[i].level[1])+' '+IntToStr(Players[i].level[2])+' '+IntToStr(Players[i].level[3])+' '+IntToStr(Players[i].level[4])+' | XP: '+IntToStr(Players[i].Integers[11])+' | K: '+IntToStr(Players[i].Integers[12])+' | Ate: '+IntToStr(Players[i].Integers[15])+' | PU: '+IntToStr(Players[i].Integers[14])+' | AU: '+IntToStr(Players[i].Integers[13])+' |');
end;
end;
end;
begin//stat updates
ReportVars[0] := Killed;
ReportVars[1] := XPn;
ReportVars[2] := foodate;
ReportVars[3] := BonesPicked;
ReportVars[4] := Buried;
ReportVars[5] := arrowcount;
ReportVars[6] := itemspicked;
ReportVars[7] := CurAU;
SendSRLReport;
end;
if UseFileLogging then
begin
RoundTime2 := (getsystemtime-RoundTimeSTart2)/60000;
WriteINI('NarclesINImain', 'TTimeran',inttostr(strtoint(ReadINI('NarclesINImain', 'TTimeran', AppPath+'\Plugins\NarclesINI.ini'))+RoundTime2), AppPath+'\Plugins\NarclesINI.ini');
WriteINI(ScriptINIid, 'Timeran',inttostr(strtoint(ReadINI(ScriptINIid, 'Timeran', AppPath+'\Plugins\NarclesINI.ini'))+RoundTime2), AppPath+'\Plugins\NarclesINI.ini');
WriteINI(ScriptINIid, 'YourKills',inttostr(strtoint(ReadINI(ScriptINIid, 'YourKills', AppPath+'\Plugins\NarclesINI.ini'))+Killed), AppPath+'\Plugins\NarclesINI.ini');
WriteINI(ScriptINIid, 'XPGained',inttostr(strtoint(ReadINI(ScriptINIid, 'XPGained', AppPath+'\Plugins\NarclesINI.ini'))+XPn), AppPath+'\Plugins\NarclesINI.ini');
RoundTimeStart2 := getsystemtime;
end;
foodate := 0;
BonesPicked := 0;
Buried := 0;
arrowcount := 0;
itemspicked := 0;
AddtoReport('/~~~ Narcle''s AutoFight v'+Version+' ~~\');
AddtoReport('|________Made by Narcle_________|');
AddtoReport('| Active Players: '+inttostr(ActiveCount)+' False: '+inttostr(HowManyPlayers-ActiveCount)+' |');
AddtoReport('Current Player: '+Players[Currentplayer].Name);
end;


procedure LogoutSeq(i:integer);
begin
NAFOutFight;
ProgressReport;
if (i = 0) then nextplayer(false);
if (i = 1) then nextplayer(true);
NAFset;
end;

var BreakMark,StartBreak,Tcount:integer;
procedure RemoteReport;
var
X1, Y2, x, y:integer;
reportmsgis:string;
begin
If (reportgave=0) and (doremote) then
begin
if (FindChatText('From') and FindChatText(remotename) and FindChatText(remotecode)) and
FindColor(X1, Y2, 128, MCX1, MCY1, MCX1 + 30, MCY2) then
begin
reportmsgis := '';
NarcDebug('Remote command detected');
//RemoteLogout
if FindChatText('logout') then
begin
NarcDebug('Logout command given, logging out...');
GameTab(8);
if FindText(x, y, remotename, SmallChars, 520, 200, 750, 470) then
begin
MMouse(x, y, 1, 1);
GetMousePos(x, y);
if IsUpText('Message')then
begin
Mouse(x, y, 3, 3, True);
wait(800+random(500));
Sendtext('aight');
Wait(200 + Random(500));
TypeByte(13);
ProgressReport;
logout;
wait((Rlogouttime*60000)+random(60000));
exit;
end;
end;
end;
//RemoteLogout END
if FindChatText('Kill') then reportmsgis := (inttostr(TKilled)+' '+ Players[CurrentPlayer].Strings[1] +'s killed');
if FindChatText('Combat') then reportmsgis := ('lvl ' + inttostr(GetCombatLevel));
if FindChatText('doing') and (RemoteStat = 1) then reportmsgis := ('fighting still');
if FindChatText('doing') and (RemoteStat = 0) then reportmsgis := ('waiting for hp to regen... sigh');
if not(reportmsgis = '') then
begin
NarcDebug('Remote command detected');
GameTab(8);
if FindText(x, y, remotename, SmallChars, 520, 200, 750, 470) then
begin
NarcDebug('Remote status given');
MMouse(x, y, 1, 1);
GetMousePos(x, y);
if IsUpText('Message') then
begin
Mouse(x, y, 3, 3, True);
wait(800+random(500));
Sendtext(reportmsgis);
Wait(100 + Random(500));
TypeByte(13);
StatRgiven := StatRgiven + 1
reportgave:=1;
end else exit;
end;
end;
end;
end;
end;


procedure SleepnBreak;
var
Hour, Mins, Sec, MSec: Word;
Curtime:integer;
begin
if (SleepOrBreak = 'both') or (SleepOrBreak = 'break') or (SleepOrBreak = 'sleep') then
begin
DecodeTime(Now, Hour, Mins, Sec, MSec);
Curtime := (Hour*100)+mins;
if (SleepOrBreak = 'both') or (SleepOrBreak = 'break') then
begin//break start
if Curtime = 0 then StartBreak:=0;
if Breakmark = 0 then
begin
StartBreak := Curtime;
Breakmark := 1;
end;
if (Curtime >= (StartBreak+BreakAt)) then
begin
ProgressReport;
Logout;
writeln(TheTime+': Taking 7-12 minute break');
wait(210000+random(150000));
PickUpMouse;//stops power save
wait(210000+random(150000));
writeln(TheTime+': Break End');
Breakmark := 0;
nextplayer(true);
NAFset;
end;
end;//break end
if (SleepOrBreak = 'both') or (SleepOrBreak = 'sleep') then
begin//sleep start
if (Curtime = sleepat) or (Curtime = 2000) then //600 = 6am
begin
ProgressReport;
Logout;
writeln(TheTime+': Now going to "sleep"');
Repeat
wait(580000+random(19900));
PickUpMouse; //stops power save
wait(580000+random(19900));
PickUpMouse;
wait(580000+random(19900));
PickUpMouse;
Tcount := Tcount+1;
writeln(TheTime+': ~30min check');
until(Tcount >= SleepFor);
writeln(TheTime+': Wakeup time! Fighting will continue...');
nextplayer(true);
NAFset;
end;
end;//sleep end
end;
end;


function CustomPickup:boolean;
var
i,x,y:integer;
Found:boolean;
begin
for i := 0 to (GetArrayLength(CustomColors)-1) do
begin
if (FindColorSpiralTolerance(x, y, CustomColors[i], MSX1, MSY1, MSX2, MSY2, 6)) then
begin
Found := true;
Break;
end;
end;
if Found then
begin
MMouse(x,y,3,3)
if IsUpTextMultiCustom(['ake','Tak']) then
Mouse(x, y, 1, 1, False);
for i := 0 to (GetArrayLength(CustomPickups)-1) do
begin
if ChooseOption(CustomPickups[i]) then
begin
result := true;
Status('Picking up item...');
itemspicked := itemspicked+1;
RandomsCheck(8);
break;
end;
end;
end;
end;

var
RuneColor:integer;
RuneColorWorks:boolean;
procedure Runepickup;
var
x1, y1, runetxt:integer;
X, Y, Z, H, S, L: extended;
R, G, B, I, tcts: integer;
Points: TPointArray;
Colors: TIntegerArray;
Timer: integer;
begin
if not RuneColorWorks then
begin
tcts:= GetColorToleranceSpeed;
ColorToleranceSpeed(1);
timer:= GetSystemTime;
FindColorsTolerance(Points, 10790318, 10, 10, MSX2-10, MSY2-10, 50);
Colors:= GetColors(Points);
ClearSameIntegers(Colors);
for I:= 0 to High(Colors) do
begin
ColorToRGB(Colors[i], R, G, B)
if (R >= 143) and (R <= 206) then
if (G >= 133) and (G <= 198) then
if (B >= 132) and (B <= 197) then
begin
ColorToHSL(Colors[i], H, S, L);
if (H >= 0) and (H <= 2.15185186564922) then
if (S >= 4.63273548781872) and (S <= 7.99230797886848) then
if (L >= 55.9745094299316) and (L <= 76.9666650772095) then
begin
ColorToXYZ(Colors[i], X, Y, Z);
if (X >= 26.0644902048543) and (X <= 52.2230243548972) then
if (Y >= 26.5397768313005) and (Y <= 53.8902219925496) then
if (Z >= 27.664745696193) and (Z <= 57.0685717815164) then
begin
RuneColor := Colors[i];
break;
end;
end;
end;
end;
ColorToleranceSpeed(tcts);
end;

runetxt := BitmapFromString(29, 7, 'beNpjYPg/wQGOYkPcgQg/G' +
'00xphSaCAMYwEVwsSFcTBMg2uHiaGYSNBZZOx41yIJEGovLF7jspc' +
'RYBiSApgBrFBAMc1yxiRywcIRmO6ZKrFJQAAAj/90I'); {rune txt}
x1:=MSCX;
y1:=MSCY;
if (FindColorSpiralTolerance(x1, y1, RuneColor, MSX1, MSY1, MSX2, MSY2, 3)) then
MMouse(x1, y1, 3, 3);
begin
GetMousePos(x1, y1);
if IsUpTextMultiCustom(['ake','Tak','rune']) then
Mouse(x1, y1, 1, 1, False);
GetMousePos(x1, y1);
if (FindBitmap(runetxt, x1, y1)) then
begin
Mouse(x1, y1, 1, 1, true);
Status('Picking up item...');
itemspicked := itemspicked+1;
RandomsCheck(8);
end else
begin
ChooseOption('move damn mouse away please'); //Lawl
wait(400+random(200));
end;
end;
Freebitmap(runetxt);
end;

var
BoneColorWorks:boolean;
BoneColor:integer;
procedure Bonepickup; //Thanks to Rune Hackers bitmaps
var
x1, y1, Takebonewhite, Takeboneyellow, keBigb:integer;
X, Y, Z, H, S, L: extended;
R, G, B, I, tcts: integer;
Points: TPointArray;
Colors: TIntegerArray;
Timer: integer;
begin
if not BoneColorWorks then
begin
tcts:= GetColorToleranceSpeed;
ColorToleranceSpeed(1);
timer:= GetSystemTime;
FindColorsTolerance(Points, 14343135, 10, 10, MSX2-10, MSY2-10, 61);
Colors:= GetColors(Points);
ClearSameIntegers(Colors);
for I:= 0 to High(Colors) do
begin
ColorToRGB(Colors[i], R, G, B)
if (R >= 188) and (R <= 255) then
if (G >= 179) and (G <= 255) then
if (B >= 178) and (B <= 255) then
begin
ColorToHSL(Colors[i], H, S, L);
if (H >= 0) and (H <= 2.68095242530107) then
if (S >= 0) and (S <= 7.99230797886848) then
if (L >= 73.817648601532) and (L <= 99.5156863212585) then
begin
ColorToXYZ(Colors[i], X, Y, Z);
if (X >= 48.0988252882343) and (X <= 93.5129148091628) then
if (Y >= 49.4779493711955) and (Y <= 98.3750550333117) then
if (Z >= 52.2335661029953) and (Z <= 107.117084931276) then
begin
BoneColor:= Colors[i];
break;
end;
end;
end;
end;
ColorToleranceSpeed(tcts);
end;

begin
keBigb := BitmapFromString(49, 11, 'beNrNlEsKgDAMRHM0d17A' +
'rXfyxhFaCNP8+lHE0EWqYfrojBJxqfPYZxdfG64FBdRpnpQiojUpK' +
'vWESnReRHJlf4U0e2MJkgoVQ41kqTpYX2HfzZsdwKNFCrcRVZQl2+' +
'd5kxkZsDzKzcjZ3Li8z3Vcg7gtpP0MSRmEJC7PN0hC4l7UeLzV0Xa' +
'sq6M+ENsnFxUNuNvk39Wo3K9ph5c='); {ke Big b txt}
Takebonewhite := BitmapFromString(59, 1, 'z78DA737343000324' +
'E086216EEA626A6262EE86034064914937BC00D92E4CBDA8E6581' +
'A9818404854970CBC382689E92F00146F4FAE');
Takeboneyellow := BitmapFromString(59, 1, 'z78DA73737373333' +
'0700393C8C00D43DCD4C5D4C4C41C591C9984C82293B85462DA85' +
'A917D51C4B0313030889EA928117C72431FD050090804D72');
x1:=MSCX;
y1:=MSCY;
if (FindColorSpiralTolerance(x1, y1, BoneColor, 150, 90, 360, 270, 3)) then
begin
MMouse(x1, y1, 3, 3);
GetMousePos(x1, y1);
if IsUpTextMultiCustom(['ake','Tak','Bone','ones']) then
Mouse(x1, y1, 0, 0, False);
if(FindBitmap(Takebonewhite, x1, y1)) or (FindBitmap(Takeboneyellow, x1, y1))
or (FindBitmap(keBigb, x1, y1))then
begin
Mouse(x1, y1, 1, 1, true);
Status('Picking up bone...');
wait(800+random(100));
BonesPicked:=BonesPicked+1;
BoneColorWorks := true;

if (invcount = 28) then//bone bury
begin
gametab(4);
Status('Burying bones...');
for i := 1 to 28 do
begin
MMouseItem(i);
GetMousePos(x1, y1);
if IsUpText('Bury') then
begin
Mouse(x1,y1,1,1,true);
RandomsCheck(4);
Buried:=Buried+1;
end;
end;
end;//bone bury end

end;
end;
Freebitmap(Takebonewhite);
Freebitmap(Takeboneyellow);
Freebitmap(keBigb);
end;
end;


procedure Ammopickup;
var
x, y, c0, c1:integer;
Ammotxt:string;
begin
begin
if (lowercase(ArrowBoltKnives) = 'arrows') then Ammotxt := 'rrow';
if (lowercase(ArrowBoltKnives) = 'bolts') then Ammotxt := 'olt';
if (lowercase(ArrowBoltKnives) = 'knives') then Ammotxt := 'nive';
if (FindcolorTolerance(x, y, c0, 125, 75, 385, 285, 2)) or
(FindcolorTolerance(x, y, c1, 125, 75, 385, 285, 2)) then
MMouse(x, y, 3, 3);
begin
GetMousePos(x, y);
if (IsUpText('Take')) or (IsUpText(Ammotxt))then
begin
Mouse(x, y, 1, 1, False);
GetMousePos(x, y);
if chooseoption(Ammotxt) then
begin
Status('Pick up ammo...');
Mouse(x, y, 1, 1, true);
arrowcount := arrowcount+1;
wait(800+random(100));
end else
ChooseOption('move damn mouse away please');
end;
end;
end;
end;

var SpecUsed1,SpecUsed2:integer;
procedure UseSpecial;
begin
If (Players[CurrentPlayer].Booleans[1]) then
begin
if SpecUsed2 = 0 then begin MarkTime(SpecUsed1); SpecUsed2:=1; end;
if (TimeFromMark(SpecUsed1)>=(110000+random(30000))) and (SpecUsed2=1) then
begin
gametab(1);
Status('Using Special...');
wait(100+random(50));
Mouse(640,421,8,4,true);
MarkTime(SpecUsed1);
SpecUsed2 := 0;
end;
end;
end;

function StatCD(s:string; T,HP:integer):boolean;
var
n:integer;
begin
n := T+random(4);
repeat
Status(s+'... '+inttostr(n));
n := n-1;
RandomsCheck(0);
wait(975);
if not(HP = 0) then
if (HpPercent > HP) then
begin
result:=true;
Break;
end;
if ((Getsystemtime-CharStartTime)>(CurrentKillTime * 60000)) then
begin
logoutSeq(t);
result := true;
Break;
end;
until (n=0)
end;

procedure NAFhpcheck;//Longest check, but not dying is important no?
var
tcts:integer;
begin
if(not(loggedin))then exit;
tcts:= GetColorToleranceSpeed;
ColorToleranceSpeed(1);
begin
if (Players[CurrentPlayer].Booleans[0]) and (outoffood = false) and (HpPercent < 70) then
begin
if(not(loggedin))then exit;
gametab(4);
Status('Looking for food to eat...');
begin
if MouseInvTextCustom(['Eat'], '', true, true, 1, 28, 300, 1) >= 1 then
foodate := foodate+1 else outoffood := true;
end;
end;
if (HpPercent < 30) then
begin
Status('Running away HP% < 30...');
RunAwayDirection(CurrentRunDir);
StatCD('Waiting for out of fight', 15, 30);
Runback;
end;
if (HpPercent < 60) and (outoffood = true) then
begin
Status('HP low, waiting for regen...');
repeat
if StatCD('Waiting for regen', 25, 60) then Break;
if infight then
begin
if StatCD('Waiting till out of fight', 15, 60) then Break;
if (HpPercent < 50) and infight then
begin
Status('Waiting to auto-logout...');
Repeat
wait(5000);
until(not(loggedin))
LogoutSeq(1);
Break;
end;
end;
RandomMovement;
until( (HpPercent > 60) or (not(loggedin)) );
HighestAngle;
end;
end;
ColorToleranceSpeed(tcts);
end;

var MobColorFail,FindMonsterFail:integer;
function NAFfight(name: string; color, tol: integer): boolean;//Derived from Hypersecrets
var
x, y: integer;
begin
result := false;
x:=MSCX;
y:=MSCY;
if FindColorSpiralTolerance(x, y, color, MSX1, MSY1, MSX2, MSY2, Tol) then
begin
MMouse(x, y, 3, 3);
if IsFightAt(x, y) then exit;
wait(150+random(50));
if (pos(name, rs_GetUpText) > 0) then
begin
result := true;
MarkTime(FailTimer);
MobColorFail := 0;
Status('Attacking...');
GetMousePos(x, y);
case Random(2) of
0: begin
Mouse(x, y, 0, 0, false);
if not(ChooseOption('ttack')) then
result := false;
end;
1: Mouse(x, y, 0, 0, true);
end;
end;
end;
end;


function NAFattack:boolean;
var
MobColors: array[0..3] of integer;
i,t: Integer;
dir: string;
begin
if (not (LoggedIn)) or (infight and (not(infightnotattacking))) then Exit;
MobColors[0] := CurrentColor1;
MobColors[1] := CurrentColor2;
MobColors[2] := CurrentColor3;
Status('Looking for monster...');
for i := 0 to 2 do
if (NAFfight(CurrentMonsterName, MobColors[i], 3)) then
begin
NAFOutFight;
result:=true;
end else
begin
MobColorFail := MobColorFail+1;
if (MobColorFail >= 5) then
begin
case Random(4) of
0: dir := 'nswe';
1: dir := 'wens';
2: dir := 'sewn';
3: dir := 'ewns';
end;
for t := 1 to 4 do
for i := 0 to 2 do
if (not (NAFfight(CurrentMonsterName, MobColors[i], 6))) then
begin
if infight then exit;
FindMonsterFail := FindMonsterFail+1;
if FindMonsterFail >= 4 then
begin
HighestBrightness;
FindMonsterFail := 0;
end;
Status('Rotating camera...');
MakeCompass(StrGet(dir, t));
end else
begin
NAFOutFight;
result:=true;
end;
end;
end;
end;

procedure NAFOutFight;
begin
flag;
if (CurrentFightingType=1) or (CurrentFightingType=2) then RandomsCheck(8) else
RandomsCheck(2);
if (InFight) then
begin
Status('Killing Monster...');
repeat
if (not (LoggedIn)) then exit;
Wait(100);
if infightnotattacking then
begin
if ((CurrentFightingType=1) or (CurrentFightingType=2)) then RandomsCheck(8) else RandomsCheck(3);
Status('In fight not attacking.');
if infightnotattacking then exit;
end;
RandomsCheck(0);
NAFhpcheck;
until (not(InFight))
Exit;
end else
Wait(300);
end;

//=============================================Main Execution============================================\\

begin
SetupSRL;
if UseFileLogging then NarclesINI;
DeclarePlayers;
NarcSig;
NAFset;
repeat
If (not(loggedin))then loginplayer;
RemoteReport;
NAFhpcheck;
USEspecial;
NAFattack;
if Players[CurrentPlayer].Booleans[2] then
begin
If not PickUpPriority then NAFOutFight;
If (PickupBones) then Bonepickup;
If (PickupRunes) then Runepickup;
If (PickupAmmo) then Ammopickup;
end;
Stopban;
sleepnbreak;
RandomsCheck(0);
if (TimeFromMark(FailTimer) > 180000) then LogoutSeq(0);
If ((Getsystemtime-CharStartTime)>(CurrentKillTime * 60000)) then logoutSeq(1);
until(false);
end.

Dumpin

2007-12-20 02:00:12

show us the script? just use true and false?

Sir R. M8gic1an

2007-12-20 02:01:44

seems like no matter what it'll always return false. i'm guessing you missed a begin on an if or an else, that would've made the difference.

but yeah showing the script would be best :/

~RM

Narcle

2007-12-20 02:12:20

Posted the script… I couldn't figure it out. And its my damn script. :mad:

munk

2007-12-20 02:59:42

Ive seen this a couple times. never affected anything so I never cared:p

Bobarkinator

2007-12-20 08:12:57

If I remember right it results from having a constant boolean then doing an if const then. where the const is false so it is never true. If will go away if you change the const to true I think, either way it doesn't matter

n3ss3s

2007-12-20 08:20:55

Ahh, now I remember, some time ago someone posted in the scripting help because of this, and somebody said you can't directly use consts, but I tried with string and integer, they worked, I was like wtf, so, make a var,
TehVar := TehConst;
If TehVar Then

Narcle

2007-12-20 09:15:14

But using Booleans as a const will still work right? It seems to work fine for me. Just gives me that gay warning.

mastaraymond

2007-12-20 09:19:04

Here..

program New;
begin
if not false and true then
Writeln('test');
if not false xor true=false and true then
Writeln('hoi');
end.
Try this one :p

Negaal

2007-12-20 12:59:57

Line 1: [Warning] (1:1)

I get these time to time, I'll just make copy of script, and CTRL +Z until it starts working…and i look what i'm taking back, so i know where to look…

Most annoyning is, that it won't give you specific line…

mastaraymond

2007-12-20 17:27:05

From: Negaal
I get these time to time, I'll just make copy of script, and CTRL +Z until it starts working…and i look what i'm taking back, so i know where to look…

Most annoyning is, that it won't give you specific line…

These come when you never end a begin loop.. I guess.

Like,

If true then
Begin;
If False then
Begin;
End;

It somehow, gives some weird errors..

R0b0t1

2007-12-20 20:39:41

It most likely gives strange errors when missing a "begin" because it doesn't know where to start debugging.

Miitchyy

2007-12-21 08:23:52

Means you stuffed up an if, Like Ray said,
I know I've gotten this before but I can't remember how.

begin
if True or False then
end.
Line 2: [Warning] (2:9): Calculation always evaluates to True in script
begin
if False and True then
end.
Line 2: [Warning] (2:10): Calculation always evaluates to False in script