Code:
//This is for Form1.h (Display of the trainer) //
#pragma once
namespace DNS {
using namespace System;
using namespace System::ComponentModel;
using namespace System::Collections;
using namespace System::Windows::Forms;
using namespace System::Data;
using namespace System::Drawing;
using namespace System::IO;
/// <summary>
/// Summary for Form1
/// </summary>
public ref class Form1 : public System::Windows::Forms::Form
{
public:
Form1(void)
{
InitializeComponent();
//
//TODO: Add the constructor code here
//
}
protected:
/// <summary>
/// Clean up any resources being used.
/// </summary>
~Form1()
{
if (components)
{
delete components;
}
}
System::Windows::Forms::ListViewItem^ listViewItem;
private: System::Windows::Forms::Label^ label1;
protected:
private: System::Windows::Forms::Label^ label2;
private: System::Windows::Forms::Label^ label3;
private: System::Windows::Forms::Timer^ timer1;
private: System::Windows::Forms::GroupBox^ groupBox1;
private: System::Windows::Forms::Button^ cmdCopy;
private: System::Windows::Forms::GroupBox^ groupBox2;
private: System::Windows::Forms::CheckBox^ chkAnimation;
private: System::Windows::Forms::CheckBox^ chkNOCD;
private: System::Windows::Forms::CheckBox^ chkWallhack;
private: System::Windows::Forms::ComboBox^ comboBox1;
private: System::Windows::Forms::GroupBox^ groupBox3;
private: System::Windows::Forms::ListView^ listView1;
private: System::Windows::Forms::ColumnHeader^ columnHeader1;
private: System::Windows::Forms::ColumnHeader^ columnHeader2;
private: System::Windows::Forms::ColumnHeader^ columnHeader3;
private: System::Windows::Forms::ColumnHeader^ columnHeader4;
private: System::Windows::Forms::Button^ cmdLoad;
private: System::Windows::Forms::Button^ cmdSave;
private: System::Windows::Forms::Button^ cmdTeleport;
private: System::Windows::Forms::Button^ cmdClear;
private: System::Windows::Forms::Button^ cmdAdd;
private: System::Windows::Forms::TextBox^ txtName;
private: System::Windows::Forms::Label^ label6;
private: System::Windows::Forms::Label^ label5;
private: System::Windows::Forms::Label^ label4;
private: System::Windows::Forms::SaveFileDialog^ saveFileDialog1;
private: System::Windows::Forms::OpenFileDialog^ openFileDialog1;
private: System::Windows::Forms::NumericUpDown^ numericDropDownX;
private: System::Windows::Forms::NumericUpDown^ numericDropDownY;
private: System::Windows::Forms::NumericUpDown^ numericDropDownZ;
private: System::Windows::Forms::Label^ label7;
private: System::ComponentModel::IContainer^ components;
private:
/// <summary>
/// Required designer variable.
/// </summary>
#pragma region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
void InitializeComponent(void)
{
this->components = (gcnew System::ComponentModel::Container());
this->label1 = (gcnew System::Windows::Forms::Label());
this->timer1 = (gcnew System::Windows::Forms::Timer(this->components));
this->label2 = (gcnew System::Windows::Forms::Label());
this->label3 = (gcnew System::Windows::Forms::Label());
this->groupBox1 = (gcnew System::Windows::Forms::GroupBox());
this->cmdCopy = (gcnew System::Windows::Forms::Button());
this->label6 = (gcnew System::Windows::Forms::Label());
this->label5 = (gcnew System::Windows::Forms::Label());
this->label4 = (gcnew System::Windows::Forms::Label());
this->groupBox2 = (gcnew System::Windows::Forms::GroupBox());
this->comboBox1 = (gcnew System::Windows::Forms::ComboBox());
this->chkAnimation = (gcnew System::Windows::Forms::CheckBox());
this->chkNOCD = (gcnew System::Windows::Forms::CheckBox());
this->chkWallhack = (gcnew System::Windows::Forms::CheckBox());
this->groupBox3 = (gcnew System::Windows::Forms::GroupBox());
this->numericDropDownX = (gcnew System::Windows::Forms::NumericUpDown());
this->numericDropDownY = (gcnew System::Windows::Forms::NumericUpDown());
this->numericDropDownZ = (gcnew System::Windows::Forms::NumericUpDown());
this->txtName = (gcnew System::Windows::Forms::TextBox());
this->cmdLoad = (gcnew System::Windows::Forms::Button());
this->cmdSave = (gcnew System::Windows::Forms::Button());
this->cmdTeleport = (gcnew System::Windows::Forms::Button());
this->cmdClear = (gcnew System::Windows::Forms::Button());
this->cmdAdd = (gcnew System::Windows::Forms::Button());
this->listView1 = (gcnew System::Windows::Forms::ListView());
this->columnHeader1 = (gcnew System::Windows::Forms::ColumnHeader());
this->columnHeader2 = (gcnew System::Windows::Forms::ColumnHeader());
this->columnHeader3 = (gcnew System::Windows::Forms::ColumnHeader());
this->columnHeader4 = (gcnew System::Windows::Forms::ColumnHeader());
this->saveFileDialog1 = (gcnew System::Windows::Forms::SaveFileDialog());
this->openFileDialog1 = (gcnew System::Windows::Forms::OpenFileDialog());
this->label7 = (gcnew System::Windows::Forms::Label());
this->groupBox1->SuspendLayout();
this->groupBox2->SuspendLayout();
this->groupBox3->SuspendLayout();
(cli::safe_cast<System::ComponentModel::ISupportInitialize^ >(this->numericDropDownX))->BeginInit();
(cli::safe_cast<System::ComponentModel::ISupportInitialize^ >(this->numericDropDownY))->BeginInit();
(cli::safe_cast<System::ComponentModel::ISupportInitialize^ >(this->numericDropDownZ))->BeginInit();
this->SuspendLayout();
//
// label1
//
this->label1->AutoSize = true;
this->label1->Location = System::Drawing::Point(26, 15);
this->label1->Name = L"label1";
this->label1->Size = System::Drawing::Size(13, 13);
this->label1->TabIndex = 0;
this->label1->Text = L"0";
//
// timer1
//
this->timer1->Enabled = true;
this->timer1->Interval = 50;
this->timer1->Tick += gcnew System::EventHandler(this, &Form1::timer1_Tick);
//
// label2
//
this->label2->AutoSize = true;
this->label2->Location = System::Drawing::Point(26, 28);
this->label2->Name = L"label2";
this->label2->Size = System::Drawing::Size(13, 13);
this->label2->TabIndex = 1;
this->label2->Text = L"0";
//
// label3
//
this->label3->AutoSize = true;
this->label3->Location = System::Drawing::Point(26, 41);
this->label3->Name = L"label3";
this->label3->Size = System::Drawing::Size(13, 13);
this->label3->TabIndex = 2;
this->label3->Text = L"0";
//
// groupBox1
//
this->groupBox1->Controls->Add(this->cmdCopy);
this->groupBox1->Controls->Add(this->label6);
this->groupBox1->Controls->Add(this->label5);
this->groupBox1->Controls->Add(this->label3);
this->groupBox1->Controls->Add(this->label4);
this->groupBox1->Controls->Add(this->label2);
this->groupBox1->Controls->Add(this->label1);
this->groupBox1->Location = System::Drawing::Point(271, 13);
this->groupBox1->Margin = System::Windows::Forms::Padding(3, 2, 3, 2);
this->groupBox1->Name = L"groupBox1";
this->groupBox1->Padding = System::Windows::Forms::Padding(3, 2, 3, 2);
this->groupBox1->Size = System::Drawing::Size(124, 89);
this->groupBox1->TabIndex = 3;
this->groupBox1->TabStop = false;
this->groupBox1->Text = L" Coordinates ";
//
// cmdCopy
//
this->cmdCopy->ForeColor = System::Drawing::Color::Black;
this->cmdCopy->Location = System::Drawing::Point(6, 59);
this->cmdCopy->Margin = System::Windows::Forms::Padding(3, 2, 3, 2);
this->cmdCopy->Name = L"cmdCopy";
this->cmdCopy->Size = System::Drawing::Size(111, 24);
this->cmdCopy->TabIndex = 3;
this->cmdCopy->Text = L"Copy";
this->cmdCopy->UseVisualStyleBackColor = true;
this->cmdCopy->Click += gcnew System::EventHandler(this, &Form1::cmdCopy_Click);
//
// label6
//
this->label6->AutoSize = true;
this->label6->Location = System::Drawing::Point(11, 41);
this->label6->Name = L"label6";
this->label6->Size = System::Drawing::Size(17, 13);
this->label6->TabIndex = 2;
this->label6->Text = L"Z:";
//
// label5
//
this->label5->AutoSize = true;
this->label5->Location = System::Drawing::Point(11, 28);
this->label5->Name = L"label5";
this->label5->Size = System::Drawing::Size(17, 13);
this->label5->TabIndex = 1;
this->label5->Text = L"Y:";
//
// label4
//
this->label4->AutoSize = true;
this->label4->Location = System::Drawing::Point(11, 15);
this->label4->Name = L"label4";
this->label4->Size = System::Drawing::Size(17, 13);
this->label4->TabIndex = 0;
this->label4->Text = L"X:";
//
// groupBox2
//
this->groupBox2->Controls->Add(this->comboBox1);
this->groupBox2->Controls->Add(this->chkAnimation);
this->groupBox2->Controls->Add(this->chkNOCD);
this->groupBox2->Controls->Add(this->chkWallhack);
this->groupBox2->Location = System::Drawing::Point(271, 106);
this->groupBox2->Margin = System::Windows::Forms::Padding(3, 2, 3, 2);
this->groupBox2->Name = L"groupBox2";
this->groupBox2->Padding = System::Windows::Forms::Padding(3, 2, 3, 2);
this->groupBox2->Size = System::Drawing::Size(124, 111);
this->groupBox2->TabIndex = 4;
this->groupBox2->TabStop = false;
this->groupBox2->Text = L" Utilities ";
//
// comboBox1
//
this->comboBox1->Enabled = false;
this->comboBox1->ForeColor = System::Drawing::Color::Red;
this->comboBox1->FormattingEnabled = true;
this->comboBox1->Items->AddRange(gcnew cli::array< System::Object^ >(5) {L"Warrior", L"Cleric", L"Academic", L"Archer",
L"Mage"});
this->comboBox1->Location = System::Drawing::Point(9, 80);
this->comboBox1->Margin = System::Windows::Forms::Padding(3, 2, 3, 2);
this->comboBox1->Name = L"comboBox1";
this->comboBox1->Size = System::Drawing::Size(101, 21);
this->comboBox1->TabIndex = 3;
this->comboBox1->Text = L"<= Class =>";
//
// chkAnimation
//
this->chkAnimation->AutoSize = true;
this->chkAnimation->Location = System::Drawing::Point(7, 58);
this->chkAnimation->Margin = System::Windows::Forms::Padding(3, 2, 3, 2);
this->chkAnimation->Name = L"chkAnimation";
this->chkAnimation->Size = System::Drawing::Size(89, 17);
this->chkAnimation->TabIndex = 2;
this->chkAnimation->Text = L"No Animation";
this->chkAnimation->UseVisualStyleBackColor = true;
this->chkAnimation->CheckedChanged += gcnew System::EventHandler(this, &Form1::chkAnimation_CheckedChanged);
//
// chkNOCD
//
this->chkNOCD->AutoSize = true;
this->chkNOCD->Enabled = false;
this->chkNOCD->ForeColor = System::Drawing::Color::Red;
this->chkNOCD->Location = System::Drawing::Point(7, 39);
this->chkNOCD->Margin = System::Windows::Forms::Padding(3, 2, 3, 2);
this->chkNOCD->Name = L"chkNOCD";
this->chkNOCD->Size = System::Drawing::Size(90, 17);
this->chkNOCD->TabIndex = 1;
this->chkNOCD->Text = L"No Cooldown";
this->chkNOCD->UseVisualStyleBackColor = true;
this->chkNOCD->CheckedChanged += gcnew System::EventHandler(this, &Form1::chkNOCD_CheckedChanged);
//
// chkWallhack
//
this->chkWallhack->AutoSize = true;
this->chkWallhack->Location = System::Drawing::Point(7, 20);
this->chkWallhack->Margin = System::Windows::Forms::Padding(3, 2, 3, 2);
this->chkWallhack->Name = L"chkWallhack";
this->chkWallhack->Size = System::Drawing::Size(76, 17);
this->chkWallhack->TabIndex = 0;
this->chkWallhack->Text = L"Wall Hack";
this->chkWallhack->UseVisualStyleBackColor = true;
this->chkWallhack->CheckedChanged += gcnew System::EventHandler(this, &Form1::chkWallhack_CheckedChanged);
//
// groupBox3
//
this->groupBox3->Controls->Add(this->numericDropDownX);
this->groupBox3->Controls->Add(this->numericDropDownY);
this->groupBox3->Controls->Add(this->numericDropDownZ);
this->groupBox3->Controls->Add(this->txtName);
this->groupBox3->Controls->Add(this->cmdLoad);
this->groupBox3->Controls->Add(this->cmdSave);
this->groupBox3->Controls->Add(this->cmdTeleport);
this->groupBox3->Controls->Add(this->cmdClear);
this->groupBox3->Controls->Add(this->cmdAdd);
this->groupBox3->Controls->Add(this->listView1);
this->groupBox3->Location = System::Drawing::Point(13, 13);
this->groupBox3->Margin = System::Windows::Forms::Padding(3, 2, 3, 2);
this->groupBox3->Name = L"groupBox3";
this->groupBox3->Padding = System::Windows::Forms::Padding(3, 2, 3, 2);
this->groupBox3->Size = System::Drawing::Size(252, 206);
this->groupBox3->TabIndex = 5;
this->groupBox3->TabStop = false;
this->groupBox3->Text = L" Teleport Box [F1-F10 <=> Alt+1 to 5] ";
//
// numericDropDownX
//
this->numericDropDownX->Location = System::Drawing::Point(68, 145);
this->numericDropDownX->Margin = System::Windows::Forms::Padding(3, 2, 3, 2);
this->numericDropDownX->Maximum = System::Decimal(gcnew cli::array< System::Int32 >(4) {99999, 0, 0, 0});
this->numericDropDownX->Minimum = System::Decimal(gcnew cli::array< System::Int32 >(4) {99999, 0, 0, System::Int32::MinValue});
this->numericDropDownX->Name = L"numericDropDownX";
this->numericDropDownX->Size = System::Drawing::Size(55, 20);
this->numericDropDownX->TabIndex = 5;
//
// numericDropDownY
//
this->numericDropDownY->Location = System::Drawing::Point(129, 145);
this->numericDropDownY->Margin = System::Windows::Forms::Padding(3, 2, 3, 2);
this->numericDropDownY->Maximum = System::Decimal(gcnew cli::array< System::Int32 >(4) {99999, 0, 0, 0});
this->numericDropDownY->Minimum = System::Decimal(gcnew cli::array< System::Int32 >(4) {99999, 0, 0, System::Int32::MinValue});
this->numericDropDownY->Name = L"numericDropDownY";
this->numericDropDownY->Size = System::Drawing::Size(55, 20);
this->numericDropDownY->TabIndex = 5;
//
// numericDropDownZ
//
this->numericDropDownZ->Location = System::Drawing::Point(190, 145);
this->numericDropDownZ->Margin = System::Windows::Forms::Padding(3, 2, 3, 2);
this->numericDropDownZ->Maximum = System::Decimal(gcnew cli::array< System::Int32 >(4) {99999, 0, 0, 0});
this->numericDropDownZ->Minimum = System::Decimal(gcnew cli::array< System::Int32 >(4) {99999, 0, 0, System::Int32::MinValue});
this->numericDropDownZ->Name = L"numericDropDownZ";
this->numericDropDownZ->Size = System::Drawing::Size(55, 20);
this->numericDropDownZ->TabIndex = 5;
//
// txtName
//
this->txtName->Location = System::Drawing::Point(7, 145);
this->txtName->Margin = System::Windows::Forms::Padding(3, 2, 3, 2);
this->txtName->Name = L"txtName";
this->txtName->Size = System::Drawing::Size(55, 20);
this->txtName->TabIndex = 4;
//
// cmdLoad
//
this->cmdLoad->BackColor = System::Drawing::Color::Transparent;
this->cmdLoad->ForeColor = System::Drawing::Color::Black;
this->cmdLoad->Location = System::Drawing::Point(202, 176);
this->cmdLoad->Margin = System::Windows::Forms::Padding(3, 2, 3, 2);
this->cmdLoad->Name = L"cmdLoad";
this->cmdLoad->Size = System::Drawing::Size(47, 21);
this->cmdLoad->TabIndex = 2;
this->cmdLoad->Text = L"Load";
this->cmdLoad->UseVisualStyleBackColor = false;
this->cmdLoad->Click += gcnew System::EventHandler(this, &Form1::cmdLoad_Click);
//
// cmdSave
//
this->cmdSave->ForeColor = System::Drawing::Color::Black;
this->cmdSave->Location = System::Drawing::Point(152, 176);
this->cmdSave->Margin = System::Windows::Forms::Padding(3, 2, 3, 2);
this->cmdSave->Name = L"cmdSave";
this->cmdSave->Size = System::Drawing::Size(47, 21);
this->cmdSave->TabIndex = 2;
this->cmdSave->Text = L"Save";
this->cmdSave->UseVisualStyleBackColor = true;
this->cmdSave->Click += gcnew System::EventHandler(this, &Form1::cmdSave_Click);
//
// cmdTeleport
//
this->cmdTeleport->ForeColor = System::Drawing::Color::Black;
this->cmdTeleport->Location = System::Drawing::Point(102, 176);
this->cmdTeleport->Margin = System::Windows::Forms::Padding(3, 2, 3, 2);
this->cmdTeleport->Name = L"cmdTeleport";
this->cmdTeleport->Size = System::Drawing::Size(47, 21);
this->cmdTeleport->TabIndex = 2;
this->cmdTeleport->Text = L"Tele";
this->cmdTeleport->UseVisualStyleBackColor = true;
this->cmdTeleport->Click += gcnew System::EventHandler(this, &Form1::cmdTeleport_Click);
//
// cmdClear
//
this->cmdClear->ForeColor = System::Drawing::Color::Black;
this->cmdClear->Location = System::Drawing::Point(53, 176);
this->cmdClear->Margin = System::Windows::Forms::Padding(3, 2, 3, 2);
this->cmdClear->Name = L"cmdClear";
this->cmdClear->Size = System::Drawing::Size(47, 21);
this->cmdClear->TabIndex = 2;
this->cmdClear->Text = L"Clear";
this->cmdClear->UseVisualStyleBackColor = true;
this->cmdClear->Click += gcnew System::EventHandler(this, &Form1::cmdClear_Click);
//
// cmdAdd
//
this->cmdAdd->ForeColor = System::Drawing::Color::Black;
this->cmdAdd->Location = System::Drawing::Point(4, 176);
this->cmdAdd->Margin = System::Windows::Forms::Padding(3, 2, 3, 2);
this->cmdAdd->Name = L"cmdAdd";
this->cmdAdd->Size = System::Drawing::Size(47, 21);
this->cmdAdd->TabIndex = 2;
this->cmdAdd->Text = L"Add";
this->cmdAdd->UseVisualStyleBackColor = true;
this->cmdAdd->Click += gcnew System::EventHandler(this, &Form1::cmdAdd_Click);
//
// listView1
//
this->listView1->Columns->AddRange(gcnew cli::array< System::Windows::Forms::ColumnHeader^ >(4) {this->columnHeader1, this->columnHeader2,
this->columnHeader3, this->columnHeader4});
this->listView1->FullRowSelect = true;
this->listView1->GridLines = true;
this->listView1->HeaderStyle = System::Windows::Forms::ColumnHeaderStyle::Nonclickable;
this->listView1->HideSelection = false;
this->listView1->Location = System::Drawing::Point(7, 15);
this->listView1->Margin = System::Windows::Forms::Padding(3, 2, 3, 2);
this->listView1->MultiSelect = false;
this->listView1->Name = L"listView1";
this->listView1->Size = System::Drawing::Size(239, 116);
this->listView1->TabIndex = 0;
this->listView1->UseCompatibleStateImageBehavior = false;
this->listView1->View = System::Windows::Forms::View::Details;
//
// columnHeader1
//
this->columnHeader1->Text = L"Name";
this->columnHeader1->Width = 58;
//
// columnHeader2
//
this->columnHeader2->Text = L"X Coord";
this->columnHeader2->Width = 58;
//
// columnHeader3
//
this->columnHeader3->Text = L"Y Coord";
this->columnHeader3->Width = 58;
//
// columnHeader4
//
this->columnHeader4->Text = L"Z Coord";
this->columnHeader4->Width = 58;
//
// saveFileDialog1
//
this->saveFileDialog1->OverwritePrompt = false;
this->saveFileDialog1->ShowHelp = true;
this->saveFileDialog1->Title = L"Save your current date (Will overwrite files with the same name without prompt)";
//
// openFileDialog1
//
this->openFileDialog1->FileName = L"-Select File-";
this->openFileDialog1->ShowHelp = true;
this->openFileDialog1->Title = L"Open coordinates data";
//
// label7
//
this->label7->AutoSize = true;
this->label7->Font = (gcnew System::Drawing::Font(L"Trebuchet MS", 8.25F, static_cast<System::Drawing::FontStyle>((System::Drawing::FontStyle::Bold | System::Drawing::FontStyle::Underline)),
System::Drawing::GraphicsUnit::Point, static_cast<System::Byte>(0)));
this->label7->Location = System::Drawing::Point(133, 222);
this->label7->Name = L"label7";
this->label7->Size = System::Drawing::Size(135, 16);
this->label7->TabIndex = 6;
this->label7->Text = L"Created By: XKhen0017";
//
// Form1
//
this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
this->ClientSize = System::Drawing::Size(406, 243);
this->ControlBox = false;
this->Controls->Add(this->label7);
this->Controls->Add(this->groupBox3);
this->Controls->Add(this->groupBox2);
this->Controls->Add(this->groupBox1);
this->DoubleBuffered = true;
this->FormBorderStyle = System::Windows::Forms::FormBorderStyle::FixedSingle;
this->Margin = System::Windows::Forms::Padding(3, 2, 3, 2);
this->MaximizeBox = false;
this->Name = L"Form1";
this->Opacity = 0.9;
this->Text = L"DNest Sea v85 Trainer";
this->groupBox1->ResumeLayout(false);
this->groupBox1->PerformLayout();
this->groupBox2->ResumeLayout(false);
this->groupBox2->PerformLayout();
this->groupBox3->ResumeLayout(false);
this->groupBox3->PerformLayout();
(cli::safe_cast<System::ComponentModel::ISupportInitialize^ >(this->numericDropDownX))->EndInit();
(cli::safe_cast<System::ComponentModel::ISupportInitialize^ >(this->numericDropDownY))->EndInit();
(cli::safe_cast<System::ComponentModel::ISupportInitialize^ >(this->numericDropDownZ))->EndInit();
this->ResumeLayout(false);
this->PerformLayout();
}
#pragma endregion
private: System::Void timer1_Tick(System::Object^ sender, System::EventArgs^ e);
private: System::Void chkWallhack_CheckedChanged(System::Object^ sender, System::EventArgs^ e);
private: System::Void chkNOCD_CheckedChanged(System::Object^ sender, System::EventArgs^ e);
private: System::Void cmdCopy_Click(System::Object^ sender, System::EventArgs^ e);
private: System::Void cmdClear_Click(System::Object^ sender, System::EventArgs^ e);
private: System::Void cmdAdd_Click(System::Object^ sender, System::EventArgs^ e);
private: System::Void cmdTeleport_Click(System::Object^ sender, System::EventArgs^ e);
private: System::Void chkAnimation_CheckedChanged(System::Object^ sender, System::EventArgs^ e);
private: System::Void cmdSave_Click(System::Object^ sender, System::EventArgs^ e);
private: System::Void cmdLoad_Click(System::Object^ sender, System::EventArgs^ e);
//private: System::Void timer2_Tick(System::Object^ sender, System::EventArgs^ e);
};
}
Code:
#NoTrayIcon
#RequireAdmin
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <GuiStatusBar.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include "injectme.au3"
#include <GuiConstants.au3>
#include <Constants.au3>
#include <String.au3>
#include <Date.au3>
#include "hotkey.au3"
#include "vkConstants.au3"
#region MINIMIZE TRAINER ===============================
Opt("TrayOnEventMode", 1)
Opt("TrayMenuMode", 1)
TraySetOnEvent($TRAY_EVENT_PRIMARYUP, "SpecialEvent")
#endregion MINIMIZE TRAINER ===============================
FileInstall("logo.jpg", @TempDir & "\NTBC.dat")
updateme_firstrun()
#region ### START Koda GUI section ### Form=D:\Program Files (x86)\AutoIt3\KoDA\Forms\New!.kxf
$Form1_1 = GUICreate("DNest Launcher v1.7.0", 434, 356, -1, -1)
$menu_1 = GUICtrlCreateMenu("&File")
$Update_1 = GUICtrlCreateMenuItem("&Check Update", $menu_1)
$space = GUICtrlCreateMenuItem("", $menu_1)
$exit_1 = GUICtrlCreateMenuItem("&Exit", $menu_1)
$faq_1 = GUICtrlCreateMenu("&Help")
$faq = GUICtrlCreateMenuItem("F&AQ", $faq_1)
$Group1 = GUICtrlCreateGroup("", 8, 5, 417, 305)
$Pic1 = GUICtrlCreatePic @TempDir & "\NTBC.dat", 16, 21, 400, 110)
$Group2 = GUICtrlCreateGroup("", 16, 141, 225, 161, BitOR($GUI_SS_DEFAULT_GROUP, $BS_FLAT))
$Label1 = GUICtrlCreateLabel("Folder to browse:", 24, 157, 85, 17)
$dnpath = GUICtrlCreateInput("", 24, 181, 209, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_AUTOVSCROLL, $ES_READONLY))
$Label2 = GUICtrlCreateLabel("Executable:", 24, 213, 60, 17)
$exe = GUICtrlCreateInput("DragonNest.exe", 24, 237, 209, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_AUTOVSCROLL, $ES_READONLY))
$browseb = GUICtrlCreateButton("Browse", 24, 269, 97, 25)
$trnr = GUICtrlCreateCheckbox("Enable Trainer", 140, 269, -1, 25)
GUICtrlSetState(-1, $GUI_CHECKED)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Group3 = GUICtrlCreateGroup("", 248, 141, 169, 161, BitOR($GUI_SS_DEFAULT_GROUP, $BS_FLAT))
$selsea = GUICtrlCreateRadio("DNSEA", 264, 160, 65, 17)
GUICtrlSetState(-1, $GUI_DISABLE)
$seldgn = GUICtrlCreateRadio("PlayDGN", 336, 160, 65, 17)
GUICtrlSetState(-1, $GUI_DISABLE)
$launch = GUICtrlCreateButton("Launch DragonNest", 264, 189, 139, 25)
GUICtrlSetState(-1, $GUI_DISABLE)
$forceclose = GUICtrlCreateButton("Force Relaunch DN", 264, 222, 139, 25)
$Label3 = GUICtrlCreateLabel("© XKhen, 2012 - DNLauncher", 261, 269, 148, 17)
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$StatusBar1 = _GUICtrlStatusBar_Create($Form1_1)
_GUICtrlStatusBar_SetText($StatusBar1, "Select DragonNest folder")
GUISetState(@SW_SHOW)
#endregion ### END Koda GUI section ###
#region GLOBAL DECLARATIONS! ====================================
Global $ip, $trainer, $dnpathbrowsed, $Form2, $msvc, $netframe, $dnstart, $number = 1, $pid = 0, $process = 0
Global $proc = "DragonNest.exe"
Global $path = IniRead("config.ini", "Path", "defpath", "")
_readthepath()
#endregion GLOBAL DECLARATIONS! ====================================
_HotKey_Assign(BitOR($CK_ALT, $VK_Q), 'ForceClose')
_HotKey_Assign(BitOR($CK_ALT, $VK_R), 're_launch')
While 1
$nMsg = GUIGetMsg(1)
Switch $nMsg[1]
Case $Form1_1
Switch $nMsg[0]
Case $GUI_EVENT_MINIMIZE
GUISetState(@SW_HIDE)
TraySetState(1) ; show
TraySetToolTip("Click here to restore the trainer")
TrayTip("Launcher", "Launcher minimized, click to restore.", "")
Case $faq
GUISetState(@SW_DISABLE, $Form1_1)
_Form2()
Case $GUI_EVENT_CLOSE
If Not ProcessExists($proc) Then
FileDelete($dnpathbrowsed & "\GPKitClt.dll")
FileDelete @windowsDir & "\twain_30.dll")
FileDelete @windowsDir & "\twain_31.dll")
FileDelete @TempDir & "\DGNPatch.dat")
FileDelete @TempDir & "\DNPatch.dat")
Sleep(50)
FileMove($dnpathbrowsed & "\GPKitClt.dll.BAK", $dnpathbrowsed & "\GPKitClt.dll")
Sleep(50)
Exit
Else
MsgBox(0, "Error!", "DragonNest is currently running, close any clients before continuing")
EndIf
Case $seldgn
If $dnpathbrowsed <> "" Then
If FileExists($dnpathbrowsed & "\DragonNest.exe") Then
FileInstall("pdn.dll", @windowsDir & "\twain_31.dll", 1)
FileSetAttrib @windowsDir & "\twain_31.dll", "+HA")
;## This check the IP of the server.....
Local $sData = InetGet("https://patch.dragnes*****m/dn/patch/PatchConfigList.xml", @TempDir & "\DGNPatch.dat")
Local $file = FileOpen @TempDir & "\DGNPatch.dat")
Local $line = FileReadLine($file, 10)
Local $ipadd = StringSplit($line, '"')
;## End of checking the IP
$ip = " /ip:" & $ipadd[2] & "; /port:" & $ipadd[4]
$trainer = @windowsDir & "\twain_31.dll"
_GUICtrlStatusBar_SetText($StatusBar1, "Current IP: " & $ip)
FileClose($file)
Else
GUICtrlSetState($seldgn, $GUI_UNCHECKED)
MsgBox(0, "Error!", "Please select a valid DragonNest folder.")
EndIf
Else
MsgBox(0, "Error!", "Please select folder first before selecting server.")
EndIf
Case $selsea
If $dnpathbrowsed <> "" Then
If FileExists($dnpathbrowsed & "\DragonNest.exe") Then
FileInstall("dnsea.dll", @windowsDir & "\twain_30.dll", 1)
FileSetAttrib @windowsDir & "\twain_30.dll", "+HA")
;## This check the IP of the server.....
Local $sData = InetGet("https://plaster.cherrycredits.com/dnest/patch/PatchConfigList.xml", @TempDir & "\DNPatch.dat")
Local $file = FileOpen @TempDir & "\DNPatch.dat")
Local $line = FileReadLine($file, 11)
Local $ipadd = StringSplit($line, '"')
;## End of checking the IP
$ip = " /ip:" & $ipadd[2] & "; /port:" & $ipadd[4]
$trainer = @windowsDir & "\twain_30.dll"
_GUICtrlStatusBar_SetText($StatusBar1, "Current IP: " & $ip)
FileClose($file)
Else
GUICtrlSetState($selsea, $GUI_UNCHECKED)
MsgBox(0, "Error!", "Please select a valid DragonNest folder.")
EndIf
Else
MsgBox(0, "Error!", "Please select folder first before selecting server.")
EndIf
Case $browseb
If Not ProcessExists($proc) Then
$dnpathbrowsed = FileSelectFolder("Please choose the dragon nest folder...", "")
If @error == 1 Then
GUICtrlSetData($dnpath, "Nothing selected. Please select a folder.")
Else
If FileExists($dnpathbrowsed & "\DragonNest.exe") Then
GUICtrlSetData($exe, "DragonNest.exe - Found!")
FileMove($dnpathbrowsed & "\GPKitClt.dll", $dnpathbrowsed & "\GPKitClt.dll.BAK")
Sleep(30)
FileInstall("gpk.dll", $dnpathbrowsed & "\GPKitClt.dll", 1)
IniWrite("config.ini", "Path", "defpath", $dnpathbrowsed)
GUICtrlSetData($dnpath, $dnpathbrowsed)
_GUICtrlStatusBar_SetText($StatusBar1, "Check trainer if you want to enable it...")
GUICtrlSetState($launch, $GUI_ENABLE)
GUICtrlSetState($seldgn, $GUI_ENABLE)
GUICtrlSetState($selsea, $GUI_ENABLE)
Else
GUICtrlSetData($dnpath, "Please select valid DragonNest folder.")
GUICtrlSetData($exe, "DragonNest.exe - Not Found!")
EndIf
EndIf
Else
MsgBox(0, "Error!", "DragonNest is currently running, close any clients before continuing")
EndIf
Case $forceclose
re_launch()
Case $launch
If GUICtrlRead($seldgn) == $GUI_CHECKED Or GUICtrlRead($selsea) == $GUI_CHECKED Then
enableinjection()
Else
MsgBox(0, "Error!", "Please select server before launching the client!")
EndIf
Case $Update_1
updateme()
Case $exit_1
If Not ProcessExists($proc) Then
FileDelete($dnpathbrowsed & "\GPKitClt.dll")
FileDelete @windowsDir & "\twain_30.dll")
FileDelete @windowsDir & "\twain_31.dll")
Sleep(50)
FileMove($dnpathbrowsed & "\GPKitClt.dll.BAK", $dnpathbrowsed & "\GPKitClt.dll")
Sleep(50)
Exit
Else
MsgBox(0, "Error!", "DragonNest is currently running, close any clients before continuing")
EndIf
EndSwitch
Case $Form2
Switch $nMsg[0]
Case $GUI_EVENT_CLOSE
GUIDelete($Form2)
GUISetState(@SW_ENABLE, $Form1_1)
WinActivate("DNest Launcher")
Case $nMsg[0] = $msvc
ShellExecute("https://www.microsof*****m/en-us/download/details.aspx?id=5582")
Case $nMsg[0] = $netframe
ShellExecute("https://www.microsof*****m/en-us/download/details.aspx?id=1639")
EndSwitch
EndSwitch
WEnd
Func enableinjection()
Local $tempbat = @windowsDir & "\xknv.bat"
Local $tempbat2 = @windowsDir & "\xknv2.bat"
Local $xkn = @windowsDir & "\xknv.exe"
Local $xknt = "xknv.txt"
FileDelete($tempbat)
FileDelete($tempbat2)
$dnstart = $dnpathbrowsed & "\DragonNest.exe"
Run($dnstart & $ip, $dnpathbrowsed)
$pid = ProcessList("DragonNest.exe")
$process = $pid[0][0]
FileInstall("xknv.exe", @windowsDir & "\xknv.exe")
GUICtrlSetState($launch, $GUI_DISABLE)
GUICtrlSetState($forceclose, $GUI_DISABLE)
#region For closing mutex dragonNest ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
WinWait("[CLASS:DRAGONNEST]")
If GUICtrlRead($trnr) == $GUI_CHECKED Then
_InjectDll(WinGetHandle("[ClASS:DRAGONNEST]"), $trainer)
If GUICtrlRead($seldgn) == $GUI_CHECKED Then
WinWait("PlayDGNv81 Trainer")
WinSetTitle("PlayDGNv81 Trainer", "", "DNest Client - " & $process)
ElseIf GUICtrlRead($selsea) == $GUI_CHECKED Then
WinWait("DNest Sea v85 Trainer")
WinSetTitle("DNest Sea v85 Trainer", "", "DNest Client - " & $process)
EndIf
EndIf
FileWriteLine($tempbat, "@echo off")
FileWriteLine($tempbat, "xknv.exe -a -p " & $pid[$process][1] & " MutexDragonNest > xknv.txt")
WinSetTitle("DragonNest", "", "DragonNest *XKhen")
RunWait($tempbat, "", @SW_HIDE)
$filemutex = FileOpen($xknt)
$string = StringInStr(FileRead($filemutex), ": \BaseNamedObjects\MutexDragonNest", 1)
If $string <> 0 Then
$filepos = FileSetPos($filemutex, $string - 4, 0)
FileFlush($filemutex)
$line6 = FileReadLine($filemutex)
$array1 = StringSplit($line6, ":")
FileWriteLine($tempbat2, "@echo off")
FileWriteLine($tempbat2, "xknv.exe -c " & $array1[1] & " -y -p " & $pid[$process][1])
RunWait($tempbat2, "", @SW_HIDE)
FileClose($filemutex)
Sleep(50)
FileDelete($xknt)
FileDelete($xkn)
FileDelete($tempbat)
FileDelete($tempbat2)
GUICtrlSetState($launch, $GUI_ENABLE) ;enable after the process
GUICtrlSetState($forceclose, $GUI_ENABLE)
Else
FileClose($filemutex)
ProcessClose($pid[$process][1])
FileDelete($xknt)
FileDelete($xkn)
FileDelete($tempbat)
FileDelete($tempbat2)
MsgBox(0, "Error", "Error disabling the guard. Please try again.")
GUICtrlSetState($launch, $GUI_ENABLE) ;enable after the process
GUICtrlSetState($forceclose, $GUI_ENABLE)
EndIf
#endregion For closing mutex dragonNest ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
EndFunc ;==>enableinjection
Func _readthepath()
If $path == "" Then
;
Else
$dnpathbrowsed = $path
FileMove($dnpathbrowsed & "\GPKitClt.dll", $dnpathbrowsed & "\GPKitClt.dll.BAK")
Sleep(30)
FileInstall("gpk.dll", $dnpathbrowsed & "\GPKitClt.dll", 1)
IniWrite("config.ini", "Path", "defpath", $dnpathbrowsed)
GUICtrlSetData($dnpath, $path)
GUICtrlSetData($exe, "DragonNest.exe - Found!")
_GUICtrlStatusBar_SetText($StatusBar1, "Check trainer if you want to enable it...")
GUICtrlSetState($launch, $GUI_ENABLE)
GUICtrlSetState($seldgn, $GUI_ENABLE)
GUICtrlSetState($selsea, $GUI_ENABLE)
EndIf
EndFunc ;==>_readthepath
Func updateme()
;## Update Schematics.
$VersionsInfo = "https://******************/site/dnlauncherv3/Update_New.dat"
$oldVersion = FileGetVersion @sCripTFullPath)
$newVersion = "0.0"
;## Download the newer version
$Ini = InetGet($VersionsInfo, @TempDir & "\Version.dat")
;## Checks if the download is successful
If $Ini = 0 Then
MsgBox(0, "ERROR", "The server seems to be offline.")
Else
$newVersion = IniRead @TempDir & "\Version.dat", "UPDATE", "Version", "")
If $newVersion = $oldVersion Then
MsgBox(0, "No update", "There is no update available!" & @CRLF & @CRLF & "For more stuffs check out: https://d-h.st/users/xkhen0017")
Else
$msg = MsgBox(4, "Update", "There is a new version existing: " & $newVersion & "!" & @CRLF & @CRLF & "You are using: " & $oldVersion & ". Do you want to download the new version?")
If $msg = 7 Then
FileDelete @TempDir & "\Version.dat")
;MsgBox(0, "Update", "DNLauncher update canceled as of " & @yeaR & "/" & @mon & "/" & @mdaY & " " & @HOUR & ":" & @Min & ":" & @Sec)
ElseIf $msg = 6 Then
$downloadLink = IniRead @TempDir & "\Version.dat", "UPDATE", "download", "NotFound")
$dlhandle = InetGet($downloadLink, "DNLauncher_" & $newVersion & ".exe", 1, 1)
;InetGet("https://******************/site/dnlauncherv3/Readme.txt", @sCripTDir & "\Readme.txt")
ProgressOn("Downloading...", "Please wait...", "", -1, -1, 16)
$Size = InetGetSize($downloadLink, 1)
While Not InetGetInfo($dlhandle, 2)
$Percent = Round((InetGetInfo($dlhandle, 0) / $Size) * 100, 2)
ProgressSet($Percent, $Percent & " %")
Sleep(1)
WEnd
ProgressSet(100, "Done", "Complete")
Sleep(500)
ProgressOff()
InetClose($dlhandle)
MsgBox(-1, "Success", "Download Complete! " & _Now() & @CRLF & @CRLF & "You can now launch the new launcher.")
FileDelete @TempDir & "\Version.dat")
Exit
EndIf
EndIf
EndIf
FileDelete @TempDir & "\Version.dat")
EndFunc ;==>updateme
Func _Form2()
$Form2 = GUICreate("FAQ 101", 446, 283, 192, 124)
GUISetFont(10, 400, 0, "Arial")
$Label1 = GUICtrlCreateLabel("Frequently Asked Questions", 135, 12, 264, 18)
GUICtrlSetFont(-1, 10, 800, 4, "Arial")
$Label2 = GUICtrlCreateLabel("Q1: I get an error 'mscvr100.dll' how can i fix this?", 8, 40, 428, 16)
$Label3 = GUICtrlCreateLabel("A: Download and install -->", 8, 56, 188, 16)
$msvc = GUICtrlCreateLabel("MSVC++ 2008", 180, 56, 92, 16)
GUICtrlSetColor(-1, 0x0000FF)
GUICtrlSetCursor(-1, 0)
GUICtrlSetFont(-1, -1, -1, 4)
$Label4 = GUICtrlCreateLabel("Q2: My trainer is not showing up what now?!", 8, 80, 348, 16)
$Label5 = GUICtrlCreateLabel("A: Download and install -->", 8, 96, 188, 16)
$netframe = GUICtrlCreateLabel(".Net Framework 2.0", 180, 96, 148, 16)
GUICtrlSetColor(-1, 0x0000FF)
GUICtrlSetCursor(-1, 0)
GUICtrlSetFont(-1, -1, -1, 4)
$Label6 = GUICtrlCreateLabel("Q3: My computer is 64bit, is it going to work?", 8, 120, 372, 16)
$Label7 = GUICtrlCreateLabel("A: Yes, this trainer is built for both 32 and 64 bit", 8, 136, 420, 16)
$Label8 = GUICtrlCreateLabel("Q4: Im playing NA version, is it going to work?", 8, 160, 380, 16)
$Label9 = GUICtrlCreateLabel("A: No, since i dont play NA, and our country is blocked from using it. Anyway I'm still currently decrypting the EXE of NA's DN.", 8, 176, 428, 32)
$Label10 = GUICtrlCreateLabel("Q5: Its working, but I cant login, it says 'Unable to connect to login server' how is this?", 8, 216, 428, 32)
$Label11 = GUICtrlCreateLabel("A: Check if your server is in maintenance or what.", 8, 232, 428, 32)
GUISetState(@SW_SHOW)
EndFunc ;==>_Form2
Func SpecialEvent()
GUISetState(@SW_SHOW)
TraySetState(2)
EndFunc ;==>SpecialEvent
Func updateme_firstrun()
$VersionsInfo = "https://******************/site/dnlauncherv3/Update_New.dat"
$oldVersion = FileGetVersion @sCripTFullPath)
$newVersion = "0.0"
$Ini = InetGet($VersionsInfo, @TempDir & "\Version.dat")
If $Ini = 0 Then
MsgBox(0, "ERROR", "The server seems to be offline.")
Else
$newVersion = IniRead @TempDir & "\Version.dat", "UPDATE", "Version", "")
$changelog = IniRead @TempDir & "\Version.dat", "UPDATE", "changelog", "")
If $newVersion = $oldVersion Then
;
Else
$msg = MsgBox(4, "Update", "There is a new version existing: " & $newVersion & "!" & @CRLF & @CRLF & "You are using: " & $oldVersion & @CRLF & @CRLF & "Changelog: " & $changelog & @CRLF & @CRLF & "Do you want to download the new version?")
If $msg = 7 Then
FileDelete @TempDir & "\Version.dat")
ElseIf $msg = 6 Then
$downloadLink = IniRead @TempDir & "\Version.dat", "UPDATE", "download", "NotFound")
$dlhandle = InetGet($downloadLink, "DNLauncher_" & $newVersion & ".exe", 1, 1)
;InetGet("https://******************/site/dnlauncherv3/Readme.txt", @sCripTDir & "\Readme.txt")
ProgressOn("Downloading...", "Please wait...", "", -1, -1, 16)
$Size = InetGetSize($downloadLink, 1)
While Not InetGetInfo($dlhandle, 2)
$Percent = Round((InetGetInfo($dlhandle, 0) / $Size) * 100, 2)
ProgressSet($Percent, $Percent & " %")
Sleep(1)
WEnd
ProgressSet(100, "Done", "Complete")
Sleep(500)
ProgressOff()
InetClose($dlhandle)
MsgBox(-1, "Success", "Download Complete! " & _Now() & @CRLF & @CRLF & "You can now launch the new launcher.")
FileDelete @TempDir & "\Version.dat")
Exit
EndIf
EndIf
EndIf
FileDelete @TempDir & "\Version.dat")
EndFunc ;==>updateme_firstrun
Func ForceClose()
If GUICtrlRead($seldgn) == $GUI_CHECKED Or GUICtrlRead($selsea) == $GUI_CHECKED Then
If WinGetTitle("[active]") == "DragonNest *XKhen" Or WinGetTitle("[active]") == "DragonNest" Then
;If GUICtrlGetState($launch) == 80 Then
ProcessClose(WinGetProcess("[active]"))
;EndIf
EndIf
EndIf
EndFunc ;==>ForceClose
Func re_launch()
If GUICtrlRead($seldgn) == $GUI_CHECKED Or GUICtrlRead($selsea) == $GUI_CHECKED Then
If ProcessExists("DragonNest.exe") Then
If WinGetTitle("[active]") == "DragonNest *XKhen" Or WinGetTitle("[active]") == "DragonNest" Then
If GUICtrlGetState($forceclose) == 80 Then
ProcessClose(WinGetProcess("[active]"))
enableinjection()
EndIf
EndIf
EndIf
EndIf
EndFunc ;==>re_launch