program Simple_Auto_Version_2_5;

var
  // Form variables.
  frmDesign,frmParser : TForm;
  Label1, Label2, Label3, Label4, Label5, Label6, Label7, Label8 : TLabel;
  Image1 : TImage;
  Button1, Button2, Button3, Button4,button5 : TButton;
  RelogBox, MageBox, BasicBox, PotionBox : TGroupBox;
  Edit1, Edit2, Edit3, HealHotKey, HealEdit, MageEdit : TEdit;
  CheckBox1, MageCheckBox, CheckBox3, CheckBox4, CheckBox5, CheckBox2, RegPotCheckBox : TCheckBox;
  path,path2:string;
//End Form Variables

user,pass:string;//username and password
magekey,healkey,relogf,smallp,regularp,heal,mageh,mage,ksp,archer:integer;{Mage key is the key you use to mage same for heal relogf = Relog Featur}
magew,healw:integer;{these are the waits for mage and heal}
var hp, monster,melleing, lock, kscolor, ok, cancel,drops,regpot,smallpot,ks1,ks2,ks3,ks4:integer;
var x,y,i:integer;
var dir:integer;
var loggedin,relaxing,ks,ksm:boolean;
var kszone:Tbox;
Procedure Save;
Begin
path:=scriptPath + 'Simple Config.ini'
Writeini('Relog', 'Username:', +Edit1.text, path)
Writeini('Relog', 'Password:', +Edit2.text, path)
Writeini('Hot Keys', 'Mage', +Edit3.text, path)
Writeini('Hot Keys', 'Heal', +HealHotKey.text, path)
Writeini('Waits', 'Mage', +Mageedit.text, path)
Writeini('Waits', 'Heal', +Healedit.text, path)

If(CheckBox1.Checked=True)then
 Begin
 Writeini('Relog', 'Relog Feature:', '1', path)  {1 = True 2 = False}
 End
 Else
 Begin
   Writeini('Relog', 'Relog Feature:', '2', path)
 End;
 
If(CheckBox2.Checked=True)then
 Begin
 Writeini('Potions', 'Small:', '1', path)
 End
 Else
 Begin
   Writeini('Potions', 'Small:', '2', path)
 End;
 
If(RegPotCheckBox.Checked=True)then
 Begin
 Writeini('Potions', 'Regular:', '1', path)
 End
 Else
 Begin
   Writeini('Potions', 'Regular:', '2', path)
 End;

If(CheckBox3.Checked=True)then
 Begin
 Writeini('Mage', 'Mage Heal', '1', path)
 End
 Else
 Begin
   Writeini('Mage', 'Mage Heal', '2', path)
 End;
 
 If(MageCheckBox.Checked=True)then
 Begin
 Writeini('Mage', 'Mage', '1', path)
 End
 Else
 Begin
   Writeini('Mage', 'Mage', '2', path)
 End;
 
If(CheckBox4.Checked=True)then
 Begin
 Writeini('General', 'Ks Protection', '1', path)
 End
 Else
 Begin
   Writeini('General', 'Ks Protection', '2', path)
 End;
 
 
If(CheckBox5.Checked=True)then
 Begin
 Writeini('General', 'Archer', '1', path)
 End
 Else
 Begin
   Writeini('General', 'Archer', '2', path)
 End;
End;

Procedure Load;
Begin
path:=scriptPath + 'Simple Config.ini'
archer:=StrtoInt(Readini('General', 'Archer',path));
ksp:=StrtoInt(Readini('General', 'Ks Protection',path));
mageh:=StrtoInt(Readini('Mage', 'Mage Heal', path));
mage:=StrtoInt(Readini('Mage', 'Mage', path));
regularp:=StrtoInt(Readini('Potions', 'Regular:', path));
smallp:=StrtoInt(Readini('Potions', 'Small:',path));
relogf:=StrtoInt(Readini('Relog', 'Relog Feature:', path));
magekey:=StrtoInt(Readini('Hot Keys', 'Mage', path))+111;
healkey:=StrtoInt(Readini('Hot Keys', 'Heal', path))+111;
user:=(Readini('Relog', 'Username:',path));
pass:=(Readini('Relog', 'Password:',path));
magew:=Strtoint(Readini('Waits', 'Mage', path));
healw:=Strtoint(Readini('Waits', 'Heal', path));
path2:=(ReadIni('Path', 'Eo', Path));
cleardebug;
writeln('All Information Loaded From '+ (path));
writeln('Username:= '+(user));
writeln('Password:= '+(pass));
writeln('Mage Wait:= '+inttostr(magew));
writeln('Heal Wait:= '+inttostr(healw));


//////////////////
if(smallp=1)then//
  begin         /////////////////
  writeln('Small Pots Are On');//
  end                          //
 else                          //  Small Pots
 begin                         //
 writeln('Small Pots Are Off');//
 end;                          //
/////////////////////////////////

////////////////////
if(regularp=1)then//
  begin           /////////////////
  writeln('Regular Pots Are On');//
  end                            //
 else                            //  Regular Pots
 begin                           //
 writeln('Regular Pots Are Off');//
 end;                            //
///////////////////////////////////

if(archer=1)then//
  begin         /////////////////
  writeln('Archer Is On');     //
  end                          //
 else                          //  Archer
 begin                         //
 writeln('Archer Is Off');     //
 end;                          //
/////////////////////////////////
writeln('Please Press Run To Start Script.');
End;
////////////////////////////////////////////////////////////////
procedure KeyPress(Char,msWait:Integer);/////////////////////////
begin/////////////////////////////////////////////////////////////
KeyDown(Char);/////////////////////////////////////////////////////
Wait(msWait);///////////////////////////////////////////////////////
KeyUp(Char);/////////////////////////////////////////////////////////
end;//////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////
Procedure Write(str: String);///////////////////////////////////////////
var//////////////////////////////////////////////////////////////////////
i,Txt :Integer;///////////////////////////////////////////////////////////
begin//////////////////////////////////////////////////////////////////////
i:=1////////////////////////////////////////////////////////////////////////These Two Procedures Were Made By FrostF˙r I Did NOT Make Them
txt:=Length(str)///////////////////////////////////////////////////////////
while (i<txt+1) do////////////////////////////////////////////////////////
begin////////////////////////////////////////////////////////////////////
KeyPress(GetKeyCode(StrGet(str,i)),15)//////////////////////////////////
wait(16)///////////////////////////////////////////////////////////////
i:=i+1////////////////////////////////////////////////////////////////
Wait(10)/////////////////////////////////////////////////////////////
end;////////////////////////////////////////////////////////////////
wait(600)//////////////////////////////////////////////////////////
end;//////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////

Procedure Set_Colors;
Begin
hp:=16235924;{Labeled HP in Colors.bmp}
monster:=1638350;{Labeled Mage In Colors.bmp}
lock:=255;{Labeled RelogLock In Colors.bmp}
kscolor:=0;{Dont Change}
ok:=10079232;{Labeled ok In Colors.bmp}
cancel:=6711039;{Labeled Cancel In Colors.bmp}
drops:=8716032;{Labeled Drops In Colors.bmp}
regpot:=32896;{Labled Pots In Colors.bmp}
smallpot:=14001589;{Labeled Small Pots In Colors.bmp}
Cleardebug;
writeln('HP Color:= '+inttostr(hp));
writeln('Monster Color:= '+inttostr(monster));
writeln('Lock Color:= '+inttostr(Lock));
writeln('Ks Color:= '+inttostr(kscolor));
writeln('Ok Color:= '+inttostr(ok));
writeln('Drops Color:= '+inttostr(drops));
writeln('Regular Potion Color:= '+inttostr(regpot));
writeln('Small Potion Color:= '+inttostr(smallpot));
End;

Procedure Run;
Begin
frmDesign.ModalResult:= mrOk;
Load;
Set_Colors;
End;

procedure Browse;
var
  OpenDialog1 : TOpenDialog;
begin
  OpenDialog1 := TOpenDialog.Create(frmParser);
  with OpenDialog1 do
  begin
    InitialDir := '';
    if (InitialDir = '') then // If the InitialDir is empty, set it to the AppPath
      InitialDir := AppPath;
    Options := [ofFileMustExist, ofReadOnly]; // the file must exist and open it read-only

      Filter := 'Endless (*.exe)|*.exe|';
    Filter := Filter + 'All Files (*.*)|*|'; // setup the filter
    if (Execute) then
    begin
      path2 := FileName;
      path:=scriptPath + 'Simple Config.ini'
Writeini('Path', 'Eo', +path2,path)
      
    end;
    Free;
  end;
end;

procedure Click(sender:TObject);
begin
Wait(50);
Case Sender of
Button1: OpenWebPage('http://www.eobots-online.com/index.php');
Button2: Save;
Button3: Load;
Button4: Run;
Button5: Browse;
end;
Wait(50);
end;

procedure Form;
begin
  frmDesign := CreateForm;
  with frmDesign do
  begin
    Position := poScreenCenter;
    BorderStyle := bsSingle;
    BorderIcons := [biMinimize,biSystemMenu];
    Width := 537;
    Height := 480;
    Caption := 'Simple Auto Version 2.5 By Digitx.';
    Color := clTeal;
    Font.Color := clWindowText;
    Font.Height := -37;
    Font.Name := 'Comic Sans MS';
    Font.Style := [fsBold];
    PixelsPerInch := 96;
  end;
  Label1 := TLabel.Create(frmDesign);
  with Label1 do
  begin
    Parent := frmDesign;
    Left := 376;
    Top := 408;
    Width := 152;
    Height := 16;
    Caption := 'Need Any Help? Go Here :D';
    Color := clSkyBlue;
    Font.Color := clWindowText;
    Font.Height := -11;
    Font.Name := 'Comic Sans MS';
    Font.Style := [fsBold];
    ParentColor := False;
  end;
  Label2 := TLabel.Create(frmDesign);
  with Label2 do
  begin
    Parent := frmDesign;
    Left := 8;
    Top := 8;
    Width := 520;
    Height := 56;
    Caption := 'Welcome To Simple Auto :D';
    Color := clSkyBlue;
    Font.Color := clWindowText;
    Font.Height := -40;
    Font.Name := 'Comic Sans MS';
    Font.Style := [];
    ParentColor := False;
  end;
  Button1 := TButton.Create(frmDesign);
  with Button1 do
  begin
    OnClick:=@Click;
    Parent := frmDesign;
    Left := 384;
    Top := 424;
    Width := 137;
    Height := 25;
    Caption := 'www.eobots-online.com';
    Font.Color := clLime;
    Font.Height := -11;
    Font.Name := 'MS Sans Serif';
    Font.Style := [];
    TabOrder := 0;
  end;
  RelogBox := TGroupBox.Create(frmDesign);
  with RelogBox do
  begin
    Parent := frmDesign;
    Left := 8;
    Top := 72;
    Width := 249;
    Height := 113;
    Caption := 'Relog Settings';
    Color := clSkyBlue;
    Font.Color := clWindowText;
    Font.Height := -16;
    Font.Name := 'Comic Sans MS';
    Font.Style := [fsBold];
    ParentColor := False;
    TabOrder := 1;
  end;
  Label3 := TLabel.Create(RelogBox);
  with Label3 do
  begin
    Parent := RelogBox;
    Left := 8;
    Top := 24;
    Width := 66;
    Height := 19;
    Caption := 'Username:';
    Font.Color := clWindowText;
    Font.Height := -13;
    Font.Name := 'Comic Sans MS';
    Font.Style := [fsBold];
  end;
  Label4 := TLabel.Create(RelogBox);
  with Label4 do
  begin
    Parent := RelogBox;
    Left := 8;
    Top := 48;
    Width := 62;
    Height := 19;
    Caption := 'Password:';
    Font.Color := clWindowText;
    Font.Height := -13;
    Font.Name := 'Comic Sans MS';
    Font.Style := [fsBold];
  end;
  Edit1 := TEdit.Create(RelogBox);
  with Edit1 do
  begin
    Parent := RelogBox;
    Left := 80;
    Top := 24;
    Width := 121;
    Height := 24;
    Font.Color := clWindowText;
    Font.Height := -11;
    Font.Name := 'Comic Sans MS';
    Font.Style := [fsBold];
    TabOrder := 0;
    Text := 'Your Username Here';
  end;
  Edit2 := TEdit.Create(RelogBox);
  with Edit2 do
  begin
    Parent := RelogBox;
    Left := 80;
    Top := 48;
    Width := 121;
    Height := 24;
    Font.Color := clWhite;
    PasswordChar := #1;
    Font.Height := -11;
    Font.Name := 'Comic Sans MS';
    Font.Style := [fsBold];
    TabOrder := 1;
    Text := 'Edit2';
  end;
  CheckBox1 := TCheckBox.Create(RelogBox);
  with CheckBox1 do
  begin
    Parent := RelogBox;
    Left := 8;
    Top := 80;
    Width := 233;
    Height := 17;
    Caption := 'Relog? Check if You want to Relog';
    Font.Color := clWindowText;
    Font.Height := -12;
    Font.Name := 'Comic Sans MS';
    Font.Style := [fsBold];
    TabOrder := 2;
  end;
  MageBox := TGroupBox.Create(frmDesign);
  with MageBox do
  begin
    Parent := frmDesign;
    Left := 8;
    Top := 192;
    Width := 249;
    Height := 145;
    Caption := 'Mage Settings';
    Color := clSkyBlue;
    Font.Color := clWindowText;
    Font.Height := -11;
    Font.Name := 'Comic Sans MS';
    Font.Style := [fsBold];
    ParentColor := False;
    TabOrder := 2;
  end;
  Label5 := TLabel.Create(MageBox);
  with Label5 do
  begin
    Parent := MageBox;
    Left := 8;
    Top := 24;
    Width := 118;
    Height := 21;
    Caption := 'Mage Hotkey: F';
    Font.Color := clWindowText;
    Font.Height := -15;
    Font.Name := 'Comic Sans MS';
    Font.Style := [fsBold];
  end;
  Label6 := TLabel.Create(MageBox);
  with Label6 do
  begin
    Parent := MageBox;
    Left := 8;
    Top := 56;
    Width := 113;
    Height := 21;
    Caption := 'Heal Hotkey: F';
    Font.Color := clWindowText;
    Font.Height := -15;
    Font.Name := 'Comic Sans MS';
    Font.Style := [fsBold];
  end;
  Label7 := TLabel.Create(MageBox);
  with Label7 do
  begin
    Parent := MageBox;
    Left := 8;
    Top := 88;
    Width := 113;
    Height := 16;
    Caption := 'Wait Between Mage:';
  end;
  Label8 := TLabel.Create(MageBox);
  with Label8 do
  begin
    Parent := MageBox;
    Left := 8;
    Top := 112;
    Width := 107;
    Height := 16;
    Caption := 'Wait Between Heal:';
  end;
  Edit3 := TEdit.Create(MageBox);
  with Edit3 do
  begin
    Parent := MageBox;
    Left := 128;
    Top := 24;
    Width := 17;
    Height := 27;
    Font.Color := clWindowText;
    Font.Height := -13;
    Font.Name := 'Comic Sans MS';
    Font.Style := [fsBold];
    TabOrder := 0;
    Text := '2';
  end;
  HealHotKey := TEdit.Create(MageBox);
  with HealHotKey do
  begin
    Parent := MageBox;
    Left := 121;
    Top := 57;
    Width := 15;
    Height := 27;
    Font.Color := clWindowText;
    Font.Height := -13;
    Font.Name := 'Comic Sans MS';
    Font.Style := [fsBold];
    TabOrder := 1;
    Text := '1';
  end;
  MageCheckBox := TCheckBox.Create(MageBox);
  with MageCheckBox do
  begin
    Parent := MageBox;
    Left := 152;
    Top := 24;
    Width := 89;
    Height := 17;
    Caption := 'Want To Mage?';
    Font.Color := clWindowText;
    Font.Height := -9;
    Font.Name := 'Comic Sans MS';
    Font.Style := [fsBold];
    TabOrder := 2;
  end;
  CheckBox3 := TCheckBox.Create(MageBox);
  with CheckBox3 do
  begin
    Parent := MageBox;
    Left := 144;
    Top := 64;
    Width := 97;
    Height := 17;
    Caption := 'Want To Heal?';
    Font.Color := clWindowText;
    Font.Height := -9;
    Font.Name := 'Comic Sans MS';
    Font.Style := [fsBold];
    TabOrder := 3;
  end;
  HealEdit := TEdit.Create(MageBox);
  with HealEdit do
  begin
    Parent := MageBox;
    Left := 128;
    Top := 112;
    Width := 97;
    Height := 18;
    Font.Color := clWindowText;
    Font.Height := -9;
    Font.Name := 'Comic Sans MS';
    Font.Style := [fsBold];
    TabOrder := 4;
    Text := '1000 = 1 Second';
  end;
  MageEdit := TEdit.Create(MageBox);
  with MageEdit do
  begin
    Parent := MageBox;
    Left := 128;
    Top := 88;
    Width := 97;
    Height := 18;
    Font.Color := clWindowText;
    Font.Height := -9;
    Font.Name := 'Comic Sans MS';
    Font.Style := [fsBold];
    TabOrder := 5;
    Text := '1000 = 1 Second';
  end;
  BasicBox := TGroupBox.Create(frmDesign);
  with BasicBox do
  begin
    Parent := frmDesign;
    Left := 272;
    Top := 72;
    Width := 249;
    Height := 89;
    Caption := 'Basic Settings';
    Color := clSkyBlue;
    Font.Color := clWindowText;
    Font.Height := -16;
    Font.Name := 'Comic Sans MS';
    Font.Style := [fsBold];
    ParentColor := False;
    TabOrder := 3;
  end;
  CheckBox4 := TCheckBox.Create(BasicBox);
  with CheckBox4 do
  begin
    Parent := BasicBox;
    Left := 8;
    Top := 24;
    Width := 233;
    Height := 25;
    Caption := 'Ks Protection';
    TabOrder := 0;
  end;
  CheckBox5 := TCheckBox.Create(BasicBox);
  with CheckBox5 do
  begin
    Parent := BasicBox;
    Left := 8;
    Top := 56;
    Width := 233;
    Height := 25;
    Caption := 'Archer (Scav Bow)';
    TabOrder := 1;
  end;
  PotionBox := TGroupBox.Create(frmDesign);
  with PotionBox do
  begin
    Parent := frmDesign;
    Left := 8;
    Top := 344;
    Width := 249;
    Height := 97;
    Caption := 'Potion Settings';
    Color := clSkyBlue;
    Font.Color := clWindowText;
    Font.Height := -16;
    Font.Name := 'Comic Sans MS';
    Font.Style := [fsBold];
    ParentColor := False;
    TabOrder := 4;
  end;
  CheckBox2 := TCheckBox.Create(PotionBox);
  with CheckBox2 do
  begin
    Parent := PotionBox;
    Left := 8;
    Top := 24;
    Width := 121;
    Height := 25;
    Caption := 'Small';
    Font.Color := clWindowText;
    Font.Height := -11;
    Font.Name := 'Comic Sans MS';
    Font.Style := [fsBold];
    TabOrder := 0;
  end;
  RegPotCheckBox := TCheckBox.Create(PotionBox);
  with RegPotCheckBox do
  begin
    Parent := PotionBox;
    Left := 8;
    Top := 48;
    Width := 121;
    Height := 25;
    Caption := 'Regular, and Large';
    Font.Color := clWindowText;
    Font.Height := -11;
    Font.Name := 'Comic Sans MS';
    Font.Style := [fsBold];
    TabOrder := 1;
  end;
  Button2 := TButton.Create(frmDesign);
  with Button2 do
  begin
    OnClick:=@Click;
    Parent := frmDesign;
    Left := 272;
    Top := 192;
    Width := 89;
    Height := 33;
    Caption := 'Save!';
    Font.Color := clWindowText;
    Font.Height := -13;
    Font.Name := 'Comic Sans MS';
    Font.Style := [fsBold];
    TabOrder := 13;
  end;
  Button3 := TButton.Create(frmDesign);
  with Button3 do
  begin
    OnClick:=@Click;
    Parent := frmDesign;
    Left := 376;
    Top := 192;
    Width := 89;
    Height := 33;
    Caption := 'Load!';
    Font.Color := clWindowText;
    Font.Height := -13;
    Font.Name := 'Comic Sans MS';
    Font.Style := [fsBold];
    TabOrder := 14;
  end;
  Button4 := TButton.Create(frmDesign);
  with Button4 do
  begin
    Parent := frmDesign;
    OnClick:=@Click;
    Left := 328;
    Top := 240;
    Width := 89;
    Height := 33;
    Caption := 'Run!';
    Font.Color := clWindowText;
    Font.Height := -13;
    Font.Name := 'Comic Sans MS';
    Font.Style := [fsBold];
    TabOrder := 15;
  end;


  Button5 := TButton.Create(frmDesign);
  with Button5 do
  begin
    Parent := frmDesign;
    OnClick:=@Click;
    Left := 300;
    Top := 340;
    Width := 156;
    Height := 33;
    Caption := 'Browse for Endless.exe';
    Font.Color := clWindowText;
    Font.Height := -13;
    Font.Name := 'Comic Sans MS';
    Font.Style := [fsBold];
    TabOrder := 15;
    

  end;
end;

procedure SafeForm;
var
  v : TVariantArray;
begin
  SetArrayLength(v, 0);
  ThreadSafeCall('Form', v);
end;

procedure ShowFormModal;
begin
  frmDesign.ShowModal;
end;

procedure SafeShowFormModal;
var
  v : TVariantArray;
begin
  SetArrayLength(v, 0);
  ThreadSafeCall('ShowFormModal', v);
end;

procedure MainForm;
begin
  SafeForm;
  SafeShowFormModal;
  FreeForm(frmDesign);
end;

Procedure Pot; //Regularp Smallp
Begin

 If(regularp=1)Then
  Begin
///////////////////////////////////////
  If(Not(GetColor(204,33)=44345))Then //
   Begin                           /////
   KeyUp(MageKey);                 //
   Sleep(350);                     //
   Clickmouse(79,366,true);        //
   Repeat                          //////////////Heal
    Begin
    If(findcolorspiral(x,y,regpot,111,362,479,470))Then
    Begin                          //
    Clickmouse(x,y,true);      //
    Wait(50);
    end
    else
     Begin
     cleardebug;
     writeln('No Regular Potions Found! Change Your Settings or Buy Some...');
     End;                   //
    End;                           //////////////////////////
  Until((findcolorspiral(x, y, 44345, 153, 27, 205, 40)) or//
  (findcolorspiral(x, y, Monster, 13, 61, 630, 332)))///////
  keyup(HealKey);  //             /////////////////////
  End;                            //
////////////////////////////////////
  End;
  
 If(smallp=1)Then
  Begin
  ///////////////////////////////////////
  If(Not(GetColor(204,33)=44345))Then //
   Begin                           /////
   KeyUp(MageKey);                 //
   Sleep(350);                     //
   Clickmouse(79,366,true);        //
   Repeat                          //////////////Heal
    Begin
    If(findcolorspiral(x,y,smallpot,111,362,479,470))Then
    Begin                          //
    Clickmouse(x,y,true);      //
    Wait(50);
    end
    else
     Begin
     cleardebug;
     writeln('No Small Potions Found! Change Your Settings or Buy Some...');
     End;                   //
    End;                           //////////////////////////
  Until((findcolorspiral(x, y, 44345, 153, 27, 205, 40)) or//
  (findcolorspiral(x, y, Monster, 13, 61, 630, 332)))///////
  keyup(HealKey);  //             /////////////////////
  End;                            //
////////////////////////////////////
  End;
  
End;

Procedure Relog;
Begin
if(findwindowtitlepart('Endless Online',False))Then
 Begin
 ActivateClient;
 End;
 If(Loggedin=False)Then
 Begin

     Begin
     Clickmouse(600,49,true);//Click The arrow :P
     Wait(1000);
     End;

     
     Repeat
     Begin
     Clickmouse(345,223,true);//Click The Ok Button :P
     Wait(1000);
     End;
     Until(Not(Getcolor(23,398)=lock));
     
     Repeat
     Begin
     Clickmouse(114,369,true);//Click The Play Game Button :P
     Wait(1000);
     Clickmouse(393,320,true);
     Wait(1000);
     End;
     Until(Getcolor(512,331)=lock);

     Repeat
     Begin
     Clickmouse(114,369,true);//Click The Play Game Button :P
     Wait(1000);
     Write(user);
     Wait(500);
     Clickmouse(412,389,true);//Click The Password Field :P
     Wait(500);
     Write(pass);
     Wait(1000);
     Keydown(13);
     wait(350);
     Keyup(13);
     wait(1000);
     Clickmouse(393,323,true);//Click The Ok Button :P
     End;
     Until(Not(Getcolor(521,332)=lock));
     

     Begin
     Wait(1000);
     Clickmouse(541,137,true);
      Repeat
      Begin
       Wait(100);
      End;
      Until(Getcolor(23,398)=lock);
     Loggedin:=True;
     End;
End;
End;



Procedure Checkdc;
Begin
 If(Getcolor(376,325)=Ok)then
 Begin
 loggedin:=false;
  Repeat
  Clickmouse(401,319,true);
  wait(5000);
  cleardebug;
  writeln('Clicking OK');
  Until(not(Getcolor(376,325)=Ok))
 End;
 Relog;
End;

Procedure Melleu;
Begin
if (findcolortriangle(x, y, Monster, 327, 163, 349, 179, 508, 72))
and(archer=1)
Then
Begin
If(not(dir=1))then              //
  Begin                          //
  Sendarrowwait(0,10);           //
  dir:=1;                        //
  End;                           //
 Keydown(17);                    //
 Pot;                            //
 melleing:=1;
 If(Not(findcolortriangle(x, y, Monster, 327, 163, 349, 179, 508, 72)))Then//
  Begin     ////////////////////////////////////////////////
  Keyup(17);//
  End;
  End////////
///////////////////////////////////
Else
Begin
If(GetColor(353,165)=Monster)Then//
 Begin                           //
 If(not(dir=1))then              //
  Begin                          //
  Sendarrowwait(0,10);           //
  dir:=1;                        //
  End;                           //
 Keydown(17);                    //
 Pot;                            //
 melleing:=1;                    ///////////////////////////
 If(Not(Findcolorspiral(x,y,monster,347,151,363,173)))Then//
  Begin     ////////////////////////////////////////////////
  Keyup(17);//
  End;////////
 End;//
End;
End;///

Procedure Mellel;
Begin
if (findcolortriangle(x, y, Monster, 129, 70, 109, 86, 309, 162))
and(archer=1)
Then
Begin
If(not(dir=2))then              //
  Begin                          //
  Sendarrowwait(3,10);           //
  dir:=2;                        //
  End;                           //
 Keydown(17);                    //
 Pot;                            //
 melleing:=1;
 If(Not(findcolortriangle(x, y, Monster, 129, 70, 109, 86, 309, 162)))Then//
  Begin     ////////////////////////////////////////////////
  Keyup(17);//
  End;
  End////////
///////////////////////////////////
Else
Begin
If(GetColor(294,165)=Monster)Then
 Begin
 If(not(dir=2))then
  Begin
  Sendarrowwait(3,10);
  dir:=2;
  End;
 Keydown(17);
 Pot;
 melleing:=1;
 If(Not(FindColorSpiral(x,y,monster,280,148,307,178)))Then
  Begin
  Keyup(17);
  End;
 End;
 End;
End;

Procedure Meller;
Begin
if (findcolortriangle(x, y, Monster, 342, 180, 326, 194, 528, 273))
and(archer=1)
Then
Begin
If(not(dir=3))then              //
  Begin                          //
  Sendarrowwait(1,10);           //
  dir:=3;                        //
  End;                           //
 Keydown(17);                    //
 Pot;                            //
 melleing:=1;
 If(Not(findcolortriangle(x, y, Monster, 342, 180, 326, 194, 528, 273)))Then//
  Begin     ////////////////////////////////////////////////
  Keyup(17);//
  End;
  End////////
///////////////////////////////////
Else
Begin
If(GetColor(344,191)=Monster)Then
 Begin
 If(not(dir=3))then
  Begin
  Sendarrowwait(1,10);
  dir:=3;
  End;
 Keydown(17);
 Pot;
 melleing:=1;
 If(Not(GetColor(344,191)=Monster))Then
  Begin
  Keyup(17);
  End;
 End;
 End;
End;

Procedure Melled;
Begin
if (findcolortriangle(x, y, Monster, 109, 276, 125, 290, 295, 182))
and(archer=1)
Then
Begin
If(not(dir=4))then              //
  Begin                          //
  Sendarrowwait(2,10);           //
  dir:=4;                        //
  End;                           //
 Keydown(17);                    //
 Pot;                            //
 melleing:=1;
 If(Not(findcolortriangle(x, y, Monster, 109, 276, 125, 290, 295, 182)))Then//
  Begin     ////////////////////////////////////////////////
  Keyup(17);//
  End;
  End////////
///////////////////////////////////
Else
Begin
If(GetColor(290,193)=Monster)Then
 Begin
 If(not(dir=4))then
  Begin
  Sendarrowwait(2,10);
  dir:=4;
  End;
 Keydown(17);
 Pot;
 melleing:=1;
 If(Not(GetColor(290,193)=Monster))Then
  Begin
  Keyup(17);
  End;
 End;
 End;
End;

Procedure Flame;
Begin
if(mage=1)
and(not(melleing=1))then
begin
Keydown(magekey);
Cleardebug;
Pot;
If(FindColorSpiral(x,y,monster,13,41,628,335))Then
//If(FindColorSkipBox(x,y,monster,13,41,628,335,KsZone))Then
 Begin
 Keyup(17);
 movemouse(x,y);
 getmousepos(x,y);
 if(getcolor(x,y)=monster)Then
  Begin
  writeln('Now In Mage Mode!');
  writeln('Simple Auto Version 2.5');
  writeln('By Digitx');
  writeln('www.eobots-online.com');
  writeln('Procedure KeyPress and Write Are Made By FrostF˙r I Take No Credit For Them');
  writeln('For Script To Work Properly Please Have Endless As The Default');
  writeln('Path In The Run Prompt');

  Clickmouse(x,y,true);
  End;
 End;
wait(magew);
//if(findcolorspiral(x,y,kscolor,312,489,314,491))and
//(ksp=1)Then
//  Begin
 // ksm:=true;
  //ks1:=x-95
 // ks2:=y-95
//  ks3:=x+95
//  ks4:=y+95
//KsZone:=inttobox(ks1, ks2, ks3, ks4)
//  End;
end
else
begin
if(not(i=1))then
begin
cleardebug;
writeln('You Chose Not To Use Mage');
writeln('Or You Melleing :P');
i:=i-1;
end;
end;
End;

Procedure Melle;
Begin
if(ks=false)Then
Begin
Melleu;//dir - 1
Mellel;//dir - 2
Meller;//dir - 3
Melled;//dir - 4
End;
if(getcolor(313, 490)=kscolor)and
(ksp=1)Then
  Begin
  ks:=true;
  End;
If(Not(GetColor(353,165)=Monster))and
(Not(GetColor(294,165)=Monster))and
(Not(GetColor(344,191)=Monster))and
(Not(GetColor(290,193)=Monster))and
(not(findcolortriangle(x, y, Monster, 327, 163, 349, 179, 508, 72)))and
(not(findcolortriangle(x, y, Monster, 129, 70, 109, 86, 309, 162)))and
(not(findcolortriangle(x, y, Monster, 342, 180, 326, 194, 528, 273)))and
(Not(findcolortriangle(x, y, Monster, 109, 276, 125, 290, 295, 182)))Then
Begin
Keyup(17);
melleing:=2;
End;
End;

Procedure All;
Begin
If(findwindowtitlepart('Endless Online',False))Then
Begin
activateclient;
End;
Wait(1000);
If(Getcolor(23,398)=lock)Then
Begin
Loggedin:=True;
End;
Checkdc;
Relog;
Flame;
Melle;

Begin
If(FindColorSpiral(x,y,monster,13,41,628,335)=False)and
(Not(GetColor(353,165)=Monster))and
(Not(GetColor(294,165)=Monster))and
(Not(GetColor(344,191)=Monster))and
(Not(GetColor(290,193)=Monster))Then
 Begin
 relaxing:=true;
 ks:=False;
 ksm:=False;
///////////////////////////////////////
 If(Not(GetColor(204,33)=44345))Then //
  Begin                           /////
  KeyUp(MageKey);                 //
  Sleep(350);                     //
  Keydown(HealKey);            //
  Repeat                          //////////////Heal
   Begin                          //
   Clickmouse(319,182,true);      //
   Wait(HealW);                   //
   End;                           //
  Until((findcolorspiral(x, y, 44345, 153, 27, 205, 40)) or
(findcolorspiral(x, y, Monster, 13, 61, 630, 332)))
keyup(HealKey);  //
  End;                            //
////////////////////////////////////


Keyup(magekey);
relaxing:=true;
writeln('No Monsters Found Now Relaxing :D');
  writeln('Simple Auto Version 2.5');
  writeln('By Digitx');
  writeln('www.eobots-online.com');
  writeln('Procedure KeyPress and Write Are Made By FrostF˙r I Take No Credit For Them');
  writeln('For Script To Work Properly Please Have Endless As The Default');
  writeln('Path In The Run Prompt');
  writeln('Now Checking Health And Checking For Drops!');
Repeat
wait(100);
////////////////////////////////////////////////////////
if(FindColorSpiral(x, y,drops,244, 149, 398, 224))then//
begin                                                 //
FindColorSpiral(x, y,drops, 244, 149, 398, 224)       /////////////////
wait(140);keydown(119);wait(20);                                     /////////
movemousesmooth(x, y);wait(200);clickmouse(x, y, true);wait(500);keyup(119);////////Drops
end;//////////////////////////////////////////////////////////////////////////
/////
Until(FindColorSpiral(x,y,monster,13,41,628,335))or
(GetColor(353,165)=Monster)or
(GetColor(294,165)=Monster)or
(GetColor(344,191)=Monster)or
(GetColor(290,193)=Monster);
Begin
relaxing:=False;
End;

End;
End;
if(isfkeydown(9))Then
  Begin
  TerminateScript;
  End;
End;

Procedure Main;
Begin
cleardebug;
writeln('Welcome To Simple Auto Version 2.5');
writeln('By Digitx');
writeln('www.eobots-online.com');
writeln('Procedure KeyPress and Write Are Made By FrostF˙r I Take No Credit For Them');
addtoreport('F9 To Stop');
wait(1000);
 if(findwindowtitlepart('Endless Online', false))Then
 Begin
 Activateclient;
 dir:=6;
 ks:=false;
 End
  Else
   Begin
   writeln('Attemting To Start Endless Online');
   writeln('Location: '+(path2));
   keydown(91);wait(100);keydown(82);wait(300);
   keyup(91);wait(100);keyup(82);wait(300);// Brings up run prompt
   sendkeys(path2);
   keydown(13);wait(30);keyup(13);
   repeat
   writeln('Waiting For Eo To Open');
   wait(1000);
   cleardebug;
   Until(findwindowtitlepart('Endless Online',False));
   if(findwindowtitlepart('Endless Online',False))Then
   Begin
   activateclient;
   End;
   End;
repeat
All;
until(isfkeydown(9));
End;

begin
i:=2;
  ClearReport;
  ClearDebug;
  writeln('Welcome to Simple Auto Version 2.5!');
  writeln('Please Input All Of The Information.');
  MainForm;
  wait(2000);
  main;
  Repeat
  if(relaxing=false)Then
  Begin
  All;
  if(isfkeydown(9))Then
  Begin
  TerminateScript;
  End;
  End;
  Until(False);
end.
