Register for your free account! | Forgot your password?

Go Back   elitepvpers > Aion > Aion Hacks, Bots, Cheats & Exploits
You last visited: Today at 01:28

  • Please register to post and access all features, it's quick, easy and FREE!

 

Aion AutoIt Bot Beta [Open Source]

Reply
 
Old   #826
 
elite*gold: 0
Join Date: Jan 2008
Posts: 1
Received Thanks: 0
huhu, ich hab das problem, dass wenn ich wp´s adde die immer die gleichen kords haben.
egal wo ich bin, ich hab immer die selben kords. bitte um hilfe, danke...


lG



nicestef is offline  
Old   #827
 
elite*gold: 0
Join Date: Dec 2008
Posts: 27
Received Thanks: 5
bei mir gehts irgendwie nicht und noch was.
wieso hast du da keine WinGetHandle reingemacht xD
und ein paar kleine fehler sind auch drin die aber nicht wirklich schlimm sind ^^
naajaa ich sag mal danke das du den gepostet hast auch wenn mir der bot an sich nichts bringt die Source war da interessanter^^


Kirasame is offline  
Old   #828
 
elite*gold: 0
Join Date: Nov 2009
Posts: 1
Received Thanks: 0
Hi bei mir funzt des iwie net -.- wenn ich die WPs einstelle egal wieviele egal welche abstände oder sonstwas, sobald ich den bot aktiviere läuft der irgendwo in die pampa un die meisten mobs registriert er gar net...warum?
Zoddster is offline  
Old   #829
 
elite*gold: 0
Join Date: Oct 2009
Posts: 295
Received Thanks: 103
MiniMax2

Now works with Min / Max Distance ...

for me its about 30% more eff. then the new RC2.3...

i changed a lot of stuff in this version ... and dont tell me
its not working... (see Mele pic... ) ... as i changed combat
movements please use this SETUP:

1. Use standard Keyboard setup !

2. Use these Options
You must register and activate your account in order to view images.


See pics how i Set the timers.. hope it helps

try to play a bit with the Casttime if you DA combos dont hit...
if its only spamming one spell then you have to increase its
Cooldown... (Cooldown may be bigger then the actual one but
sure not smaller ... same for Casting time )

Precast:
Can be used as buff... but if you want speedkill then input
your pulling spell here (voke or what ever..) .. the bot autm.
goes to MAX DISTANCE before it does PRECAST ...

START WITH ATTACK 1 ... "x" out the ones you dont need

..... if people still use the old version ill keep tuning it for fun...

Testresult:

You must register and activate your account in order to view images.


Mele Pic:

You must register and activate your account in order to view images.



Mage Pic:

You must register and activate your account in order to view images.
Attached Files
File Type: zip MiniMax2.zip (323.7 KB, 79 views)


chefes78 is offline  
Old   #830
 
elite*gold: 0
Join Date: Oct 2009
Posts: 295
Received Thanks: 103
...

this version runs along your waypoints and only attacks mob within
max range ... perfect for mages

Code:
#AutoIT3Wrapper_UseUpx=n
#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_outfile=AutoAion_beta_010.exe
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <GuiConstants.au3>
#Include <file.au3>
#include <NoMadMemory.au3>

GuiCreate("AutoAion v0.10.2 MiniMax2 ", 270,800, 1100, 50,-1, $WS_EX_TOPMOST)
GUICtrlCreatePic("logo.jpg", 0, 736, 270, 74)
GUISetBkColor(0xffffff)
GUISetState(@SW_SHOW)
GuiCtrlSetState(-1,$GUI_DISABLE)

HotKeySet("{F7}","Eexit")
HotKeySet("{F8}","Eexit")
HotKeySet("{F9}","Eexit")
HotKeySet("{F10}","Eexit")
HotKeySet("{F11}","Eexit")
HotKeySet("{F12}","Eexit")
HotKeySet("{F5}","stop")
HotKeySet("{NUMPADADD}","_keyboardToWpInterface")
Global $attack8hp = 65
global $looks
global $attackdistmax
Global $attackdistmin
global $abstand1
Global $looted
global $atck
Global $loopcounter = 0
global $abstand
Global $configFile = "AA.conf"
Global $Run = False
Global $enemyKillCount = 0
Global $enemyEpCount = 0
Global $playerEnergy
Global $playerEnergyMax
Global $playerHP
Global $playerHPMax
Global $playerEP
Global $playerEPMax
Global $targetHPpercent
Global $AionRun = False
Global $pid = 0
Global $openmem = 0
Global $baseADDR = 0
Global $finalADDR = 0
Global $wpField[1000]
Global $count =1
Global $countMax=0
global $pi = 3.14159265358979323846264338327950
global $file1 = "data.txt"

global $attack1 = "x"
global $attack2 = "x"
global $attack3 = "x"
global $attack4 = "x"
global $attack5 = "x"
global $attack6 = "x"
global $attack7 = "x"
global $attack8 = "x"
global $attack9 = "x"
global $attack10 = "x"
global $attack11 = "x"
global $attack12 = "x"
global $attack13 = "x"

global $attackgk = "1"
Global $attackgd = "5"
global $attackgdm = "15"

global $loot = "x"
global $reg = "x"
Global $i =0
global $attack1c = "0"
global $attack2c = "0"
global $attack3c = "0"
global $attack4c = "0"
global $attack5c = "0"
global $attack6c = "0"
global $attack7c = "0"
global $attack8c = "0"
global $attack9c = "0"
global $attack10c = "0"
global $attack11c = "0"
global $attack12c = "0"
global $attack13c = "0"

global $attack1Cd = "0"
global $attack2Cd = "0"
global $attack3Cd = "0"
global $attack4Cd = "0"
global $attack5Cd = "0"
global $attack6Cd = "0"
global $attack7Cd = "0"
global $attack8Cd = "0"
global $attack9Cd = "0"
global $attack10Cd = "0"
global $attack11Cd = "0"
global $attack12Cd = "0"
global $attack13Cd = "0"

global $attack1LastCast = "0"
global $attack2LastCast = "0"
global $attack3LastCast = "0"
global $attack4LastCast = "0"
global $attack5LastCast = "0"
global $attack6LastCast = "0"
global $attack7LastCast = "0"
global $attack8LastCast = "0"
global $attack9LastCast = "0"
global $attack10LastCast = "0"
global $attack11LastCast = "0"
global $attack12LastCast = "0"
global $attack13LastCast = "0"

global $killCount
global $status
global $TimeCount
global $jumper = 0

global $attack1_da
global $attack2_da
global $attack3_da
global $attack4_da
global $attack5_da
global $attack6_da
global $attack7_da
global $attack8_da
global $attack9_da
global $attack10_da
global $attack11_da
;~ global $attack12_da
;~ global $attack13_da
;~ global $attack14_da

global $attack1mm_da
global $attack2mm_da
global $attack3mm_da
global $attack4mm_da
global $attack5mm_da
global $attack6mm_da
global $attack7mm_da
global $attack8mm_da
global $attack9mm_da
global $attack10mm_da
;~ global $attack11mm_da
;~ global $attack12mm_da
;~ global $attack13mm_da
;~ global $attack14mm_da


global $attack18hp = 85
global $reg_minLife = 40
global $reg_minMana = 10

global $timeDiff = 0;
global $lastTime = 0;
global $newTime = 0;
global $avgTime = 0;

global $rot_down = "a down"
global $rot_up = "a up"

Global $timeToShutdownOutput
Global $sdtimerInput
Global $timeToShutdown = 0
Global $timeCache = 0

Global $combatStartTimer = 0
Global $combatAnimaLibera = 0
Global $goodCombat = 0
Global $combatFlag = 0
Global $lastBlackListEnemy = 0


; THE FUTURE!
Global $confVar1
Global $confVar2
Global $confVar3
Global $confVar4
Global $confVar5
Global $confVar6
Global $confVar7
Global $confVar8
Global $confVar9
Global $confVar10
Global $confVar11
Global $confVar12
Global $confVar13
Global $confVar14
Global $confVar15
Global $confVar16
Global $confVar17
Global $confVar18
Global $confVar19
Global $confVar20
Global $confVar21
Global $confVar22
Global $confVar23
Global $confVar24
Global $confVar25
Global $confVar26
Global $confVar27
Global $confVar28
Global $confVar29
Global $confVar30
Global $confVar31
Global $confVar32
Global $confVar33
Global $confVar34
Global $confVar35
Global $confVar36
Global $confVar37
Global $confVar38
Global $confVar39
Global $confVar40
Global $confVar41
Global $confVar42
Global $confVar43
Global $confVar44
Global $confVar45
Global $confVar46
Global $confVar47



$attack1_da = GUICtrlCreateCheckbox("DA", 195, 60, 35, 20)
$attack2_da = GUICtrlCreateCheckbox("DA",195, 90, 35, 20)
$attack3_da = GUICtrlCreateCheckbox("DA", 195, 120, 35, 20)
$attack5_da = GUICtrlCreateCheckbox("DA", 195, 150, 35, 20)
$attack6_da = GUICtrlCreateCheckbox("DA", 195, 180, 35, 20)
$attack4_da = GUICtrlCreateCheckbox("DA", 195, 30, 35, 20)
$attack7_da = GUICtrlCreateCheckbox("DA", 195, 210, 35, 20)
$attack8_da = GUICtrlCreateCheckbox("DA", 195, 240, 35, 20)
$attack9_da = GUICtrlCreateCheckbox("DA", 195, 270, 35, 20)
$attack10_da = GUICtrlCreateCheckbox("DA", 195, 300 ,35, 20)
$attack11_da = GUICtrlCreateCheckbox("DA", 195, 330, 35, 20)

$attacklmm_da = GUICtrlCreateLabel("Distance",225, 10 , 50, 20)

$attackl111mm_da = GUICtrlCreateLabel(" - Max -",230, 33, 50, 20)
$attack1mm_da = GUICtrlCreateCheckbox("Max", 230, 60, 50, 20)
$attack2mm_da = GUICtrlCreateCheckbox("Max", 230, 90, 50, 20)
$attack3mm_da = GUICtrlCreateCheckbox("Max", 230, 120, 50, 20)
$attack4mm_da = GUICtrlCreateCheckbox("Max", 230, 150, 50, 20)
$attack5mm_da = GUICtrlCreateCheckbox("Max", 230, 180, 50, 20)
$attack6mm_da = GUICtrlCreateCheckbox("Max", 230, 210, 50, 20)
$attack7mm_da = GUICtrlCreateCheckbox("Max", 230, 240, 50, 20)
$attack8mm_da = GUICtrlCreateCheckbox("Max", 230, 270, 50, 20)
$attack9mm_da = GUICtrlCreateCheckbox("Max", 230, 300, 50, 20)
$attack10mm_da = GUICtrlCreateCheckbox("Max", 230, 330, 50, 20)

readKeys()

$Label1 = GUICtrlCreateLabel("Key", 65, 10, 60, 17)
$Label1 = GUICtrlCreateLabel("Casttime", 100, 10, 60, 17)
$Label1 = GUICtrlCreateLabel("Cooldown", 150, 10, 60, 17)

$Label1 = GUICtrlCreateLabel("Kill Count:", 150, 470, 60, 17)
$killCount = GUICtrlCreateLabel($enemyKillCount, 200, 470, 100, 17)
$Label1 = GUICtrlCreateLabel("EP Count:", 150, 490, 60, 17)
$epCount = GUICtrlCreateLabel($enemyEpCount, 200, 490, 100, 17)
$Label1 = GUICtrlCreateLabel("Lvl-up in:", 150, 510, 60, 17)
$TimeCount = GUICtrlCreateLabel($avgTime, 200, 510, 100, 17)
$Label1 = GUICtrlCreateLabel("Shutdown:", 150, 530, 60, 17)
$timeToShutdownOutput = GUICtrlCreateLabel("-----", 210, 530, 100, 17)

$Label1 = GUICtrlCreateLabel("Attack 1:", 15, 62, 44, 17)
$attack1Key = GUICtrlCreateInput($attack1, 65, 60, 20, 21)
$attack1Cast = GUICtrlCreateInput($attack1c, 100, 60, 40, 21)
$attack1Cooldown = GUICtrlCreateInput($attack1Cd, 150, 60, 40, 21)

$Label2 = GUICtrlCreateLabel("Attack 2:", 15, 92, 44, 17)
$attack2Key = GUICtrlCreateInput($attack2, 65, 90, 20, 21)
$attack2Cast = GUICtrlCreateInput($attack2c, 100, 90, 40, 21)
$attack2Cooldown = GUICtrlCreateInput($attack2Cd, 150, 90, 40, 21)

$Label3 = GUICtrlCreateLabel("Attack 3:", 15, 122, 44, 17)
$attack3Key = GUICtrlCreateInput($attack3, 65, 120, 20, 21)
$attack3Cast = GUICtrlCreateInput($attack3c, 100, 120, 40, 21)
$attack3Cooldown = GUICtrlCreateInput($attack3Cd, 150, 120, 40, 21)

$Label5 = GUICtrlCreateLabel("Attack 4:", 15, 152, 44, 17)
$attack5Key = GUICtrlCreateInput($attack5, 65, 150, 20, 21)
$attack5Cast = GUICtrlCreateInput($attack5c, 100, 150, 40, 21)
$attack5Cooldown = GUICtrlCreateInput($attack5Cd, 150, 150, 40, 21)

$Label6 = GUICtrlCreateLabel("Attack 5:", 15, 182, 44, 17)
$attack6Key = GUICtrlCreateInput($attack6, 65, 180, 20, 21)
$attack6Cast = GUICtrlCreateInput($attack6c, 100, 180, 40, 21)
$attack6Cooldown = GUICtrlCreateInput($attack6Cd, 150, 180, 40, 21)

;;; ------------------------------------- new ones  ---------------------

$Label99 = GUICtrlCreateLabel("Attack 6:", 15, 212, 44, 17)
$attack9Key = GUICtrlCreateInput($attack9, 65, 210, 20, 21)
$attack9Cast = GUICtrlCreateInput($attack9c, 100, 210, 40, 21)
$attack9Cooldown = GUICtrlCreateInput($attack9Cd, 150, 210, 40, 21)

$Label100 = GUICtrlCreateLabel("Attack 7:", 15, 242, 44, 17)
$attack10Key = GUICtrlCreateInput($attack10, 65, 240,20, 21)
$attack10Cast = GUICtrlCreateInput($attack10c, 100, 240, 40, 21)
$attack10Cooldown = GUICtrlCreateInput($attack10Cd, 150, 240, 40, 21)



$Label101 = GUICtrlCreateLabel("Attack 8:", 15, 272, 44, 17)
$attack11Key = GUICtrlCreateInput($attack11, 65, 270, 20, 21)
$attack11Cast = GUICtrlCreateInput($attack11c, 100, 270, 40, 21)
$attack11Cooldown = GUICtrlCreateInput($attack11Cd, 150, 270, 40, 21)

$Label102 = GUICtrlCreateLabel("Attack 9:", 15, 302, 44, 17)
$attack12Key = GUICtrlCreateInput($attack12, 65, 300, 20, 21)
$attack12Cast = GUICtrlCreateInput($attack12c, 100, 300, 40, 21)
$attack12Cooldown = GUICtrlCreateInput($attack12Cd, 150, 300, 40, 21)

$Label103 = GUICtrlCreateLabel("Attac 10:", 15, 332, 44, 17)
$attack13Key = GUICtrlCreateInput($attack13, 65, 330, 20, 21)
$attack13Cast = GUICtrlCreateInput($attack13c, 100, 330, 40, 21)
$attack13Cooldown = GUICtrlCreateInput($attack13Cd, 150, 330, 40, 21)

;-----------------------------------------------------------------------------------

$Label4 = GUICtrlCreateLabel("PreCast:", 17, 32, 50, 17)
$attack4Key = GUICtrlCreateInput($attack4, 65, 30, 20, 21)
$attack4Cast = GUICtrlCreateInput($attack4c, 100, 30, 40, 21)
$attack4Cooldown = GUICtrlCreateInput($attack4Cd, 150, 30, 40, 21)

$Label7 = GUICtrlCreateLabel("PostCast:", 14, 412, 50, 17)
$attack7Key = GUICtrlCreateInput($attack7, 65, 410, 20, 21)
$attack7Cast = GUICtrlCreateInput($attack7c, 100, 410, 40, 21)
$attack7Cooldown = GUICtrlCreateInput($attack7Cd, 150, 410, 40, 21)

$Label8 = GUICtrlCreateLabel("Em Cast:", 14, 442, 50, 17)
$attack8Key = GUICtrlCreateInput($attack8, 65, 440, 20, 21)
$attack8Cast = GUICtrlCreateInput($attack8c, 100, 440, 40, 21)
$attack8Cooldown = GUICtrlCreateInput($attack8Cd, 150, 440, 40, 21)
$Label8 = GUICtrlCreateLabel("HP:", 191, 442, 18, 17)
$attack8hitPoint = GUICtrlCreateInput($attack8hp, 210, 440, 20, 21)
$Label8 = GUICtrlCreateLabel("%", 232, 442, 10, 17)


$Label3 = GUICtrlCreateLabel("Loot:", 35, 472, 25, 17)
$lootKey = GUICtrlCreateInput($loot, 65, 470, 20, 21)

$Label3 = GUICtrlCreateLabel("Reg:", 36, 502, 22, 17)
$regKey = GUICtrlCreateInput($reg, 65, 500, 20, 21)
$Label3 = GUICtrlCreateLabel("HP:", 90, 502, 19, 15)
$Label3 = GUICtrlCreateLabel("MA:", 90, 530, 19, 15)
$regMin = GUICtrlCreateInput($reg_minLife, 110, 500, 20, 21)
$regMinMana = GUICtrlCreateInput($reg_minMana, 110, 527, 20, 21)
$Label3 = GUICtrlCreateLabel("%", 130, 502, 10, 17)
$Label3 = GUICtrlCreateLabel("%", 130, 530, 10, 17)

$Label9 = GUICtrlCreateLabel("Key:", 38 ,560, 20, 17)
$Labe20 = GUICtrlCreateLabel("Min distance:", 98,560, 70, 17)
$Labe21 = GUICtrlCreateLabel("Max:", 193 ,560, 23, 17)
$atck = GUICtrlCreateInput($attackgk, 65, 558, 20, 21)
$attackdistmin = GUICtrlCreateInput($attackgd, 165,558, 22, 21)
$attackdistmax = GUICtrlCreateInput($attackgdm, 219 ,558, 27, 21)
GUICtrlCreatePic("attack.jpg", 10, 555 , 25	, 25)


$Label6 = GUICtrlCreateLabel("Filename:", 40,590, 70, 17)
$wpFileInput = GUICtrlCreateInput("", 140, 607, 70, 20)
$Label6 = GUICtrlCreateLabel("Filename:", 150,590, 70, 17)
$wpSaveInput = GUICtrlCreateInput("", 30, 607, 70, 20)
; status field
$status = GUICtrlCreateLabel("Start Bot-Engine... done!"&getCredits(), 5,690, 230, 55)
;buttons
$buttonSave = GuiCtrlCreateButton("Save", 30,660,70,20)
$buttonRun = GuiCtrlCreateButton("Run Bot", 140,660,70,20)
$buttonAddWayPoint = GuiCtrlCreateButton("Add WP", 30,630,70,20)
$buttonOpenWayPoint = GuiCtrlCreateButton("Open WP", 140,630,70,20)


$Label2 = GUICtrlCreateLabel("Timer:", 200, 695, 44, 17)
$sdtimerInput = GUICtrlCreateInput("0", 200, 710, 60, 21)


Func stop()
		Send("{w up}")
		$Run = False
		GUICtrlSetData ($buttonRun,"Start Bot")
	EndFunc


;#################################################
;interface functions
;#################################################

func readKeys()
	if FileExists($file1) Then

	$attack1 = FileReadLine($file1,"1")
	$attack2 = FileReadLine($file1,"2")
	$attack3 = FileReadLine($file1,"3")
	$attack4 = FileReadLine($file1,"14")

	$loot = FileReadLine($file1,"4")
	$reg = FileReadLine($file1,"5")
	$reg_minLife = FileReadLine($file1,"12")
	$reg_minMana = FileReadLine($file1,"13")

	$attack1c = FileReadLine($file1,"6")
	$attack2c = FileReadLine($file1,"7")
	$attack3c = FileReadLine($file1,"8")
	$attack4c = FileReadLine($file1,"15")

	$attack1Cd = FileReadLine($file1,"9")
	$attack2Cd = FileReadLine($file1,"10")
	$attack3Cd = FileReadLine($file1,"11")
	$attack4Cd = FileReadLine($file1,"16")

	if (FileReadLine($file1,"17") == 1) Then
		GUICtrlSetState($attack1_da,$GUI_CHECKED)
	EndIf
	if (FileReadLine($file1,"18") == 1) Then
		GUICtrlSetState($attack2_da,$GUI_CHECKED)
	EndIf
	if (FileReadLine($file1,"19") == 1) Then
		GUICtrlSetState($attack3_da,$GUI_CHECKED)
	EndIf
	if (FileReadLine($file1,"20") == 1) Then
		GUICtrlSetState($attack4_da,$GUI_CHECKED)
	EndIf
	if (FileReadLine($file1,"21") == 1) Then
		GUICtrlSetState($attack5_da,$GUI_CHECKED)
	EndIf
	if (FileReadLine($file1,"22") == 1) Then
		GUICtrlSetState($attack6_da,$GUI_CHECKED)
	EndIf

	if (FileReadLine($file1,"39") == 1) Then
		GUICtrlSetState($attack1mm_da,$GUI_CHECKED)
	EndIf
	if (FileReadLine($file1,"40") == 1) Then
		GUICtrlSetState($attack2mm_da,$GUI_CHECKED)
	EndIf
	if (FileReadLine($file1,"41") == 1) Then
		GUICtrlSetState($attack3mm_da,$GUI_CHECKED)
	EndIf
	if (FileReadLine($file1,"42") == 1) Then
		GUICtrlSetState($attack4mm_da,$GUI_CHECKED)
	EndIf
	if (FileReadLine($file1,"43") == 1) Then
		GUICtrlSetState($attack5mm_da,$GUI_CHECKED)
	EndIf
	if (FileReadLine($file1,"44") == 1) Then
		GUICtrlSetState($attack6mm_da,$GUI_CHECKED)
	EndIf
		if (FileReadLine($file1,"45") == 1) Then
		GUICtrlSetState($attack7mm_da,$GUI_CHECKED)
	EndIf
		if (FileReadLine($file1,"46") == 1) Then
		GUICtrlSetState($attack8mm_da,$GUI_CHECKED)
	EndIf
		if (FileReadLine($file1,"47") == 1) Then
		GUICtrlSetState($attack9mm_da,$GUI_CHECKED)
	EndIf
		if (FileReadLine($file1,"48") == 1) Then
		GUICtrlSetState($attack10mm_da,$GUI_CHECKED)
	EndIf
		if (FileReadLine($file1,"49") == 1) Then
		GUICtrlSetState($attack7_da,$GUI_CHECKED)
	EndIf
		if (FileReadLine($file1,"50") == 1) Then
		GUICtrlSetState($attack8_da,$GUI_CHECKED)
	EndIf
		if (FileReadLine($file1,"51") == 1) Then
		GUICtrlSetState($attack9_da,$GUI_CHECKED)
	EndIf
		if (FileReadLine($file1,"52") == 1) Then
		GUICtrlSetState($attack10_da,$GUI_CHECKED)
	EndIf
		if (FileReadLine($file1,"53") == 1) Then
		GUICtrlSetState($attack11_da,$GUI_CHECKED)
	EndIf





	$attack5 = FileReadLine($file1,"23")
	$attack5c = FileReadLine($file1,"24")
	$attack5Cd = FileReadLine($file1,"25")
	$attack6 = FileReadLine($file1,"26")
	$attack6c = FileReadLine($file1,"27")
	$attack6Cd = FileReadLine($file1,"28")
	$attack7 = FileReadLine($file1,"29")
	$attack7c = FileReadLine($file1,"30")
	$attack7Cd = FileReadLine($file1,"31")

	$attack8 = FileReadLine($file1,"32")
	$attack8c = FileReadLine($file1,"33")
	$attack8Cd = FileReadLine($file1,"34")
	$attack8hp = FileReadLine($file1,"35")
	$attackgk =  FileReadLine($file1,"36")
	$attackgd = FileReadLine($file1,"37")
	$attackgdm = FileReadLine($file1,"38")

	$attack9 = FileReadLine($file1,"54")
	$attack9c = FileReadLine($file1,"55")
	$attack9Cd = FileReadLine($file1,"56")

	$attack10 = FileReadLine($file1,"57")
	$attack10c = FileReadLine($file1,"58")
	$attack10Cd = FileReadLine($file1,"59")

	$attack11 = FileReadLine($file1,"60")
	$attack11c = FileReadLine($file1,"61")
	$attack11Cd = FileReadLine($file1,"62")

	$attack12 = FileReadLine($file1,"63")
	$attack12c = FileReadLine($file1,"64")
	$attack12Cd = FileReadLine($file1,"65")

	$attack13 = FileReadLine($file1,"66")
	$attack13c = FileReadLine($file1,"67")
	$attack13Cd = FileReadLine($file1,"68")






	GUICtrlSetData($status,"Save and Load new Values")
	EndIf
EndFunc



Func saveKeys()
	$readAttack1 = GuiCtrlRead($attack1Key)
	$readAttack2 = GuiCtrlRead($attack2Key)
	$readAttack3 = GuiCtrlRead($attack3Key)
	$readAttack4 = GuiCtrlRead($attack4Key)
	$readAttack5 = GuiCtrlRead($attack5Key)
	$readAttack6 = GuiCtrlRead($attack6Key)
	$readAttack7 = GuiCtrlRead($attack7Key)
	$readAttack8  = GuiCtrlRead($attack8Key)
	$readAttack9  = GuiCtrlRead($attack9Key)
	$readAttack10 = GuiCtrlRead($attack10Key)
	$readAttack11 = GuiCtrlRead($attack11Key)
	$readAttack12 = GuiCtrlRead($attack12Key)
	$readAttack13 = GuiCtrlRead($attack13Key)

	$readAttack1cast = GuiCtrlRead($attack1Cast)
	$readAttack2cast = GuiCtrlRead($attack2Cast)
	$readAttack3cast = GuiCtrlRead($attack3Cast)
	$readAttack4cast = GuiCtrlRead($attack4Cast)
	$readAttack5cast = GuiCtrlRead($attack5Cast)
	$readAttack6cast = GuiCtrlRead($attack6Cast)
	$readAttack7cast = GuiCtrlRead($attack7Cast)
	$readAttack8cast = GuiCtrlRead($attack8Cast)
	$readAttack9cast = GuiCtrlRead($attack9Cast)
	$readAttack10cast = GuiCtrlRead($attack10Cast)
	$readAttack11cast = GuiCtrlRead($attack11Cast)
	$readAttack12cast = GuiCtrlRead($attack12Cast)
	$readAttack13cast = GuiCtrlRead($attack13Cast)

	$readAttack1cd = GuiCtrlRead($attack1Cooldown)
	$readAttack2cd = GuiCtrlRead($attack2Cooldown)
	$readAttack3cd = GuiCtrlRead($attack3Cooldown)
	$readAttack4cd = GuiCtrlRead($attack4Cooldown)
	$readAttack5cd = GuiCtrlRead($attack5Cooldown)
	$readAttack6cd = GuiCtrlRead($attack6Cooldown)
	$readAttack7cd = GuiCtrlRead($attack7Cooldown)
	$readAttack8cd = GuiCtrlRead($attack8Cooldown)
	$readAttack9cd = GuiCtrlRead($attack9Cooldown)
	$readAttack10cd = GuiCtrlRead($attack10Cooldown)
	$readAttack11cd = GuiCtrlRead($attack11Cooldown)
	$readAttack12cd = GuiCtrlRead($attack12Cooldown)
	$readAttack13cd = GuiCtrlRead($attack13Cooldown)

	$readAttack1da = GuiCtrlRead($attack1_da)
	$readAttack2da = GuiCtrlRead($attack2_da)
	$readAttack3da = GuiCtrlRead($attack3_da)
	$readAttack4da = GuiCtrlRead($attack4_da)
	$readAttack5da = GuiCtrlRead($attack5_da)
	$readAttack6da = GuiCtrlRead($attack6_da)
	$readAttack7da = GuiCtrlRead($attack7_da)
	$readAttack8da = GuiCtrlRead($attack8_da)
	$readAttack9da = GuiCtrlRead($attack9_da)
	$readAttack10da = GuiCtrlRead($attack10_da)
	$readAttack11da = GuiCtrlRead($attack11_da)



	$readAttack1mm = GuiCtrlRead($attack1mm_da)
	$readAttack2mm = GuiCtrlRead($attack2mm_da)
	$readAttack3mm = GuiCtrlRead($attack3mm_da)
	$readAttack4mm = GuiCtrlRead($attack4mm_da)
	$readAttack5mm = GuiCtrlRead($attack5mm_da)
	$readAttack6mm = GuiCtrlRead($attack6mm_da)
	$readAttack7mm = GuiCtrlRead($attack7mm_da)
	$readAttack8mm = GuiCtrlRead($attack8mm_da)
	$readAttack9mm = GuiCtrlRead($attack9mm_da)
	$readAttack10mm = GuiCtrlRead($attack10mm_da)


	$readAttack8hp = GuiCtrlRead($attack8hitPoint)
	$reg_minLife = GuiCtrlRead($regMin)
	$reg_minMana = GuiCtrlRead($regMinMana)




	$readatck = GuiCtrlRead($atck)
	$readattackdistmin = GuiCtrlRead($attackdistmin)
	$readattackdistmax = GuiCtrlRead($attackdistmax)



	$readLoot = GuiCtrlRead($lootKey)
	$readReg = GuiCtrlRead($regKey)
	FileDelete("data.txt")
	FileWriteLine($file1,$readAttack1)		;1
	FileWriteLine($file1,$readAttack2)		;2
	FileWriteLine($file1,$readAttack3)		;3
	FileWriteLine($file1,$readLoot)			;4
	FileWriteLine($file1,$readReg)			;5
	FileWriteLine($file1,$readAttack1cast)	;6
	FileWriteLine($file1,$readAttack2cast)	;7
	FileWriteLine($file1,$readAttack3cast)	;8
	FileWriteLine($file1,$readAttack1cd)	;9
	FileWriteLine($file1,$readAttack2cd)	;10
	FileWriteLine($file1,$readAttack3cd)	;11
	FileWriteLine($file1,$reg_minLife)		;12
	FileWriteLine($file1,$reg_minMana)		;13
	FileWriteLine($file1,$readAttack4)		;14
	FileWriteLine($file1,$readAttack4cast)	;15
	FileWriteLine($file1,$readAttack4cd)	;16

	FileWriteLine($file1,$readAttack1da)	;17
	FileWriteLine($file1,$readAttack2da)	;18
	FileWriteLine($file1,$readAttack3da)	;19
	FileWriteLine($file1,$readAttack4da)	;20
	FileWriteLine($file1,$readAttack5da)	;21
	FileWriteLine($file1,$readAttack6da)	;22


	FileWriteLine($file1,$readAttack5)		;23
	FileWriteLine($file1,$readAttack5cast)	;24
	FileWriteLine($file1,$readAttack5cd)	;25
	FileWriteLine($file1,$readAttack6)		;26
	FileWriteLine($file1,$readAttack6cast)	;27
	FileWriteLine($file1,$readAttack6cd)	;28
	FileWriteLine($file1,$readAttack7)		;29
	FileWriteLine($file1,$readAttack7cast)	;30
	FileWriteLine($file1,$readAttack7cd)	;31
	FileWriteLine($file1,$readAttack8)		;32
	FileWriteLine($file1,$readAttack8cast)	;33
	FileWriteLine($file1,$readAttack8cd)	;34
	FileWriteLine($file1,$readAttack8hp)	;35
	FileWriteLine($file1,$readatck)			;36

	FileWriteLine($file1,$readattackdistmin) ;37
	FileWriteLine($file1,$readattackdistmax) ;38

	FileWriteLine($file1,$readAttack1mm)	 ;39
	FileWriteLine($file1,$readAttack2mm) 	;40
	FileWriteLine($file1,$readAttack3mm) 	;41
	FileWriteLine($file1,$readAttack4mm) 	;42
	FileWriteLine($file1,$readAttack5mm) 	;43
	FileWriteLine($file1,$readAttack6mm) 	;44
	FileWriteLine($file1,$readAttack7mm) 	;45
	FileWriteLine($file1,$readAttack8mm) 	;46
	FileWriteLine($file1,$readAttack9mm) 	;47
	FileWriteLine($file1,$readAttack10mm) 	;48

	FileWriteLine($file1,$readAttack7da)	;49
	FileWriteLine($file1,$readAttack8da)	;50
	FileWriteLine($file1,$readAttack9da)	;51
	FileWriteLine($file1,$readAttack10da)	;52
	FileWriteLine($file1,$readAttack11da)	;53

	FileWriteLine($file1,$readAttack9)		;54
	FileWriteLine($file1,$readAttack9cast)	;55
	FileWriteLine($file1,$readAttack9cd)	;56

	FileWriteLine($file1,$readAttack10)		;57
	FileWriteLine($file1,$readAttack10cast)	;58
	FileWriteLine($file1,$readAttack10cd)	;59

	FileWriteLine($file1,$readAttack11)		;60
	FileWriteLine($file1,$readAttack11cast)	;61
	FileWriteLine($file1,$readAttack11cd)	;62

	FileWriteLine($file1,$readAttack12)		;63
	FileWriteLine($file1,$readAttack12cast)	;64
	FileWriteLine($file1,$readAttack12cd)	;65

	FileWriteLine($file1,$readAttack13)		;66
	FileWriteLine($file1,$readAttack13cast)	;67
	FileWriteLine($file1,$readAttack13cd)	;68
	readKeys()
EndFunc


; THE FUTURE!
Func loadConfig()
	$confVar1 = FileReadLine($configFile,"1")
	$confVar2 = FileReadLine($configFile,"2")
	$confVar3 = FileReadLine($configFile,"3")
	$confVar4 = FileReadLine($configFile,"4")
	$confVar5 = FileReadLine($configFile,"5")
	$confVar6 = FileReadLine($configFile,"6")
	$confVar7 = FileReadLine($configFile,"7")
	$confVar8 = FileReadLine($configFile,"8")
	$confVar9 = FileReadLine($configFile,"9")
	$confVar10 = FileReadLine($configFile,"10")
	$confVar11 = FileReadLine($configFile,"11")
	$confVar12 = FileReadLine($configFile,"12")
	$confVar13 = FileReadLine($configFile,"13")
	$confVar14 = FileReadLine($configFile,"14")
	$confVar15 = FileReadLine($configFile,"15")
	$confVar16 = FileReadLine($configFile,"16")
	$confVar17 = FileReadLine($configFile,"17")
	$confVar18 = FileReadLine($configFile,"18")
	$confVar19 = FileReadLine($configFile,"19")
	$confVar20 = FileReadLine($configFile,"20")
	$confVar21 = FileReadLine($configFile,"21")
	$confVar22 = FileReadLine($configFile,"22")
	$confVar23 = FileReadLine($configFile,"23")
	$confVar24 = FileReadLine($configFile,"24")
	$confVar25 = FileReadLine($configFile,"25")
	$confVar26 = FileReadLine($configFile,"26")
	$confVar27 = FileReadLine($configFile,"27")
	$confVar28 = FileReadLine($configFile,"28")
	$confVar29 = FileReadLine($configFile,"29")
	$confVar30 = FileReadLine($configFile,"30")
	$confVar31 = FileReadLine($configFile,"31")
	$confVar32 = FileReadLine($configFile,"32")
	$confVar33 = FileReadLine($configFile,"33")
	$confVar34 = FileReadLine($configFile,"34")
	$confVar35 = FileReadLine($configFile,"35")
	$confVar36 = FileReadLine($configFile,"36")
	$confVar37 = FileReadLine($configFile,"37")
	$confVar38 = FileReadLine($configFile,"38")
	$confVar39 = FileReadLine($configFile,"39")
	$confVar40 = FileReadLine($configFile,"40")
	$confVar41 = FileReadLine($configFile,"41")
EndFunc

Func _toolTip($msg)
	GUICtrlSetData($status,$msg)
EndFunc

;#################################################
;Memory Read/write functions
;#################################################


Func OpenAionMemory()
	$pid = ProcessExists("AION.bin")
	If $pid == -1 Then
		Return
	EndIf
	$openmem = _MemoryOpen($pid)
	If @error Then
		Return
	EndIf
	$AionRun = True
EndFunc


Func MemReadDLLEnemyHP($offset)
    $StaticOffset = Dec($offset)
    Global $pid
    Global $CUROffset[1]
    $CUROffset[0] = 0
    $baseADDR = _MemoryModuleGetBaseAddress($pid, "Game.dll")
    $finalADDR = "0x" & Hex($baseADDR + $StaticOffset)
    $MemTest = _MemoryRead($finaladdr,$openmem)
	$MemTest = _memoryread(   $MemTest+ 0x1C4,$openmem)
    $MemTest = _memoryread(   $MemTest + 0x0034, $openmem,"byte" )
    Return $MemTest
EndFunc

Func MemReadDLLEnemyLevel($offset)
    $StaticOffset = Dec($offset)
    Global $pid
    Global $CUROffset[1]
    $CUROffset[0] = 0
    $baseADDR = _MemoryModuleGetBaseAddress($pid, "Game.dll")
    $finalADDR = "0x" & Hex($baseADDR + $StaticOffset)
    $MemTest = _MemoryRead($finaladdr,$openmem)
	$MemTest = _memoryread(   $MemTest+ 0x1C4,$openmem)
    $MemTest = _memoryread(   $MemTest + 0x0032, $openmem,"byte" )
    Return $MemTest
EndFunc

Func MemReadTargetType($offset)
    $StaticOffset = Dec($offset)
    Global $pid
    Global $CUROffset[1]
    $CUROffset[0] = 0
    $baseADDR = _MemoryModuleGetBaseAddress($pid, "Game.dll")
    $finalADDR = "0x" & Hex($baseADDR + $StaticOffset)
    $MemTest = _MemoryRead($finaladdr,$openmem)
	$MemTest = _memoryread(   $MemTest+ 0x1C4,$openmem)
    $MemTest = _memoryread(   $MemTest + 0x0168, $openmem )
    Return $MemTest
EndFunc



Func MemReadDLL($offset)
    $StaticOffset = Dec($offset)
    Global $pid
    Global $CUROffset[1]
    $CUROffset[0] = 0
    $baseADDR = _MemoryModuleGetBaseAddress($pid, "Game.dll")
    $finalADDR = "0x" & Hex($baseADDR + $StaticOffset)
    $MemTest = _MemoryRead($finaladdr,$openmem)

    Return $MemTest
EndFunc

Func MemReadDLLFloat($offset)
	$StaticOffset = Dec($offset)
	Global $pid
	Global $CUROffset[1]
	$CUROffset[0] = 0
	$baseADDR = _MemoryModuleGetBaseAddress($pid, "Game.dll")
	$finalADDR = "0x" & Hex($baseADDR + $StaticOffset)
	$MemTest = _MemoryRead($finaladdr,$openmem,"float")
	Return $MemTest
EndFunc

Func MemWriteDLL($offset, $data)
	$StaticOffset = Dec($offset)
	Global $pid
	Global $CUROffset[1]
	$CUROffset[0] = 0
	$baseADDR = _MemoryModuleGetBaseAddress($pid, "Game.dll")
	$finalADDR = "0x" & Hex($baseADDR + $StaticOffset)

	_MemoryWrite($finalADDR,$openmem,$data,"float")
	Return
EndFunc

Func MemReadEntity($offset)
    $StaticOffset = Dec($offset)
    Global $pid
    Global $CUROffset[1]
    $CUROffset[0] = 0
    $baseADDR = _MemoryModuleGetBaseAddress($pid, "Game.dll")
    $finalADDR = "0x" & Hex($baseADDR + $StaticOffset)
    $MemTest = _memoryread($finaladdr,$openmem)
	$MemTest = _memoryread($MemTest+ 0x1C4,$openmem)
    Return $MemTest
EndFunc

Func MemReadTargetName($offset = "4F68FC")
    $StaticOffset = Dec($offset)
    Global $pid
    Global $CUROffset[1]
    $CUROffset[0] = 0
    $baseADDR = _MemoryModuleGetBaseAddress($pid, "Game.dll")
    $finalADDR = "0x" & Hex($baseADDR + $StaticOffset)
    $MemTest = _memoryread($finaladdr,$openmem)
	$MemTest = _memoryread($MemTest+ 0x4 ,$openmem)
	;$MemTest = _memoryread(   $MemTest + 0x0036 , $openmem,"byte" )
    Return $MemTest
EndFunc

Func GetDistance()																				;;;: distance  - Added by kknb 30.10.2009
    $y1 = PlayerXPos()
    $targetx = MemReadtargetxCoord("4F68FC")
    $x1 = PlayerYPos()
    $targety = MemReadtargetYCoord("4F68FC")
    $diff = sqrt((($x1 - $targetx)^2) + (($y1 - $targety)^2))
    $erg = Round($diff)
Return $erg -3
EndFunc

Func MemReadtargetxCoord($offset)
    $StaticOffset = Dec($offset)
    Global $pid
    Global $CUROffset[1]
    $CUROffset[0] = 0
    $baseADDR = _MemoryModuleGetBaseAddress($pid, "Game.dll")
    $finalADDR = "0x" & Hex($baseADDR + $StaticOffset)
    $MemTest = _memoryread($finaladdr,$openmem)
	$MemTest = _memoryread($MemTest+ 0x28,$openmem,"float")
    Return $MemTest
EndFunc

Func MemReadtargetYCoord($offset)
    $StaticOffset = Dec($offset)
    Global $pid
    Global $CUROffset[1]
    $CUROffset[0] = 0
    $baseADDR = _MemoryModuleGetBaseAddress($pid, "Game.dll")
    $finalADDR = "0x" & Hex($baseADDR + $StaticOffset)
    $MemTest = _memoryread($finaladdr,$openmem)
	$MemTest = _memoryread($MemTest+ 0x2c,$openmem,"float")
    Return $MemTest
EndFunc


; the HP of the TargetEnemy
Func CheckEnemyDead()
	return MemReadDLLEnemyHP("4F68FC")
	;Return 0
EndFunc

Func playerCurrectEP()
	return MemReadDLL("8EEEA8")
EndFunc

Func PlayerMaxEP()
	return MemReadDLL("8EEE98")
EndFunc

Func playerCurrectMana()
	return MemReadDLL("8EEEC0")
EndFunc

Func PlayerMaxMana()
	return MemReadDLL("8EEEBC")
EndFunc

Func playerCurrectHp()
	return MemReadDLL("8EEEB8")
EndFunc

Func playerCurrectHpPercent()
	$val = MemReadDLL("8EEEB8")
	$Pval = ($val * 100) / PlayerMaxHp()
	return Round($Pval)
EndFunc

Func PlayerMaxHp()
	return MemReadDLL("8EEEB4")
EndFunc

Func PlayerXPos()
	return MemReadDLLFloat("8E6944")
EndFunc

Func PlayerYPos()
	return MemReadDLLFloat("8E6940")
EndFunc

Func PlayerZPos()
	return MemReadDLLFloat("8E6948")
EndFunc

; Angel of the Player 360° / 2 :)
Func GetPlayerPos()
	Return MemReadDLLFloat("8E40C0")
EndFunc

Func GetEnemyLvl()
	Return MemReadDLLEnemyLevel("4F68FC")
EndFunc

Func getEnityId()
	Return MemReadEntity("4F68FC")
EndFunc

Func getTargetOfTarget()
	Return MemReadTargetName()
EndFunc

Func getEnemyType()
	Return MemReadTargetType("4F68FC")
EndFunc

Func ReadMemValues()
	$playerHP = playerCurrectHp()
	$playerHPMax = PlayerMaxHp()

	$playerEP = playerCurrectEP()
	$playerEPMax = PlayerMaxEP()
	$playerEnergy = playerCurrectMana()
	$playerEnergyMax = PlayerMaxMana()
EndFunc

;#################################################
;fight functions
;#################################################

Func enemyInsgid()
	$enemyhp = CheckEnemyDead()
	if $enemyhp <> 0 And $enemyhp > 99 And getEnemyType() <> 0 then
		if GetEnemyLvl() = 1 Then
			return false
		EndIf
		return true
	EndIf
;~ 	return false
EndFunc

Func KillEnemy()

		send($attackgk)
		send($atck)
			$dist = GetDistance()
			if ( $dist >= $attackgdm ) then
				send($attackgk)
				$timer = _TimeGetStamp() +13
					Do
						sleep(50)
					until GetDistance() <= $attackgd -1 or $timer <=  _TimeGetStamp()
						send("{s down}")
						sleep(40)
						send("{s up}")
						F_EmCast()
;~ 						F_arttack1()
;~ 						validateAttack()
;~ 					Else
;~ 							F_EmCast()
;~ 							F_arttack1()
;~ 							validateAttack()
					EndIf



		_toolTip("pulling mob / otw to mob")
		if $attack4 <> "x" then
			F_buff()
			F_EmCast()


		EndIf
;~ 		sleep(300)
;~ 		;-------------------------------------------------

		while CheckEnemyDead() <> 0

		;-------------------------------------------------
			if $attack1 <> "x" then
				if($combatFlag == 2) Then
					return false
				EndIf
					if(GuiCtrlRead($attack1mm_da) = 1    ) then  									;;;;;;;  MAX hacken ticked
						$dist = GetDistance()
						if ( $dist >= $attackgdm ) then
							send($attackgk)
							$timer = _TimeGetStamp() +13
								Do
									sleep(50)
								until GetDistance() <= $attackgdm -1 or $timer <  _TimeGetStamp()
							send("{s down}")
							sleep(40)
							send("{s up}")
							F_EmCast()
							F_arttack1()
;~ 							sleep(1000)
;~ 							validateAttack()
						Else
							F_EmCast()
							F_arttack1()
;~ 							sleep(1000)
;~ 							validateAttack()
						EndIf

					Else

						$dist = GetDistance()
						if ( $dist >= $attackgd ) then
							send($attackgk)
							$timer = _TimeGetStamp() +13
								Do
									sleep(50)
								until GetDistance() <= $attackgd -1 or $timer <  _TimeGetStamp()
							send("{s down}")
							sleep(40)
							send("{s up}")
							F_EmCast()
							F_arttack1()
;~ 							validateAttack()
						Else
							F_EmCast()
							F_arttack1()
;~ 							validateAttack()
						EndIf
					EndIf
			EndIf
		;-------------------------------------------------

				;-------------------------------------------------
			if $attack2 <> "x" then
				if($combatFlag == 2) Then
					return false
				EndIf
					if(GuiCtrlRead($attack2mm_da) = 1    ) then  									;;;;;;;  MAX hacken ticked
						$dist = GetDistance()
						if ( $dist >= $attackgdm ) then
							send($attackgk)
							$timer = _TimeGetStamp() +13
								Do
									sleep(50)
								until GetDistance() <= $attackgdm -1 or $timer <  _TimeGetStamp()
							send("{s down}")
							sleep(40)
							send("{s up}")
							F_EmCast()
							F_arttack2()
;~ 							validateAttack()
						Else
							F_EmCast()
							F_arttack2()
;~ 							validateAttack()
						EndIf

					Else

						$dist = GetDistance()
						if ( $dist >= $attackgd ) then
							send($attackgk)
							$timer = _TimeGetStamp() +13
								Do
									sleep(50)
								until GetDistance() <= $attackgd -1 or $timer <  _TimeGetStamp()
							send("{s down}")
							sleep(40)
							send("{s up}")
							F_EmCast()
							F_arttack2()
;~ 							validateAttack()
						Else
							F_EmCast()
							F_arttack2()
;~ 							validateAttack()
						EndIf
					EndIf
			EndIf
		;-------------------------------------------------
				;-------------------------------------------------
			if $attack3 <> "x" then
				if($combatFlag == 2) Then
					return false
				EndIf
					if(GuiCtrlRead($attack3mm_da) == 1    ) then  									;;;;;;;  MAX hacken ticked
						$dist = GetDistance()
						if ( $dist >= $attackgdm ) then
							send($attackgk)
							$timer = _TimeGetStamp() +13
								Do
									sleep(50)
								until GetDistance() <= $attackgdm -1 or $timer <  _TimeGetStamp()
							send("{s down}")
							sleep(40)
							send("{s up}")
							F_EmCast()
							F_arttack3()
;~ 							validateAttack()
						Else
							F_EmCast()
							F_arttack3()
;~ 							validateAttack()
						EndIf

					Else

						$dist = GetDistance()
						if ( $dist >= $attackgd ) then
							send($attackgk)
							$timer = _TimeGetStamp() +13
								Do
									sleep(50)
								until GetDistance() <= $attackgd -1 or $timer <  _TimeGetStamp()
							send("{s down}")
							sleep(40)
							send("{s up}")
							F_EmCast()
							F_arttack3()
;~ 							validateAttack()
						Else
							F_EmCast()
							F_arttack3()
;~ 							validateAttack()
						EndIf
					EndIf
			EndIf
		;-------------------------------------------------
				;-------------------------------------------------

		;-------------------------------------------------
				;-------------------------------------------------
			if $attack5 <> "x" then
				if($combatFlag == 2) Then
					return false
				EndIf
					if(GuiCtrlRead($attack4mm_da) == 1    ) then  									;;;;;;;  MAX hacken ticked
						$dist = GetDistance()
						if ( $dist >= $attackgdm ) then
							send($attackgk)
							$timer = _TimeGetStamp() +13
								Do
									sleep(50)
								until GetDistance() <= $attackgdm -1 or $timer <  _TimeGetStamp()
							send("{s down}")
							sleep(40)
							send("{s up}")
							F_EmCast()
							F_arttack5()
;~ 							validateAttack()
						Else
							F_EmCast()
							F_arttack5()
;~ 							validateAttack()
						EndIf

					Else

						$dist = GetDistance()
						if ( $dist >= $attackgd ) then
							send($attackgk)
							$timer = _TimeGetStamp() +13
								Do
									sleep(50)
								until GetDistance() <= $attackgd -1 or $timer <  _TimeGetStamp()
							send("{s down}")
							sleep(40)
							send("{s up}")
							F_EmCast()
							F_arttack5()
;~ 							validateAttack()
						Else
							F_EmCast()
							F_arttack5()
;~ 							validateAttack()
						EndIf
					EndIf
			EndIf
		;-------------------------------------------------
				;-------------------------------------------------
			if $attack6 <> "x" then
				if($combatFlag == 2) Then
					return false
				EndIf
					if(GuiCtrlRead($attack5mm_da) == 1    ) then  									;;;;;;;  MAX hacken ticked
						$dist = GetDistance()
						if ( $dist >= $attackgdm ) then
							send($attackgk)
							$timer = _TimeGetStamp() +13
								Do
									sleep(50)
								until GetDistance() <= $attackgdm -1 or $timer <  _TimeGetStamp()
							send("{s down}")
							sleep(40)
							send("{s up}")
							F_EmCast()
							F_arttack6()
;~ 							validateAttack()
						Else
							F_EmCast()
							F_arttack6()
;~ 							validateAttack()
						EndIf

					Else

						$dist = GetDistance()
						if ( $dist >= $attackgd ) then
							send($attackgk)
							$timer = _TimeGetStamp() +13
								Do
									sleep(50)
								until GetDistance() <= $attackgd -1 or $timer <  _TimeGetStamp()
							send("{s down}")
							sleep(40)
							send("{s up}")
							F_EmCast()
							F_arttack6()
;~ 							validateAttack()
						Else
							F_EmCast()
							F_arttack6()
;~ 							validateAttack()
						EndIf
					EndIf
			EndIf
				;-------------------------------------------------
				;-------------------------------------------------
				;-------------------------------------------------
				;-------------------------------------------------

			if $attack9 <> "x" then
				if($combatFlag == 2) Then
					return false
				EndIf
					if(GuiCtrlRead($attack6mm_da) == 1    ) then  									;;;;;;;  MAX hacken ticked
						$dist = GetDistance()
						if ( $dist >= $attackgdm ) then
							send($attackgk)
							$timer = _TimeGetStamp() +13
								Do
									sleep(50)
								until GetDistance() <= $attackgdm -1 or $timer <  _TimeGetStamp()
							send("{s down}")
							sleep(40)
							send("{s up}")
							F_EmCast()
							F_arttack9()
;~ 							validateAttack()
						Else
							F_EmCast()
							F_arttack9()
;~ 							validateAttack()
						EndIf

					Else

						$dist = GetDistance()
						if ( $dist >= $attackgd ) then
							send($attackgk)
							$timer = _TimeGetStamp() +13
								Do
									sleep(50)
								until GetDistance() <= $attackgd -1 or $timer <  _TimeGetStamp()
							send("{s down}")
							sleep(40)
							send("{s up}")
							F_EmCast()
							F_arttack9()
;~ 							validateAttack()
						Else
							F_EmCast()
							F_arttack9()
;~ 							validateAttack()
						EndIf
					EndIf
			EndIf
		;-------------------------------------------------
				;-------------------------------------------------
			if $attack10 <> "x" then
				if($combatFlag == 2) Then
					return false
				EndIf
					if(GuiCtrlRead($attack7mm_da) == 1    ) then  									;;;;;;;  MAX hacken ticked
						$dist = GetDistance()
						if ( $dist >= $attackgdm ) then
							send($attackgk)
							$timer = _TimeGetStamp() +13
								Do
									sleep(50)
								until GetDistance() <= $attackgdm -1 or $timer <  _TimeGetStamp()
							send("{s down}")
							sleep(40)
							send("{s up}")
							F_EmCast()
							F_arttack10()
;~ 							validateAttack()
						Else
							F_EmCast()
							F_arttack10()
;~ 							validateAttack()
						EndIf

					Else

						$dist = GetDistance()
						if ( $dist >= $attackgd ) then
							send($attackgk)
							$timer = _TimeGetStamp() +13
								Do
									sleep(50)
								until GetDistance() <= $attackgd -1 or $timer <  _TimeGetStamp()
							send("{s down}")
							sleep(40)
							send("{s up}")
							F_EmCast()
							F_arttack10()
;~ 							validateAttack()
						Else
							F_EmCast()
							F_arttack10()
;~ 							validateAttack()
						EndIf
					EndIf
			EndIf
		;-------------------------------------------------
				;-------------------------------------------------
			if $attack11 <> "x" then
				if($combatFlag == 2) Then
					return false
				EndIf
					if(GuiCtrlRead($attack8mm_da) == 1    ) then  									;;;;;;;  MAX hacken ticked
						$dist = GetDistance()
						if ( $dist >= $attackgdm ) then
							send($attackgk)
							$timer = _TimeGetStamp() +13
								Do
									sleep(50)
								until GetDistance() <= $attackgdm -1 or $timer <  _TimeGetStamp()
							send("{s down}")
							sleep(40)
							send("{s up}")
							F_EmCast()
							F_arttack11()
;~ 							validateAttack()
						Else
							F_EmCast()
							F_arttack11()
;~ 							validateAttack()
						EndIf

					Else

						$dist = GetDistance()
						if ( $dist >= $attackgd ) then
							send($attackgk)
							$timer = _TimeGetStamp() +13
								Do
									sleep(50)
								until GetDistance() <= $attackgd -1 or $timer <  _TimeGetStamp()
							send("{s down}")
							sleep(40)
							send("{s up}")
							F_EmCast()
							F_arttack11()
;~ 							validateAttack()
						Else
							F_EmCast()
							F_arttack11()
;~ 							validateAttack()
						EndIf
					EndIf
			EndIf
		;-------------------------------------------------
				;-------------------------------------------------
			if $attack12 <> "x" then
				if($combatFlag == 2) Then
					return false
				EndIf
					if(GuiCtrlRead($attack9mm_da) == 1    ) then  									;;;;;;;  MAX hacken ticked
						$dist = GetDistance()
						if ( $dist >= $attackgdm ) then
							send($attackgk)
							$timer = _TimeGetStamp() +13
								Do
									sleep(50)
								until GetDistance() <= $attackgdm -1 or $timer <  _TimeGetStamp()
							send("{s down}")
							sleep(40)
							send("{s up}")
							F_EmCast()
							F_arttack12()
;~ 							validateAttack()
						Else
							F_EmCast()
							F_arttack12()
;~ 							validateAttack()
						EndIf

					Else

						$dist = GetDistance()
						if ( $dist >= $attackgd ) then
							send($attackgk)
							$timer = _TimeGetStamp() +13
								Do
									sleep(50)
								until GetDistance() <= $attackgd -1 or $timer <  _TimeGetStamp()
							send("{s down}")
							sleep(40)
							send("{s up}")
							F_EmCast()
							F_arttack12()
;~ 							validateAttack()
						Else
							F_EmCast()
							F_arttack12()
;~ 							validateAttack()
						EndIf
					EndIf
			EndIf
		;-------------------------------------------------
				;-------------------------------------------------
			if $attack13 <> "x" then
				if($combatFlag == 2) Then
					return false
				EndIf
					if(GuiCtrlRead($attack10mm_da) == 1    ) then  									;;;;;;;  MAX hacken ticked
						$dist = GetDistance()
						if ( $dist >= $attackgdm ) then
							send($attackgk)
							$timer = _TimeGetStamp() +13
								Do
									sleep(50)
								until GetDistance() <= $attackgdm -1 or $timer <  _TimeGetStamp()
							send("{s down}")
							sleep(40)
							send("{s up}")
							F_EmCast()
							F_arttack13()
;~ 							validateAttack()
						Else
							F_EmCast()
							F_arttack13()
;~ 							validateAttack()
						EndIf

					Else

						$dist = GetDistance()
						if ( $dist >= $attackgd ) then
							send($attackgk)
							$timer = _TimeGetStamp() +13
								Do
									sleep(50)
								until GetDistance() <= $attackgd -1 or $timer <  _TimeGetStamp()
							send("{s down}")
							sleep(40)
							send("{s up}")
							F_EmCast()
							F_arttack13()
;~ 							validateAttack()
						Else
							F_EmCast()
							F_arttack13()
;~ 							validateAttack()
						EndIf
					EndIf
			EndIf



	;-------------------------------------------------

		WEnd

	;-------------------------------------------------
		sleep(500)
		_toolTip("Mob down")

		; add 1 to the kill counter :)
		$enemyKillCount = $enemyKillCount + 1
		GUICtrlSetData( $killCount, $enemyKillCount)
		Sleep(1300)
		; ep counter
		$newEp = playerCurrectEP() - $playerEP
		$playerEP = playerCurrectEP()
		$enemyEpCount = $enemyEpCount + $newEp
		GUICtrlSetData($epCount , $enemyEpCount)
		; loot

		_toolTip("start Looting")
		Send($loot)
		Sleep(400)
		Send($loot)
		calcTime($newEp)
		Sleep(3500)

		if(enemyInsgid() ) Then
			F_EmCast()
			KillEnemy()

		Else

		if $attack7 <> "x" then
			F_PostAttack()
		EndIf
		EndIf

		if(enemyInsgid() ) Then
			F_EmCast()
			KillEnemy()
		EndIf
		sleep(50)
		if ((playerCurrectHp()/$playerHPMax)*100) < $reg_minLife Or ((playerCurrectMana()/$playerEnergyMax)*100) < $reg_minMana Then
			_toolTip("start Reging")
			Send($reg)
			while PlayerMaxHp() <> playerCurrectHp()
				if( CheckEnemyDead() <> 0) Then
					ExitLoop
				EndIf
				if(enemyInsgid() ) Then
				KillEnemy()
				EndIf
				Sleep(1000)


			WEnd
			while PlayerMaxMana() <> playerCurrectMana()
				if(CheckEnemyDead() <> 0) Then
					ExitLoop
				EndIf
				if(enemyInsgid() ) Then
				KillEnemy()
				EndIf
				Sleep(1000)
			WEnd
			Send("{w down}")
			Sleep(100)
			Send("{w up}")
		EndIf
		$jumper = _getRandomJumpTimer()
		return True
EndFunc

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


Func validateAttack()
	if($goodCombat < 1) Then
		if($combatStartTimer < _TimeGetStamp() ) Then
			if(CheckEnemyDead() < 100) Then
				$goodCombat = 1
				$combatFlag = 1
			Elseif($combatAnimaLibera < 2) Then
				if(CheckEnemyDead() < 100) Then
					$goodCombat = 1
					$combatFlag = 1
;~ 					return True
				EndIf
				combatFreeMind()
				$combatAnimaLibera = $combatAnimaLibera + 1
			Else
				$combatFlag = 2
				$lastBlackListEnemy = getEnityId()
			EndIf
		EndIf
	EndIf
EndFunc



Func combatFreeMind()
	Send("{s down}")
	Sleep(1000)
	Send("{s up}")
	if($combatAnimaLibera > 0) Then
		Send("{e down}")
		Sleep(2000)
		Send("{e up}")
		Sleep(70)
		send($attackgk)
	Else
		Send("{q down}")
		Sleep(2000)
		Send("{q up}")
		Sleep(70)
		send($attackgk)
	EndIf

	$combatStartTimer = _TimeGetStamp() + 15
EndFunc


Func checkBlackList()
	If getEnityId() == $lastBlackListEnemy And $lastBlackListEnemy <> 0 Then
		Return False
	Else
		Return True
	EndIf
EndFunc

Func checkShutDown()
	if($timeToShutdown > 0) Then
		$sddiff = $timeToShutdown - _TimeGetStamp()
		If $timeToShutdown < _TimeGetStamp() Then
			Send("{w up}")
			$Run = False
			GUICtrlSetData ($buttonRun,"Start Bot")
		Elseif($sddiff <> $timeCache) Then
			$timeCache = $sddiff
			GUICtrlSetData($timeToShutdownOutput ,SecToTime($sddiff))
		EndIf
	EndIf
EndFunc

Func setShutDownTimer()
	if GuiCtrlRead($sdtimerInput) > 0 And GuiCtrlRead($sdtimerInput) <> "" Then
		$timeToShutdown = _TimeGetStamp() + (GuiCtrlRead($sdtimerInput) * 60)
	Else
		$timeToShutdown = 0
		GUICtrlSetData($timeToShutdownOutput ,"-----")
		$Run = false
	EndIf
EndFunc


;################################################
; Action functions
;################################################

Func Eexit()
Send("{a up}")
Send("{s up}")
Send("{d up}")
Send("{w up}")
;~ Send("{q up}")
;~ Send("{e up}")
	Exit
	EndFunc

Func F_arttack1()
	F_EmCast()
	if(($attack1LastCast + $attack1Cd) < _TimeGetStamp() and CheckEnemyDead() <> 0) Then
		_toolTip("start attack Nr1")
		Send($attack1)
		Sleep($attack1c)
		$attack1LastCast = _TimeGetStamp()
		sleep(200)
		validateAttack()
		if(GuiCtrlRead($attack1_da) == 1 And CheckEnemyDead() <> 0) Then

			Send($attack1)
			sleep($attack1c/4)

			if CheckEnemyDead() <> 0 then
				Send($attack1)
				sleep($attack1c/4)
			EndIf
					if CheckEnemyDead() <> 0 then
					Send($attack1)
					sleep($attack1c/4)
					EndIf

						if CheckEnemyDead() <> 0 then
						Send($attack1)
						sleep($attack1c/4)
						EndIf

					if CheckEnemyDead() <> 0 then
					Send($attack1)
					sleep($attack1c/4)
				EndIf

;~ 			if CheckEnemyDead() <> 0 then
;~ 				Send($attack1)
;~ 				sleep($attack1c/4)
;~ 			EndIf
;~ 					if CheckEnemyDead() <> 0 then
;~ 					Send($attack1)
;~ 					sleep($attack1c/4)
;~ 				EndIf


			Sleep(100)
		EndIf
	EndIf
EndFunc

Func F_arttack2()
	F_EmCast()
	if(($attack2LastCast + $attack2Cd) < _TimeGetStamp() and CheckEnemyDead() <> 0) Then
		_toolTip("start attack Nr2")
		Send($attack2)
		Sleep($attack2c)
		$attack2LastCast = _TimeGetStamp()
		sleep(200)
		validateAttack()
		if(GuiCtrlRead($attack2_da) == 1 And CheckEnemyDead() <> 0) Then
			Send($attack2)
			sleep($attack2c/4)

			if CheckEnemyDead() <> 0 then
				Send($attack2)
				sleep($attack2c/4)
			EndIf
					if CheckEnemyDead() <> 0 then
					Send($attack2)
					sleep($attack2c/4)
					EndIf

						if CheckEnemyDead() <> 0 then
						Send($attack2)
						sleep($attack2c/4)
						EndIf

					if CheckEnemyDead() <> 0 then
					Send($attack2)
					sleep($attack2c/4)
				EndIf
		EndIf
	EndIf
EndFunc

Func F_arttack3()
	F_EmCast()
	if(($attack3LastCast + $attack3Cd) < _TimeGetStamp() and CheckEnemyDead() <> 0) Then
		_toolTip("start attack Nr3")
		Send($attack3)
		Sleep($attack3c)
		$attack3LastCast = _TimeGetStamp()
		sleep(200)
		validateAttack()
		if(GuiCtrlRead($attack3_da) == 1 And CheckEnemyDead() <> 0) Then

			Send($attack3)
			sleep($attack3c/4)

			if CheckEnemyDead() <> 0 then
				Send($attack3)
				sleep($attack3c/4)
			EndIf
					if CheckEnemyDead() <> 0 then
					Send($attack3)
					sleep($attack3c/4)
					EndIf

						if CheckEnemyDead() <> 0 then
						Send($attack3)
						sleep($attack3c/4)
						EndIf

					if CheckEnemyDead() <> 0 then
					Send($attack3)
					sleep($attack3c/4)
				EndIf
		EndIf
	EndIf
EndFunc

Func F_arttack5()
	F_EmCast()
	if(($attack5LastCast + $attack5Cd) < _TimeGetStamp() and CheckEnemyDead() <> 0) Then
		_toolTip("start attack Nr4")
		Send($attack5)
		Sleep($attack5c)
		$attack5LastCast = _TimeGetStamp()
		sleep(200)
		validateAttack()
		if(GuiCtrlRead($attack5_da) == 1 And CheckEnemyDead() <> 0) Then

			Send($attack5)
			sleep($attack5c/4)

			if CheckEnemyDead() <> 0 then
				Send($attack5)
				sleep($attack5c/4)
			EndIf
					if CheckEnemyDead() <> 0 then
					Send($attack5)
					sleep($attack5c/4)
					EndIf

						if CheckEnemyDead() <> 0 then
						Send($attack5)
						sleep($attack5c/4)
						EndIf

					if CheckEnemyDead() <> 0 then
					Send($attack5)
					sleep($attack5c/4)
				EndIf
		EndIf
	EndIf
EndFunc

Func F_arttack6()
	F_EmCast()
	if(($attack6LastCast + $attack6Cd) < _TimeGetStamp() and CheckEnemyDead() <> 0) Then
		_toolTip("start attack Nr5")
		Send($attack6)
		Sleep($attack6c)
		$attack6LastCast = _TimeGetStamp()
		sleep(200)
		validateAttack()
		if(GuiCtrlRead($attack6_da) == 1 And CheckEnemyDead() <> 0) Then

			Send($attack6)
			sleep($attack6c/4)

			if CheckEnemyDead() <> 0 then
				Send($attack6)
				sleep($attack6c/4)
			EndIf
					if CheckEnemyDead() <> 0 then
					Send($attack6)
					sleep($attack6c/4)
					EndIf

						if CheckEnemyDead() <> 0 then
						Send($attack6)
						sleep($attack6c/4)
						EndIf

					if CheckEnemyDead() <> 0 then
					Send($attack6)
					sleep($attack6c/4)
				EndIf
		EndIf
	EndIf
EndFunc

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;_

Func F_arttack9()
	F_EmCast()
	if(($attack9LastCast + $attack9Cd) < _TimeGetStamp() and CheckEnemyDead() <> 0) Then
		_toolTip("start attack Nr6")
		Send($attack9)
		Sleep($attack9c)
		$attack9LastCast = _TimeGetStamp()
		sleep(200)
		validateAttack()
		if(GuiCtrlRead($attack7_da) == 1 And CheckEnemyDead() <> 0) Then

			Send($attack9)
			sleep($attack9c/4)

			if CheckEnemyDead() <> 0 then
				Send($attack9)
				sleep($attack9c/4)
			EndIf
					if CheckEnemyDead() <> 0 then
					Send($attack9)
					sleep($attack9c/4)
					EndIf

						if CheckEnemyDead() <> 0 then
						Send($attack9)
						sleep($attack9c/4)
						EndIf

					if CheckEnemyDead() <> 0 then
					Send($attack9)
					sleep($attack9c/4)
				EndIf
		EndIf
	EndIf
EndFunc

Func F_arttack10()
	F_EmCast()
	if(($attack10LastCast + $attack10Cd) < _TimeGetStamp() and CheckEnemyDead() <> 0) Then
		_toolTip("start attack Nr7")
		Send($attack10)
		Sleep($attack10c)
		$attack10LastCast = _TimeGetStamp()
		sleep(200)
		validateAttack()
		if(GuiCtrlRead($attack8_da) == 1 And CheckEnemyDead() <> 0) Then

			Send($attack10)
			sleep($attack10c/4)

			if CheckEnemyDead() <> 0 then
				Send($attack10)
				sleep($attack10c/4)
			EndIf
					if CheckEnemyDead() <> 0 then
					Send($attack10)
					sleep($attack10c/4)
					EndIf

						if CheckEnemyDead() <> 0 then
						Send($attack10)
						sleep($attack10c/4)
						EndIf

					if CheckEnemyDead() <> 0 then
					Send($attack10)
					sleep($attack10c/4)
				EndIf
		EndIf
	EndIf
EndFunc

Func F_arttack11()
	F_EmCast()
	if(($attack11LastCast + $attack11Cd) < _TimeGetStamp() and CheckEnemyDead() <> 0) Then
		_toolTip("start attack Nr8")
		Send($attack11)
		Sleep($attack11c)
		$attack11LastCast = _TimeGetStamp()
		sleep(200)
		validateAttack()
		if(GuiCtrlRead($attack9_da) == 1 And CheckEnemyDead() <> 0) Then

			Send($attack11)
			sleep($attack11c/4)

			if CheckEnemyDead() <> 0 then
				Send($attack11)
				sleep($attack11c/4)
			EndIf
					if CheckEnemyDead() <> 0 then
					Send($attack11)
					sleep($attack11c/4)
					EndIf

						if CheckEnemyDead() <> 0 then
						Send($attack11)
						sleep($attack11c/4)
						EndIf

					if CheckEnemyDead() <> 0 then
					Send($attack11)
					sleep($attack11c/4)
				EndIf
		EndIf
	EndIf
EndFunc

Func F_arttack12()
	F_EmCast()
	if(($attack12LastCast + $attack12Cd) < _TimeGetStamp() and CheckEnemyDead() <> 0) Then
		_toolTip("start attack Nr9")
		Send($attack12)
		Sleep($attack12c)
		$attack12LastCast = _TimeGetStamp()
		sleep(200)
		validateAttack()
		if(GuiCtrlRead($attack10_da) == 1 And CheckEnemyDead() <> 0) Then

			Send($attack12)
			sleep($attack12c/4)

			if CheckEnemyDead() <> 0 then
				Send($attack12)
				sleep($attack12c/4)
			EndIf
					if CheckEnemyDead() <> 0 then
					Send($attack12)
					sleep($attack12c/4)
					EndIf

						if CheckEnemyDead() <> 0 then
						Send($attack12)
						sleep($attack12c/4)
						EndIf

					if CheckEnemyDead() <> 0 then
					Send($attack12)
					sleep($attack12c/4)
				EndIf
		EndIf
	EndIf
EndFunc

Func F_arttack13()
	F_EmCast()
	if(($attack13LastCast + $attack13Cd) < _TimeGetStamp() and CheckEnemyDead() <> 0) Then
		_toolTip("start attack Nr10")
		Send($attack13)
		Sleep($attack13c)
		$attack13LastCast = _TimeGetStamp()
		sleep(200)
		validateAttack()
		if(GuiCtrlRead($attack11_da) == 1 And CheckEnemyDead() <> 0) Then

			Send($attack13)
			sleep($attack13c/4)

			if CheckEnemyDead() <> 0 then
				Send($attack13)
				sleep($attack13c/4)
			EndIf
					if CheckEnemyDead() <> 0 then
					Send($attack13)
					sleep($attack13c/4)
					EndIf

						if CheckEnemyDead() <> 0 then
						Send($attack13)
						sleep($attack13c/4)
						EndIf

					if CheckEnemyDead() <> 0 then
					Send($attack13)
					sleep($attack13c/4)
				EndIf
		EndIf
	EndIf
EndFunc

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

Func F_buff()
	if(($attack4LastCast + $attack4Cd) < _TimeGetStamp()) Then
		_toolTip("starting PreCast")
		Send($attack4)
		Sleep($attack4c)
		$attack4LastCast = _TimeGetStamp()
		if(GuiCtrlRead($attack4_da) == 1) Then

			Send($attack4)
			sleep($attack4c/4)

			if CheckEnemyDead() <> 0 then
				Send($attack4)
				sleep($attack4c/4)
			EndIf
					if CheckEnemyDead() <> 0 then
					Send($attack4)
					sleep($attack4c/4)
					EndIf

						if CheckEnemyDead() <> 0 then
						Send($attack4)
						sleep($attack4c/4)
						EndIf

					if CheckEnemyDead() <> 0 then
					Send($attack4)
					sleep($attack4c/4)
				EndIf
		EndIf
;~ 		send($atck)
;~ 		send($attackgk)
	EndIf

EndFunc

Func playerCurrectMpPercent()

                $val2 = MemReadDLL("8EEEC0")

                $Pval2 = ($val2 * 100) / PlayerMaxMana()

                return Round($Pval2)

EndFunc

Func F_PostAttack()
;~ 		if playerCurrectHpPercent() > 90 Or playerCurrectMpPercent() > 90 then
;~ 		if playerCurrectHpPercent()  > 90 then


		if(($attack7LastCast + $attack7Cd) < _TimeGetStamp()) Then
		if playerCurrectHpPercent() < 90 then   ;;;;;;;;;;;;;;;;; Or playerCurrectMpPercent() < 90 then
		_toolTip("PostCast HP/MP below 90%")
		Send($attack7)
		Sleep($attack7c)

		$attack7LastCast = _TimeGetStamp()
;~ 		sleep(500)
		EndIf
		EndIf
EndFunc

Func F_EmCast()
	if ($attack8 <> "x") then
		if(($attack8LastCast + $attack8Cd) < _TimeGetStamp() and playerCurrectHpPercent() <= $attack8hp) Then
			_toolTip("starting Emergency Cast")
			Send($attack8)
			Sleep($attack8c)
			$attack8LastCast = _TimeGetStamp()
		EndIf
	EndIf
EndFunc


;#################################################
;waypoint functions
;#################################################

Func _keyboardToWpInterface()
	OpenAionMemory()
	addWP()
EndFunc

Func addWP()

	$playerX = PlayerXPos()
	$playerY = PlayerYPos()
	$playerZ = PlayerZPos()

	$WPFile = "wp"

	$openFile = GuiCtrlRead($wpSaveInput)
	$wpSave = FileOpen($openFile, 1)

	FileWriteLine($wpSave ,Round($playerX,2))
	FileWriteLine($wpSave ,Round($playerY,2))
	FileWriteLine($wpSave ,Round($playerZ,2))
	FileClose($wpSave)
	_toolTip("WayPoint: "&Round($playerX,0)&" - "&Round($playerY,0)&" - "&Round($playerZ,0)&" added")
EndFunc

Func readWP()
	$countMax=0
	$count = 1
	$openFile = GuiCtrlRead($wpFileInput)
	$readWPfile = FileOpen($openFile, 0)

	While 1
		$x1 = FileReadLine($readWPfile,$count)

		if $x1 = "" Then
			$count = 1
			ExitLoop
		EndIf

		If @error = -1 Then	ExitLoop
		$count = $count +1
		$countMax = $countMax +1
		$x2 = FileReadLine($readWPfile,$count)
		$count = $count +1
		$countMax = $countMax +1
		$x3 = FileReadLine($readWPfile,$count)
		$count = $count +1
		$countMax = $countMax +1


	Wend
	FileClose($readWPfile)


	$openFile = GuiCtrlRead($wpFileInput)
	$readWPfile = FileOpen($openFile, 0)

	While 1

		$x1 = FileReadLine($readWPfile,$count)

		if $x1 = "" Then

			$count = 1
			ExitLoop
		EndIf

		If @error = -1 Then	ExitLoop

		$wpField[$count-1] = $x1

		$count = $count +1

		$x2 = FileReadLine($readWPfile,$count)
		$wpField[$count-1] = $x2

		$count = $count +1

		$x3 = FileReadLine($readWPfile,$count)
		$wpField[$count-1] = $x3

		$count = $count +1




	Wend
	_toolTip("Waypoints loaded ... "&$countMax/3&" found" )
	FileClose($readWPfile)

EndFunc

Func getCredits()
	return @LF&"developed by: Plany, Unknown "&@LF &"Logo by: Blun0r" &@LF & "Edited by Chefes78"
EndFunc

Func calcTime($nep)
	$ntime = _TimeGetStamp() - $timeDiff
	$tmpMep = PlayerMaxEP()
	$tmpCep = playerCurrectEP()
	$timeToLevelUp =(($tmpMep - $tmpCep) / $nep ) * $ntime
	$newTime = Round(($timeToLevelUp/60)/60,2)
	if($lastTime <> 0) Then
		if($newTime > $lastTime) Then
			$difftime = $newTime - $lastTime
			$avgTime = $difftime + $lastTime
		Elseif($lastTime > $newTime) Then
			$difftime = $lastTime - $newTime
			$avgTime = $difftime + $newTime
		EndIf
		$lastTime = $newTime
	Else
		$lastTime = $newTime
		$avgTime = $newTime;
	EndIf
	GUICtrlSetData($TimeCount, timeToHuman($avgTime))
EndFunc

;#################################################
;navigate functions
;#################################################


Func calcDist($xa,$ya)
	$distCalc = sqrt( ($xa-PlayerXPos())^2 + ($ya-PlayerYPos())^2 )
	if($distCalc > 15) Then
		_jumpPlayer()
	EndIf
	return $distCalc
EndFunc

Func _getRandomJumpTimer()
	return _TimeGetStamp() + Random(0,6,1)
EndFunc

Func _jumpPlayer()
	if($jumper < _TimeGetStamp()) Then
		if( $jumper <> 0) Then
			Send("{SPACE down}")
			Sleep(80)
			Send("{SPACE up}")
		EndIf
		$jumper = _getRandomJumpTimer()
	EndIf
EndFunc

Func _switchRotate($target, $now)
	if($target < $now) Then
		If(($now - $target) > 180) Then
			$rot_down = "a down"
			$rot_up = "a up"
		Else
			$rot_down = "d down"
			$rot_up = "d up"
		EndIf
	Else
		If(($target - $now) > 180) Then
			$rot_down = "d down"
			$rot_up = "d up"
		Else
			$rot_down = "a down"
			$rot_up = "a up"
		EndIf
	EndIf
EndFunc

; rechnet 90 zu 360 hoch
Func getAngle($diffX, $diffY)
	$angle = ATan($diffY/$diffX)
	$angle = ($angle * 180.0 )/ $pi
	if $diffX > 0 and $diffY > 0 Then
		return getThreeSixty((180 -$angle),true)
	ElseIf $diffX > 0 and $diffY < 0 Then
		return getThreeSixty((-180 -$angle),true)
	ElseIf $diffX < 0 and $diffY < 0 Then
		return getThreeSixty((0 -$angle),true)
	ElseIf $diffX < 0 and $diffY > 0 Then
		return getThreeSixty((0 -$angle),true)
	EndIf
EndFunc

; Flag = true  - rechne 180 auf 360 hoch
;Flag = false - calc 360er rotate!
Func getThreeSixty($angle, $flag = false)
	If($flag) Then
		If($angle < 0) Then
			$angle = (360 - ($angle * -1))
		EndIf
	Else
		If($angle > 360)Then
			$angle = $angle - 360
		ElseIf($angle < 0)Then
			$angle = $angle + 360
		EndIf
	EndIf
	Return $angle
EndFunc

Func alignRotaion($x, $y, $move = false)
	$playerXcoord = PlayerXPos()
	$playerYcoord = PlayerYPos()
		;$playerZcoord = PlayerZPos()
	$diffY = Round($y - $playerYcoord,2)
	$diffX = Round($x - $playerXcoord,2)
	$angle = getAngle($diffX, $diffY)
	$nowAng = getThreeSixty(GetPlayerPos(), true)
	_switchRotate($angle, $nowAng)
	While ($angle + 5) < $nowAng OR ($angle - 5) > $nowAng
		if $move Then
			Send("{w down}")
		EndIf
		Send("{"&$rot_down&"}")
		$nowAng = getThreeSixty(GetPlayerPos(), true)
	WEnd
	if $move Then
		if(($angle + 5) < $nowAng AND ($angle - 5) > $nowAng) Then
			Send("{w up}")
		EndIf
	EndIf
	Send("{"&$rot_up&"}")
EndFunc

func lookaround()

WinActivate("AION Client")

;~ $looks = 0

while 1

Send("{TAB}")
sleep(20)
$mob1 = GetDistance()
sleep(20)
	if ( CheckEnemyDead() > 99 ) then
		if ( enemyInsgid() )then
			if ( checkBlackList() ) Then
				if (  GetDistance() <= $attackgdm  ) then
					Return True
					ExitLoop
				EndIf
			EndIf
		EndIf


;~ 	Else
;~ 		_toolTip("Bad mob.. Checking rear view")
;~ 		$looks = $looks +1
	EndIf

;~ 	If $Run = False Then
;~ 		Send("{w up}")
;~ 		Send("{s up}")
;~ 		Send("{a up}")
;~ 		Send("{d up}")
;~ 		ExitLoop
;~ 	EndIf

;~ 	if $looks >= 5 Then
;~ 		return False
;~ 		ExitLoop
;~ 	EndIf


;~ Until $looks = 2
_toolTip("Checking rear view")
;~ sleep(1500)
MouseMove( 200, 400 )
MouseClick("middle" , 200 , 400)
sleep(300)
MouseMove( 200, 400 )
;~ $looks = 0

;~ Do

Send("{TAB}")
sleep(20)
$mob2 = GetDistance()
sleep(20)
	if ( CheckEnemyDead() > 99 ) then
		if ( enemyInsgid() )then
			if ( checkBlackList() ) Then
				if (  GetDistance() <= $attackgdm +2 ) then
					Return True
					ExitLoop
				EndIf
			EndIf
		EndIf


;~ 	Else
;~ 		_toolTip("..back to front view")
;~ 		$looks = $looks +1
;~ 		ExitLoop

	EndIf

;~ 	If $Run = False Then
;~ 		Send("{w up}")
;~ 		Send("{s up}")
;~ 		Send("{a up}")
;~ 		Send("{d up}")
;~ 		ExitLoop
;~ 	EndIf

;~ 	if $looks >= 5 Then
;~ 		return False
;~ 		ExitLoop
;~ 	EndIf


;~ Until $looks = 2
;~ WEnd


_toolTip("back to front view")
;~ sleep(300)
MouseMove( 200, 400 )
MouseClick("middle" , 200 , 400)
sleep(300)
	if ( $mob1 < $mob2 ) then
		send("{TAB}")
	EndIf

	if ( CheckEnemyDead() = 0 ) then
		Return False
		ExitLoop
	Else
;~ 		KillEnemy()
		Return False
		ExitLoop
	EndIf
WEnd

EndFunc

Func Tabb()


EndFunc



Func walkPoints()

	while $i < ($countMax-1)
		checkShutDown()
		WinActivate("AION Client")
		WinWaitActive("AION Client")
		_toolTip("Move to waypoint "&($i/3)+1)
		$xCoord=$wpField[$i]
		$yCoord=$wpField[$i+1]
		$zCoord=$wpField[$i+2]
		$i=$i+3

		$Distance = calcDist($xCoord,$yCoord)
		while $Distance > 3
			alignRotaion($xCoord, $yCoord, true)
			_toolTip("Tabing")
;~ 			while ( GetDistance() >
				sleep(20)
			Send("{Tab}")
			sleep(20)
;~ 			$wdist = GetDistance()
;~ 			sleep(20)
;~ 			WEnd
;~ 			if CheckEnemyDead() > 0 Then
;~ 			Send("{w up}")
;~ 			sleep(80)
;~ 			send($attackgk)
			if(enemyInsgid() and checkBlackList() and $attackgdm >= GetDistance() ) Then
						_toolTip("Good mob")
						Send("{w up}")
							sleep(20)
							send("{s down}")
							sleep(30)
							send("{s up}")

;~ 						send($attackgk)
				if(GuiCtrlRead($attack1mm_da) == 1    ) then  									;;;;;;;  MAX hacken ticked
					$dist = GetDistance()
					sleep(20)
					if ( $dist > $attackgdm ) then
						sleep(30)
						_toolTip("lock on")
;~ 						Send($attackgk)
						sleep(10)
;~ 						send($atck)
;~ 						sleep(10)
						Send($attackgk)
						$timer = _TimeGetStamp() + 10
							Do
								sleep(10)
							until GetDistance() < $attackgdm -1 or $timer <  _TimeGetStamp()
							Send("{w up}")
							sleep(30)
							send("{s down}")
							sleep(30)
							send("{s up}")
							KillEnemy()
							if ( lookaround() = True) Then
								KillEnemy()
							Else
							walkPoints()
							EndIf
					Else
							send("{w up}")
							send("{s down}")
							sleep(30)
							send("{s up}")
							KillEnemy()
								if ( lookaround() = True) Then
								KillEnemy()
								Else
								walkPoints()
								EndIf





					EndIf

				Else

					$dist = GetDistance()
					if ( $dist > $attackgd ) then
						Send("{w up}")
						Sleep(20)
							send("{s down}")
							sleep(30)
							send("{s up}")



						_toolTip("lock on")
						send($attackgk)
						sleep(30)
						send($atck)
						sleep(30)
						Send($attackgk)
						$timer = _TimeGetStamp() + 10
							Do
								sleep(10)
							until GetDistance() < $attackgd -1 or $timer <  _TimeGetStamp()
							Send("{w up}")
							send("{s down}")
							sleep(20)
							send("{s up}")
							KillEnemy()
					Else
						send("{w up}")
						send("{s down}")
						sleep(20)
						send("{s up}")
						KillEnemy()
					EndIf
				EndIf

				_toolTip("Move to waypoint "&($i/3)+1)
			EndIf



			$Distance = calcDist($xCoord,$yCoord)
			alignRotaion($xCoord, $yCoord, true)
			Send("{w down}")
			sleep(80)
;~ 			Send("{TAB}")									;newww
;~ 			sleep(50)										;newww
;~ 			send($attackgk)										;newww

			If $Run = False Then
				Send("{w up}")
							sleep(20)
							send("{s down}")
							sleep(20)
							send("{s up}")
				ExitLoop
			EndIf
		WEnd

		If $Run = False Then
			Send("{w up}")
							sleep(20)
							send("{s down}")
							sleep(20)
							send("{s up}")
			ExitLoop
		EndIf
		$jumper = _getRandomJumpTimer()
	WEnd
	$i=0
EndFunc

;#################################################
; unix Timestamp / useable Function
;#################################################

Func timeToHuman($time)
	$st = Round($time,0)
	$mi = (Round($time,2) - $st)* 100
	if($mi < 0) Then
		$mi = $mi * -1
	EndIf
	return $st&"H "&Round($mi)&"M"
EndFunc

Func SecToTime($sec)
	$min = $sec / 60
	$hour = $min / 60
	if(Round($min) >= 60)Then
		return Round($hour)&" H"
	ElseIf($sec >= 60) Then
		return Round($min)&" M"
	Else
		return Round($sec)&" S"
	EndIf
EndFunc

Func _TimeGetStamp()
	Local $av_Time
	$av_Time = DllCall('CrtDll.dll', 'long:cdecl', 'time', 'ptr', 0)
	If @error Then
		SetError(99)
		Return False
	EndIf
	Return $av_Time[0]
EndFunc


Func _DecimalToHex($hx_dec, $hx_length = 6)

    If IsInt($hx_dec) = 0 Then
        SetError(1)
        MsgBox(0,"Error","Wrong input, try again ...")
        Return ""
    EndIf
    Local $ret = "", $Ii, $hx_tmp, $hx_max
    If $hx_dec < 4294967296 Then
        If $hx_length < 9 Then Return Hex($hx_dec, $hx_length)
        If $hx_length = 21 Then
            $ret = Hex($hx_dec)
            While StringLeft($ret, 1) = "0"
                $ret = StringMid($ret, 2)
            WEnd
            Return $ret
        EndIf
    EndIf
    For $Ii = $hx_length - 1 To 0 Step -1
        $hx_max = 16 ^ $Ii - 1
        If $ret = "" And $hx_length = 21 And $hx_max > $hx_dec Then ContinueLoop
        $hx_tmp = Int($hx_dec/($hx_max+1))
        If $ret = "" And $hx_length = 21 And $Ii > 0 And $hx_tmp = 0 Then ContinueLoop
        ;$ret &= StringMid($HX_REF, $hx_tmp+1, 1)
        $hx_dec -= $hx_tmp * ($hx_max + 1)
    Next
    $ret=String($ret)
    If $hx_length < 21 And StringLen($ret) < $hx_length Then SetError(1)
    Return $ret
EndFunc  ;==>_DecToHex()



;#############################################################################################################################################################
;gui loop                                                                                                                                           gui loop #
;#############################################################################################################################################################


While 1
	$msg = GUIGetMsg()
	Switch $msg
		Case $GUI_EVENT_CLOSE
			Exit
		Case $buttonSave
			saveKeys()
		Case $buttonAddWayPoint
			OpenAionMemory()
			addWP()
		Case $buttonOpenWayPoint
			readWP()
		Case $buttonRun
			GUICtrlSetData ($buttonRun,"Bot running")
			setShutDownTimer()
			OpenAionMemory()
			ReadMemValues()
			$Run = True
			while $Run = True
				checkShutDown()
				if ( lookaround() = True) Then
					KillEnemy()
				Else
					walkPoints()
				EndIf
			WEnd
	EndSwitch
WEnd

;0 4 8 C hex 4bit jumps
	;For $i = 9361000 To 9369000
	;	GUICtrlSetData($status,"SCAN VAR "&$i)
	;	$var = MemReadDLL(_DecimalToHex($i))
	;	if( Round($var,2) > 1000 And Round($var,2) < 6900000) Then
	;		FileWriteLine("mem.txt",_DecimalToHex($i)&" = "&Round($var,2))
	;	EndIf
	;Next

#cs

THE FUTURE!

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
$gui = GUICreate("tabs for page options", 500, 400)
$tab = GUICtrlCreateTab(-10, -22, 520, 430)
$tabpage1 = GUICtrlCreateTabItem("page1")
$tab1Btn1 = GUICtrlCreateButton("go to page 2", 60, 60, 100, 30)
$tab1Btn2 = GUICtrlCreateButton("go to page 3", 60, 120, 100, 30)
GUICtrlCreateLabel("This is page 1", 100, 200)
$tabpage2 = GUICtrlCreateTabItem("page2")
$tab2Btn1 = GUICtrlCreateButton("go to page 1", 60, 60, 100, 30)
$tab2Btn2 = GUICtrlCreateButton("go to page 4", 60, 120, 100, 30)
GUICtrlCreateLabel("This is page 2", 100, 220)
$tabpage3 = GUICtrlCreateTabItem("page3")
$tab3Btn1 = GUICtrlCreateButton("go to page 2", 60, 60, 100, 30)
$tab3Btn2 = GUICtrlCreateButton("go to page 4", 60, 120, 100, 30)
GUICtrlCreateLabel("This is page 3", 100, 240)
$tabpage4 = GUICtrlCreateTabItem("page4")
$tab4Btn1 = GUICtrlCreateButton("go to page 1", 60, 60, 100, 30)
$tab4Btn2 = GUICtrlCreateButton("go to page 3", 60, 120, 100, 30)
GUICtrlCreateLabel("This is page 4", 100, 260)
GUICtrlCreateTabItem("")
GUICtrlSetState($tabpage1, $GUI_SHOW)
GUISetState()

While 1
    $Msg = GUIGetMsg()
    Switch $Msg
        Case - 3
            Exit
        Case $tab1Btn1
            GUICtrlSetState($tabpage2, $GUI_SHOW)
        Case $tab1Btn2
            GUICtrlSetState($tabpage3, $GUI_SHOW)
        Case $tab2Btn1
            GUICtrlSetState($tabpage1, $GUI_SHOW)
        Case $tab2Btn2
            GUICtrlSetState($tabpage4, $GUI_SHOW)
        Case $tab3Btn1
            GUICtrlSetState($tabpage2, $GUI_SHOW)
        Case $tab3Btn2
            GUICtrlSetState($tabpage4, $GUI_SHOW)
        Case $tab4Btn1
            GUICtrlSetState($tabpage1, $GUI_SHOW)
        Case $tab4Btn2
            GUICtrlSetState($tabpage3, $GUI_SHOW)

    EndSwitch

WEnd


#ce
chefes78 is offline  
Old   #831
 
elite*gold: 0
Join Date: Nov 2009
Posts: 6
Received Thanks: 0
Question

Doesnt quite work for me. Reffering to last version and version before the last one posted in the thread.

1. What i did is DL a bot
2. Start it after i log into Aion
3. Made sure i dont have disabled click to move or anything like that (as shows on screenshot)
4. Put up 3 waypoints where w1 would be really close to w3. Saved waypoints and then loaded them
5. All my skills are instant so i added up few skills (not just 1 2 3 but also things like g, h, j etc if that matters) and put 1500 in "castime" on every skills, then i entered their cooldown (be it 10 or 30 seconds). And checked DA if that was a chain skill.
6. Made sure to keep my Aion window as active window

What happened then is basically character run to waypoint, target a mob, prebuff and stops.

I thought "ok", closed the bot and tried again with less skills. This time it didnt run anywhere targeted mob and shoot a skill on him. Then stopped doing anything.

I thought ok, close the bot and tried again. This time it didnt use skills but kept autoattacking the mob which almost got me killed. I pressed few buttons manually to help him kill so the mob died but bot didnt proceed to do anything, nor rest (he was at 20% hp), nor find another mob.

I am using Win XP. My game resolution is somewhat 1800x1200 if it does matter.

What can be the problem?
Thank you in advance.

p.s. also one question: i didnt read the whole 85 pages so can anyone tell me what does "Reg" parameter means? Should i bind "Sit/rest" to it or a healing potion?
Xwave is offline  
Old   #832
 
elite*gold: 0
Join Date: Oct 2009
Posts: 295
Received Thanks: 103
Quote:
Originally Posted by Xwave View Post
Doesnt quite work for me. Reffering to last version and version before the last one posted in the thread.

1. What i did is DL a bot
2. Start it after i log into Aion
3. Made sure i dont have disabled click to move or anything like that (as shows on screenshot)
4. Put up 3 waypoints where w1 would be really close to w3. Saved waypoints and then loaded them
5. All my skills are instant so i added up few skills (not just 1 2 3 but also things like g, h, j etc if that matters) and put 1500 in "castime" on every skills, then i entered their cooldown (be it 10 or 30 seconds). And checked DA if that was a chain skill.
6. Made sure to keep my Aion window as active window

What happened then is basically character run to waypoint, target a mob, prebuff and stops.

I thought "ok", closed the bot and tried again with less skills. This time it didnt run anywhere targeted mob and shoot a skill on him. Then stopped doing anything.

I thought ok, close the bot and tried again. This time it didnt use skills but kept autoattacking the mob which almost got me killed. I pressed few buttons manually to help him kill so the mob died but bot didnt proceed to do anything, nor rest (he was at 20% hp), nor find another mob.

I am using Win XP. My game resolution is somewhat 1800x1200 if it does matter.

What can be the problem?
Thank you in advance.

p.s. also one question: i didnt read the whole 85 pages so can anyone tell me what does "Reg" parameter means? Should i bind "Sit/rest" to it or a healing potion?
did you set MIn and Max range?

try using a pulling spell as precast...

or try this one... some bugs eliminated..




yes Reg is regenerate HP / MP... set % when it should rest
chefes78 is offline  
Old   #833
 
elite*gold: 0
Join Date: Nov 2009
Posts: 6
Received Thanks: 0
I left it at 5-15 and was standing exactly on the mob face (thats well in range of my spells). "Errors" are completely random as i said — sometimes it prebuff, sometimes not, somtimes it shoots a skill ones, sometimes just auto-attacks but then always stops. It may "wake up" after a minute if i am still alive and run to the next waypoint completely ignoring that there are other mobs still around.

Tbh it looks like it sort of hang up, since when i try to f5 + close the bot it usually take up some time and i have to terminate the process via c+a+d.
Xwave is offline  
Old   #834
 
elite*gold: 0
Join Date: Oct 2009
Posts: 295
Received Thanks: 103
when you get agro it doesnt prebuff... start with attack 1 again

F7 till F10 about are quick exit... kills Gui

Nr1 Start game ...

Nr2 Fill out Attacks etc and hit SAVE

Nr3 Record WP or go to 4 if done...l

Nr4 open WP and hit start

_________________________________________

post a pic where i can see you Bot settings and the game behind (dont forget to
overpaint your chara name ;D ) ... i can help better then
chefes78 is offline  
Old   #835
 
elite*gold: 0
Join Date: Nov 2009
Posts: 6
Received Thanks: 0
I am hitting non-agressive mobs so i doubt i can get agro.
So i did what you said.

It went slightly better this time, he used skills but delay between skills was 10-15+ seconds. Bot managed to execute a chain but he just stand still after it use one skill and wait. Sometimes auto-attacking, sometimes not.

I helped to kill this mob manually, and he got stuck while looting (i dont know, maybe there is some "loot all" thingie in the options?).

So i stopped the bot to make a screenie and 10 seconds after i stopped it (it was saying "start bot" not "botting" so it was stopped i asume) he used herbal treatment and sit down to rest ><

TLDR

1. There is huge delay between every action
2. It doesnt loot.

Thats what i figured out so far at least.

Here is a screenshot:
Xwave is offline  
Old   #836
 
elite*gold: 0
Join Date: Oct 2009
Posts: 295
Received Thanks: 103
Quote:
Originally Posted by Xwave View Post
I am hitting non-agressive mobs so i doubt i can get agro.
So i did what you said.

It went slightly better this time, he used skills but delay between skills was 10-15+ seconds. Bot managed to execute a chain but he just stand still after it use one skill and wait. Sometimes auto-attacking, sometimes not.

I helped to kill this mob manually, and he got stuck while looting (i dont know, maybe there is some "loot all" thingie in the options?).

So i stopped the bot to make a screenie and 10 seconds after i stopped it (it was saying "start bot" not "botting" so it was stopped i asume) he used herbal treatment and sit down to rest ><

TLDR

1. There is huge delay between every action
2. It doesnt loot.

Thats what i figured out so far at least.

Here is a screenshot:
some things i saw .. you shouldnt use Q and E buttons... they are needed
for the needed for antistuck...

i will input a "wait for min range" func before looting... thats a bug yeah

what job are you playing? looks like ranged? set Max ticks...


.. if you play in wondowed mode you should change the mouse wheel click position to
somewhere inside your game... it switches view while lookaround()

around line 2426:
MouseMove( 200, 400 )
MouseClick("middle" , 200 , 400)


loot problem fixed:


Code:
#AutoIT3Wrapper_UseUpx=n
#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_outfile=AutoAion_beta_010.exe
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <GuiConstants.au3>
#Include <file.au3>
#include <NoMadMemory.au3>

GuiCreate("AutoAion v0.10.2 MiniMax2 ", 270,800, 1100, 50,-1, $WS_EX_TOPMOST)
GUICtrlCreatePic("logo.jpg", 0, 736, 270, 74)
GUISetBkColor(0xffffff)
GUISetState(@SW_SHOW)
GuiCtrlSetState(-1,$GUI_DISABLE)

HotKeySet("{F7}","Eexit")
HotKeySet("{F8}","Eexit")
HotKeySet("{F9}","Eexit")
HotKeySet("{F10}","Eexit")
HotKeySet("{F11}","Eexit")
HotKeySet("{F12}","Eexit")
HotKeySet("{F5}","stop")
HotKeySet("{NUMPADADD}","_keyboardToWpInterface")
Global $attack8hp = 65
global $looks
global $attackdistmax
Global $attackdistmin
global $abstand1
Global $looted
global $atck
Global $loopcounter = 0
global $abstand
Global $configFile = "AA.conf"
Global $Run = False
Global $enemyKillCount = 0
Global $enemyEpCount = 0
Global $playerEnergy
Global $playerEnergyMax
Global $playerHP
Global $playerHPMax
Global $playerEP
Global $playerEPMax
Global $targetHPpercent
Global $AionRun = False
Global $pid = 0
Global $openmem = 0
Global $baseADDR = 0
Global $finalADDR = 0
Global $wpField[1000]
Global $count =1
Global $countMax=0
global $pi = 3.14159265358979323846264338327950
global $file1 = "data.txt"

global $attack1 = "x"
global $attack2 = "x"
global $attack3 = "x"
global $attack4 = "x"
global $attack5 = "x"
global $attack6 = "x"
global $attack7 = "x"
global $attack8 = "x"
global $attack9 = "x"
global $attack10 = "x"
global $attack11 = "x"
global $attack12 = "x"
global $attack13 = "x"

global $attackgk = "1"
Global $attackgd = "5"
global $attackgdm = "15"

global $loot = "x"
global $reg = "x"
Global $i =0
global $attack1c = "0"
global $attack2c = "0"
global $attack3c = "0"
global $attack4c = "0"
global $attack5c = "0"
global $attack6c = "0"
global $attack7c = "0"
global $attack8c = "0"
global $attack9c = "0"
global $attack10c = "0"
global $attack11c = "0"
global $attack12c = "0"
global $attack13c = "0"

global $attack1Cd = "0"
global $attack2Cd = "0"
global $attack3Cd = "0"
global $attack4Cd = "0"
global $attack5Cd = "0"
global $attack6Cd = "0"
global $attack7Cd = "0"
global $attack8Cd = "0"
global $attack9Cd = "0"
global $attack10Cd = "0"
global $attack11Cd = "0"
global $attack12Cd = "0"
global $attack13Cd = "0"

global $attack1LastCast = "0"
global $attack2LastCast = "0"
global $attack3LastCast = "0"
global $attack4LastCast = "0"
global $attack5LastCast = "0"
global $attack6LastCast = "0"
global $attack7LastCast = "0"
global $attack8LastCast = "0"
global $attack9LastCast = "0"
global $attack10LastCast = "0"
global $attack11LastCast = "0"
global $attack12LastCast = "0"
global $attack13LastCast = "0"

global $killCount
global $status
global $TimeCount
global $jumper = 0

global $attack1_da
global $attack2_da
global $attack3_da
global $attack4_da
global $attack5_da
global $attack6_da
global $attack7_da
global $attack8_da
global $attack9_da
global $attack10_da
global $attack11_da
;~ global $attack12_da
;~ global $attack13_da
;~ global $attack14_da

global $attack1mm_da
global $attack2mm_da
global $attack3mm_da
global $attack4mm_da
global $attack5mm_da
global $attack6mm_da
global $attack7mm_da
global $attack8mm_da
global $attack9mm_da
global $attack10mm_da
;~ global $attack11mm_da
;~ global $attack12mm_da
;~ global $attack13mm_da
;~ global $attack14mm_da


global $attack18hp = 85
global $reg_minLife = 40
global $reg_minMana = 10

global $timeDiff = 0;
global $lastTime = 0;
global $newTime = 0;
global $avgTime = 0;

global $rot_down = "a down"
global $rot_up = "a up"

Global $timeToShutdownOutput
Global $sdtimerInput
Global $timeToShutdown = 0
Global $timeCache = 0

Global $combatStartTimer = 0
Global $combatAnimaLibera = 0
Global $goodCombat = 0
Global $combatFlag = 0
Global $lastBlackListEnemy = 0


; THE FUTURE!
Global $confVar1
Global $confVar2
Global $confVar3
Global $confVar4
Global $confVar5
Global $confVar6
Global $confVar7
Global $confVar8
Global $confVar9
Global $confVar10
Global $confVar11
Global $confVar12
Global $confVar13
Global $confVar14
Global $confVar15
Global $confVar16
Global $confVar17
Global $confVar18
Global $confVar19
Global $confVar20
Global $confVar21
Global $confVar22
Global $confVar23
Global $confVar24
Global $confVar25
Global $confVar26
Global $confVar27
Global $confVar28
Global $confVar29
Global $confVar30
Global $confVar31
Global $confVar32
Global $confVar33
Global $confVar34
Global $confVar35
Global $confVar36
Global $confVar37
Global $confVar38
Global $confVar39
Global $confVar40
Global $confVar41
Global $confVar42
Global $confVar43
Global $confVar44
Global $confVar45
Global $confVar46
Global $confVar47



$attack1_da = GUICtrlCreateCheckbox("DA", 195, 60, 35, 20)
$attack2_da = GUICtrlCreateCheckbox("DA",195, 90, 35, 20)
$attack3_da = GUICtrlCreateCheckbox("DA", 195, 120, 35, 20)
$attack5_da = GUICtrlCreateCheckbox("DA", 195, 150, 35, 20)
$attack6_da = GUICtrlCreateCheckbox("DA", 195, 180, 35, 20)
$attack4_da = GUICtrlCreateCheckbox("DA", 195, 30, 35, 20)
$attack7_da = GUICtrlCreateCheckbox("DA", 195, 210, 35, 20)
$attack8_da = GUICtrlCreateCheckbox("DA", 195, 240, 35, 20)
$attack9_da = GUICtrlCreateCheckbox("DA", 195, 270, 35, 20)
$attack10_da = GUICtrlCreateCheckbox("DA", 195, 300 ,35, 20)
$attack11_da = GUICtrlCreateCheckbox("DA", 195, 330, 35, 20)

$attacklmm_da = GUICtrlCreateLabel("Distance",225, 10 , 50, 20)

$attackl111mm_da = GUICtrlCreateLabel(" - Max -",230, 33, 50, 20)
$attack1mm_da = GUICtrlCreateCheckbox("Max", 230, 60, 50, 20)
$attack2mm_da = GUICtrlCreateCheckbox("Max", 230, 90, 50, 20)
$attack3mm_da = GUICtrlCreateCheckbox("Max", 230, 120, 50, 20)
$attack4mm_da = GUICtrlCreateCheckbox("Max", 230, 150, 50, 20)
$attack5mm_da = GUICtrlCreateCheckbox("Max", 230, 180, 50, 20)
$attack6mm_da = GUICtrlCreateCheckbox("Max", 230, 210, 50, 20)
$attack7mm_da = GUICtrlCreateCheckbox("Max", 230, 240, 50, 20)
$attack8mm_da = GUICtrlCreateCheckbox("Max", 230, 270, 50, 20)
$attack9mm_da = GUICtrlCreateCheckbox("Max", 230, 300, 50, 20)
$attack10mm_da = GUICtrlCreateCheckbox("Max", 230, 330, 50, 20)

readKeys()

$Label1 = GUICtrlCreateLabel("Key", 65, 10, 60, 17)
$Label1 = GUICtrlCreateLabel("Casttime", 100, 10, 60, 17)
$Label1 = GUICtrlCreateLabel("Cooldown", 150, 10, 60, 17)

$Label1 = GUICtrlCreateLabel("Kill Count:", 150, 470, 60, 17)
$killCount = GUICtrlCreateLabel($enemyKillCount, 200, 470, 100, 17)
$Label1 = GUICtrlCreateLabel("EP Count:", 150, 490, 60, 17)
$epCount = GUICtrlCreateLabel($enemyEpCount, 200, 490, 100, 17)
$Label1 = GUICtrlCreateLabel("Lvl-up in:", 150, 510, 60, 17)
$TimeCount = GUICtrlCreateLabel($avgTime, 200, 510, 100, 17)
$Label1 = GUICtrlCreateLabel("Shutdown:", 150, 530, 60, 17)
$timeToShutdownOutput = GUICtrlCreateLabel("-----", 210, 530, 100, 17)

$Label1 = GUICtrlCreateLabel("Attack 1:", 15, 62, 44, 17)
$attack1Key = GUICtrlCreateInput($attack1, 65, 60, 20, 21)
$attack1Cast = GUICtrlCreateInput($attack1c, 100, 60, 40, 21)
$attack1Cooldown = GUICtrlCreateInput($attack1Cd, 150, 60, 40, 21)

$Label2 = GUICtrlCreateLabel("Attack 2:", 15, 92, 44, 17)
$attack2Key = GUICtrlCreateInput($attack2, 65, 90, 20, 21)
$attack2Cast = GUICtrlCreateInput($attack2c, 100, 90, 40, 21)
$attack2Cooldown = GUICtrlCreateInput($attack2Cd, 150, 90, 40, 21)

$Label3 = GUICtrlCreateLabel("Attack 3:", 15, 122, 44, 17)
$attack3Key = GUICtrlCreateInput($attack3, 65, 120, 20, 21)
$attack3Cast = GUICtrlCreateInput($attack3c, 100, 120, 40, 21)
$attack3Cooldown = GUICtrlCreateInput($attack3Cd, 150, 120, 40, 21)

$Label5 = GUICtrlCreateLabel("Attack 4:", 15, 152, 44, 17)
$attack5Key = GUICtrlCreateInput($attack5, 65, 150, 20, 21)
$attack5Cast = GUICtrlCreateInput($attack5c, 100, 150, 40, 21)
$attack5Cooldown = GUICtrlCreateInput($attack5Cd, 150, 150, 40, 21)

$Label6 = GUICtrlCreateLabel("Attack 5:", 15, 182, 44, 17)
$attack6Key = GUICtrlCreateInput($attack6, 65, 180, 20, 21)
$attack6Cast = GUICtrlCreateInput($attack6c, 100, 180, 40, 21)
$attack6Cooldown = GUICtrlCreateInput($attack6Cd, 150, 180, 40, 21)

;;; ------------------------------------- new ones  ---------------------

$Label99 = GUICtrlCreateLabel("Attack 6:", 15, 212, 44, 17)
$attack9Key = GUICtrlCreateInput($attack9, 65, 210, 20, 21)
$attack9Cast = GUICtrlCreateInput($attack9c, 100, 210, 40, 21)
$attack9Cooldown = GUICtrlCreateInput($attack9Cd, 150, 210, 40, 21)

$Label100 = GUICtrlCreateLabel("Attack 7:", 15, 242, 44, 17)
$attack10Key = GUICtrlCreateInput($attack10, 65, 240,20, 21)
$attack10Cast = GUICtrlCreateInput($attack10c, 100, 240, 40, 21)
$attack10Cooldown = GUICtrlCreateInput($attack10Cd, 150, 240, 40, 21)



$Label101 = GUICtrlCreateLabel("Attack 8:", 15, 272, 44, 17)
$attack11Key = GUICtrlCreateInput($attack11, 65, 270, 20, 21)
$attack11Cast = GUICtrlCreateInput($attack11c, 100, 270, 40, 21)
$attack11Cooldown = GUICtrlCreateInput($attack11Cd, 150, 270, 40, 21)

$Label102 = GUICtrlCreateLabel("Attack 9:", 15, 302, 44, 17)
$attack12Key = GUICtrlCreateInput($attack12, 65, 300, 20, 21)
$attack12Cast = GUICtrlCreateInput($attack12c, 100, 300, 40, 21)
$attack12Cooldown = GUICtrlCreateInput($attack12Cd, 150, 300, 40, 21)

$Label103 = GUICtrlCreateLabel("Attac 10:", 15, 332, 44, 17)
$attack13Key = GUICtrlCreateInput($attack13, 65, 330, 20, 21)
$attack13Cast = GUICtrlCreateInput($attack13c, 100, 330, 40, 21)
$attack13Cooldown = GUICtrlCreateInput($attack13Cd, 150, 330, 40, 21)

;-----------------------------------------------------------------------------------

$Label4 = GUICtrlCreateLabel("PreCast:", 17, 32, 50, 17)
$attack4Key = GUICtrlCreateInput($attack4, 65, 30, 20, 21)
$attack4Cast = GUICtrlCreateInput($attack4c, 100, 30, 40, 21)
$attack4Cooldown = GUICtrlCreateInput($attack4Cd, 150, 30, 40, 21)

$Label7 = GUICtrlCreateLabel("PostCast:", 14, 412, 50, 17)
$attack7Key = GUICtrlCreateInput($attack7, 65, 410, 20, 21)
$attack7Cast = GUICtrlCreateInput($attack7c, 100, 410, 40, 21)
$attack7Cooldown = GUICtrlCreateInput($attack7Cd, 150, 410, 40, 21)

$Label8 = GUICtrlCreateLabel("Em Cast:", 14, 442, 50, 17)
$attack8Key = GUICtrlCreateInput($attack8, 65, 440, 20, 21)
$attack8Cast = GUICtrlCreateInput($attack8c, 100, 440, 40, 21)
$attack8Cooldown = GUICtrlCreateInput($attack8Cd, 150, 440, 40, 21)
$Label8 = GUICtrlCreateLabel("HP:", 191, 442, 18, 17)
$attack8hitPoint = GUICtrlCreateInput($attack8hp, 210, 440, 20, 21)
$Label8 = GUICtrlCreateLabel("%", 232, 442, 10, 17)


$Label3 = GUICtrlCreateLabel("Loot:", 35, 472, 25, 17)
$lootKey = GUICtrlCreateInput($loot, 65, 470, 20, 21)

$Label3 = GUICtrlCreateLabel("Reg:", 36, 502, 22, 17)
$regKey = GUICtrlCreateInput($reg, 65, 500, 20, 21)
$Label3 = GUICtrlCreateLabel("HP:", 90, 502, 19, 15)
$Label3 = GUICtrlCreateLabel("MA:", 90, 530, 19, 15)
$regMin = GUICtrlCreateInput($reg_minLife, 110, 500, 20, 21)
$regMinMana = GUICtrlCreateInput($reg_minMana, 110, 527, 20, 21)
$Label3 = GUICtrlCreateLabel("%", 130, 502, 10, 17)
$Label3 = GUICtrlCreateLabel("%", 130, 530, 10, 17)

$Label9 = GUICtrlCreateLabel("Key:", 38 ,560, 20, 17)
$Labe20 = GUICtrlCreateLabel("Min distance:", 98,560, 70, 17)
$Labe21 = GUICtrlCreateLabel("Max:", 193 ,560, 23, 17)
$atck = GUICtrlCreateInput($attackgk, 65, 558, 20, 21)
$attackdistmin = GUICtrlCreateInput($attackgd, 165,558, 22, 21)
$attackdistmax = GUICtrlCreateInput($attackgdm, 219 ,558, 27, 21)
GUICtrlCreatePic("attack.jpg", 10, 555 , 25	, 25)


$Label6 = GUICtrlCreateLabel("Filename:", 40,590, 70, 17)
$wpFileInput = GUICtrlCreateInput("", 140, 607, 70, 20)
$Label6 = GUICtrlCreateLabel("Filename:", 150,590, 70, 17)
$wpSaveInput = GUICtrlCreateInput("", 30, 607, 70, 20)
; status field
$status = GUICtrlCreateLabel("Start Bot-Engine... done!"&getCredits(), 5,690, 230, 55)
;buttons
$buttonSave = GuiCtrlCreateButton("Save", 30,660,70,20)
$buttonRun = GuiCtrlCreateButton("Run Bot", 140,660,70,20)
$buttonAddWayPoint = GuiCtrlCreateButton("Add WP", 30,630,70,20)
$buttonOpenWayPoint = GuiCtrlCreateButton("Open WP", 140,630,70,20)


$Label2 = GUICtrlCreateLabel("Timer:", 200, 695, 44, 17)
$sdtimerInput = GUICtrlCreateInput("0", 200, 710, 60, 21)


Func stop()
		Send("{w up}")
		$Run = False
		GUICtrlSetData ($buttonRun,"Start Bot")
	EndFunc


;#################################################
;interface functions
;#################################################

func readKeys()
	if FileExists($file1) Then

	$attack1 = FileReadLine($file1,"1")
	$attack2 = FileReadLine($file1,"2")
	$attack3 = FileReadLine($file1,"3")
	$attack4 = FileReadLine($file1,"14")

	$loot = FileReadLine($file1,"4")
	$reg = FileReadLine($file1,"5")
	$reg_minLife = FileReadLine($file1,"12")
	$reg_minMana = FileReadLine($file1,"13")

	$attack1c = FileReadLine($file1,"6")
	$attack2c = FileReadLine($file1,"7")
	$attack3c = FileReadLine($file1,"8")
	$attack4c = FileReadLine($file1,"15")

	$attack1Cd = FileReadLine($file1,"9")
	$attack2Cd = FileReadLine($file1,"10")
	$attack3Cd = FileReadLine($file1,"11")
	$attack4Cd = FileReadLine($file1,"16")

	if (FileReadLine($file1,"17") == 1) Then
		GUICtrlSetState($attack1_da,$GUI_CHECKED)
	EndIf
	if (FileReadLine($file1,"18") == 1) Then
		GUICtrlSetState($attack2_da,$GUI_CHECKED)
	EndIf
	if (FileReadLine($file1,"19") == 1) Then
		GUICtrlSetState($attack3_da,$GUI_CHECKED)
	EndIf
	if (FileReadLine($file1,"20") == 1) Then
		GUICtrlSetState($attack4_da,$GUI_CHECKED)
	EndIf
	if (FileReadLine($file1,"21") == 1) Then
		GUICtrlSetState($attack5_da,$GUI_CHECKED)
	EndIf
	if (FileReadLine($file1,"22") == 1) Then
		GUICtrlSetState($attack6_da,$GUI_CHECKED)
	EndIf

	if (FileReadLine($file1,"39") == 1) Then
		GUICtrlSetState($attack1mm_da,$GUI_CHECKED)
	EndIf
	if (FileReadLine($file1,"40") == 1) Then
		GUICtrlSetState($attack2mm_da,$GUI_CHECKED)
	EndIf
	if (FileReadLine($file1,"41") == 1) Then
		GUICtrlSetState($attack3mm_da,$GUI_CHECKED)
	EndIf
	if (FileReadLine($file1,"42") == 1) Then
		GUICtrlSetState($attack4mm_da,$GUI_CHECKED)
	EndIf
	if (FileReadLine($file1,"43") == 1) Then
		GUICtrlSetState($attack5mm_da,$GUI_CHECKED)
	EndIf
	if (FileReadLine($file1,"44") == 1) Then
		GUICtrlSetState($attack6mm_da,$GUI_CHECKED)
	EndIf
		if (FileReadLine($file1,"45") == 1) Then
		GUICtrlSetState($attack7mm_da,$GUI_CHECKED)
	EndIf
		if (FileReadLine($file1,"46") == 1) Then
		GUICtrlSetState($attack8mm_da,$GUI_CHECKED)
	EndIf
		if (FileReadLine($file1,"47") == 1) Then
		GUICtrlSetState($attack9mm_da,$GUI_CHECKED)
	EndIf
		if (FileReadLine($file1,"48") == 1) Then
		GUICtrlSetState($attack10mm_da,$GUI_CHECKED)
	EndIf
		if (FileReadLine($file1,"49") == 1) Then
		GUICtrlSetState($attack7_da,$GUI_CHECKED)
	EndIf
		if (FileReadLine($file1,"50") == 1) Then
		GUICtrlSetState($attack8_da,$GUI_CHECKED)
	EndIf
		if (FileReadLine($file1,"51") == 1) Then
		GUICtrlSetState($attack9_da,$GUI_CHECKED)
	EndIf
		if (FileReadLine($file1,"52") == 1) Then
		GUICtrlSetState($attack10_da,$GUI_CHECKED)
	EndIf
		if (FileReadLine($file1,"53") == 1) Then
		GUICtrlSetState($attack11_da,$GUI_CHECKED)
	EndIf





	$attack5 = FileReadLine($file1,"23")
	$attack5c = FileReadLine($file1,"24")
	$attack5Cd = FileReadLine($file1,"25")
	$attack6 = FileReadLine($file1,"26")
	$attack6c = FileReadLine($file1,"27")
	$attack6Cd = FileReadLine($file1,"28")
	$attack7 = FileReadLine($file1,"29")
	$attack7c = FileReadLine($file1,"30")
	$attack7Cd = FileReadLine($file1,"31")

	$attack8 = FileReadLine($file1,"32")
	$attack8c = FileReadLine($file1,"33")
	$attack8Cd = FileReadLine($file1,"34")
	$attack8hp = FileReadLine($file1,"35")
	$attackgk =  FileReadLine($file1,"36")
	$attackgd = FileReadLine($file1,"37")
	$attackgdm = FileReadLine($file1,"38")

	$attack9 = FileReadLine($file1,"54")
	$attack9c = FileReadLine($file1,"55")
	$attack9Cd = FileReadLine($file1,"56")

	$attack10 = FileReadLine($file1,"57")
	$attack10c = FileReadLine($file1,"58")
	$attack10Cd = FileReadLine($file1,"59")

	$attack11 = FileReadLine($file1,"60")
	$attack11c = FileReadLine($file1,"61")
	$attack11Cd = FileReadLine($file1,"62")

	$attack12 = FileReadLine($file1,"63")
	$attack12c = FileReadLine($file1,"64")
	$attack12Cd = FileReadLine($file1,"65")

	$attack13 = FileReadLine($file1,"66")
	$attack13c = FileReadLine($file1,"67")
	$attack13Cd = FileReadLine($file1,"68")






	GUICtrlSetData($status,"Save and Load new Values")
	EndIf
EndFunc



Func saveKeys()
	$readAttack1 = GuiCtrlRead($attack1Key)
	$readAttack2 = GuiCtrlRead($attack2Key)
	$readAttack3 = GuiCtrlRead($attack3Key)
	$readAttack4 = GuiCtrlRead($attack4Key)
	$readAttack5 = GuiCtrlRead($attack5Key)
	$readAttack6 = GuiCtrlRead($attack6Key)
	$readAttack7 = GuiCtrlRead($attack7Key)
	$readAttack8  = GuiCtrlRead($attack8Key)
	$readAttack9  = GuiCtrlRead($attack9Key)
	$readAttack10 = GuiCtrlRead($attack10Key)
	$readAttack11 = GuiCtrlRead($attack11Key)
	$readAttack12 = GuiCtrlRead($attack12Key)
	$readAttack13 = GuiCtrlRead($attack13Key)

	$readAttack1cast = GuiCtrlRead($attack1Cast)
	$readAttack2cast = GuiCtrlRead($attack2Cast)
	$readAttack3cast = GuiCtrlRead($attack3Cast)
	$readAttack4cast = GuiCtrlRead($attack4Cast)
	$readAttack5cast = GuiCtrlRead($attack5Cast)
	$readAttack6cast = GuiCtrlRead($attack6Cast)
	$readAttack7cast = GuiCtrlRead($attack7Cast)
	$readAttack8cast = GuiCtrlRead($attack8Cast)
	$readAttack9cast = GuiCtrlRead($attack9Cast)
	$readAttack10cast = GuiCtrlRead($attack10Cast)
	$readAttack11cast = GuiCtrlRead($attack11Cast)
	$readAttack12cast = GuiCtrlRead($attack12Cast)
	$readAttack13cast = GuiCtrlRead($attack13Cast)

	$readAttack1cd = GuiCtrlRead($attack1Cooldown)
	$readAttack2cd = GuiCtrlRead($attack2Cooldown)
	$readAttack3cd = GuiCtrlRead($attack3Cooldown)
	$readAttack4cd = GuiCtrlRead($attack4Cooldown)
	$readAttack5cd = GuiCtrlRead($attack5Cooldown)
	$readAttack6cd = GuiCtrlRead($attack6Cooldown)
	$readAttack7cd = GuiCtrlRead($attack7Cooldown)
	$readAttack8cd = GuiCtrlRead($attack8Cooldown)
	$readAttack9cd = GuiCtrlRead($attack9Cooldown)
	$readAttack10cd = GuiCtrlRead($attack10Cooldown)
	$readAttack11cd = GuiCtrlRead($attack11Cooldown)
	$readAttack12cd = GuiCtrlRead($attack12Cooldown)
	$readAttack13cd = GuiCtrlRead($attack13Cooldown)

	$readAttack1da = GuiCtrlRead($attack1_da)
	$readAttack2da = GuiCtrlRead($attack2_da)
	$readAttack3da = GuiCtrlRead($attack3_da)
	$readAttack4da = GuiCtrlRead($attack4_da)
	$readAttack5da = GuiCtrlRead($attack5_da)
	$readAttack6da = GuiCtrlRead($attack6_da)
	$readAttack7da = GuiCtrlRead($attack7_da)
	$readAttack8da = GuiCtrlRead($attack8_da)
	$readAttack9da = GuiCtrlRead($attack9_da)
	$readAttack10da = GuiCtrlRead($attack10_da)
	$readAttack11da = GuiCtrlRead($attack11_da)



	$readAttack1mm = GuiCtrlRead($attack1mm_da)
	$readAttack2mm = GuiCtrlRead($attack2mm_da)
	$readAttack3mm = GuiCtrlRead($attack3mm_da)
	$readAttack4mm = GuiCtrlRead($attack4mm_da)
	$readAttack5mm = GuiCtrlRead($attack5mm_da)
	$readAttack6mm = GuiCtrlRead($attack6mm_da)
	$readAttack7mm = GuiCtrlRead($attack7mm_da)
	$readAttack8mm = GuiCtrlRead($attack8mm_da)
	$readAttack9mm = GuiCtrlRead($attack9mm_da)
	$readAttack10mm = GuiCtrlRead($attack10mm_da)


	$readAttack8hp = GuiCtrlRead($attack8hitPoint)
	$reg_minLife = GuiCtrlRead($regMin)
	$reg_minMana = GuiCtrlRead($regMinMana)




	$readatck = GuiCtrlRead($atck)
	$readattackdistmin = GuiCtrlRead($attackdistmin)
	$readattackdistmax = GuiCtrlRead($attackdistmax)



	$readLoot = GuiCtrlRead($lootKey)
	$readReg = GuiCtrlRead($regKey)
	FileDelete("data.txt")
	FileWriteLine($file1,$readAttack1)		;1
	FileWriteLine($file1,$readAttack2)		;2
	FileWriteLine($file1,$readAttack3)		;3
	FileWriteLine($file1,$readLoot)			;4
	FileWriteLine($file1,$readReg)			;5
	FileWriteLine($file1,$readAttack1cast)	;6
	FileWriteLine($file1,$readAttack2cast)	;7
	FileWriteLine($file1,$readAttack3cast)	;8
	FileWriteLine($file1,$readAttack1cd)	;9
	FileWriteLine($file1,$readAttack2cd)	;10
	FileWriteLine($file1,$readAttack3cd)	;11
	FileWriteLine($file1,$reg_minLife)		;12
	FileWriteLine($file1,$reg_minMana)		;13
	FileWriteLine($file1,$readAttack4)		;14
	FileWriteLine($file1,$readAttack4cast)	;15
	FileWriteLine($file1,$readAttack4cd)	;16

	FileWriteLine($file1,$readAttack1da)	;17
	FileWriteLine($file1,$readAttack2da)	;18
	FileWriteLine($file1,$readAttack3da)	;19
	FileWriteLine($file1,$readAttack4da)	;20
	FileWriteLine($file1,$readAttack5da)	;21
	FileWriteLine($file1,$readAttack6da)	;22


	FileWriteLine($file1,$readAttack5)		;23
	FileWriteLine($file1,$readAttack5cast)	;24
	FileWriteLine($file1,$readAttack5cd)	;25
	FileWriteLine($file1,$readAttack6)		;26
	FileWriteLine($file1,$readAttack6cast)	;27
	FileWriteLine($file1,$readAttack6cd)	;28
	FileWriteLine($file1,$readAttack7)		;29
	FileWriteLine($file1,$readAttack7cast)	;30
	FileWriteLine($file1,$readAttack7cd)	;31
	FileWriteLine($file1,$readAttack8)		;32
	FileWriteLine($file1,$readAttack8cast)	;33
	FileWriteLine($file1,$readAttack8cd)	;34
	FileWriteLine($file1,$readAttack8hp)	;35
	FileWriteLine($file1,$readatck)			;36

	FileWriteLine($file1,$readattackdistmin) ;37
	FileWriteLine($file1,$readattackdistmax) ;38

	FileWriteLine($file1,$readAttack1mm)	 ;39
	FileWriteLine($file1,$readAttack2mm) 	;40
	FileWriteLine($file1,$readAttack3mm) 	;41
	FileWriteLine($file1,$readAttack4mm) 	;42
	FileWriteLine($file1,$readAttack5mm) 	;43
	FileWriteLine($file1,$readAttack6mm) 	;44
	FileWriteLine($file1,$readAttack7mm) 	;45
	FileWriteLine($file1,$readAttack8mm) 	;46
	FileWriteLine($file1,$readAttack9mm) 	;47
	FileWriteLine($file1,$readAttack10mm) 	;48

	FileWriteLine($file1,$readAttack7da)	;49
	FileWriteLine($file1,$readAttack8da)	;50
	FileWriteLine($file1,$readAttack9da)	;51
	FileWriteLine($file1,$readAttack10da)	;52
	FileWriteLine($file1,$readAttack11da)	;53

	FileWriteLine($file1,$readAttack9)		;54
	FileWriteLine($file1,$readAttack9cast)	;55
	FileWriteLine($file1,$readAttack9cd)	;56

	FileWriteLine($file1,$readAttack10)		;57
	FileWriteLine($file1,$readAttack10cast)	;58
	FileWriteLine($file1,$readAttack10cd)	;59

	FileWriteLine($file1,$readAttack11)		;60
	FileWriteLine($file1,$readAttack11cast)	;61
	FileWriteLine($file1,$readAttack11cd)	;62

	FileWriteLine($file1,$readAttack12)		;63
	FileWriteLine($file1,$readAttack12cast)	;64
	FileWriteLine($file1,$readAttack12cd)	;65

	FileWriteLine($file1,$readAttack13)		;66
	FileWriteLine($file1,$readAttack13cast)	;67
	FileWriteLine($file1,$readAttack13cd)	;68
	readKeys()
EndFunc


; THE FUTURE!
Func loadConfig()
	$confVar1 = FileReadLine($configFile,"1")
	$confVar2 = FileReadLine($configFile,"2")
	$confVar3 = FileReadLine($configFile,"3")
	$confVar4 = FileReadLine($configFile,"4")
	$confVar5 = FileReadLine($configFile,"5")
	$confVar6 = FileReadLine($configFile,"6")
	$confVar7 = FileReadLine($configFile,"7")
	$confVar8 = FileReadLine($configFile,"8")
	$confVar9 = FileReadLine($configFile,"9")
	$confVar10 = FileReadLine($configFile,"10")
	$confVar11 = FileReadLine($configFile,"11")
	$confVar12 = FileReadLine($configFile,"12")
	$confVar13 = FileReadLine($configFile,"13")
	$confVar14 = FileReadLine($configFile,"14")
	$confVar15 = FileReadLine($configFile,"15")
	$confVar16 = FileReadLine($configFile,"16")
	$confVar17 = FileReadLine($configFile,"17")
	$confVar18 = FileReadLine($configFile,"18")
	$confVar19 = FileReadLine($configFile,"19")
	$confVar20 = FileReadLine($configFile,"20")
	$confVar21 = FileReadLine($configFile,"21")
	$confVar22 = FileReadLine($configFile,"22")
	$confVar23 = FileReadLine($configFile,"23")
	$confVar24 = FileReadLine($configFile,"24")
	$confVar25 = FileReadLine($configFile,"25")
	$confVar26 = FileReadLine($configFile,"26")
	$confVar27 = FileReadLine($configFile,"27")
	$confVar28 = FileReadLine($configFile,"28")
	$confVar29 = FileReadLine($configFile,"29")
	$confVar30 = FileReadLine($configFile,"30")
	$confVar31 = FileReadLine($configFile,"31")
	$confVar32 = FileReadLine($configFile,"32")
	$confVar33 = FileReadLine($configFile,"33")
	$confVar34 = FileReadLine($configFile,"34")
	$confVar35 = FileReadLine($configFile,"35")
	$confVar36 = FileReadLine($configFile,"36")
	$confVar37 = FileReadLine($configFile,"37")
	$confVar38 = FileReadLine($configFile,"38")
	$confVar39 = FileReadLine($configFile,"39")
	$confVar40 = FileReadLine($configFile,"40")
	$confVar41 = FileReadLine($configFile,"41")
EndFunc

Func _toolTip($msg)
	GUICtrlSetData($status,$msg)
EndFunc

;#################################################
;Memory Read/write functions
;#################################################


Func OpenAionMemory()
	$pid = ProcessExists("AION.bin")
	If $pid == -1 Then
		Return
	EndIf
	$openmem = _MemoryOpen($pid)
	If @error Then
		Return
	EndIf
	$AionRun = True
EndFunc


Func MemReadDLLEnemyHP($offset)
    $StaticOffset = Dec($offset)
    Global $pid
    Global $CUROffset[1]
    $CUROffset[0] = 0
    $baseADDR = _MemoryModuleGetBaseAddress($pid, "Game.dll")
    $finalADDR = "0x" & Hex($baseADDR + $StaticOffset)
    $MemTest = _MemoryRead($finaladdr,$openmem)
	$MemTest = _memoryread(   $MemTest+ 0x1C4,$openmem)
    $MemTest = _memoryread(   $MemTest + 0x0034, $openmem,"byte" )
    Return $MemTest
EndFunc

Func MemReadDLLEnemyLevel($offset)
    $StaticOffset = Dec($offset)
    Global $pid
    Global $CUROffset[1]
    $CUROffset[0] = 0
    $baseADDR = _MemoryModuleGetBaseAddress($pid, "Game.dll")
    $finalADDR = "0x" & Hex($baseADDR + $StaticOffset)
    $MemTest = _MemoryRead($finaladdr,$openmem)
	$MemTest = _memoryread(   $MemTest+ 0x1C4,$openmem)
    $MemTest = _memoryread(   $MemTest + 0x0032, $openmem,"byte" )
    Return $MemTest
EndFunc

Func MemReadTargetType($offset)
    $StaticOffset = Dec($offset)
    Global $pid
    Global $CUROffset[1]
    $CUROffset[0] = 0
    $baseADDR = _MemoryModuleGetBaseAddress($pid, "Game.dll")
    $finalADDR = "0x" & Hex($baseADDR + $StaticOffset)
    $MemTest = _MemoryRead($finaladdr,$openmem)
	$MemTest = _memoryread(   $MemTest+ 0x1C4,$openmem)
    $MemTest = _memoryread(   $MemTest + 0x0168, $openmem )
    Return $MemTest
EndFunc



Func MemReadDLL($offset)
    $StaticOffset = Dec($offset)
    Global $pid
    Global $CUROffset[1]
    $CUROffset[0] = 0
    $baseADDR = _MemoryModuleGetBaseAddress($pid, "Game.dll")
    $finalADDR = "0x" & Hex($baseADDR + $StaticOffset)
    $MemTest = _MemoryRead($finaladdr,$openmem)

    Return $MemTest
EndFunc

Func MemReadDLLFloat($offset)
	$StaticOffset = Dec($offset)
	Global $pid
	Global $CUROffset[1]
	$CUROffset[0] = 0
	$baseADDR = _MemoryModuleGetBaseAddress($pid, "Game.dll")
	$finalADDR = "0x" & Hex($baseADDR + $StaticOffset)
	$MemTest = _MemoryRead($finaladdr,$openmem,"float")
	Return $MemTest
EndFunc

Func MemWriteDLL($offset, $data)
	$StaticOffset = Dec($offset)
	Global $pid
	Global $CUROffset[1]
	$CUROffset[0] = 0
	$baseADDR = _MemoryModuleGetBaseAddress($pid, "Game.dll")
	$finalADDR = "0x" & Hex($baseADDR + $StaticOffset)

	_MemoryWrite($finalADDR,$openmem,$data,"float")
	Return
EndFunc

Func MemReadEntity($offset)
    $StaticOffset = Dec($offset)
    Global $pid
    Global $CUROffset[1]
    $CUROffset[0] = 0
    $baseADDR = _MemoryModuleGetBaseAddress($pid, "Game.dll")
    $finalADDR = "0x" & Hex($baseADDR + $StaticOffset)
    $MemTest = _memoryread($finaladdr,$openmem)
	$MemTest = _memoryread($MemTest+ 0x1C4,$openmem)
    Return $MemTest
EndFunc

Func MemReadTargetName($offset = "4F68FC")
    $StaticOffset = Dec($offset)
    Global $pid
    Global $CUROffset[1]
    $CUROffset[0] = 0
    $baseADDR = _MemoryModuleGetBaseAddress($pid, "Game.dll")
    $finalADDR = "0x" & Hex($baseADDR + $StaticOffset)
    $MemTest = _memoryread($finaladdr,$openmem)
	$MemTest = _memoryread($MemTest+ 0x4 ,$openmem)
	;$MemTest = _memoryread(   $MemTest + 0x0036 , $openmem,"byte" )
    Return $MemTest
EndFunc

Func GetDistance()																				;;;: distance  - Added by kknb 30.10.2009
    $y1 = PlayerXPos()
    $targetx = MemReadtargetxCoord("4F68FC")
    $x1 = PlayerYPos()
    $targety = MemReadtargetYCoord("4F68FC")
    $diff = sqrt((($x1 - $targetx)^2) + (($y1 - $targety)^2))
    $erg = Round($diff)
Return $erg -3
EndFunc

Func MemReadtargetxCoord($offset)
    $StaticOffset = Dec($offset)
    Global $pid
    Global $CUROffset[1]
    $CUROffset[0] = 0
    $baseADDR = _MemoryModuleGetBaseAddress($pid, "Game.dll")
    $finalADDR = "0x" & Hex($baseADDR + $StaticOffset)
    $MemTest = _memoryread($finaladdr,$openmem)
	$MemTest = _memoryread($MemTest+ 0x28,$openmem,"float")
    Return $MemTest
EndFunc

Func MemReadtargetYCoord($offset)
    $StaticOffset = Dec($offset)
    Global $pid
    Global $CUROffset[1]
    $CUROffset[0] = 0
    $baseADDR = _MemoryModuleGetBaseAddress($pid, "Game.dll")
    $finalADDR = "0x" & Hex($baseADDR + $StaticOffset)
    $MemTest = _memoryread($finaladdr,$openmem)
	$MemTest = _memoryread($MemTest+ 0x2c,$openmem,"float")
    Return $MemTest
EndFunc


; the HP of the TargetEnemy
Func CheckEnemyDead()
	return MemReadDLLEnemyHP("4F68FC")
	;Return 0
EndFunc

Func playerCurrectEP()
	return MemReadDLL("8EEEA8")
EndFunc

Func PlayerMaxEP()
	return MemReadDLL("8EEE98")
EndFunc

Func playerCurrectMana()
	return MemReadDLL("8EEEC0")
EndFunc

Func PlayerMaxMana()
	return MemReadDLL("8EEEBC")
EndFunc

Func playerCurrectHp()
	return MemReadDLL("8EEEB8")
EndFunc

Func playerCurrectHpPercent()
	$val = MemReadDLL("8EEEB8")
	$Pval = ($val * 100) / PlayerMaxHp()
	return Round($Pval)
EndFunc

Func PlayerMaxHp()
	return MemReadDLL("8EEEB4")
EndFunc

Func PlayerXPos()
	return MemReadDLLFloat("8E6944")
EndFunc

Func PlayerYPos()
	return MemReadDLLFloat("8E6940")
EndFunc

Func PlayerZPos()
	return MemReadDLLFloat("8E6948")
EndFunc

; Angel of the Player 360° / 2 :)
Func GetPlayerPos()
	Return MemReadDLLFloat("8E40C0")
EndFunc

Func GetEnemyLvl()
	Return MemReadDLLEnemyLevel("4F68FC")
EndFunc

Func getEnityId()
	Return MemReadEntity("4F68FC")
EndFunc

Func getTargetOfTarget()
	Return MemReadTargetName()
EndFunc

Func getEnemyType()
	Return MemReadTargetType("4F68FC")
EndFunc

Func ReadMemValues()
	$playerHP = playerCurrectHp()
	$playerHPMax = PlayerMaxHp()

	$playerEP = playerCurrectEP()
	$playerEPMax = PlayerMaxEP()
	$playerEnergy = playerCurrectMana()
	$playerEnergyMax = PlayerMaxMana()
EndFunc

;#################################################
;fight functions
;#################################################

Func enemyInsgid()
	$enemyhp = CheckEnemyDead()
	if $enemyhp <> 0 And $enemyhp > 99 And getEnemyType() <> 0 then
		if GetEnemyLvl() = 1 Then
			return false
		EndIf
		return true
	EndIf
;~ 	return false
EndFunc

Func KillEnemy()

		send($attackgk)
		send($atck)
			$dist = GetDistance()
			if ( $dist >= $attackgdm ) then
				send($attackgk)
				$timer = _TimeGetStamp() +13
					Do
						sleep(50)
					until GetDistance() <= $attackgd -1 or $timer <=  _TimeGetStamp()
						send("{s down}")
						sleep(40)
						send("{s up}")
						F_EmCast()
;~ 						F_arttack1()
;~ 						validateAttack()
;~ 					Else
;~ 							F_EmCast()
;~ 							F_arttack1()
;~ 							validateAttack()
					EndIf



		_toolTip("pulling mob / otw to mob")
		if $attack4 <> "x" then
			F_buff()
			F_EmCast()


		EndIf
;~ 		sleep(300)
;~ 		;-------------------------------------------------

		while CheckEnemyDead() <> 0

		;-------------------------------------------------
			if $attack1 <> "x" then
				if($combatFlag == 2) Then
					return false
				EndIf
					if(GuiCtrlRead($attack1mm_da) = 1    ) then  									;;;;;;;  MAX hacken ticked
						$dist = GetDistance()
						if ( $dist >= $attackgdm ) then
							send($attackgk)
							$timer = _TimeGetStamp() +13
								Do
									sleep(50)
								until GetDistance() <= $attackgdm -1 or $timer <  _TimeGetStamp()
							send("{s down}")
							sleep(40)
							send("{s up}")
							F_EmCast()
							F_arttack1()
;~ 							sleep(1000)
;~ 							validateAttack()
						Else
							F_EmCast()
							F_arttack1()
;~ 							sleep(1000)
;~ 							validateAttack()
						EndIf

					Else

						$dist = GetDistance()
						if ( $dist >= $attackgd ) then
							send($attackgk)
							$timer = _TimeGetStamp() +13
								Do
									sleep(50)
								until GetDistance() <= $attackgd -1 or $timer <  _TimeGetStamp()
							send("{s down}")
							sleep(40)
							send("{s up}")
							F_EmCast()
							F_arttack1()
;~ 							validateAttack()
						Else
							F_EmCast()
							F_arttack1()
;~ 							validateAttack()
						EndIf
					EndIf
			EndIf
		;-------------------------------------------------

				;-------------------------------------------------
			if $attack2 <> "x" then
				if($combatFlag == 2) Then
					return false
				EndIf
					if(GuiCtrlRead($attack2mm_da) = 1    ) then  									;;;;;;;  MAX hacken ticked
						$dist = GetDistance()
						if ( $dist >= $attackgdm ) then
							send($attackgk)
							$timer = _TimeGetStamp() +13
								Do
									sleep(50)
								until GetDistance() <= $attackgdm -1 or $timer <  _TimeGetStamp()
							send("{s down}")
							sleep(40)
							send("{s up}")
							F_EmCast()
							F_arttack2()
;~ 							validateAttack()
						Else
							F_EmCast()
							F_arttack2()
;~ 							validateAttack()
						EndIf

					Else

						$dist = GetDistance()
						if ( $dist >= $attackgd ) then
							send($attackgk)
							$timer = _TimeGetStamp() +13
								Do
									sleep(50)
								until GetDistance() <= $attackgd -1 or $timer <  _TimeGetStamp()
							send("{s down}")
							sleep(40)
							send("{s up}")
							F_EmCast()
							F_arttack2()
;~ 							validateAttack()
						Else
							F_EmCast()
							F_arttack2()
;~ 							validateAttack()
						EndIf
					EndIf
			EndIf
		;-------------------------------------------------
				;-------------------------------------------------
			if $attack3 <> "x" then
				if($combatFlag == 2) Then
					return false
				EndIf
					if(GuiCtrlRead($attack3mm_da) == 1    ) then  									;;;;;;;  MAX hacken ticked
						$dist = GetDistance()
						if ( $dist >= $attackgdm ) then
							send($attackgk)
							$timer = _TimeGetStamp() +13
								Do
									sleep(50)
								until GetDistance() <= $attackgdm -1 or $timer <  _TimeGetStamp()
							send("{s down}")
							sleep(40)
							send("{s up}")
							F_EmCast()
							F_arttack3()
;~ 							validateAttack()
						Else
							F_EmCast()
							F_arttack3()
;~ 							validateAttack()
						EndIf

					Else

						$dist = GetDistance()
						if ( $dist >= $attackgd ) then
							send($attackgk)
							$timer = _TimeGetStamp() +13
								Do
									sleep(50)
								until GetDistance() <= $attackgd -1 or $timer <  _TimeGetStamp()
							send("{s down}")
							sleep(40)
							send("{s up}")
							F_EmCast()
							F_arttack3()
;~ 							validateAttack()
						Else
							F_EmCast()
							F_arttack3()
;~ 							validateAttack()
						EndIf
					EndIf
			EndIf
		;-------------------------------------------------
				;-------------------------------------------------

		;-------------------------------------------------
				;-------------------------------------------------
			if $attack5 <> "x" then
				if($combatFlag == 2) Then
					return false
				EndIf
					if(GuiCtrlRead($attack4mm_da) == 1    ) then  									;;;;;;;  MAX hacken ticked
						$dist = GetDistance()
						if ( $dist >= $attackgdm ) then
							send($attackgk)
							$timer = _TimeGetStamp() +13
								Do
									sleep(50)
								until GetDistance() <= $attackgdm -1 or $timer <  _TimeGetStamp()
							send("{s down}")
							sleep(40)
							send("{s up}")
							F_EmCast()
							F_arttack5()
;~ 							validateAttack()
						Else
							F_EmCast()
							F_arttack5()
;~ 							validateAttack()
						EndIf

					Else

						$dist = GetDistance()
						if ( $dist >= $attackgd ) then
							send($attackgk)
							$timer = _TimeGetStamp() +13
								Do
									sleep(50)
								until GetDistance() <= $attackgd -1 or $timer <  _TimeGetStamp()
							send("{s down}")
							sleep(40)
							send("{s up}")
							F_EmCast()
							F_arttack5()
;~ 							validateAttack()
						Else
							F_EmCast()
							F_arttack5()
;~ 							validateAttack()
						EndIf
					EndIf
			EndIf
		;-------------------------------------------------
				;-------------------------------------------------
			if $attack6 <> "x" then
				if($combatFlag == 2) Then
					return false
				EndIf
					if(GuiCtrlRead($attack5mm_da) == 1    ) then  									;;;;;;;  MAX hacken ticked
						$dist = GetDistance()
						if ( $dist >= $attackgdm ) then
							send($attackgk)
							$timer = _TimeGetStamp() +13
								Do
									sleep(50)
								until GetDistance() <= $attackgdm -1 or $timer <  _TimeGetStamp()
							send("{s down}")
							sleep(40)
							send("{s up}")
							F_EmCast()
							F_arttack6()
;~ 							validateAttack()
						Else
							F_EmCast()
							F_arttack6()
;~ 							validateAttack()
						EndIf

					Else

						$dist = GetDistance()
						if ( $dist >= $attackgd ) then
							send($attackgk)
							$timer = _TimeGetStamp() +13
								Do
									sleep(50)
								until GetDistance() <= $attackgd -1 or $timer <  _TimeGetStamp()
							send("{s down}")
							sleep(40)
							send("{s up}")
							F_EmCast()
							F_arttack6()
;~ 							validateAttack()
						Else
							F_EmCast()
							F_arttack6()
;~ 							validateAttack()
						EndIf
					EndIf
			EndIf
				;-------------------------------------------------
				;-------------------------------------------------
				;-------------------------------------------------
				;-------------------------------------------------

			if $attack9 <> "x" then
				if($combatFlag == 2) Then
					return false
				EndIf
					if(GuiCtrlRead($attack6mm_da) == 1    ) then  									;;;;;;;  MAX hacken ticked
						$dist = GetDistance()
						if ( $dist >= $attackgdm ) then
							send($attackgk)
							$timer = _TimeGetStamp() +13
								Do
									sleep(50)
								until GetDistance() <= $attackgdm -1 or $timer <  _TimeGetStamp()
							send("{s down}")
							sleep(40)
							send("{s up}")
							F_EmCast()
							F_arttack9()
;~ 							validateAttack()
						Else
							F_EmCast()
							F_arttack9()
;~ 							validateAttack()
						EndIf

					Else

						$dist = GetDistance()
						if ( $dist >= $attackgd ) then
							send($attackgk)
							$timer = _TimeGetStamp() +13
								Do
									sleep(50)
								until GetDistance() <= $attackgd -1 or $timer <  _TimeGetStamp()
							send("{s down}")
							sleep(40)
							send("{s up}")
							F_EmCast()
							F_arttack9()
;~ 							validateAttack()
						Else
							F_EmCast()
							F_arttack9()
;~ 							validateAttack()
						EndIf
					EndIf
			EndIf
		;-------------------------------------------------
				;-------------------------------------------------
			if $attack10 <> "x" then
				if($combatFlag == 2) Then
					return false
				EndIf
					if(GuiCtrlRead($attack7mm_da) == 1    ) then  									;;;;;;;  MAX hacken ticked
						$dist = GetDistance()
						if ( $dist >= $attackgdm ) then
							send($attackgk)
							$timer = _TimeGetStamp() +13
								Do
									sleep(50)
								until GetDistance() <= $attackgdm -1 or $timer <  _TimeGetStamp()
							send("{s down}")
							sleep(40)
							send("{s up}")
							F_EmCast()
							F_arttack10()
;~ 							validateAttack()
						Else
							F_EmCast()
							F_arttack10()
;~ 							validateAttack()
						EndIf

					Else

						$dist = GetDistance()
						if ( $dist >= $attackgd ) then
							send($attackgk)
							$timer = _TimeGetStamp() +13
								Do
									sleep(50)
								until GetDistance() <= $attackgd -1 or $timer <  _TimeGetStamp()
							send("{s down}")
							sleep(40)
							send("{s up}")
							F_EmCast()
							F_arttack10()
;~ 							validateAttack()
						Else
							F_EmCast()
							F_arttack10()
;~ 							validateAttack()
						EndIf
					EndIf
			EndIf
		;-------------------------------------------------
				;-------------------------------------------------
			if $attack11 <> "x" then
				if($combatFlag == 2) Then
					return false
				EndIf
					if(GuiCtrlRead($attack8mm_da) == 1    ) then  									;;;;;;;  MAX hacken ticked
						$dist = GetDistance()
						if ( $dist >= $attackgdm ) then
							send($attackgk)
							$timer = _TimeGetStamp() +13
								Do
									sleep(50)
								until GetDistance() <= $attackgdm -1 or $timer <  _TimeGetStamp()
							send("{s down}")
							sleep(40)
							send("{s up}")
							F_EmCast()
							F_arttack11()
;~ 							validateAttack()
						Else
							F_EmCast()
							F_arttack11()
;~ 							validateAttack()
						EndIf

					Else

						$dist = GetDistance()
						if ( $dist >= $attackgd ) then
							send($attackgk)
							$timer = _TimeGetStamp() +13
								Do
									sleep(50)
								until GetDistance() <= $attackgd -1 or $timer <  _TimeGetStamp()
							send("{s down}")
							sleep(40)
							send("{s up}")
							F_EmCast()
							F_arttack11()
;~ 							validateAttack()
						Else
							F_EmCast()
							F_arttack11()
;~ 							validateAttack()
						EndIf
					EndIf
			EndIf
		;-------------------------------------------------
				;-------------------------------------------------
			if $attack12 <> "x" then
				if($combatFlag == 2) Then
					return false
				EndIf
					if(GuiCtrlRead($attack9mm_da) == 1    ) then  									;;;;;;;  MAX hacken ticked
						$dist = GetDistance()
						if ( $dist >= $attackgdm ) then
							send($attackgk)
							$timer = _TimeGetStamp() +13
								Do
									sleep(50)
								until GetDistance() <= $attackgdm -1 or $timer <  _TimeGetStamp()
							send("{s down}")
							sleep(40)
							send("{s up}")
							F_EmCast()
							F_arttack12()
;~ 							validateAttack()
						Else
							F_EmCast()
							F_arttack12()
;~ 							validateAttack()
						EndIf

					Else

						$dist = GetDistance()
						if ( $dist >= $attackgd ) then
							send($attackgk)
							$timer = _TimeGetStamp() +13
								Do
									sleep(50)
								until GetDistance() <= $attackgd -1 or $timer <  _TimeGetStamp()
							send("{s down}")
							sleep(40)
							send("{s up}")
							F_EmCast()
							F_arttack12()
;~ 							validateAttack()
						Else
							F_EmCast()
							F_arttack12()
;~ 							validateAttack()
						EndIf
					EndIf
			EndIf
		;-------------------------------------------------
				;-------------------------------------------------
			if $attack13 <> "x" then
				if($combatFlag == 2) Then
					return false
				EndIf
					if(GuiCtrlRead($attack10mm_da) == 1    ) then  									;;;;;;;  MAX hacken ticked
						$dist = GetDistance()
						if ( $dist >= $attackgdm ) then
							send($attackgk)
							$timer = _TimeGetStamp() +13
								Do
									sleep(50)
								until GetDistance() <= $attackgdm -1 or $timer <  _TimeGetStamp()
							send("{s down}")
							sleep(40)
							send("{s up}")
							F_EmCast()
							F_arttack13()
;~ 							validateAttack()
						Else
							F_EmCast()
							F_arttack13()
;~ 							validateAttack()
						EndIf

					Else

						$dist = GetDistance()
						if ( $dist >= $attackgd ) then
							send($attackgk)
							$timer = _TimeGetStamp() +13
								Do
									sleep(50)
								until GetDistance() <= $attackgd -1 or $timer <  _TimeGetStamp()
							send("{s down}")
							sleep(40)
							send("{s up}")
							F_EmCast()
							F_arttack13()
;~ 							validateAttack()
						Else
							F_EmCast()
							F_arttack13()
;~ 							validateAttack()
						EndIf
					EndIf
			EndIf



	;-------------------------------------------------

		WEnd

	;-------------------------------------------------
		sleep(500)
		_toolTip("Mob down")

		; add 1 to the kill counter :)
		$enemyKillCount = $enemyKillCount + 1
		GUICtrlSetData( $killCount, $enemyKillCount)
		Sleep(1300)
		; ep counter
		$newEp = playerCurrectEP() - $playerEP
		$playerEP = playerCurrectEP()
		$enemyEpCount = $enemyEpCount + $newEp
		GUICtrlSetData($epCount , $enemyEpCount)
		; loot

		_toolTip("start Looting")
		Send($loot)
		Sleep(400)
		Send($loot)
		Do
			sleep(10)
		until GetDistance() < $attackgd

		calcTime($newEp)
		Sleep(3500)

		if(enemyInsgid() ) Then
			F_EmCast()
			KillEnemy()

		Else

		if $attack7 <> "x" then
			F_PostAttack()
		EndIf
		EndIf

		if(enemyInsgid() ) Then
			F_EmCast()
			KillEnemy()
		EndIf
		sleep(50)
		if ((playerCurrectHp()/$playerHPMax)*100) < $reg_minLife Or ((playerCurrectMana()/$playerEnergyMax)*100) < $reg_minMana Then
			_toolTip("start Reging")
			Send($reg)
			while PlayerMaxHp() <> playerCurrectHp()
				if( CheckEnemyDead() <> 0) Then
					ExitLoop
				EndIf
				if(enemyInsgid() ) Then
				KillEnemy()
				EndIf
				Sleep(1000)


			WEnd
			while PlayerMaxMana() <> playerCurrectMana()
				if(CheckEnemyDead() <> 0) Then
					ExitLoop
				EndIf
				if(enemyInsgid() ) Then
				KillEnemy()
				EndIf
				Sleep(1000)
			WEnd
			Send("{w down}")
			Sleep(100)
			Send("{w up}")
		EndIf
		$jumper = _getRandomJumpTimer()
		return True
EndFunc

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


Func validateAttack()
	if($goodCombat < 1) Then
		if($combatStartTimer < _TimeGetStamp() ) Then
			if(CheckEnemyDead() < 100) Then
				$goodCombat = 1
				$combatFlag = 1
			Elseif($combatAnimaLibera < 2) Then
				if(CheckEnemyDead() < 100) Then
					$goodCombat = 1
					$combatFlag = 1
;~ 					return True
				EndIf
				combatFreeMind()
				$combatAnimaLibera = $combatAnimaLibera + 1
			Else
				$combatFlag = 2
				$lastBlackListEnemy = getEnityId()
			EndIf
		EndIf
	EndIf
EndFunc



Func combatFreeMind()
	Send("{s down}")
	Sleep(1000)
	Send("{s up}")
	if($combatAnimaLibera > 0) Then
		Send("{e down}")
		Sleep(2000)
		Send("{e up}")
		Sleep(70)
		send($attackgk)
	Else
		Send("{q down}")
		Sleep(2000)
		Send("{q up}")
		Sleep(70)
		send($attackgk)
	EndIf

	$combatStartTimer = _TimeGetStamp() + 15
EndFunc


Func checkBlackList()
	If getEnityId() == $lastBlackListEnemy And $lastBlackListEnemy <> 0 Then
		Return False
	Else
		Return True
	EndIf
EndFunc

Func checkShutDown()
	if($timeToShutdown > 0) Then
		$sddiff = $timeToShutdown - _TimeGetStamp()
		If $timeToShutdown < _TimeGetStamp() Then
			Send("{w up}")
			$Run = False
			GUICtrlSetData ($buttonRun,"Start Bot")
		Elseif($sddiff <> $timeCache) Then
			$timeCache = $sddiff
			GUICtrlSetData($timeToShutdownOutput ,SecToTime($sddiff))
		EndIf
	EndIf
EndFunc

Func setShutDownTimer()
	if GuiCtrlRead($sdtimerInput) > 0 And GuiCtrlRead($sdtimerInput) <> "" Then
		$timeToShutdown = _TimeGetStamp() + (GuiCtrlRead($sdtimerInput) * 60)
	Else
		$timeToShutdown = 0
		GUICtrlSetData($timeToShutdownOutput ,"-----")
		$Run = false
	EndIf
EndFunc


;################################################
; Action functions
;################################################

Func Eexit()
Send("{a up}")
Send("{s up}")
Send("{d up}")
Send("{w up}")
;~ Send("{q up}")
;~ Send("{e up}")
	Exit
	EndFunc

Func F_arttack1()
	F_EmCast()
	if(($attack1LastCast + $attack1Cd) < _TimeGetStamp() and CheckEnemyDead() <> 0) Then
		_toolTip("start attack Nr1")
		Send($attack1)
		Sleep($attack1c)
		$attack1LastCast = _TimeGetStamp()
		sleep(200)
		validateAttack()
		if(GuiCtrlRead($attack1_da) == 1 And CheckEnemyDead() <> 0) Then

			Send($attack1)
			sleep($attack1c/4)

			if CheckEnemyDead() <> 0 then
				Send($attack1)
				sleep($attack1c/4)
			EndIf
					if CheckEnemyDead() <> 0 then
					Send($attack1)
					sleep($attack1c/4)
					EndIf

						if CheckEnemyDead() <> 0 then
						Send($attack1)
						sleep($attack1c/4)
						EndIf

					if CheckEnemyDead() <> 0 then
					Send($attack1)
					sleep($attack1c/4)
				EndIf

;~ 			if CheckEnemyDead() <> 0 then
;~ 				Send($attack1)
;~ 				sleep($attack1c/4)
;~ 			EndIf
;~ 					if CheckEnemyDead() <> 0 then
;~ 					Send($attack1)
;~ 					sleep($attack1c/4)
;~ 				EndIf


			Sleep(100)
		EndIf
	EndIf
EndFunc

Func F_arttack2()
	F_EmCast()
	if(($attack2LastCast + $attack2Cd) < _TimeGetStamp() and CheckEnemyDead() <> 0) Then
		_toolTip("start attack Nr2")
		Send($attack2)
		Sleep($attack2c)
		$attack2LastCast = _TimeGetStamp()
		sleep(200)
		validateAttack()
		if(GuiCtrlRead($attack2_da) == 1 And CheckEnemyDead() <> 0) Then
			Send($attack2)
			sleep($attack2c/4)

			if CheckEnemyDead() <> 0 then
				Send($attack2)
				sleep($attack2c/4)
			EndIf
					if CheckEnemyDead() <> 0 then
					Send($attack2)
					sleep($attack2c/4)
					EndIf

						if CheckEnemyDead() <> 0 then
						Send($attack2)
						sleep($attack2c/4)
						EndIf

					if CheckEnemyDead() <> 0 then
					Send($attack2)
					sleep($attack2c/4)
				EndIf
		EndIf
	EndIf
EndFunc

Func F_arttack3()
	F_EmCast()
	if(($attack3LastCast + $attack3Cd) < _TimeGetStamp() and CheckEnemyDead() <> 0) Then
		_toolTip("start attack Nr3")
		Send($attack3)
		Sleep($attack3c)
		$attack3LastCast = _TimeGetStamp()
		sleep(200)
		validateAttack()
		if(GuiCtrlRead($attack3_da) == 1 And CheckEnemyDead() <> 0) Then

			Send($attack3)
			sleep($attack3c/4)

			if CheckEnemyDead() <> 0 then
				Send($attack3)
				sleep($attack3c/4)
			EndIf
					if CheckEnemyDead() <> 0 then
					Send($attack3)
					sleep($attack3c/4)
					EndIf

						if CheckEnemyDead() <> 0 then
						Send($attack3)
						sleep($attack3c/4)
						EndIf

					if CheckEnemyDead() <> 0 then
					Send($attack3)
					sleep($attack3c/4)
				EndIf
		EndIf
	EndIf
EndFunc

Func F_arttack5()
	F_EmCast()
	if(($attack5LastCast + $attack5Cd) < _TimeGetStamp() and CheckEnemyDead() <> 0) Then
		_toolTip("start attack Nr4")
		Send($attack5)
		Sleep($attack5c)
		$attack5LastCast = _TimeGetStamp()
		sleep(200)
		validateAttack()
		if(GuiCtrlRead($attack5_da) == 1 And CheckEnemyDead() <> 0) Then

			Send($attack5)
			sleep($attack5c/4)

			if CheckEnemyDead() <> 0 then
				Send($attack5)
				sleep($attack5c/4)
			EndIf
					if CheckEnemyDead() <> 0 then
					Send($attack5)
					sleep($attack5c/4)
					EndIf

						if CheckEnemyDead() <> 0 then
						Send($attack5)
						sleep($attack5c/4)
						EndIf

					if CheckEnemyDead() <> 0 then
					Send($attack5)
					sleep($attack5c/4)
				EndIf
		EndIf
	EndIf
EndFunc

Func F_arttack6()
	F_EmCast()
	if(($attack6LastCast + $attack6Cd) < _TimeGetStamp() and CheckEnemyDead() <> 0) Then
		_toolTip("start attack Nr5")
		Send($attack6)
		Sleep($attack6c)
		$attack6LastCast = _TimeGetStamp()
		sleep(200)
		validateAttack()
		if(GuiCtrlRead($attack6_da) == 1 And CheckEnemyDead() <> 0) Then

			Send($attack6)
			sleep($attack6c/4)

			if CheckEnemyDead() <> 0 then
				Send($attack6)
				sleep($attack6c/4)
			EndIf
					if CheckEnemyDead() <> 0 then
					Send($attack6)
					sleep($attack6c/4)
					EndIf

						if CheckEnemyDead() <> 0 then
						Send($attack6)
						sleep($attack6c/4)
						EndIf

					if CheckEnemyDead() <> 0 then
					Send($attack6)
					sleep($attack6c/4)
				EndIf
		EndIf
	EndIf
EndFunc

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;_

Func F_arttack9()
	F_EmCast()
	if(($attack9LastCast + $attack9Cd) < _TimeGetStamp() and CheckEnemyDead() <> 0) Then
		_toolTip("start attack Nr6")
		Send($attack9)
		Sleep($attack9c)
		$attack9LastCast = _TimeGetStamp()
		sleep(200)
		validateAttack()
		if(GuiCtrlRead($attack7_da) == 1 And CheckEnemyDead() <> 0) Then

			Send($attack9)
			sleep($attack9c/4)

			if CheckEnemyDead() <> 0 then
				Send($attack9)
				sleep($attack9c/4)
			EndIf
					if CheckEnemyDead() <> 0 then
					Send($attack9)
					sleep($attack9c/4)
					EndIf

						if CheckEnemyDead() <> 0 then
						Send($attack9)
						sleep($attack9c/4)
						EndIf

					if CheckEnemyDead() <> 0 then
					Send($attack9)
					sleep($attack9c/4)
				EndIf
		EndIf
	EndIf
EndFunc

Func F_arttack10()
	F_EmCast()
	if(($attack10LastCast + $attack10Cd) < _TimeGetStamp() and CheckEnemyDead() <> 0) Then
		_toolTip("start attack Nr7")
		Send($attack10)
		Sleep($attack10c)
		$attack10LastCast = _TimeGetStamp()
		sleep(200)
		validateAttack()
		if(GuiCtrlRead($attack8_da) == 1 And CheckEnemyDead() <> 0) Then

			Send($attack10)
			sleep($attack10c/4)

			if CheckEnemyDead() <> 0 then
				Send($attack10)
				sleep($attack10c/4)
			EndIf
					if CheckEnemyDead() <> 0 then
					Send($attack10)
					sleep($attack10c/4)
					EndIf

						if CheckEnemyDead() <> 0 then
						Send($attack10)
						sleep($attack10c/4)
						EndIf

					if CheckEnemyDead() <> 0 then
					Send($attack10)
					sleep($attack10c/4)
				EndIf
		EndIf
	EndIf
EndFunc

Func F_arttack11()
	F_EmCast()
	if(($attack11LastCast + $attack11Cd) < _TimeGetStamp() and CheckEnemyDead() <> 0) Then
		_toolTip("start attack Nr8")
		Send($attack11)
		Sleep($attack11c)
		$attack11LastCast = _TimeGetStamp()
		sleep(200)
		validateAttack()
		if(GuiCtrlRead($attack9_da) == 1 And CheckEnemyDead() <> 0) Then

			Send($attack11)
			sleep($attack11c/4)

			if CheckEnemyDead() <> 0 then
				Send($attack11)
				sleep($attack11c/4)
			EndIf
					if CheckEnemyDead() <> 0 then
					Send($attack11)
					sleep($attack11c/4)
					EndIf

						if CheckEnemyDead() <> 0 then
						Send($attack11)
						sleep($attack11c/4)
						EndIf

					if CheckEnemyDead() <> 0 then
					Send($attack11)
					sleep($attack11c/4)
				EndIf
		EndIf
	EndIf
EndFunc

Func F_arttack12()
	F_EmCast()
	if(($attack12LastCast + $attack12Cd) < _TimeGetStamp() and CheckEnemyDead() <> 0) Then
		_toolTip("start attack Nr9")
		Send($attack12)
		Sleep($attack12c)
		$attack12LastCast = _TimeGetStamp()
		sleep(200)
		validateAttack()
		if(GuiCtrlRead($attack10_da) == 1 And CheckEnemyDead() <> 0) Then

			Send($attack12)
			sleep($attack12c/4)

			if CheckEnemyDead() <> 0 then
				Send($attack12)
				sleep($attack12c/4)
			EndIf
					if CheckEnemyDead() <> 0 then
					Send($attack12)
					sleep($attack12c/4)
					EndIf

						if CheckEnemyDead() <> 0 then
						Send($attack12)
						sleep($attack12c/4)
						EndIf

					if CheckEnemyDead() <> 0 then
					Send($attack12)
					sleep($attack12c/4)
				EndIf
		EndIf
	EndIf
EndFunc

Func F_arttack13()
	F_EmCast()
	if(($attack13LastCast + $attack13Cd) < _TimeGetStamp() and CheckEnemyDead() <> 0) Then
		_toolTip("start attack Nr10")
		Send($attack13)
		Sleep($attack13c)
		$attack13LastCast = _TimeGetStamp()
		sleep(200)
		validateAttack()
		if(GuiCtrlRead($attack11_da) == 1 And CheckEnemyDead() <> 0) Then

			Send($attack13)
			sleep($attack13c/4)

			if CheckEnemyDead() <> 0 then
				Send($attack13)
				sleep($attack13c/4)
			EndIf
					if CheckEnemyDead() <> 0 then
					Send($attack13)
					sleep($attack13c/4)
					EndIf

						if CheckEnemyDead() <> 0 then
						Send($attack13)
						sleep($attack13c/4)
						EndIf

					if CheckEnemyDead() <> 0 then
					Send($attack13)
					sleep($attack13c/4)
				EndIf
		EndIf
	EndIf
EndFunc

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

Func F_buff()
	if(($attack4LastCast + $attack4Cd) < _TimeGetStamp()) Then
		_toolTip("starting PreCast")
		Send($attack4)
		Sleep($attack4c)
		$attack4LastCast = _TimeGetStamp()
		if(GuiCtrlRead($attack4_da) == 1) Then

			Send($attack4)
			sleep($attack4c/4)

			if CheckEnemyDead() <> 0 then
				Send($attack4)
				sleep($attack4c/4)
			EndIf
					if CheckEnemyDead() <> 0 then
					Send($attack4)
					sleep($attack4c/4)
					EndIf

						if CheckEnemyDead() <> 0 then
						Send($attack4)
						sleep($attack4c/4)
						EndIf

					if CheckEnemyDead() <> 0 then
					Send($attack4)
					sleep($attack4c/4)
				EndIf
		EndIf
;~ 		send($atck)
;~ 		send($attackgk)
	EndIf

EndFunc

Func playerCurrectMpPercent()

                $val2 = MemReadDLL("8EEEC0")

                $Pval2 = ($val2 * 100) / PlayerMaxMana()

                return Round($Pval2)

EndFunc

Func F_PostAttack()
;~ 		if playerCurrectHpPercent() > 90 Or playerCurrectMpPercent() > 90 then
;~ 		if playerCurrectHpPercent()  > 90 then


		if(($attack7LastCast + $attack7Cd) < _TimeGetStamp()) Then
		if playerCurrectHpPercent() < 90 then   ;;;;;;;;;;;;;;;;; Or playerCurrectMpPercent() < 90 then
		_toolTip("PostCast HP/MP below 90%")
		Send($attack7)
		Sleep($attack7c)

		$attack7LastCast = _TimeGetStamp()
;~ 		sleep(500)
		EndIf
		EndIf
EndFunc

Func F_EmCast()
	if ($attack8 <> "x") then
		if(($attack8LastCast + $attack8Cd) < _TimeGetStamp() and playerCurrectHpPercent() <= $attack8hp) Then
			_toolTip("starting Emergency Cast")
			Send($attack8)
			Sleep($attack8c)
			$attack8LastCast = _TimeGetStamp()
		EndIf
	EndIf
EndFunc


;#################################################
;waypoint functions
;#################################################

Func _keyboardToWpInterface()
	OpenAionMemory()
	addWP()
EndFunc

Func addWP()

	$playerX = PlayerXPos()
	$playerY = PlayerYPos()
	$playerZ = PlayerZPos()

	$WPFile = "wp"

	$openFile = GuiCtrlRead($wpSaveInput)
	$wpSave = FileOpen($openFile, 1)

	FileWriteLine($wpSave ,Round($playerX,2))
	FileWriteLine($wpSave ,Round($playerY,2))
	FileWriteLine($wpSave ,Round($playerZ,2))
	FileClose($wpSave)
	_toolTip("WayPoint: "&Round($playerX,0)&" - "&Round($playerY,0)&" - "&Round($playerZ,0)&" added")
EndFunc

Func readWP()
	$countMax=0
	$count = 1
	$openFile = GuiCtrlRead($wpFileInput)
	$readWPfile = FileOpen($openFile, 0)

	While 1
		$x1 = FileReadLine($readWPfile,$count)

		if $x1 = "" Then
			$count = 1
			ExitLoop
		EndIf

		If @error = -1 Then	ExitLoop
		$count = $count +1
		$countMax = $countMax +1
		$x2 = FileReadLine($readWPfile,$count)
		$count = $count +1
		$countMax = $countMax +1
		$x3 = FileReadLine($readWPfile,$count)
		$count = $count +1
		$countMax = $countMax +1


	Wend
	FileClose($readWPfile)


	$openFile = GuiCtrlRead($wpFileInput)
	$readWPfile = FileOpen($openFile, 0)

	While 1

		$x1 = FileReadLine($readWPfile,$count)

		if $x1 = "" Then

			$count = 1
			ExitLoop
		EndIf

		If @error = -1 Then	ExitLoop

		$wpField[$count-1] = $x1

		$count = $count +1

		$x2 = FileReadLine($readWPfile,$count)
		$wpField[$count-1] = $x2

		$count = $count +1

		$x3 = FileReadLine($readWPfile,$count)
		$wpField[$count-1] = $x3

		$count = $count +1




	Wend
	_toolTip("Waypoints loaded ... "&$countMax/3&" found" )
	FileClose($readWPfile)

EndFunc

Func getCredits()
	return @LF&"developed by: Plany, Unknown "&@LF &"Logo by: Blun0r" &@LF & "Edited by Chefes78"
EndFunc

Func calcTime($nep)
	$ntime = _TimeGetStamp() - $timeDiff
	$tmpMep = PlayerMaxEP()
	$tmpCep = playerCurrectEP()
	$timeToLevelUp =(($tmpMep - $tmpCep) / $nep ) * $ntime
	$newTime = Round(($timeToLevelUp/60)/60,2)
	if($lastTime <> 0) Then
		if($newTime > $lastTime) Then
			$difftime = $newTime - $lastTime
			$avgTime = $difftime + $lastTime
		Elseif($lastTime > $newTime) Then
			$difftime = $lastTime - $newTime
			$avgTime = $difftime + $newTime
		EndIf
		$lastTime = $newTime
	Else
		$lastTime = $newTime
		$avgTime = $newTime;
	EndIf
	GUICtrlSetData($TimeCount, timeToHuman($avgTime))
EndFunc

;#################################################
;navigate functions
;#################################################


Func calcDist($xa,$ya)
	$distCalc = sqrt( ($xa-PlayerXPos())^2 + ($ya-PlayerYPos())^2 )
	if($distCalc > 15) Then
		_jumpPlayer()
	EndIf
	return $distCalc
EndFunc

Func _getRandomJumpTimer()
	return _TimeGetStamp() + Random(0,6,1)
EndFunc

Func _jumpPlayer()
	if($jumper < _TimeGetStamp()) Then
		if( $jumper <> 0) Then
			Send("{SPACE down}")
			Sleep(80)
			Send("{SPACE up}")
		EndIf
		$jumper = _getRandomJumpTimer()
	EndIf
EndFunc

Func _switchRotate($target, $now)
	if($target < $now) Then
		If(($now - $target) > 180) Then
			$rot_down = "a down"
			$rot_up = "a up"
		Else
			$rot_down = "d down"
			$rot_up = "d up"
		EndIf
	Else
		If(($target - $now) > 180) Then
			$rot_down = "d down"
			$rot_up = "d up"
		Else
			$rot_down = "a down"
			$rot_up = "a up"
		EndIf
	EndIf
EndFunc

; rechnet 90 zu 360 hoch
Func getAngle($diffX, $diffY)
	$angle = ATan($diffY/$diffX)
	$angle = ($angle * 180.0 )/ $pi
	if $diffX > 0 and $diffY > 0 Then
		return getThreeSixty((180 -$angle),true)
	ElseIf $diffX > 0 and $diffY < 0 Then
		return getThreeSixty((-180 -$angle),true)
	ElseIf $diffX < 0 and $diffY < 0 Then
		return getThreeSixty((0 -$angle),true)
	ElseIf $diffX < 0 and $diffY > 0 Then
		return getThreeSixty((0 -$angle),true)
	EndIf
EndFunc

; Flag = true  - rechne 180 auf 360 hoch
;Flag = false - calc 360er rotate!
Func getThreeSixty($angle, $flag = false)
	If($flag) Then
		If($angle < 0) Then
			$angle = (360 - ($angle * -1))
		EndIf
	Else
		If($angle > 360)Then
			$angle = $angle - 360
		ElseIf($angle < 0)Then
			$angle = $angle + 360
		EndIf
	EndIf
	Return $angle
EndFunc

Func alignRotaion($x, $y, $move = false)
	$playerXcoord = PlayerXPos()
	$playerYcoord = PlayerYPos()
		;$playerZcoord = PlayerZPos()
	$diffY = Round($y - $playerYcoord,2)
	$diffX = Round($x - $playerXcoord,2)
	$angle = getAngle($diffX, $diffY)
	$nowAng = getThreeSixty(GetPlayerPos(), true)
	_switchRotate($angle, $nowAng)
	While ($angle + 5) < $nowAng OR ($angle - 5) > $nowAng
		if $move Then
			Send("{w down}")
		EndIf
		Send("{"&$rot_down&"}")
		$nowAng = getThreeSixty(GetPlayerPos(), true)
	WEnd
	if $move Then
		if(($angle + 5) < $nowAng AND ($angle - 5) > $nowAng) Then
			Send("{w up}")
		EndIf
	EndIf
	Send("{"&$rot_up&"}")
EndFunc

func lookaround()

WinActivate("AION Client")

;~ $looks = 0

while 1

Send("{TAB}")
sleep(20)
$mob1 = GetDistance()
sleep(20)
	if ( CheckEnemyDead() > 99 ) then
		if ( enemyInsgid() )then
			if ( checkBlackList() ) Then
				if (  GetDistance() <= $attackgdm  ) then
					Return True
					ExitLoop
				EndIf
			EndIf
		EndIf


;~ 	Else
;~ 		_toolTip("Bad mob.. Checking rear view")
;~ 		$looks = $looks +1
	EndIf

;~ 	If $Run = False Then
;~ 		Send("{w up}")
;~ 		Send("{s up}")
;~ 		Send("{a up}")
;~ 		Send("{d up}")
;~ 		ExitLoop
;~ 	EndIf

;~ 	if $looks >= 5 Then
;~ 		return False
;~ 		ExitLoop
;~ 	EndIf


;~ Until $looks = 2
_toolTip("Checking rear view")
;~ sleep(1500)
MouseMove( 200, 400 )
MouseClick("middle" , 200 , 400)
sleep(300)
MouseMove( 200, 400 )
;~ $looks = 0

;~ Do

Send("{TAB}")
sleep(20)
$mob2 = GetDistance()
sleep(20)
	if ( CheckEnemyDead() > 99 ) then
		if ( enemyInsgid() )then
			if ( checkBlackList() ) Then
				if (  GetDistance() <= $attackgdm +2 ) then
					Return True
					ExitLoop
				EndIf
			EndIf
		EndIf


;~ 	Else
;~ 		_toolTip("..back to front view")
;~ 		$looks = $looks +1
;~ 		ExitLoop

	EndIf

;~ 	If $Run = False Then
;~ 		Send("{w up}")
;~ 		Send("{s up}")
;~ 		Send("{a up}")
;~ 		Send("{d up}")
;~ 		ExitLoop
;~ 	EndIf

;~ 	if $looks >= 5 Then
;~ 		return False
;~ 		ExitLoop
;~ 	EndIf


;~ Until $looks = 2
;~ WEnd


_toolTip("back to front view")
;~ sleep(300)
MouseMove( 200, 400 )
MouseClick("middle" , 200 , 400)
sleep(300)
	if ( $mob1 < $mob2 ) then
		send("{TAB}")
	EndIf

	if ( CheckEnemyDead() = 0 ) then
		Return False
		ExitLoop
	Else
;~ 		KillEnemy()
		Return False
		ExitLoop
	EndIf
WEnd

EndFunc

Func Tabb()


EndFunc



Func walkPoints()

	while $i < ($countMax-1)
		checkShutDown()
		WinActivate("AION Client")
		WinWaitActive("AION Client")
		_toolTip("Move to waypoint "&($i/3)+1)
		$xCoord=$wpField[$i]
		$yCoord=$wpField[$i+1]
		$zCoord=$wpField[$i+2]
		$i=$i+3

		$Distance = calcDist($xCoord,$yCoord)
		while $Distance > 3
			alignRotaion($xCoord, $yCoord, true)
			_toolTip("Tabing")
;~ 			while ( GetDistance() >
;~ 				sleep(10)
			Send("{Tab}")
			sleep(10)
;~ 			$wdist = GetDistance()
;~ 			sleep(20)
;~ 			WEnd
;~ 			if CheckEnemyDead() > 0 Then
;~ 			Send("{w up}")
;~ 			sleep(80)
;~ 			send($attackgk)
			if(enemyInsgid() and checkBlackList() and ($attackgdm +3  >= GetDistance()) ) Then
						_toolTip("Good mob")
;~ 						Send("{w up}")
;~ 							sleep(10)
;~ 							send("{s down}")
;~ 							sleep(30)
;~ 							send("{s up}")

						send($attackgk)
				if(GuiCtrlRead($attack1mm_da) == 1    ) then  									;;;;;;;  MAX hacken ticked
					$dist = GetDistance()
;~ 					sleep(20)
					if ( $dist > $attackgdm ) then
;~ 						sleep(30)
						_toolTip("lock on")
;~ 						Send($attackgk)
;~ 						sleep(10)
;~ 						send($atck)
;~ 						sleep(10)
						Send($attackgk)
						$timer = _TimeGetStamp() + 10
							Do
								sleep(10)
							until GetDistance() < $attackgdm -1 or $timer <  _TimeGetStamp()
							Send("{w up}")
							sleep(30)
							send("{s down}")
							sleep(30)
							send("{s up}")
							KillEnemy()
							if ( lookaround() = True) Then
								KillEnemy()
							Else
							walkPoints()
							EndIf
					Else
							send("{w up}")
							send("{s down}")
							sleep(30)
							send("{s up}")
							KillEnemy()
								if ( lookaround() = True) Then
								KillEnemy()
								Else
								walkPoints()
								EndIf





					EndIf

				Else

					$dist = GetDistance()
					if ( $dist > $attackgd ) then
						Send("{w up}")
						Sleep(20)
							send("{s down}")
							sleep(30)
							send("{s up}")



						_toolTip("lock on")
						send($attackgk)
						sleep(30)
						send($atck)
						sleep(30)
						Send($attackgk)
						$timer = _TimeGetStamp() + 10
							Do
								sleep(10)
							until GetDistance() < $attackgd -1 or $timer <  _TimeGetStamp()
							Send("{w up}")
							send("{s down}")
							sleep(20)
							send("{s up}")
							KillEnemy()
					Else
						send("{w up}")
						send("{s down}")
						sleep(20)
						send("{s up}")
						KillEnemy()
					EndIf
				EndIf

				_toolTip("Move to waypoint "&($i/3)+1)
			EndIf



			$Distance = calcDist($xCoord,$yCoord)
			alignRotaion($xCoord, $yCoord, true)
			Send("{w down}")
			sleep(80)
;~ 			Send("{TAB}")									;newww
;~ 			sleep(50)										;newww
;~ 			send($attackgk)										;newww

			If $Run = False Then
				Send("{w up}")
							sleep(20)
							send("{s down}")
							sleep(20)
							send("{s up}")
				ExitLoop
			EndIf
		WEnd

		If $Run = False Then
			Send("{w up}")
							sleep(20)
							send("{s down}")
							sleep(20)
							send("{s up}")
			ExitLoop
		EndIf
		$jumper = _getRandomJumpTimer()
	WEnd
	$i=0
EndFunc

;#################################################
; unix Timestamp / useable Function
;#################################################

Func timeToHuman($time)
	$st = Round($time,0)
	$mi = (Round($time,2) - $st)* 100
	if($mi < 0) Then
		$mi = $mi * -1
	EndIf
	return $st&"H "&Round($mi)&"M"
EndFunc

Func SecToTime($sec)
	$min = $sec / 60
	$hour = $min / 60
	if(Round($min) >= 60)Then
		return Round($hour)&" H"
	ElseIf($sec >= 60) Then
		return Round($min)&" M"
	Else
		return Round($sec)&" S"
	EndIf
EndFunc

Func _TimeGetStamp()
	Local $av_Time
	$av_Time = DllCall('CrtDll.dll', 'long:cdecl', 'time', 'ptr', 0)
	If @error Then
		SetError(99)
		Return False
	EndIf
	Return $av_Time[0]
EndFunc


Func _DecimalToHex($hx_dec, $hx_length = 6)

    If IsInt($hx_dec) = 0 Then
        SetError(1)
        MsgBox(0,"Error","Wrong input, try again ...")
        Return ""
    EndIf
    Local $ret = "", $Ii, $hx_tmp, $hx_max
    If $hx_dec < 4294967296 Then
        If $hx_length < 9 Then Return Hex($hx_dec, $hx_length)
        If $hx_length = 21 Then
            $ret = Hex($hx_dec)
            While StringLeft($ret, 1) = "0"
                $ret = StringMid($ret, 2)
            WEnd
            Return $ret
        EndIf
    EndIf
    For $Ii = $hx_length - 1 To 0 Step -1
        $hx_max = 16 ^ $Ii - 1
        If $ret = "" And $hx_length = 21 And $hx_max > $hx_dec Then ContinueLoop
        $hx_tmp = Int($hx_dec/($hx_max+1))
        If $ret = "" And $hx_length = 21 And $Ii > 0 And $hx_tmp = 0 Then ContinueLoop
        ;$ret &= StringMid($HX_REF, $hx_tmp+1, 1)
        $hx_dec -= $hx_tmp * ($hx_max + 1)
    Next
    $ret=String($ret)
    If $hx_length < 21 And StringLen($ret) < $hx_length Then SetError(1)
    Return $ret
EndFunc  ;==>_DecToHex()



;#############################################################################################################################################################
;gui loop                                                                                                                                           gui loop #
;#############################################################################################################################################################


While 1
	$msg = GUIGetMsg()
	Switch $msg
		Case $GUI_EVENT_CLOSE
			Exit
		Case $buttonSave
			saveKeys()
		Case $buttonAddWayPoint
			OpenAionMemory()
			addWP()
		Case $buttonOpenWayPoint
			readWP()
		Case $buttonRun
			GUICtrlSetData ($buttonRun,"Bot running")
			setShutDownTimer()
			OpenAionMemory()
			ReadMemValues()
			$Run = True
			while $Run = True
				checkShutDown()
				if ( lookaround() = True) Then
					KillEnemy()
				Else
					walkPoints()
				EndIf
			WEnd
	EndSwitch
WEnd

;0 4 8 C hex 4bit jumps
	;For $i = 9361000 To 9369000
	;	GUICtrlSetData($status,"SCAN VAR "&$i)
	;	$var = MemReadDLL(_DecimalToHex($i))
	;	if( Round($var,2) > 1000 And Round($var,2) < 6900000) Then
	;		FileWriteLine("mem.txt",_DecimalToHex($i)&" = "&Round($var,2))
	;	EndIf
	;Next

#cs

THE FUTURE!

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
$gui = GUICreate("tabs for page options", 500, 400)
$tab = GUICtrlCreateTab(-10, -22, 520, 430)
$tabpage1 = GUICtrlCreateTabItem("page1")
$tab1Btn1 = GUICtrlCreateButton("go to page 2", 60, 60, 100, 30)
$tab1Btn2 = GUICtrlCreateButton("go to page 3", 60, 120, 100, 30)
GUICtrlCreateLabel("This is page 1", 100, 200)
$tabpage2 = GUICtrlCreateTabItem("page2")
$tab2Btn1 = GUICtrlCreateButton("go to page 1", 60, 60, 100, 30)
$tab2Btn2 = GUICtrlCreateButton("go to page 4", 60, 120, 100, 30)
GUICtrlCreateLabel("This is page 2", 100, 220)
$tabpage3 = GUICtrlCreateTabItem("page3")
$tab3Btn1 = GUICtrlCreateButton("go to page 2", 60, 60, 100, 30)
$tab3Btn2 = GUICtrlCreateButton("go to page 4", 60, 120, 100, 30)
GUICtrlCreateLabel("This is page 3", 100, 240)
$tabpage4 = GUICtrlCreateTabItem("page4")
$tab4Btn1 = GUICtrlCreateButton("go to page 1", 60, 60, 100, 30)
$tab4Btn2 = GUICtrlCreateButton("go to page 3", 60, 120, 100, 30)
GUICtrlCreateLabel("This is page 4", 100, 260)
GUICtrlCreateTabItem("")
GUICtrlSetState($tabpage1, $GUI_SHOW)
GUISetState()

While 1
    $Msg = GUIGetMsg()
    Switch $Msg
        Case - 3
            Exit
        Case $tab1Btn1
            GUICtrlSetState($tabpage2, $GUI_SHOW)
        Case $tab1Btn2
            GUICtrlSetState($tabpage3, $GUI_SHOW)
        Case $tab2Btn1
            GUICtrlSetState($tabpage1, $GUI_SHOW)
        Case $tab2Btn2
            GUICtrlSetState($tabpage4, $GUI_SHOW)
        Case $tab3Btn1
            GUICtrlSetState($tabpage2, $GUI_SHOW)
        Case $tab3Btn2
            GUICtrlSetState($tabpage4, $GUI_SHOW)
        Case $tab4Btn1
            GUICtrlSetState($tabpage1, $GUI_SHOW)
        Case $tab4Btn2
            GUICtrlSetState($tabpage3, $GUI_SHOW)

    EndSwitch

WEnd


#ce
chefes78 is offline  
Old   #837
 
elite*gold: 0
Join Date: Apr 2008
Posts: 23
Received Thanks: 1
Which is the official version now ? What is this MinMax thing ?
taquito86 is offline  
Old   #838
 
elite*gold: 0
Join Date: Oct 2009
Posts: 3
Received Thanks: 0
So the co-ordinates not working after 1.5.1 patch means that a new version of Chef's will be out eventually?
Dynaku is offline  
Old   #839
 
elite*gold: 0
Join Date: Oct 2009
Posts: 4
Received Thanks: 2
Hab die PlayerAdr gefunden, vielleicht kann mal jemand nach den MobAdr suchen

Player- und Mobadressen hab ich, fehlen noch PlayerPosAdressen, jemand was gefunden?
Fritz205 is offline  
Old   #840
 
elite*gold: 0
Join Date: Oct 2009
Posts: 13
Received Thanks: 5
I dont think anyone is updating this bot anymore.

plany123 is doing his own thing with the AutoAion (not open source).
You need to figure the read memory stuff yourself and how to mod the bot yourslef if you want it to work with the new patch. All the info is out there (i've managed to modify s bit of the bot i'm working with in about 3 hours with close to zero memory reading knowledge). Its gonna take a while but it doable trust me

Anyway, if someone is kind enough to post a modified version of the open source with the needed changes i(we) would be most graceful - still have some problems myself with distance and target x,y coords.

Thanks again for the open source and hope to get this back up asap.
Cheers, d3xyna.


d3xyna is offline  
Reply



« Previous Thread | Next Thread »



All times are GMT +2. The time now is 01:28.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.

Support | Contact Us | FAQ | Advertising | Privacy Policy
Copyright ©2017 elitepvpers All Rights Reserved.