Quote:
Originally Posted by afkguy
Well I woke up this morning and decided to hell with AHK. It's kinda nice because of how it uses hotkeys and timers, and it has less syntax to worry about. But then again less syntax rules makes it a bit more difficult to read.
I downloaded autoit and made a simple function to send the number 1 and it worked... far easier solution that some of the things I had in mind (making a packet bot which requires learning assembly language).
So now I'm in the process of rewritting my bot in AU3. I popped open the documentation and within about an hour I think I understand the main differences. I just finished testing memory management (open, read, write, finding addresses using offsets) and so far no real problems.
Tested and working great. Now it's all about converting syntax.
|
well if you download the AutoUpdater, or just grab one of the earlier versions of the EEBot I started, you'll have the .au3 files ya need. And you'll get to see how everything is written out and build from it. It makes use of the EEAutoPilot.settings file though so make sure to grab the most current version of that (the updater will do this if EEAutoPilot.settings does not exist in the same directory as the Updater. It will act as an Install feature and Install the files to the working directory). Just need to allow it access to the Internet for downloading purposes.
In the attachments you'll find the most recent Updater, that will grab the source code from the website I'm storing them at. Also here is the source code to it as well, because I know applications that download files via INET usually get a Trojan virus false-positive from at least 1 source at Virustotal.com. You can compile the Updater and then you'll get a nice example of how to build off of a file/package updating script :P Then you ge the files needed kill two birds with one stone.
The ZIP file contains the Installer-Updater tool to grab the bot's source code from the website.
The RAR file contains the .au3 file used to make the AutoUpdater as well as the website it links to where you can even download the files manually.
Also since I just noticed that you posted a script snippet, here you go mine. This is how everything functions.
First Off Everything I got reads from the EEAutoPilot.settings file. This is just a ini file with the extension changed.
Code:
[main]
exe=_Launcher.exe
app_base = 0x00C73AD8
app_base_offset = 0xC
Zoom_ADDR = 0x00C7D7F4
pname = 0x00C7BEB4
ptarget = 0x00C73AEC
ZOOM_OFFSET1 = 0x54
OFFSET_CurHP = 0x4
OFFSET_MaxHP = 0x4C
OFFSET_CurMP = 0x8
OFFSET_MaxMP = 0x50
OFFSET_TARGET = 0x08
OFFSET_EXP = 0x18
OFFSET_CEXP = 0x20
OFFSET_CLASSLVL = 0x24
OFFSET_BASELVL = 0x1C
OFFSET_PDEF = 0x64
OFFSET_PCRIT = 0x11C
OFFSET_PACC = 0x118
OFFSET_PSTR = 0x148
OFFSET_PAGI = 0x150
OFFSET_PINT = 0x14C
OFFSET_PWIS = 0x154
OFFSET_PLCK = 0x158
OFFSET_GUILDTITLE = 0x1F0
OFFSET_PNAME = 0x1B8
[settings]
version=1.2.003
bgcolor=0xc1c1c1
txt_color=0xff00ff
win_trans=45
isTrans=1
The settings section of the settings file you'll notice the keys
version,bgcolor,txt_color,win_trans and isTrans
version is for the updater to compare this version number with the version number stored in the autoupdate.dlc file from the website.
bgcolor is the key that sets all the background colors for all my controls and the GUI. This is also the color that appears transparent on the GUI's controls (labels,input boxes etc..) using a some simple API. So if the control background is this bgcolor then it'll make it transparent. Because by default if you change the background color of a control on the autoit forms they will have a box with solid color surrounding your text. This just allows the forms background color to show through.
txt_color is the key for all the text colors on the application.
win_trans is the value of transparency
and isTrans basically acts as a boolean.
Here is a slightly modified NomadMemory
Code:
#include-once
Func _EEMemOpen($DWACCESS = 0x1F0FFF, $DWINHERITHANDLE = 1)
$DWPROCID = ProcessExists(IniRead(@WorkingDir & "\EEAutoPilot.settings","main","exe",""))
If $DWPROCID = 0 then
MsgBox(0,"","Process Doesn't Exist!" & @crlf & "If however it DOES, then something is terribly wrong !")
exit 0
EndIf
local $DWHANDLES[2] = [DllOpen("kernel32.dll")]
If @error Then
SetError(2)
Return 0
EndIf
Local $DWOPENPROC = DllCall($DWHANDLES[0], "int", "OpenProcess", "int", $DWACCESS, "int", $DWINHERITHANDLE, "int", $DWPROCID)
If @error Then
SetError(3)
Return 0
EndIf
$DWHANDLES[1] = $DWOPENPROC[0]
Return $DWHANDLES
EndFunc
Func _EEMemClose($DWHANDLES)
If Not IsArray($DWHANDLES) Then
SetError(1)
Return 0
EndIf
DllCall($DWHANDLES[0], "int", "CloseHandle", "int", $DWHANDLES[1])
If Not @error Then
DllClose($DWHANDLES[0])
Return 1
Else
DllClose($DWHANDLES[0])
SetError(2)
Return 0
EndIf
EndFunc
Func _EEMemRead($DWADDRESS, $DWTYPE = "dword")
$DWHANDLES = _EEMemOpen()
If Not IsArray($DWHANDLES) Then
SetError(1)
Return 0
EndIf
Local $DWBUFFER = DllStructCreate($DWTYPE)
If @error Then
SetError(@error + 1)
Return 0
EndIf
DllCall($DWHANDLES[0], "int", "ReadProcessMemory", "int", $DWHANDLES[1], "int", $DWADDRESS, "ptr", DllStructGetPtr($DWBUFFER), "int", DllStructGetSize($DWBUFFER), "int", "")
If Not @error Then
Local $DWVALUE = DllStructGetData($DWBUFFER, 1)
_EEMemClose($DWHANDLES)
Return $DWVALUE
Else
SetError(6)
Return 0
EndIf
EndFunc
Func _EEMemWrite($DWADDRESS, $DWDATA, $DWTYPE = "dword")
$DWHANDLES = _EEMemOpen()
If Not IsArray($DWHANDLES) Then
SetError(1)
Return 0
EndIf
Local $DWBUFFER = DllStructCreate($DWTYPE)
If @error Then
SetError(@error + 1)
Return 0
Else
DllStructSetData($DWBUFFER, 1, $DWDATA)
If @error Then
SetError(6)
Return 0
EndIf
EndIf
DllCall($DWHANDLES[0], "int", "WriteProcessMemory", "int", $DWHANDLES[1], "int", $DWADDRESS, "ptr", DllStructGetPtr($DWBUFFER), "int", DllStructGetSize($DWBUFFER), "int", "")
If Not @error Then
Return 1
Else
SetError(7)
Return 0
EndIf
_EEMemClose($DWHANDLES)
EndFunc
You'll notice it also uses the EEAutoPilot.settings file to detect the process ID.
Here we have the EEData.au3 file
This is where the memory reading is done
If you're familiar with C# then you should be familiar with including files needed.
so by using #include 'EEMem.au3' at the top of the file this includes the functions from the selected au3 file in your current application. So you'll basically be able to make calls to all the memory reading functions inside the EEMem.au3. This file is really helpful while working with bot functions like your CheckHP() function
Code:
Func CheckHP()
$BASE_OFFSET = 0x0C
$HP_OFFSET = 0x04
$APP_POINTER = 0x00C73AD8
$GamePID = WinGetProcess("Eden Eternal")
$GameHandle = _MemoryOpen($GamePID)
$APP_ADDRESS = _MemoryRead($APP_Pointer, $GameHandle, "dword")
$BASE_POINTER = "0x" & hex($APP_ADDRESS + $BASE_OFFSET)
$BASE_ADDRESS = _MemoryRead($BASE_POINTER, $GameHandle, "dword")
$HP_ADDRESS = "0x" & hex($BASE_ADDRESS + $HP_OFFSET)
$PLAYER_HP = _MemoryRead($HP_ADDRESS, $GameHandle, "dword")
MsgBox(1, "Test", $Player_HP, 100)
EndFunc
It is much more simple to check the HP, and this can be used in a loop (just as yours can, but with less mess in your main bot code)
Now using the function ReadEE inside the EEData.au3 included file you can grab mutiple memory values when needed with less clutter.
Code:
func CheckHP()
$hp = Int(ReadEE("current_hp"))
$hp_pot = Int(GuiCtrlRead($Input1))
if Int($hp) < Int($hp_pot) Then
$key4 = Int(GuiCtrlRead($Combo4))
Send($key4,0)
EndIf
EndFunc
So like,
$hp = Int(ReadEE("current_hp"))
$mp = Int(ReadEE("current_mp"))
$str = Int(ReadEE("player_str"))
$def = Int(ReadEE("player_def"))
Switching between the diff types allows you to read diff values. Whether it be a integer, or a string
_EEMemRead($var, "char[16]") - Returns a String Value from the Memory
_EEMemRead($var, "dword") - Returns a Integer
_EEMemRead($var, "double") - Returns a Double value
_EEMemRead($var, "float") - Returns a Floating Point
Code:
func ReadEE($type)
switch $type
case "player_name"
$p_name = _EEMemRead($PlayerPNAME, "char[16]")
return String($p_name)
case "player_guild_title"
$p_guildt = _EEMemRead($PlayerGuildTitle, "char[16]")
return String($p_guildt)
case "player_str"
$p_str = _EEMemRead($PlayerPSTR, "dword")
return Int($p_str)
case "player_agi"
$p_agi = _EEMemRead($PlayerPAGI, "dword")
return Int($p_agi)
case "player_int"
$p_int = _EEMemRead($PlayerPINT, "dword")
return Int($p_int)
case "player_acc"
$p_acc = _EEMemRead($PlayerPACC, "float")
return Int($p_acc)
case "player_crit"
$p_crit = _EEMemRead($PlayerPCRIT, "float")
return Int($p_crit)
case "player_def"
$p_def = _EEMemRead($PlayerDEF, "dword")
return Int($p_def)
case "base_lvl"
$base_lvl = _EEMemRead($BaseLVL, "dword")
return Int($base_lvl)
case "class_lvl"
$class_lvl = _EEMemRead($ClassLVL, "dword")
return Int($class_lvl)
case "current_cexp"
$cur_cexp = _EEMemRead($CurCEXP, "dword")
return Int($cur_cexp)
case "current_exp"
$cur_exp = _EEMemRead($CurEXP, "dword")
return Int($cur_exp)
case "player_target"
$targetbaseADDR = _EEMemRead($ptarget,"dword")
$target = '0x' & Hex($targetbaseADDR + $OFFSET_TARGET)
$targeted = '0x' & Hex($target)
$target = _EEMemRead($targeted, "dword")
Return Int($target)
case "name"
$name = _EEMemRead($pname, "char[16]")
return String($name)
case "current_hp"
$cur_hp = _EEMemRead($CurHP, "dword")
return Int($cur_hp)
case "max_hp"
$max_hp = _EEMemRead($MaxHP)
return Int($max_hp)
case "current_mp"
$cur_mp = _EEMemRead($CurMP)
return Int($cur_mp)
case "max_mp"
$max_mp = _EEMemRead($MaxMP)
return Int($max_mp)
EndSwitch
EndFunc
Code:
;EEAutoPilotBot - Data Source 1.2.001
#include 'EEMem.au3'
#include <Misc.au3>
#include <StaticConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <Constants.au3>
#include <WinAPI.au3>
#Region====MISC FUNCTIONS==========================================================================
;GUICtrlCreateLabel("Label2", 5, 80, 150, 17)
func _GuiCreateLabel($caption,$left,$top,$width,$height,$fontsize,$bkcolor,$txtcolor)
$label = GuiCtrlCreateLabel($caption,$left,$top,$width,$height)
GuiCtrlSetBkColor(-1,$bkcolor)
GuiCtrlSetColor(-1,$txtcolor)
GuiCtrlSetFont(-1,$fontsize,1)
return $label
$label = ""
EndFunc
func _GuiCreateCombo($caption,$left,$top,$width,$height,$fontsize,$bkcolor,$txtcolor,$str)
$combo = GuiCtrlCreateCombo($caption,$left,$top,$width,$height)
GuiCtrlSetBkColor(-1,$bkcolor)
GuiCtrlSetColor(-1,$txtcolor)
GuiCtrlSetFont(-1,$fontsize,1)
GUICtrlSetData(-1, $str)
return $combo
$combo = ""
EndFunc
func _GuiCreateInput($caption,$left,$top,$width,$height,$fontsize,$bkcolor,$txtcolor)
$input = GuiCtrlCreateInput($caption,$left,$top,$width,$height)
GuiCtrlSetBkColor(-1,$bkcolor)
GuiCtrlSetColor(-1,$txtcolor)
GuiCtrlSetFont(-1,$fontsize,1)
return $input
$input = ""
EndFunc
func BackColor()
return IniRead(@WorkingDir & "\EEAutoPilot.settings","settings","bgcolor","")
EndFunc
func TextColor()
return IniRead(@WorkingDir & "\EEAutoPilot.settings","settings","txt_color","")
EndFunc
Func DragWindow($gui,$controls) ;allows dragging of widget and click to exit
$dll = DllOpen("user32.dll")
Local $PosDiff[2]
While 1
$MousePos = MouseGetPos ()
$WinPos = WinGetPos ($gui,"")
$PosDiff[0] = $WinPos[0] - $MousePos[0]
$PosDiff[1] = $WinPos[1] - $MousePos[1]
While _IsPressed ("01", $dll)
$MousePos = MouseGetPos ()
WinMove ($gui, "", $MousePos[0] + $PosDiff[0], $MousePos[1] + $PosDiff[1])
WinMove ($controls, "", $MousePos[0] + $PosDiff[0], $MousePos[1] + $PosDiff[1])
$WinPos = WinGetPos ("","")
WEnd
ExitLoop
WEnd
_WinAPI_RedrawWindow($gui,"","",BitOR($RDW_ERASE,$RDW_INVALIDATE,$RDW_UPDATENOW,$RDW_FRAME,$RDW_ALLCHILDREN))
_WinAPI_RedrawWindow($controls,"","",BitOR($RDW_ERASE,$RDW_INVALIDATE,$RDW_UPDATENOW))
DLLCLose($dll)
EndFunc
;===============================================================================
;
; Function Name: _API_SetLayeredWindowAttributes
; Description:: Sets Layered Window Attributes:) See MSDN for more informaion
; Parameter(s):
; $hwnd - Handle of GUI to work on
; $i_transcolor - Transparent color
; $Transparency - Set Transparancy of GUI
; $isColorRef - If True, $i_transcolor is a COLORREF-Strucure, else an RGB-Color
; Requirement(s): Layered Windows
; Return Value(s): Success: 1
; Error: 0
; @error: 1 to 3 - Error from DllCall
; @error: 4 - Function did not succeed - use
; _WinAPI_GetLastErrorMessage or _WinAPI_GetLastError to get more information
; Author(s): Prog@ndy
;
;===============================================================================
;
Func _API_SetLayeredWindowAttributes($hwnd, $i_transcolor, $Transparency, $isColorRef = False)
Local Const $AC_SRC_ALPHA = 1
Local Const $ULW_ALPHA = 2
Local Const $LWA_ALPHA = 0x2
Local Const $LWA_COLORKEY = 0x1
If Not $isColorRef Then
$i_transcolor = Hex(String($i_transcolor), 6)
$i_transcolor = Execute('0x00' & StringMid($i_transcolor, 5, 2) & StringMid($i_transcolor, 3, 2) & StringMid($i_transcolor, 1, 2))
EndIf
Local $Ret = DllCall("user32.dll", "int", "SetLayeredWindowAttributes", "hwnd", $hwnd, "long", $i_transcolor, "byte", $Transparency, "long", $LWA_COLORKEY + $LWA_ALPHA)
Select
Case @error
Return SetError(@error,0,0)
Case $ret[0] = 0
Return SetError(4,0,0)
Case Else
Return 1
EndSelect
EndFunc;==>_API_SetLayeredWindowAttributes
Func _GuiRoundCorners($h_win, $i_x1, $i_y1, $i_x3, $i_y3)
Dim $pos, $ret, $ret2
$pos = WinGetPos($h_win)
$ret = DllCall("gdi32.dll", "long", "CreateRoundRectRgn", "long", $i_x1, "long", $i_y1, "long", $pos[2], "long", $pos[3], "long", $i_x3,"long", $i_y3)
If $ret[0] Then
$ret2 = DllCall("user32.dll", "long", "SetWindowRgn", "hwnd", $h_win, "long", $ret[0], "int", 1)
If $ret2[0] Then
Return 1
Else
Return 0
EndIf
Else
Return 0
EndIf
EndFunc ;==>_GuiRoundCorners
;~ Function-'Format'-Description-------------------------------------------------------
;~ Format Function Created by Blinko
;~ Description: Format( $value )
;~ This was made to imitate Visual Basic's Format Function.
;~ Where (Example Text1 = Format( Text1, "###,###" )
;~ If Text1.text = 1000
;~ then Format(Text1, "###,###") = 1,000
;~ However AutoIt doesnt have a function for this. So i made one up.
;~
;~ Usage: Format($expression, $separator, $nSize)
;~ As the Above Example u want a string like 100000 to read as 100,000
;~ You simply say for example Format('100000' , ',' , 3)
;~ Usage Example: GuiCtrlSetData( $Label, Format(GetPlayerGold(), ',' , 3) )
;~ You may also use "," instead of ',' it does not matter :P
;~ ---------------------------------------------------------------------------------------
Func Format($expression, $separator, $nSize)
Local $split = StringSplit($expression, "")
Local $newText = ""
Local $counter = 0
If StringLen($expression) > $nSize Then
For $i = $split[0] To 1 Step -1
If $counter = $nSize Then
$newText = $split[$i] & $separator & $newText
$counter = 0
Else
$newText = $split[$i] & $newText
EndIf
$counter +=1
Next
Else
$expression = $expression
Return $expression
EndIf
Return $newText
EndFunc
#EndRegion===========================================================================================================================
#Region====EEAutoPilot.settings Info===============================================================
;~ local $app_base = 0x00C71E98
;~ local $Zoom_ADDR = 0x00C7157C
;~ local $ptarget = 0x00C71EAC
local $app_base = IniRead(@WorkingDir & "\EEAutoPilot.settings","main","app_base","")
local $app_base_offset = IniRead(@WorkingDir & "\EEAutoPilot.settings","main","app_base_offset","")
local $Zoom_ADDR = IniRead(@WorkingDir & "\EEAutoPilot.settings","main","Zoom_ADDR","")
local $pname = IniRead(@WorkingDir & "\EEAutoPilot.settings","main","pname","") ;static name
local $ptarget = IniRead(@WorkingDir & "\EEAutoPilot.settings","main","ptarget","")
local $ZOOM_OFFSET1 = IniRead(@WorkingDir & "\EEAutoPilot.settings","main","ZOOM_OFFSET1","")
local $OFFSET_CurHP = IniRead(@WorkingDir & "\EEAutoPilot.settings","main","OFFSET_CurHP","")
local $OFFSET_MaxHP = IniRead(@WorkingDir & "\EEAutoPilot.settings","main","OFFSET_MaxHP","")
local $OFFSET_CurMP = IniRead(@WorkingDir & "\EEAutoPilot.settings","main","OFFSET_CurMP","")
local $OFFSET_MaxMP = IniRead(@WorkingDir & "\EEAutoPilot.settings","main","OFFSET_MaxMP","")
local $OFFSET_TARGET = IniRead(@WorkingDir & "\EEAutoPilot.settings","main","OFFSET_TARGET","")
local $OFFSET_EXP = IniRead(@WorkingDir & "\EEAutoPilot.settings","main","OFFSET_EXP","")
local $OFFSET_CEXP = IniRead(@WorkingDir & "\EEAutoPilot.settings","main","OFFSET_CEXP","")
local $OFFSET_CLASSLVL = IniRead(@WorkingDir & "\EEAutoPilot.settings","main","OFFSET_CLASSLVL","")
local $OFFSET_BASELVL = IniRead(@WorkingDir & "\EEAutoPilot.settings","main","OFFSET_BASELVL","")
local $OFFSET_PDEF = IniRead(@WorkingDir & "\EEAutoPilot.settings","main","OFFSET_PDEF","")
local $OFFSET_PCRIT = IniRead(@WorkingDir & "\EEAutoPilot.settings","main","OFFSET_PCRIT","")
local $OFFSET_PACC = IniRead(@WorkingDir & "\EEAutoPilot.settings","main","OFFSET_PACC","")
local $OFFSET_PSTR = IniRead(@WorkingDir & "\EEAutoPilot.settings","main","OFFSET_PSTR","")
local $OFFSET_PAGI = IniRead(@WorkingDir & "\EEAutoPilot.settings","main","OFFSET_PAGI","")
local $OFFSET_PINT = IniRead(@WorkingDir & "\EEAutoPilot.settings","main","OFFSET_PINT","")
local $OFFSET_PWIS = IniRead(@WorkingDir & "\EEAutoPilot.settings","main","OFFSET_PWIS","")
local $OFFSET_PLCK = IniRead(@WorkingDir & "\EEAutoPilot.settings","main","OFFSET_PLCK","")
local $OFFSET_GUILDTITLE = IniRead(@WorkingDir & "\EEAutoPilot.settings","main","OFFSET_GUILDTITLE","")
local $OFFSET_PNAME = IniRead(@WorkingDir & "\EEAutoPilot.settings","main","OFFSET_PNAME","") ;offset for player name from app base address
#endregion============================================================================================================================
#region====BASE ADDRESS + OFFSETS==================================================================
func GetBaseAddress()
local $base = _EEMemRead($app_base)
local $ptr = '0x' & Hex($base + $app_base_offset)
local $base_address = _EEMemRead($ptr)
return $base_address
EndFunc
local $CurHP = '0x' & Hex(GetBaseAddress() + $OFFSET_CurHP)
local $MaxHP = '0x' & Hex(GetBaseAddress() + $OFFSET_MaxHP)
local $CurMP = '0x' & Hex(GetBaseAddress() + $OFFSET_CurMP)
local $MaxMP = '0x' & Hex(GetBaseAddress() + $OFFSET_MaxMP)
local $CurEXP = '0x' & Hex(GetBaseAddress() + $OFFSET_EXP)
local $CurCEXP = '0x' & Hex(GetBaseAddress() + $OFFSET_CEXP)
local $ClassLVL = '0x' & Hex(GetBaseAddress() + $OFFSET_CLASSLVL)
local $BaseLVL = '0x' & Hex(GetBaseAddress() + $OFFSET_BASELVL)
local $PlayerDEF = '0x' & Hex(GetBaseAddress() + $OFFSET_PDEF)
local $PlayerPCRIT = '0x' & Hex(GetBaseAddress() + $OFFSET_PCRIT)
local $PlayerPSTR = '0x' & Hex(GetBaseAddress() + $OFFSET_PSTR)
local $PlayerPAGI = '0x' & Hex(GetBaseAddress() + $OFFSET_PAGI)
local $PlayerPINT = '0x' & Hex(GetBaseAddress() + $OFFSET_PINT)
local $PlayerPWIS = '0x' & Hex(GetBaseAddress() + $OFFSET_PWIS)
local $PlayerPLCK = '0x' & Hex(GetBaseAddress() + $OFFSET_PLCK)
local $PlayerPACC = '0x' & Hex(GetBaseAddress() + $OFFSET_PACC)
local $PlayerGuildTitle = '0x' & Hex(GetBaseAddress() + $OFFSET_GUILDTITLE)
local $PlayerPNAME = '0x' & Hex(GetBaseAddress() + $OFFSET_PNAME)
#endregion=======================================================================================================================
#region====ReadEE/WriteEE Functions================================================================
func ReadEE($type)
switch $type
case "player_name"
$p_name = _EEMemRead($PlayerPNAME, "char[16]")
return String($p_name)
case "player_guild_title"
$p_guildt = _EEMemRead($PlayerGuildTitle, "char[16]")
return String($p_guildt)
case "player_str"
$p_str = _EEMemRead($PlayerPSTR, "dword")
return Int($p_str)
case "player_agi"
$p_agi = _EEMemRead($PlayerPAGI, "dword")
return Int($p_agi)
case "player_int"
$p_int = _EEMemRead($PlayerPINT, "dword")
return Int($p_int)
case "player_acc"
$p_acc = _EEMemRead($PlayerPACC, "float")
return Int($p_acc)
case "player_crit"
$p_crit = _EEMemRead($PlayerPCRIT, "float")
return Int($p_crit)
case "player_def"
$p_def = _EEMemRead($PlayerDEF, "dword")
return Int($p_def)
case "base_lvl"
$base_lvl = _EEMemRead($BaseLVL, "dword")
return Int($base_lvl)
case "class_lvl"
$class_lvl = _EEMemRead($ClassLVL, "dword")
return Int($class_lvl)
case "current_cexp"
$cur_cexp = _EEMemRead($CurCEXP, "dword")
return Int($cur_cexp)
case "current_exp"
$cur_exp = _EEMemRead($CurEXP, "dword")
return Int($cur_exp)
case "player_target"
$targetbaseADDR = _EEMemRead($ptarget,"dword")
$target = '0x' & Hex($targetbaseADDR + $OFFSET_TARGET)
$targeted = '0x' & Hex($target)
$target = _EEMemRead($targeted, "dword")
Return Int($target)
case "name"
$name = _EEMemRead($pname, "char[16]")
return String($name)
case "current_hp"
$cur_hp = _EEMemRead($CurHP, "dword")
return Int($cur_hp)
case "max_hp"
$max_hp = _EEMemRead($MaxHP)
return Int($max_hp)
case "current_mp"
$cur_mp = _EEMemRead($CurMP)
return Int($cur_mp)
case "max_mp"
$max_mp = _EEMemRead($MaxMP)
return Int($max_mp)
EndSwitch
EndFunc
func WriteEE($address,$offset,$value)
;"1198383360" zoom hack value
;1098383360 normal value
$1 = _EEMemRead($address, "dword")
_EEMemWrite($1 + $offset, $value, "dword")
EndFunc
#endregion=========================================================================================================================
#region====Control Functions=======================================================================
Func ZoomHack()
WriteEE($Zoom_ADDR,$ZOOM_OFFSET1,"1198383360")
EndFunc
#endregion=========================================================================================
Then we have the actual Bot File.
This uses slightly modified functions that AutoIt uses by default. Which are also inside the EEdata.au3 file.
for example, Auto It uses GuiCtrlCreateLabel, I've worked out a _GuiCreateLabel function that basically does the same, but lets me set values for like font, text color and all that at once without calling separate functions. It's a bit more code, but all this goes to helping you piece together a bot file with more options, and it's completely versitile you can use it in any application..
Like the DragWindow function. This lets you drag a window around from any control, or the gui itself without having to have a border around the GUI with the close buttons etc..
_GuiRoundCorners allows you to round the corners of your application.
But while using all this as a backbone, it's alot more simple to use these functions. So instead of making a GUI with a label and having to then set all the values you want, just make a new function.
Like, instead of using
Code:
$label = GuiCtrlCreateLabel($caption,$left,$top,$width,$height)
GuiCtrlSetBkColor(-1,$bkcolor)
GuiCtrlSetColor(-1,$txtcolor)
GuiCtrlSetFont(-1,$fontsize,1)
We use..
Code:
$lbl_name = _GuiCreateLabel("Player Name: ",5,8,165,17,8,$bgcolor,$text_color )
All from the custom function.
Code:
func _GuiCreateLabel($caption,$left,$top,$width,$height,$fontsize,$bkcolor,$txtcolor)
$label = GuiCtrlCreateLabel($caption,$left,$top,$width,$height)
GuiCtrlSetBkColor(-1,$bkcolor)
GuiCtrlSetColor(-1,$txtcolor)
GuiCtrlSetFont(-1,$fontsize,1)
return $label
$label = ""
EndFunc
EEBot_V1.2.au3
Code:
#RequireAdmin
#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_icon=..\..\Icon Entry_1.ico
#AutoIt3Wrapper_outfile=EEBot_v1.2.exe
#AutoIt3Wrapper_UseUpx=n
#AutoIt3Wrapper_Add_Constants=n
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#include 'EEData.au3'
#include <ComboConstants.au3>
#include <EditConstants.au3>
#include <GUIComboBoxEx.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
opt("GuiOnEventMode",1)
global $running,$hastarget,$stopped = 0
local $trans_back,$hide
$text_color = TextColor()
$bgcolor = BackColor()
HotKeySet("{F1}","enable_disable_trans")
HotKeySet("{F2}","hidewin")
HotKeySet("{F5}","RunMiniBot")
HotKeySet("{F6}","ZoomHack")
HotKeySet("{F7}","ShowStats")
HotKeySet("{DEL}","Close")
$win = WinGetTitle("EE Auto-Pilot")
If WinExists($win) Then
MsgBox(0,"Warning","Bot already open")
Exit
EndIf
#Region ### START Koda GUI section ### Form=
$win = WinGetPos("Eden Eternal","")
$x = $win[0]
$y = $win[1]
$w = $win[2]
$h = $win[3]
;~ $Form1 = GUICreate("EE Auto-Pilot", 233, 296, $x, $y+175,$WS_POPUP,$WS_EX_TOOLWINDOW)
$Form1 = GUICreate("EE Auto-Pilot", 233, 50, $x, $y+@desktopHeight / 2,$WS_POPUP,$WS_EX_TOOLWINDOW)
;~ $Form1 = GUICreate("EE Auto-Pilot", 233, 296, $x, $y+@desktopHeight / 2,$WS_POPUP,$WS_EX_TOOLWINDOW)
GUISetOnEvent ($GUI_EVENT_PRIMARYDOWN, "Drag" )
;~ $guicontrols=GUICreate("controls",233, 296, $x, $y+175,$WS_POPUP,$WS_EX_LAYERED,$Form1)
$guicontrols=GUICreate("controls",233, 296, 0, 0,$WS_POPUP,$WS_EX_LAYERED,$Form1)
GUISetBkColor($bgcolor)
;~ WinSetTitle("Eden Eternal","","EEBot_v1.2")
WinSetOnTop("EE Auto-Pilot","",1)
WinSetOnTop("controls","",1)
;~ WinActivate("EEBot_v1.2","")
$lbl_name = _GuiCreateLabel("Name Hidden",5,8,165,17,8,$bgcolor,$text_color )
$Label1 = _GuiCreateLabel("",5,64,150,17,8,$bgcolor,$text_color )
$Label2 = _GuiCreateLabel("",5,80,150,17,8,$bgcolor,$text_color )
$Label3 = _GuiCreateLabel("",5,96,150,17,8,$bgcolor,$text_color )
$lbl_exp = _GuiCreateLabel("",5,113,200,17,8,$bgcolor,$text_color )
$Label4 = _GuiCreateLabel("Pot HP <= ",5,154,70,17,8,$bgcolor,$text_color )
$Label5 = _GuiCreateLabel("Pot MP <= ",5,181,70,17,8,$bgcolor,$text_color )
$Label6 = _GuiCreateLabel("Skill 1:",5,208,35,17,8,$bgcolor,$text_color )
$Label7 = _GuiCreateLabel("Skill 2:",5,232,35,17,8,$bgcolor,$text_color )
$Label8 = _GuiCreateLabel("Skill 3:",5,257,35,17,8,$bgcolor,$text_color )
$lbl_classexp = _GuiCreateLabel("Class Exp:",5,129,200,17,8,$bgcolor,$text_color )
$Label9 = _GuiCreateLabel("",5,28,200,17,8,$bgcolor,$text_color )
$Label10 = _GuiCreateLabel("",5,45,290,17,8,$bgcolor,$text_color )
$Input1 = _GuiCreateInput("250",75,154,50,21,8,$bgcolor,$text_color)
$Input2 = _GuiCreateInput("250",75,181,50,21,8,$bgcolor,$text_color)
$Combo1 = _GuiCreateCombo("",48,208,49,25,7,$bgcolor,$text_color,"1|2|3|4|5|6|7|8|9|0")
$Combo2 = _GuiCreateCombo("",48,232,49,25,7,$bgcolor,$text_color,"1|2|3|4|5|6|7|8|9|0")
$Combo3 = _GuiCreateCombo("",48,256,49,25,7,$bgcolor,$text_color,"1|2|3|4|5|6|7|8|9|0")
$Combo4 = _GuiCreateCombo("",128,154,49,25,7,$bgcolor,$text_color,"1|2|3|4|5|6|7|8|9|0")
$Combo5 = _GuiCreateCombo("",128,181,49,25,7,$bgcolor,$text_color,"1|2|3|4|5|6|7|8|9|0")
GUISetBkColor(0x000000,$Form1)
_API_SetLayeredWindowAttributes($guicontrols, $bgcolor, 255)
GUISetState(@SW_SHOW, $Form1)
GUISetState(@SW_SHOW, $guicontrols)
_GuiRoundCorners($Form1,0, 0, 30, 30) ; makes the background have round corners
GUISwitch($guicontrols)
#EndRegion ### END Koda GUI section ###
func Drag()
DragWindow($Form1,$guicontrols)
EndFunc
func enable_disable_trans()
$trans = IniRead(@WorkingDir & "\EEAutoPilot.settings","settings","istrans","")
if $trans = 1 then
INIWrite(@WorkingDir & "\EEAutoPilot.settings","settings","istrans",0)
$wTrans = IniRead(@WorkingDir & "\EEAutoPilot.settings","settings","win_trans","")
WinSetTrans($Form1,"",$wTrans)
$wTrans = ""
Elseif $trans = 0 Then
INIWrite(@WorkingDir & "\EEAutoPilot.settings","settings","istrans",1)
WinSetTrans($Form1,"",0)
endif
EndFunc
func hidewin()
$hide = NOT $hide
while $hide
GUISetState(@SW_hide, $Form1)
GUISetState(@SW_hide, $guicontrols)
WEnd
GUISetState(@SW_show, $Form1)
GUISetState(@SW_show, $guicontrols)
EndFunc
func CLOSE()
WinSetOnTop("EE Auto-Pilot","",0)
WinSetOnTop("controls","",0)
WinSetTitle("EEBot_v1.2","","Eden Eternal")
exit 0
EndFunc
func UpdateInfo()
GuiCtrlSetData($Label1,Format(ReadEE("current_hp"),",",3) & " / " & Format(ReadEE("max_hp"),",",3) & " : " & Round(Int(ReadEE("current_hp")) / Int(ReadEE("max_hp")) * 100,2) & " %")
GuiCtrlSetData($Label2,Format(ReadEE("current_mp"),",",3) & " / " & Format(ReadEE("max_mp"),",",3) & " : " & Round(Int(ReadEE("current_mp")) / Int(ReadEE("max_mp")) * 100,2) & " %")
GuiCtrlSetData($lbl_exp,"Exp: " & Format(ReadEE("current_exp"),",",3))
GuiCtrlSetData($lbl_classexp,"Class Exp: " & Format(ReadEE("current_cexp"),",",3) )
GuiCtrlSetData($Label3,"Player Target: " & ReadEE("player_target"))
GuiCtrlSetData($Label9,"Player Level: " & ReadEE("base_lvl") & " " & "Player DEF: " & ReadEE("player_def") )
GuiCtrlSetData($Label10,"Class Level: " & ReadEE("class_lvl") & " " & "Player CRIT: " & ReadEE("player_crit"))
GuiCtrlSetData($lbl_name,"Player Name: " & ReadEE("player_name"))
Sleep(300)
EndFunc
func CheckHP()
$hp = Int(ReadEE("current_hp"))
$hp_pot = Int(GuiCtrlRead($Input1))
if Int($hp) < Int($hp_pot) Then
$key4 = Int(GuiCtrlRead($Combo4))
Send($key4,0)
EndIf
EndFunc
func CheckMP()
$mp = Int(ReadEE("current_mp"))
$mp_pot = Int(GuiCtrlRead($Input2))
if Int($mp) < Int($mp_pot) Then
$key5 = Int(GuiCtrlRead($Combo5))
Send($key5,0)
EndIf
EndFunc
Func CheckTarget()
$target = Int(ReadEE("player_target"))
if Int($target) == 0 Then
Send("{TAB}",0)
EndIf
Return Int(ReadEE("player_target"))
EndFunc
func ShowStats()
$msg = "Current HP: " & ReadEE("current_hp") & @crlf
$msg &= "Max HP: " & ReadEE("max_hp") & @crlf
$msg &= "Current MP: " & ReadEE("current_mp") & @crlf
$msg &= "Max MP: " & ReadEE("max_mp") & @crlf
$msg &= "STR: " & ReadEE("player_str") & @crlf
$msg &= "AGI: " & ReadEE("player_agi") & @crlf
$msg &= "INT: " & ReadEE("player_int") & @crlf
$msg &= "P-Crit: " & ReadEE("player_crit") & @crlf
$msg &= "ACC: " & ReadEE("player_acc") & @crlf
$msg &= "DEF: " & ReadEE("player_def") & @crlf
$msg &= "BASE LVL: " & ReadEE("base_lvl") & @crlf
$msg &= "CLASS LVL: " & ReadEE("class_lvl") & @crlf
$msg &= "Current Class EXP: " & ReadEE("current_cexp") & @crlf
$msg &= "Current EXP: " & ReadEE("current_exp") & @crlf
$msg &= "Current TARGET: " & ReadEE("player_target") & @crlf
$msg &= "Player Name: " & ReadEE("player_name") & @crlf
$msg &= "Guild Name: " & ReadEE("player_guild_title")
MsgBox(0,"",$msg)
EndFunc
func RunMiniBot()
$running = NOT $running
while $running
UpdateInfo()
CheckTarget()
CheckHP()
CheckMP()
$key1 = Int(GuiCtrlRead($Combo1))
Send($key1,0)
$key2 = Int(GuiCtrlRead($Combo2))
Send($key2,0)
$key3 = Int(GuiCtrlRead($Combo3))
Send($key3,0)
Wend
EndFunc
WinSetTrans($Form1,"",0)
While 1
$w = WinGetPos("Eden Eternal","")
$x1 = $w[0]
$y1 = $w[1]
$a = $w[3]
$pos = WinGetPos("EE Auto-Pilot","")
$x2 = $pos[0]
$y2 = $pos[1]
$trans_back = IniRead(@WorkingDir & "\EEAutoPilot.settings","settings","istrans","")
If $trans_back = 1 then
If $x1 <> $x2 or $y1 <> $y2 Then
WinMove("EE Auto-Pilot","",$x1,$y1+175)
WinMove("controls","",$x1,$y1 + 175)
EndIf
elseif $trans_back = 0 Then
EndIf
UpdateInfo()
Sleep(100)
WEnd
Then using different setup HotKeys I can make the guis background appear (with its transparency), or disappear. While visible is can be moved around the screen, while its hidden the visible controls are placed within the client window fullscreen or minimized this is why there are controls to the window placement and such.
One HotKeys is there to hide the gui and everything even from within the game client because once you minimize it the visible controls (text and inputs) stay visible on top of all windows,so due to this bug I can't figure out how to fix I just have the HotKey hide the whole application and then make it visible again once the user is ready to continue using the bot.
The ZoomHack() function is used from within the EEData.au3 file but it's not working atm.
There is alot to take in from this bot, so I'd recommend you download it, or use the updater to grab you the files.