Fitta
2014-11-04 15:29:19
How Long have You Played Runescape?
1 Year(s)
Are you affilated in anyway with Jagex LTD?
No
Were you Referred to SRL?
What is your general programming knowledge?
Java, PHP
Are you a member of any other communities?
All major botting sites
Tell us about yourself…
Please show us one (or multiple) of your scripts.
1 Year(s)
Are you affilated in anyway with Jagex LTD?
No
Were you Referred to SRL?
What is your general programming knowledge?
Java, PHP
Are you a member of any other communities?
All major botting sites
Tell us about yourself…
From: Fitta
17 year old guy studying from home. Got a lot of spare time as my legs are not fully working!
Started playing rs, got tired of it, found this place and made some simple scripts. Now I'm addicted heh.
Also plays CS:GO and Leauge Of Legends.
Since last time I've done a lot of scripting, mostly Aerolib.. Really want to contribute with this script for the old schoolers! I've got a bunch of other scripts too, but this one is the most recent!
Please show us one (or multiple) of your scripts.
program NMZ;
{$DEFINE SMART}
{$i AeroLib/AeroLib.Simba}
{
FORM VARIABLES
}
var
FittForm:TForm;
ButtonArr: array [0..1] of TButton;
ComboBox: TComboBox;
CheckBoxArr: array [0..3] of TCheckBox;
LabelArr: array [0..6] of TLabel;
EditArr: array [0..4] of TEdit;
RunNMZ, SaveForm, LoadForm: Boolean;
{
END OF FORM VARIABLES
}
{
SCRIPT VARIABLES
}
T: Array [0..3] of Timer;
Disconnect: boolean;
{
END OF SCRIPT VARIABLES
}
{
SCRIPT CONSTANTS
}
const
default = 'Arial Black';
Button_OK = 0;
Button_Save = 1;
CheckBox_Prayer = 0;
CheckBox_Abs = 1;
CheckBox_Track = 2;
CheckBox_Logout = 3;
Label_FProg = 0;
Edit_FKEY = 0;
Edit_PrioStart = 1;
Edit_PrioEnd = 2;
Edit_BoostStart = 3;
Edit_BoostEnd = 4;
Timer_Boost = 0;
Timer_WaitPot = 1;
Timer_Flick_Prayer = 2;
Timer_Disconnect = 3;
Bool_Prio_Pot = 0;
Bool_Prio_Out = 1;
Bool_Boost_Out = 2;
Bool_Player_Prayer = 5;
Bool_Player_Abs = 7;
Bool_Player_Logout = 6;
Bool_Player_Track = 8;
Int_DrinkDoses = 1;
Int_Flick_Next = 2;
Int_Prio_NextPot = 3;
Int_Player_PrioStart = 4;
Int_Player_PrioEnd = 5;
Int_Player_BoostStart = 6;
Int_Player_BoostEnd = 7;
Int_Player_fkey = 8;
Int_Player_MaxHP = 9;
Int_Prio_TimeTillPot = 10;
Int_Prayer_TimeTillflick = 11;
Str_Player_Skill = 0;
afterClick = 19;
antiBan = 1300;
{
END OF SCRIPT CONSTANTS
}
{
FORM CODE
}
procedure SaveFormINI;
begin
If Not SaveForm then
Exit;
WriteINI('nmz', 'skill', Me.Strings[Str_Player_Skill], ScriptPath + 'nmzsetup.ini');
WriteINI('nmz', 'prayer', BoolToStr(Me.Booleans[Bool_Player_Prayer]), ScriptPath + 'nmzsetup.ini');
WriteINI('nmz', 'abs', BoolToStr(Me.Booleans[Bool_Player_Abs]), ScriptPath + 'nmzsetup.ini');
WriteINI('nmz', 'logout', BoolToStr(Me.Booleans[Bool_Player_Logout]), ScriptPath + 'nmzsetup.ini');
WriteINI('nmz', 'track', BoolToStr(Me.Booleans[Bool_Player_Track]), ScriptPath + 'nmzsetup.ini');
WriteINI('nmz', 'fkey', IntToStr(Me.Integers[Int_Player_fkey]), ScriptPath + 'nmzsetup.ini');
WriteINI('nmz', 'priostart', IntToStr(Me.Integers[Int_Player_PrioStart]), ScriptPath + 'nmzsetup.ini');
WriteINI('nmz', 'prioend', IntToStr(Me.Integers[Int_Player_PrioEnd]), ScriptPath + 'nmzsetup.ini');
WriteINI('nmz', 'booststart', IntToStr(Me.Integers[Int_Player_BoostStart]), ScriptPath + 'nmzsetup.ini');
WriteINI('nmz', 'boostend', IntToStr(Me.Integers[Int_Player_BoostEnd]), ScriptPath + 'nmzsetup.ini');
Writeln('[Form] .ini file saved with settings..');
end;
procedure procedure_OnClick(sender: TObject);
{$IFNDEF CODEINSIGHT}
native;
{$ENDIF}
begin
case Sender of
CheckBoxArr[CheckBox_Prayer]:
Case CheckBoxArr[CheckBox_Prayer].getState of
cbChecked:
begin
CheckBoxArr[CheckBox_Abs].setVisible(False);
FittForm.SetBounds(400, 320, 180, 320);
CheckBoxArr[CheckBox_Prayer].SetBounds(15, 15, 150, 150);
LabelArr[1].setCaption('Prayer');
LabelArr[1].SetBounds(50, 155, 50, 50);
end;
cbUnchecked:
begin
CheckBoxArr[CheckBox_Abs].setVisible(True);
FittForm.SetBounds(400, 320, 320, 50);
CheckBoxArr[CheckBox_Prayer].SetBounds(15, 15, 150, 150);
end;
end;
CheckBoxArr[CheckBox_Abs]:
Case CheckBoxArr[CheckBox_Abs].getState of
cbChecked:
begin
CheckBoxArr[CheckBox_Prayer].setVisible(False);
FittForm.SetBounds(400, 320, 180, 320);
CheckBoxArr[CheckBox_ABS].SetBounds(15, 15, 150, 150);
LabelArr[1].setCaption('Absorption');
LabelArr[1].SetBounds(40, 155, 50, 50);
end;
cbUnchecked:
begin
CheckBoxArr[CheckBox_Prayer].setVisible(True);
FittForm.SetBounds(400, 320, 320, 50);
CheckBoxArr[CheckBox_ABS].SetBounds(15+145, 15, 150, 150);
end;
end;
CheckBoxArr[CheckBox_Track]:
Case CheckBoxArr[CheckBox_Track].getState of
cbChecked:
begin
ComboBox.setEnabled(True);
EditArr[Edit_FKEY].setEnabled(True);
LabelArr[Label_FProg].setEnabled(True);
end;
cbUnchecked:
begin
ComboBox.setEnabled(False);
ComboBox.setCaption('Style of combat?');
EditArr[Edit_FKEY].setEnabled(False);
LabelArr[Label_FProg].setEnabled(False);
end;
end;
ButtonArr[Button_Save]:
begin
SaveForm := True;
Client.WriteLn('[FORM] Will save these settings when start..');
end;
ButtonArr[Button_OK]:
begin
Me.Booleans[Bool_Player_Prayer] := (CheckBoxArr[CheckBox_Prayer].getState = cbChecked);
Me.Booleans[Bool_Player_Abs] := (CheckBoxArr[CheckBox_Abs].getState = cbChecked);
Me.Booleans[Bool_Player_Logout] := (CheckBoxArr[CheckBox_Logout].getState = cbChecked);
Me.Booleans[Bool_Player_Track] := (CheckBoxArr[CheckBox_Track].getState = cbChecked);
Me.Integers[Int_Player_PrioStart] := StrToIntDef(EditArr[Edit_PrioStart].getCaption, -1);
Me.Integers[Int_Player_PrioEnd] := StrToIntDef(EditArr[Edit_PrioEnd].getCaption, -1);
Me.Integers[Int_Player_BoostStart] := StrToIntDef(EditArr[Edit_BoostStart].getCaption, -1);
Me.Integers[Int_Player_BoostEnd] := StrToIntDef(EditArr[Edit_BoostEnd].getCaption, -1);
Me.Integers[Int_Player_fkey] := StrToIntDef(EditArr[Edit_FKEY].getCaption, -1);
Me.Strings[Str_Player_Skill] := ComboBox.getCaption;
Writeln('[FORM] OK -> Script start');
RunNMZ := True;
FittForm.Close;
end;
end;
end;
procedure InitForm;
{$IFNDEF CODEINSIGHT}
native;
{$ENDIF}
var
I: Integer;
t_Bool: Boolean;
begin
FittForm.Init(nil);
with FittForm do
begin
SetCaption('Nightmare Zone');
SetBounds(408, 321, 320, 50);
SetPosition(poScreenCenter);
SetBorderStyle(bsDialog);
SetColor(16777215);
GetFont().SetName(default);
GetFont().SetColor(536870912);
GetFont().SetSize(11);
end;
For I:=0 to High(ButtonArr)do
begin
ButtonArr[I].Init(FittForm);
with ButtonArr[I] do
begin
SetParent(FittForm);
SetBounds(20+(I*75), 275, 60, 25);
SetOnClick(procedure_OnClick);
GetFont().SetName(default);
GetFont().SetColor(536870912);
GetFont().SetSize(9);
end;
end;
ButtonArr[Button_OK].SetCaption('Start');
ButtonArr[Button_Save].SetCaption('Save');
ComboBox.Init(FittForm);
With ComboBox do
begin
SetParent(FittForm);
SetBounds(15, 100, 140, 28);
SetEnabled(False);
setCaption('Style of combat?');
GetItems().Add('Attack');
GetItems().Add('Strength');
GetItems().Add('Defence');
GetItems().Add('Range');
GetItems().Add('Mage');
SetOnClick(procedure_OnClick);
GetFont().SetName(default);
GetFont().SetColor(536870912);
GetFont().SetSize(7);
end;
For I:=0 to High(CheckBoxArr)do
begin
CheckBoxArr[I].Init(FittForm);
With CheckBoxArr[I] do
begin
SetParent(FittForm);
getFont().SetSize(7);
SetOnClick(procedure_OnClick);
SetBounds(15+(I*145), 15, 150, 150);
end;
end;
CheckBoxArr[CheckBox_Prayer].SetCaption('Using Prayer?');
CheckBoxArr[CheckBox_Abs].SetCaption('Using Absorption?');
CheckBoxArr[CheckBox_Logout].SetCaption('Logout when done?');
CheckBoxArr[CheckBox_Logout].SetBounds(15, 50, 150, 150);
CheckBoxArr[CheckBox_Track].SetCaption('Track experience?');
CheckBoxArr[CheckBox_Track].SetBounds(15, 70, 150, 150);
For I:=0 to High(LabelArr)do
begin
LabelArr[I].Init(FittForm);
With LabelArr[I] do
begin
SetParent(FittForm);
getFont().SetSize(7);
SetBounds(15, 130+(I*40), 50, 50);
SetVisible(False);
end;
end;
LabelArr[Label_FProg].setCaption('F for progress');
LabelArr[Label_FProg].setVisible(True);
LabelArr[Label_FProg].SetBounds(35, 130, 50, 50);
LabelArr[Label_FProg].setEnabled(False);
LabelArr[1].setCaption('Absorption');
LabelArr[1].getFont().SetSize(9);
LabelArr[1].setVisible(True);
LabelArr[1].SetBounds(40, 155, 50, 50);
LabelArr[2].setCaption('Start');
LabelArr[2].getFont().SetSize(6);
LabelArr[2].setVisible(True);
LabelArr[2].SetBounds(25, 185, 50, 50);
LabelArr[3].setCaption('End');
LabelArr[3].getFont().SetSize(6);
LabelArr[3].setVisible(True);
LabelArr[3].SetBounds(95, 185, 50, 50);
LabelArr[4].setCaption('Overloads');
LabelArr[4].getFont().SetSize(9);
LabelArr[4].setVisible(True);
LabelArr[4].SetBounds(40, 215, 50, 50);
LabelArr[5].setCaption('Start');
LabelArr[5].getFont().SetSize(6);
LabelArr[5].setVisible(True);
LabelArr[5].SetBounds(25, 245, 50, 50);
LabelArr[6].setCaption('End');
LabelArr[6].getFont().SetSize(6);
LabelArr[6].setVisible(True);
LabelArr[6].SetBounds(95, 245, 50, 50);
For I:=0 to High(EditArr)do
begin
EditArr[I].Init(FittForm);
EditArr[I].setMaxLength(2);
With EditArr[I] do
begin
SetParent(FittForm);
SetBounds(50, 100+(I*40), 50, 50);
getFont().SetSize(7);
end;
end;
EditArr[EDIT_FKEY].SetBounds(44, 127, 15, 12);
EditArr[EDIT_FKEY].setEnabled(False);
EditArr[EDIT_FKEY].setMaxLength(1);
EditArr[EDIT_PrioStart].SetBounds(55, 180, 22, 12);
EditArr[Edit_PrioEnd].SetBounds(120, 180, 22, 12);
EditArr[Edit_BoostStart].SetBounds(55, 240, 22, 12);
EditArr[Edit_BoostEnd].SetBounds(120, 240, 22, 12);
If LoadForm then
begin
If Me.Booleans[Bool_Player_Prayer] then
begin
CheckBoxArr[CheckBox_Abs].setVisible(False);
CheckBoxArr[CheckBox_Prayer].setState(cbChecked);
FittForm.SetBounds(400, 320, 180, 320);
CheckBoxArr[CheckBox_Prayer].SetBounds(15, 15, 150, 150);
LabelArr[1].setCaption('Prayer');
LabelArr[1].SetBounds(60, 155, 50, 50);
end;
If Me.Booleans[Bool_Player_Abs] then
begin
CheckBoxArr[CheckBox_Prayer].setVisible(False);
CheckBoxArr[CheckBox_Abs].setState(cbChecked);
FittForm.SetBounds(400, 320, 180, 320);
CheckBoxArr[CheckBox_ABS].SetBounds(15, 15, 150, 150);
LabelArr[1].setCaption('Absorption');
end;
If Me.Booleans[Bool_Player_Logout] then
CheckBoxArr[CheckBox_Logout].setState(cbChecked);
If Me.Booleans[Bool_Player_Track] then
begin
CheckBoxArr[CheckBox_Track].setState(cbChecked);
ComboBox.setEnabled(True);
EditArr[Edit_FKEY].setEnabled(True);
LabelArr[Label_FProg].setEnabled(True);
ComboBox.setCaption(Me.Strings[Str_Player_Skill]);
end;
EditArr[Edit_PrioStart].setCaption(IntToStr(Me.Integers[Int_Player_PrioStart]));
EditArr[Edit_PrioEnd].setCaption(IntToStr(Me.Integers[Int_Player_PrioEnd]));
EditArr[Edit_BoostStart].setCaption(IntToStr(Me.Integers[Int_Player_BoostStart]));
EditArr[Edit_BoostEnd].setCaption(IntToStr(Me.Integers[Int_Player_BoostEnd]));
EditArr[Edit_FKEY].setCaption(IntToStr(Me.Integers[Int_Player_fkey]));
end;
FittForm.ShowModal;
end;
procedure Free;
{$IFNDEF CODEINSIGHT}
native;
{$ENDIF}
begin
if (FittForm = nil) then
exit();
client.writeln('[FORM] Freeing form..');
FittForm.free;
end;
procedure ShowForm();
begin
try
sync(InitForm);
except
writeln('ERROR: Failed to initialize form');
finally
sync(Free);
end;
end;
Procedure LoadINI;
begin
If FileExists(ScriptPath + 'nmzsetup.ini')then
begin
Me.Strings[Str_Player_Skill] := ReadINI('nmz', 'skill', ScriptPath + 'nmzsetup.ini');
Me.Booleans[Bool_Player_Prayer] := StrToBoolDef(ReadINI('nmz', 'prayer', ScriptPath + 'nmzsetup.ini'), False);
Me.Booleans[Bool_Player_Abs] := StrToBoolDef(ReadINI('nmz', 'abs', ScriptPath + 'nmzsetup.ini'), False);
Me.Booleans[Bool_Player_Logout] := StrToBoolDef(ReadINI('nmz', 'logout', ScriptPath + 'nmzsetup.ini'), False);
Me.Booleans[Bool_Player_Track] := StrToBoolDef(ReadINI('nmz', 'track', ScriptPath + 'nmzsetup.ini'), False);
Me.Integers[Int_Player_PrioStart] := StrToIntDef(ReadINI('nmz', 'priostart', ScriptPath + 'nmzsetup.ini'), 0);
Me.Integers[Int_Player_PrioEnd] := StrToIntDef(ReadINI('nmz', 'prioend', ScriptPath + 'nmzsetup.ini'), 0);
Me.Integers[Int_Player_BoostStart] := StrToIntDef(ReadINI('nmz', 'booststart', ScriptPath + 'nmzsetup.ini'), 0);
Me.Integers[Int_Player_BoostEnd] := StrToIntDef(ReadINI('nmz', 'boostend', ScriptPath + 'nmzsetup.ini'), 0);
Me.Integers[Int_Player_fkey] := StrToIntDef(ReadINI('nmz', 'fkey', ScriptPath + 'nmzsetup.ini'), 0);
LoadForm := True;
end;
end;
{
END OF FORM CODE
}
{
NIGHTMARE ZONE CODE
}
procedure Debug(func, res, text: String);
var
S: String;
begin
S := '[NMZ] ' + Func;
If not (res = '') then
S := S + ': ' + res;
If not (text = '') then
S := S + ' - ' + Text;
Writeln(S);
end;
procedure Debug_screen(log: string);
begin
if (not directoryExists(ScriptPath + 'nmz\')) then
forceDirectories(ScriptPath + 'nmz\');
try
saveScreenshot(ScriptPath + 'nmz\' + theDate(DATE_FORMAL) + ', ' + log + '.png');
except
Writeln('Failed to save screenshot of: ' + log);
end;
end;
Procedure PrintSetup;
var
S: String;
begin
If Me.Booleans[Bool_Player_Prayer] then
begin
S := 'Prayer potions';
T[Timer_Flick_Prayer].START;
Me.Integers[Int_Prio_NextPot] := 7+Random(19);
end else
S := 'Absorption potions';
Writeln('[Setup]');
Writeln(' ' + S + ' - Start: ' + IntToStr(Me.Integers[Int_Player_PrioStart]) + ' End: ' + IntToStr(Me.Integers[Int_Player_PrioEnd]));
Writeln(' Overload potions - Start: ' + IntToStr(Me.Integers[Int_Player_BoostStart]) + ' End: ' + IntToStr(Me.Integers[Int_Player_BoostEnd]));
Writeln(' logOut when done: ' + BoolToStr(Me.Booleans[Bool_Player_Logout]));
Writeln(' Track experience: ' + BoolToStr(Me.Booleans[Bool_Player_Track]));
If Me.Booleans[Bool_Player_Track] then
begin
Writeln(' FKey for progress: ' + IntToStr(Me.Integers[Int_Player_fkey]));
Writeln(' Skill of choice: ' + Me.Strings[Str_Player_Skill] );
end;
Writeln('[End of Setup]');
end;
function getAbsText: integer;
var
I: Integer;
S: String;
begin
Result := 200;
For I:=8 downto 1 do
begin
S := getChatBoxText(I, 24320);
If (S = '')then
Continue;
S := GetNumbers(S);
Result := StrToIntDef(S, 200);
Break;
end;
end;
procedure mouseHandle(B: TBox; mouse_type: Integer);
begin
If Not mouseInBox(B)then
MouseBox(B, mouse_Type)
else
if Random(2) = 0 then
fastClick(mouse_Type)
else
MouseBox(B, mouse_Type);
end;
function MouseOnScreen: boolean;
var
x, y: integer;
begin
GetMousePos(x, y);
Result := PointInBox(Point(x, y), IntToBox(0, 0, 760, 500));
end;
procedure mouseOffScreen;
begin
If MouseOnScreen then
MMouseOffClient('rand');
end;
Procedure mightOffScreen;
begin
If Random(10) = 0 then
mouseOffScreen;
end;
function Tab(i: integer): boolean;
begin
Case Random(8)of
0: Result := FTab(I);
1..7: Result := gameTab(I);
end;
end;
procedure beHuman(i: Integer);
begin
If Not MouseOnScreen then
Exit;
Case Random(I)of
0..3: mouseOffScreen;
4..8: setCompass(Random(361));
9: randomMovement;
10: randomFKeys(True);
11: Tab(TAB_STATS);
12..16: SleepAndMoveMouse(200+Random(2000));
17: randomRClick;
end;
end;
procedure flickPrayer;
begin
If (Not isLoggedIn)or(Me.Booleans[Bool_Player_Prayer]) then
Exit;
If T[Timer_Flick_Prayer].timeElapsed() > Me.Integers[Int_Prayer_TimeTillflick] then
begin
Me.Integers[Int_Prayer_TimeTillflick] := 15000+Random(17000);
Debug('flickPrayer', 'clicking..', 'Next at ' + msToTime(Me.Integers[Int_Prayer_TimeTillflick], TIME_SHORT));
MouseBox(523, 96, 564, 114, 5, MOUSE_LEFT);
Wait(800+Random(500));
Case Random(3) of
0: MouseBox(523, 96, 564, 114, 5, MOUSE_LEFT);
1, 2: fastClick(MOUSE_LEFT);
end;
T[Timer_Flick_Prayer].START;
end;
end;
function InteractInv(startSearch, endSearch: Integer; upText: String): boolean;
var
I: Integer;
B: TBox;
S: String;
begin
If (Not isLoggedIn)or(Not Tab(TAB_INV)) then
Exit(False);
For I:=startSearch to endSearch do
If itemInSlot(I) then
begin
B := invBox(I);
mouseHandle(B, mouse_Move);
If waitUpTextMulti([upText, 'ial', 'teel'], 250+Random(100))then
begin
Debug('InteractInv', 'Found item in search area', '(Slot: ' + ToStr(I) + ' - Cords: ' + ToStr(B) + ')');
If waitUpTextMulti(['Vial', 'teel'], 50+Random(50))then
begin
Debug('InteractInv', 'Item is an vial', 'Vial -> Dropping');
interactSlot(I, 'Drop');
Continue;
end else
If (Random(10) = 0) then
begin
fastClick(mouse_Right);
if not waitOption('rink', 250+Random(100))then
Debug('waitOption', 'troubling with ''rink''', '');
end else
fastClick(mouse_Left);
Result := True;
Exit;
end;
end;
end;
Procedure drink_Potions;
var
t_Int: Integer;
begin
{If OverLoad then}
t_Int := getCurrentHealth;
If (t_Int > 50)and(not Me.Booleans[Bool_Boost_Out])and(T[Timer_Boost].timeElapsed > 40000) then
begin
Debug('drink_Potions', 'Full HP -> Overload', 'HP is ' + ToStr(t_Int));
If Not Me.Booleans[Bool_Boost_Out] then
Me.Booleans[Bool_Boost_Out] := (Not InteractInv(Me.Integers[Int_Player_BoostStart], Me.Integers[Int_Player_BoostEnd], 'load'));
If Me.Booleans[Bool_Boost_Out] then
Debug('drink_Potions', 'Out of overloads', '')
else
begin
beHuman(afterClick);
T[Timer_Boost].start;
end;
end;
{If LowPray then}
t_Int := getPrayerPoints;
If (t_Int < Me.Integers[Int_Prio_NextPot])and(Me.Booleans[Bool_Player_Prayer])and(Not Me.Booleans[Bool_Boost_Out])then
begin
Me.Integers[Int_Prio_NextPot] := 7+Random(19);
Debug('drink_Potions', 'Low prayer -> Prayer potion', 'Prayer is ' + ToStr(t_Int) + ' - Next pot at ' + ToStr(Me.Integers[Int_Prio_NextPot]));
If Not Me.Booleans[Bool_Prio_Out] then
Me.Booleans[Bool_Prio_Out] := (Not InteractInv(Me.Integers[Int_Player_PrioStart], Me.Integers[Int_Player_PrioEnd], 'rayer'));
If not t_Int = Me.Integers[Int_Player_BoostStart] then
Me.Integers[Int_Player_BoostStart] := t_Int;
If Me.Booleans[Bool_Boost_Out] then
Debug('drink_Potions', 'Out of prayer potions', '')
else
beHuman(afterClick);
end;
{If AbsLow then}
t_Int := getAbsText;
If (t_Int < 200)and(Not Me.Booleans[Bool_Prio_Pot])and(Me.Booleans[Bool_Player_Abs])and(not Me.Booleans[Bool_Prio_Out]) then
begin
Me.Integers[Int_DrinkDoses] := 3+Random(12);
T[Timer_WaitPot].start;
Me.Booleans[Bool_Prio_Pot] := True;
Me.Integers[Int_Prio_TimeTillPot] := 1000*Random(30);
Debug('drink_Potions', 'Int_DrinkDoses: ' + ToStr(Me.Integers[Int_DrinkDoses]) + ' - Time to pot: ' + msToTime(Me.Integers[Int_Prio_TimeTillPot], TIME_SHORT) + ' -> POT_Prio := True', '');
end;
{If Prio_Pot then}
If (Me.Booleans[Bool_Prio_Pot])and(T[Timer_WaitPot].timeElapsed() > Me.Integers[Int_Prio_TimeTillPot])then
begin
Debug('drink_Potions', 'Bool_Prio_Pot := False', '');
Me.Booleans[Bool_Prio_Pot] := False;
For t_Int:=1 to Me.Integers[Int_DrinkDoses] do
If Not Me.Booleans[Bool_Prio_Out] then
begin
flickPrayer;
Me.Booleans[Bool_Prio_Out] := (Not InteractInv(Me.Integers[Int_Player_PrioStart], Me.Integers[Int_Player_PrioEnd], 'rink'));
Wait(700+Random(500));
end;
If Me.Booleans[Bool_Prio_Out] then
Debug('drink_Potions', 'Out of absorption potions', '')
else
beHuman(afterClick);
end;
end;
function outside_NMZ: boolean;
var
I: Integer;
S: String
begin
For I:=8 downto 1 do
begin
S := getChatBoxText(I, 0);
If (S = '')then
Continue;
Result := (Pos('wake up feeling', S) > 1)
If Result then
Exit;
end;
end;
procedure Disconnected;
begin
If (Disconnect)or(isLoggedIn) then
begin
Debug('Disconnected', 'Seems like we re-connected', 'Ending timer');
Disconnect := False;
end;
If (Not isLoggedIn)and(Not Disconnect)then
begin
Debug('Disconnected', 'Not LoggedIn', 'Starting timer in case of reconnect');
Disconnect := True;
T[Timer_Disconnect].start;
end;
If (Disconnect)and(T[Timer_Disconnect].timeElapsed > 8000)then
begin
Debug('Disconnected', 'We have waited for 8 secs being logged out', 'Logging out/Terminate');
TerminateScript;
end;
end;
function findPowerUp: boolean;
var
I, H: Integer;
Colors, PS: TIntegerArray;
TPA, tTPA: TPointArray;
ATPA: T2DPointArray;
Boxes: TBoxArray;
begin
If Not IsLoggedIn then
Exit;
Colors := [8073615, 7876236, 9184925];
For I:=0 to 2 do
if FindColorsTolerance(tTPA, Colors[I], MSX1, MSY1, MSX2, MSY2, 10)then
TPA := CombineTPA(TPA, tTPA);
If Length(TPA) = 0 then
Exit;
ATPA := TPAtoATPA(TPA, 30);
H := High(ATPA);
For I:=0 to H do
begin
Inc(C);
SetLength(Boxes, C);
Boxes[C-1] := PointToBox(MiddleTPA(ATPA[I]), 10);
end;
OS_SMART.__Graphics.DrawBoxes(Boxes, clRed, False);
PS := pixelShiftMulti(Boxes, 400);
H := High(PS);
For I:=0 to H do
If PS[I] > 0 then
begin
mouse(MiddleBox(Boxes[I]), 0, 0, MOUSE_MOVE);
If waitUptext('apper', 200+Random(100))then
begin
Debug('findPowerUp', 'Found', 'PixelShift: ' + ToStr(PS[I]));
Case Random(4)of
0:
begin
fastClick(mouse_Right);
Result := waitOption('ctivate', 300+Random(100));
end;
1..3:
begin
fastClick(mouse_Left);
Result := didClick(True, 500+Random(250));
end;
end;
If Result then
Exit;
end;
end;
end;
begin
initAL;
SetLength(Me.Integers, 100);
SetLength(Me.Strings, 100);
SetLength(Me.Booleans, 100);
LoadINI;
ShowForm();
SaveFormINI;
If Not RunNMZ then
begin
Writeln('[Form] Exit form -> Script terminate');
TerminateScript;
end;
PrintSetup;
Debug('Mainloop', 'Entering loop', '');
repeat
drink_Potions;
flickPrayer;
beHuman(antiBan);
mightOffScreen;
Disconnected;
//findPowerUp;
until(outside_NMZ);
Debug('Mainloop', 'We woke from our dream', 'LoggedIn: ' + ToStr(isLoggedIn) + ' - outside_NMZ: ' + ToStr(outside_NMZ));
If Me.Booleans[Bool_Player_Logout] then
logoutPlayer;
end.
{
END OF NIGHTMARE ZONE CODE
}