Register for your free account! | Forgot your password?

Go Back   elitepvpers > General Gaming > General Gaming Discussion
You last visited: Today at 23:15

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

 

Eden Eternal Simple Bot

Closed Thread
 
Old   #436
 
elite*gold: 0
Join Date: Jan 2010
Posts: 271
Received Thanks: 80
Wow you really went into detail. Thats awesome. I already understand much of these concepts. SkyBot (for TwelveSky 2) was very advanced. The source is broken up into over a dozen files. AutoHotkey doesn't have anything like the nomadmemory functions so I had to build them myself, which was an awesome learning experience.

I mostly needed your code as reference to start pulling data from the memory. I am adjusting some of the naming for the ini load area, address/offset area and general process access to allow for changes via the ini file. This is because when I begin to move SkyBot from AHK to AU3 I will be recoding some things so it can be integrated into another RPG "on the fly", or at least reduce recoding. Essentially I want to only have to relocate addresses for exploitable areas in each game. Because they all have the same general mechanisms.

Healing, attacking, moving around, differentiation between skills/abilities, experience/leveling, pets, loot/loot quality differences, etc etc. Once SkyBot is reduced to a framework it should be relatively easy to make it work for other games.

I think for starters I am going to delay building a user interface. I may start with yours (i like your custom func) and work from there. I am more interested right now on getting my functions over to au3, because they are already built and ready to go once they know how to find the required data (x position, y position, z, camera position/angle, curhp maxhp, target status, etc etc)

Before I read your last post I put this together using a lot of your code:

Code:
Opt("TrayIconDebug", 1)
#include "include/nomadmemory.au3"
#include <Misc.au3>
#include <StaticConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <Constants.au3>
#include <WinAPI.au3>

HotKeySet("{f9}", "CheckHP")
HotKeySet("{f10}", "CloseProgram")

$Game_Exist = ProcessExists("_Launcher.exe")
If $Game_Exist = 0 then
	MsgBox(0,"","Game is not running." & @crlf & "Please launch the game first.")
	exit 0
EndIf
$Run = 1
Func CloseProgram()
	$Run = 0
EndFunc
LoadSettings()
GetAddresses()
while $Run = 1
	UpdateStatus()
	MsgBox(1,"", "hp= " & $hp)
wend

func UpdateStatus()
global	$hp= readmemory("current_hp")
EndFunc


#Region==== Load config.settings ===============================================================
Func LoadSettings()
global $Game_Win_Name = IniRead(@WorkingDir & "\config.settings","General","Game_Win_Name","")
global $APP_POINTER = IniRead(@WorkingDir & "\config.settings","Addresses","app_pointer","")
global $BASE_OFFSET = IniRead(@WorkingDir & "\config.settings","Addresses","base_offset","")
global $Zoom_ADDR = IniRead(@WorkingDir & "\config.settings","Addresses","Zoom_ADDR","")
global $pname = IniRead(@WorkingDir & "\config.settings","Addresses","pname","") ;static name
global $ptarget = IniRead(@WorkingDir & "\config.settings","Addresses","ptarget","")
global $ZOOM_OFFSET1 = IniRead(@WorkingDir & "\config.settings","Addresses","ZOOM_OFFSET1","")
global $OFFSET_CurHP = IniRead(@WorkingDir & "\config.settings","Addresses","OFFSET_CurHP","")
global $OFFSET_MaxHP = IniRead(@WorkingDir & "\config.settings","Addresses","OFFSET_MaxHP","")
global $OFFSET_CurMP = IniRead(@WorkingDir & "\config.settings","Addresses","OFFSET_CurMP","")
global $OFFSET_MaxMP = IniRead(@WorkingDir & "\config.settings","Addresses","OFFSET_MaxMP","")
global $OFFSET_TARGET = IniRead(@WorkingDir & "\config.settings","Addresses","OFFSET_TARGET","")
global $OFFSET_EXP = IniRead(@WorkingDir & "\config.settings","Addresses","OFFSET_EXP","")
global $OFFSET_CEXP = IniRead(@WorkingDir & "\config.settings","Addresses","OFFSET_CEXP","")
global $OFFSET_CLASSLVL = IniRead(@WorkingDir & "\config.settings","Addresses","OFFSET_CLASSLVL","")
global $OFFSET_BASELVL = IniRead(@WorkingDir & "\config.settings","Addresses","OFFSET_BASELVL","")
global $OFFSET_PDEF = IniRead(@WorkingDir & "\config.settings","Addresses","OFFSET_PDEF","")
global $OFFSET_PCRIT = IniRead(@WorkingDir & "\config.settings","Addresses","OFFSET_PCRIT","")
global $OFFSET_PACC = IniRead(@WorkingDir & "\config.settings","Addresses","OFFSET_PACC","")
global $OFFSET_PSTR = IniRead(@WorkingDir & "\config.settings","Addresses","OFFSET_PSTR","")
global $OFFSET_PAGI = IniRead(@WorkingDir & "\config.settings","Addresses","OFFSET_PAGI","")
global $OFFSET_PINT = IniRead(@WorkingDir & "\config.settings","Addresses","OFFSET_PINT","")
global $OFFSET_PWIS = IniRead(@WorkingDir & "\config.settings","Addresses","OFFSET_PWIS","")
global $OFFSET_PLCK = IniRead(@WorkingDir & "\config.settings","Addresses","OFFSET_PLCK","")
global $OFFSET_GUILDTITLE = IniRead(@WorkingDir & "\config.settings","Addresses","OFFSET_GUILDTITLE","")
global $OFFSET_PNAME = IniRead(@WorkingDir & "\config.settings","Addresses","OFFSET_PNAME","") 
EndFunc
#endregion============================================================================================================================
#region====BASE ADDRESS + OFFSETS==================================================================
Func GetBaseAddress()
global $GAME_PID = WinGetProcess($Game_Win_Name)
global $GAME_HANDLE = _MemoryOpen($GAME_PID)
global $APP_ADDRESS = _MemoryRead($APP_POINTER, $GAME_HANDLE, "dword")
global $BASE_POINTER = "0x" & hex($APP_ADDRESS + $BASE_OFFSET)
global $BASE_ADDRESS = _MemoryRead($BASE_POINTER, $GAME_HANDLE, "dword")
_MemoryClose($GAME_HANDLE)
return $base_address
EndFunc
func GetAddresses()
global $CurHP = '0x' & Hex(GetBaseAddress() + $OFFSET_CurHP)
global $MaxHP = '0x' & Hex(GetBaseAddress() + $OFFSET_MaxHP)
global $CurMP = '0x' & Hex(GetBaseAddress() + $OFFSET_CurMP)
global $MaxMP = '0x' & Hex(GetBaseAddress() + $OFFSET_MaxMP)
global $CurEXP = '0x' & Hex(GetBaseAddress() + $OFFSET_EXP)
global $CurCEXP = '0x' & Hex(GetBaseAddress() + $OFFSET_CEXP)
global $ClassLVL = '0x' & Hex(GetBaseAddress() + $OFFSET_CLASSLVL)
global $BaseLVL = '0x' & Hex(GetBaseAddress() + $OFFSET_BASELVL)
global $PlayerDEF = '0x' & Hex(GetBaseAddress() + $OFFSET_PDEF)
global $PlayerPCRIT = '0x' & Hex(GetBaseAddress() + $OFFSET_PCRIT)
global $PlayerPSTR = '0x' & Hex(GetBaseAddress() + $OFFSET_PSTR)
global $PlayerPAGI = '0x' & Hex(GetBaseAddress() + $OFFSET_PAGI)
global $PlayerPINT = '0x' & Hex(GetBaseAddress() + $OFFSET_PINT)
global $PlayerPWIS = '0x' & Hex(GetBaseAddress() + $OFFSET_PWIS)
global $PlayerPLCK = '0x' & Hex(GetBaseAddress() + $OFFSET_PLCK)
global $PlayerPACC = '0x' & Hex(GetBaseAddress() + $OFFSET_PACC)
global $PlayerGuildTitle = '0x' & Hex(GetBaseAddress() + $OFFSET_GUILDTITLE)
global $PlayerPNAME = '0x' & Hex(GetBaseAddress() + $OFFSET_PNAME)
EndFunc
#endregion=======================================================================================================================
#region====ReadEE/WriteEE Functions================================================================
func ReadMemory($type)
$GAME_PID = WinGetProcess($Game_Win_Name)
$GAME_HANDLE = _MemoryOpen($GAME_PID)
		switch $type

			case "player_name"
				$p_name = _MemoryRead($PlayerPNAME, $GAME_HANDLE, "char[16]")
			return String($p_name)

			case "player_guild_title"
				$p_guildt = _MemoryRead($PlayerGuildTitle, $GAME_HANDLE, "char[16]")
			return String($p_guildt)

			case "player_str"
				$p_str = _MemoryRead($PlayerPSTR, $GAME_HANDLE, "dword")
			return Int($p_str)

			case "player_agi"
				$p_agi = _MemoryRead($PlayerPAGI, $GAME_HANDLE, "dword")
			return Int($p_agi)

			case "player_int"
				$p_int = _MemoryRead($PlayerPINT, $GAME_HANDLE, "dword")
			return Int($p_int)

			case "player_acc"
				$p_acc = _MemoryRead($PlayerPACC, $GAME_HANDLE, "float")
			return Int($p_acc)

			case "player_crit"
				$p_crit = _MemoryRead($PlayerPCRIT, $GAME_HANDLE, "float")
			return Int($p_crit)

			case "player_def"
				$p_def = _MemoryRead($PlayerDEF, $GAME_HANDLE, "dword")
			return Int($p_def)

			case "base_lvl"
				$base_lvl = _MemoryRead($BaseLVL, $GAME_HANDLE, "dword")
			return Int($base_lvl)

			case "class_lvl"
				$class_lvl = _MemoryRead($ClassLVL, $GAME_HANDLE, "dword")
			return Int($class_lvl)

			case "current_cexp"
				$cur_cexp = _MemoryRead($CurCEXP, $GAME_HANDLE, "dword")
			return Int($cur_cexp)

			case "current_exp"
				$cur_exp = _MemoryRead($CurEXP, $GAME_HANDLE, "dword")
			return Int($cur_exp)

			case "player_target"
				$targetbaseADDR = _MemoryRead($ptarget, $GAME_HANDLE,"dword")
				$target =  '0x' & Hex($targetbaseADDR + $OFFSET_TARGET)
				$targeted = '0x' & Hex($target)
				$target = _MemoryRead($targeted, $GAME_HANDLE, "dword")
				Return Int($target)

			case "name"
				$name = _MemoryRead($pname, $GAME_HANDLE, "char[16]")
			return String($name)

			case "current_hp"
				$cur_hp = _MemoryRead($CurHP, $GAME_HANDLE, "dword")
				return Int($cur_hp)

			case "max_hp"
				$max_hp = _MemoryRead($MaxHP, $GAME_HANDLE, "dword")
			return Int($max_hp)

			case "current_mp"
				$cur_mp = _MemoryRead($CurMP, $GAME_HANDLE, "dword")
			return Int($cur_mp)

			case "max_mp"
				$max_mp = _MemoryRead($MaxMP, $GAME_HANDLE, "dword")
			return Int($max_mp)

		EndSwitch

EndFunc
It's prolly a bit sloppy up top cuz i was testing stuff. Works though. The settings file looks a bit different too in order to be generic in naming.

The while loop that checks $run will be the main operating loop. Still working out in my head how the flow will work considering the difference between ahk and au3.

Here is a snippet of code from my bot in AHK. This is the healing function during a revamp to make it more flexible. It is aggregating data to use later so it can find out when it should heal depending on current conditions within respect to user selection in the gui.

Code:
;;;;;;;   ---  Auto Heal HitPoints  ---  ;;;;;;;
Random_HP_Percent:
Random, Set_Heal_Percent , 50,80
return
Check_Character_Dam:
Character_HPTotal:=ReadMemory4Byte(MaxHP,"Eden Eternal")
Character_Health_Now:=ReadMemory4Byte(CurHP,"Eden Eternal")
Character_Health_Percent := (Character_Health_Now / Character_HPTotal) * 100
If (Character_Health_Percent < Set_Heal_Percent)
{ 
Character_Health_Before:=Character_Health_Now
FileAppend , MAX HP:%Character_HPTotal% - Set Heal Percent: %Set_Heal_Percent%  - Health Percent: %Character_Health_Percent% - Healed At: %Character_Health_Now% `n, Heal_Log.txt
	Gosub,Heal
}
return
Heal:
Critical
IfWinActive , Eden Eternal
{
;; Decide which slot to press
Time_Since_Heal := A_TickCount - LastHeal
	If Time_Since_Heal >= 500
	{
	if NumHeals = 0
	{
	; Action EDIT
Last_GUI_Action := A_TickCount
GuiControl,2:,OSDACTION,ACTION : Just Healed NUMBER 1
	; AE
		
	HP_Tabs_Used ++
	;Send,9
	NumHeals += 1
	LastHeal := A_TickCount
	}
	else if NumHeals >= 1
	{
	; Action EDIT
Last_GUI_Action := A_TickCount
GuiControl,2:,OSDACTION,ACTION : Just Healed NUMBER 1
	; AE
		
	HP_Tabs_Used ++
	;Send,9
	NumHeals = 0
	LastHeal := A_TickCount
	}
} ; Time since heal
}
return



afkguy is offline  
Old   #437
 
elite*gold: 0
Join Date: Aug 2005
Posts: 499
Received Thanks: 130
Quote:
Originally Posted by afkguy View Post
Before I read your last post I put this together using a lot of your code:

Code:
Opt("TrayIconDebug", 1)
#include "include/nomadmemory.au3"
#include <Misc.au3>
#include <StaticConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <Constants.au3>
#include <WinAPI.au3>

HotKeySet("{f9}", "CheckHP")
HotKeySet("{f10}", "CloseProgram")

$Game_Exist = ProcessExists("_Launcher.exe")
If $Game_Exist = 0 then
	MsgBox(0,"","Game is not running." & @crlf & "Please launch the game first.")
	exit 0
EndIf
$Run = 1
Func CloseProgram()
	$Run = 0
EndFunc
LoadSettings()
GetAddresses()
while $Run = 1
	UpdateStatus()
	MsgBox(1,"", "hp= " & $hp)
wend

func UpdateStatus()
global	$hp= readmemory("current_hp")
EndFunc


#Region==== Load config.settings ===============================================================
Func LoadSettings()
global $Game_Win_Name = IniRead(@WorkingDir & "\config.settings","General","Game_Win_Name","")
global $APP_POINTER = IniRead(@WorkingDir & "\config.settings","Addresses","app_pointer","")
global $BASE_OFFSET = IniRead(@WorkingDir & "\config.settings","Addresses","base_offset","")
global $Zoom_ADDR = IniRead(@WorkingDir & "\config.settings","Addresses","Zoom_ADDR","")
global $pname = IniRead(@WorkingDir & "\config.settings","Addresses","pname","") ;static name
global $ptarget = IniRead(@WorkingDir & "\config.settings","Addresses","ptarget","")
global $ZOOM_OFFSET1 = IniRead(@WorkingDir & "\config.settings","Addresses","ZOOM_OFFSET1","")
global $OFFSET_CurHP = IniRead(@WorkingDir & "\config.settings","Addresses","OFFSET_CurHP","")
global $OFFSET_MaxHP = IniRead(@WorkingDir & "\config.settings","Addresses","OFFSET_MaxHP","")
global $OFFSET_CurMP = IniRead(@WorkingDir & "\config.settings","Addresses","OFFSET_CurMP","")
global $OFFSET_MaxMP = IniRead(@WorkingDir & "\config.settings","Addresses","OFFSET_MaxMP","")
global $OFFSET_TARGET = IniRead(@WorkingDir & "\config.settings","Addresses","OFFSET_TARGET","")
global $OFFSET_EXP = IniRead(@WorkingDir & "\config.settings","Addresses","OFFSET_EXP","")
global $OFFSET_CEXP = IniRead(@WorkingDir & "\config.settings","Addresses","OFFSET_CEXP","")
global $OFFSET_CLASSLVL = IniRead(@WorkingDir & "\config.settings","Addresses","OFFSET_CLASSLVL","")
global $OFFSET_BASELVL = IniRead(@WorkingDir & "\config.settings","Addresses","OFFSET_BASELVL","")
global $OFFSET_PDEF = IniRead(@WorkingDir & "\config.settings","Addresses","OFFSET_PDEF","")
global $OFFSET_PCRIT = IniRead(@WorkingDir & "\config.settings","Addresses","OFFSET_PCRIT","")
global $OFFSET_PACC = IniRead(@WorkingDir & "\config.settings","Addresses","OFFSET_PACC","")
global $OFFSET_PSTR = IniRead(@WorkingDir & "\config.settings","Addresses","OFFSET_PSTR","")
global $OFFSET_PAGI = IniRead(@WorkingDir & "\config.settings","Addresses","OFFSET_PAGI","")
global $OFFSET_PINT = IniRead(@WorkingDir & "\config.settings","Addresses","OFFSET_PINT","")
global $OFFSET_PWIS = IniRead(@WorkingDir & "\config.settings","Addresses","OFFSET_PWIS","")
global $OFFSET_PLCK = IniRead(@WorkingDir & "\config.settings","Addresses","OFFSET_PLCK","")
global $OFFSET_GUILDTITLE = IniRead(@WorkingDir & "\config.settings","Addresses","OFFSET_GUILDTITLE","")
global $OFFSET_PNAME = IniRead(@WorkingDir & "\config.settings","Addresses","OFFSET_PNAME","") 
EndFunc
#endregion============================================================================================================================
#region====BASE ADDRESS + OFFSETS==================================================================
Func GetBaseAddress()
global $GAME_PID = WinGetProcess($Game_Win_Name)
global $GAME_HANDLE = _MemoryOpen($GAME_PID)
global $APP_ADDRESS = _MemoryRead($APP_POINTER, $GAME_HANDLE, "dword")
global $BASE_POINTER = "0x" & hex($APP_ADDRESS + $BASE_OFFSET)
global $BASE_ADDRESS = _MemoryRead($BASE_POINTER, $GAME_HANDLE, "dword")
_MemoryClose($GAME_HANDLE)
return $base_address
EndFunc
func GetAddresses()
global $CurHP = '0x' & Hex(GetBaseAddress() + $OFFSET_CurHP)
global $MaxHP = '0x' & Hex(GetBaseAddress() + $OFFSET_MaxHP)
global $CurMP = '0x' & Hex(GetBaseAddress() + $OFFSET_CurMP)
global $MaxMP = '0x' & Hex(GetBaseAddress() + $OFFSET_MaxMP)
global $CurEXP = '0x' & Hex(GetBaseAddress() + $OFFSET_EXP)
global $CurCEXP = '0x' & Hex(GetBaseAddress() + $OFFSET_CEXP)
global $ClassLVL = '0x' & Hex(GetBaseAddress() + $OFFSET_CLASSLVL)
global $BaseLVL = '0x' & Hex(GetBaseAddress() + $OFFSET_BASELVL)
global $PlayerDEF = '0x' & Hex(GetBaseAddress() + $OFFSET_PDEF)
global $PlayerPCRIT = '0x' & Hex(GetBaseAddress() + $OFFSET_PCRIT)
global $PlayerPSTR = '0x' & Hex(GetBaseAddress() + $OFFSET_PSTR)
global $PlayerPAGI = '0x' & Hex(GetBaseAddress() + $OFFSET_PAGI)
global $PlayerPINT = '0x' & Hex(GetBaseAddress() + $OFFSET_PINT)
global $PlayerPWIS = '0x' & Hex(GetBaseAddress() + $OFFSET_PWIS)
global $PlayerPLCK = '0x' & Hex(GetBaseAddress() + $OFFSET_PLCK)
global $PlayerPACC = '0x' & Hex(GetBaseAddress() + $OFFSET_PACC)
global $PlayerGuildTitle = '0x' & Hex(GetBaseAddress() + $OFFSET_GUILDTITLE)
global $PlayerPNAME = '0x' & Hex(GetBaseAddress() + $OFFSET_PNAME)
EndFunc
#endregion=======================================================================================================================
#region====ReadEE/WriteEE Functions================================================================
func ReadMemory($type)
$GAME_PID = WinGetProcess($Game_Win_Name)
$GAME_HANDLE = _MemoryOpen($GAME_PID)
		switch $type

			case "player_name"
				$p_name = _MemoryRead($PlayerPNAME, $GAME_HANDLE, "char[16]")
			return String($p_name)

			case "player_guild_title"
				$p_guildt = _MemoryRead($PlayerGuildTitle, $GAME_HANDLE, "char[16]")
			return String($p_guildt)

			case "player_str"
				$p_str = _MemoryRead($PlayerPSTR, $GAME_HANDLE, "dword")
			return Int($p_str)

			case "player_agi"
				$p_agi = _MemoryRead($PlayerPAGI, $GAME_HANDLE, "dword")
			return Int($p_agi)

			case "player_int"
				$p_int = _MemoryRead($PlayerPINT, $GAME_HANDLE, "dword")
			return Int($p_int)

			case "player_acc"
				$p_acc = _MemoryRead($PlayerPACC, $GAME_HANDLE, "float")
			return Int($p_acc)

			case "player_crit"
				$p_crit = _MemoryRead($PlayerPCRIT, $GAME_HANDLE, "float")
			return Int($p_crit)

			case "player_def"
				$p_def = _MemoryRead($PlayerDEF, $GAME_HANDLE, "dword")
			return Int($p_def)

			case "base_lvl"
				$base_lvl = _MemoryRead($BaseLVL, $GAME_HANDLE, "dword")
			return Int($base_lvl)

			case "class_lvl"
				$class_lvl = _MemoryRead($ClassLVL, $GAME_HANDLE, "dword")
			return Int($class_lvl)

			case "current_cexp"
				$cur_cexp = _MemoryRead($CurCEXP, $GAME_HANDLE, "dword")
			return Int($cur_cexp)

			case "current_exp"
				$cur_exp = _MemoryRead($CurEXP, $GAME_HANDLE, "dword")
			return Int($cur_exp)

			case "player_target"
				$targetbaseADDR = _MemoryRead($ptarget, $GAME_HANDLE,"dword")
				$target =  '0x' & Hex($targetbaseADDR + $OFFSET_TARGET)
				$targeted = '0x' & Hex($target)
				$target = _MemoryRead($targeted, $GAME_HANDLE, "dword")
				Return Int($target)

			case "name"
				$name = _MemoryRead($pname, $GAME_HANDLE, "char[16]")
			return String($name)

			case "current_hp"
				$cur_hp = _MemoryRead($CurHP, $GAME_HANDLE, "dword")
				return Int($cur_hp)

			case "max_hp"
				$max_hp = _MemoryRead($MaxHP, $GAME_HANDLE, "dword")
			return Int($max_hp)

			case "current_mp"
				$cur_mp = _MemoryRead($CurMP, $GAME_HANDLE, "dword")
			return Int($cur_mp)

			case "max_mp"
				$max_mp = _MemoryRead($MaxMP, $GAME_HANDLE, "dword")
			return Int($max_mp)

		EndSwitch

EndFunc
Lol that was a sloppy bit of code there. That's why I split them all up into separate include files. Just kept the actual bot clean. I noticed something earlier too. I removed alot of the code from my bot and just use a basic gui for setting the hotkeys and skills. The gui is toggled by a hotkey. The bot function was not altered however before when it would detect the target and attack it attacked until the players target = 0 then it would re-target.
However now it targets, attacks then tabs another target, and it's lightning fast so I suppose I'll have to work in some delays since the gui isn't taking up most of the applications memory.

I also add a lot of extra crap that isn't necessary like the transparent control backgrounds for the gui and such. Or the rounded corners of the gui.

I'm going to check out that AHK piece there and see if I can't rewrite it for fun.

I'm just different when I program lol. I like the code to be sharp, and fully comprehendable, however lately that has not been the case for me either. Little things you can do kinda like shortcuts you can try. for example

your peice
Code:
$Game_Exist = ProcessExists("_Launcher.exe")
If $Game_Exist = 0 then
	MsgBox(0,"","Game is not running." & @crlf & "Please launch the game first.")
	exit 0
EndIf
can be done like this as well.

Code:
If  NOT ProcessExists("_Launcher.exe") then
	MsgBox(0,"","Game is not running." & @crlf & "Please launch the game first.")
	exit 0
EndIf
No need for the extra variable $Game_Exist :P
Like changing the Window Title of the game client for windowed users.
HP/MP and experience and lvl and crap could be displayed at the top as a caption.
Or my Format function; VB6.0 uses a format function to format string like 100000 would be Format("100000","###,###) I wrote one for autoit.
That's the kind of little crap I add in extra for the love of programming.

Code:
;~ WinList() returns an array of window names currently active.
;~ $w[0][0] = Max Amount of Windows Found
;~ $w[1][0] = Window Title for the first index


$w = WinList() 
$pid = ProcessExists("_Launcher.exe")

For $i = 1 to $w[0][0]
      $wpid = WinGetProcess($w[$i][0],"")
      If $wpid = $pid then
        WinSetTitle($w[i][0],"","Eden Eternal - Player HP: " & ReadEE("player_hp"))
next
lol I'm actually surprised you found your way through all the mess I made with my bot files :P with all this extra junk.


blinko is offline  
Old   #438
 
elite*gold: 0
Join Date: Jan 2010
Posts: 271
Received Thanks: 80
heh I found my way through the mess cuz it doesnt look like a mess to me. I can read through it just fine. I would show you all the code for skybot but i dont want it to be open source. If I did though you would see the full thing in its AHK version all nice a tidy.

Keeping things tidy is super important when your working on something as big as skybot (over 2000 lines of code). I am constantly trying to minimize things.

It will take some syntax learning of AU3 before all my code it perfectly tidy. What im showing you is "effect" code, not final code.

A few things you might wanna take from the heal function I displayed are:
1. Randomize the heal spot within a range from user selection, using percent of max hp instead of literal number
2. Log healing events for further evaluation (this is what I will use to make a better healing script that adjusts as it goes, idealy the script should heal just enough to leave clearence from dying)
3. Include multiple heal slots (like potions in key 8 and 9) and alternate them so you get twice as much potential run time
4. Create a 500ms delay before healing again because in some games/systems if you do not everytime you intend to press it once it may press it multiple times. This is because of the delay from after you send the signal to the game to heal and when it actually does heal and change the value of the memory. In TS2 if this is not done the script runs so fast it will use 2 or 3 everytime it should only use 1.
5. create a spot on your interface which displays the bots current action. this is really good for debugging. Just insert gui control edits when the bot is doing something. Also, you can use these when debugging instead of using message boxes in order to keep the script running as you debug.
afkguy is offline  
Old   #439
 
elite*gold: 0
Join Date: Sep 2011
Posts: 1
Received Thanks: 0
How to use it? Anyone can help me please?


fnstw18 is offline  
Old   #440
 
elite*gold: 0
Join Date: Jan 2010
Posts: 1
Received Thanks: 0
Can i have a question plz ? Is there anyway i could turn the game screen off to do something else like watching movies , chatting or using internet web ? because everytime i tried to turn the game screen down and type to chatting box or web browser its always type 123123123123 very fast )
ducloe is offline  
Old   #441
 
elite*gold: 0
Join Date: Jun 2008
Posts: 6
Received Thanks: 0
can you help me add the auto-sit function? every time i try to add the sit function 'x' below the hp threshold it finds another target and attacks it
ramonax is offline  
Old   #442
 
elite*gold: 0
Join Date: Jan 2010
Posts: 271
Received Thanks: 80
Quote:
Originally Posted by ducloe View Post
Can i have a question plz ? Is there anyway i could turn the game screen off to do something else like watching movies , chatting or using internet web ? because everytime i tried to turn the game screen down and type to chatting box or web browser its always type 123123123123 very fast )
No this isn't currently possible. The bot can read information from the game when you game window is minimized but it cannot send information to the game.

There may be a work around using the AU3 equivilent of AHK's SendMessage() or ControlSend(). I'll play around with that a bit tommorow :P

@ramonax
I'll add that . But for educational purposes: Take a look at the main While loop. This loops forever. If you create a function, or modify an existing function to sit, you also need to create some sort of check in the targeting function to see if your sitting. You should move the key presses within the main while loop into a separate function and place the check there too. Otherwise your sitting will be interrupted by other things.

The simple way to do this is to create a $Pause variable that equals 1 when your sitting and check for that before attacking or targeting.

However, remember that when your sitting you might be attacked. So it may also be a good idea to edit the healing function so it stores your $Lasthp everytime it runs. Compare $Lasthp to $curhp before it runs, and if last is greater than current then you know you have taken damage since the last run of that function. So if that is so, you should make it set $Pause to 0. This will make it so when your sitting if you get attacked you will stand up and continue to bot as normal, hopefully targeting your attacker first...

@blinko
Thanks for the awesome reference material. I can comfortably say I know how to write in AU3 now . I spent the most of my day pulling apart peices I could use and creating a new GUI. I made a couple other functions for creating GUICtrls easier too.

I changed how and when it creates the transparency, the dragging, the moving GUI to sit inside game window, what and how to display information on the GUI, and added matching BG window with Interface window to keep them together. I also changed how and when it updates the interface controls. Removed some unneeded gui control funcs and the func that shows character status.

Loading of the settings and the layout of the settings file has changed slightly. Managing memory is mostly changed to be more framework oriented.

Just a few more tweaks and additions to the interface and then I get to the fun part! I'll start plugging in my funcs from my old bot tommorow.

There are a few things I am very interested in exploring. Like quest automation using the autoroute feature of the game. My only hangup in my mind is how I will start and proceed through the dialogs. Idealy I would like it so the bot could find quests ready to start, get the quest, move to the area, finish the quest, and return to quest giver for reward (and select reward based off user settings, like choose the warrior eqp or mage eqp or whatever). It should eventually be able to just run around doing quests until there are none, then go back to botting.

I am also going to explore using the autoroute feature to move to certain areas on the map.

Once again thanks for the reference material. Would have taken me a week to get this far without it!
afkguy is offline  
Old   #443
 
elite*gold: 0
Join Date: Aug 2005
Posts: 499
Received Thanks: 130
Quote:
Originally Posted by afkguy View Post
No this isn't currently possible. The bot can read information from the game when you game window is minimized but it cannot send information to the game.

There may be a work around using the AU3 equivilent of AHK's SendMessage() or ControlSend(). I'll play around with that a bit tommorow :P

@ramonax
I'll add that . But for educational purposes: Take a look at the main While loop. This loops forever. If you create a function, or modify an existing function to sit, you also need to create some sort of check in the targeting function to see if your sitting. You should move the key presses within the main while loop into a separate function and place the check there too. Otherwise your sitting will be interrupted by other things.

The simple way to do this is to create a $Pause variable that equals 1 when your sitting and check for that before attacking or targeting.

However, remember that when your sitting you might be attacked. So it may also be a good idea to edit the healing function so it stores your $Lasthp everytime it runs. Compare $Lasthp to $curhp before it runs, and if last is greater than current then you know you have taken damage since the last run of that function. So if that is so, you should make it set $Pause to 0. This will make it so when your sitting if you get attacked you will stand up and continue to bot as normal, hopefully targeting your attacker first...

@blinko
Thanks for the awesome reference material. I can comfortably say I know how to write in AU3 now . I spent the most of my day pulling apart peices I could use and creating a new GUI. I made a couple other functions for creating GUICtrls easier too.

I changed how and when it creates the transparency, the dragging, the moving GUI to sit inside game window, what and how to display information on the GUI, and added matching BG window with Interface window to keep them together. I also changed how and when it updates the interface controls. Removed some unneeded gui control funcs and the func that shows character status.

Loading of the settings and the layout of the settings file has changed slightly. Managing memory is mostly changed to be more framework oriented.

Just a few more tweaks and additions to the interface and then I get to the fun part! I'll start plugging in my funcs from my old bot tommorow.

There are a few things I am very interested in exploring. Like quest automation using the autoroute feature of the game. My only hangup in my mind is how I will start and proceed through the dialogs. Idealy I would like it so the bot could find quests ready to start, get the quest, move to the area, finish the quest, and return to quest giver for reward (and select reward based off user settings, like choose the warrior eqp or mage eqp or whatever). It should eventually be able to just run around doing quests until there are none, then go back to botting.

I am also going to explore using the autoroute feature to move to certain areas on the map.

Once again thanks for the reference material. Would have taken me a week to get this far without it!
no problem that's what I'm here for :P
blinko is offline  
Old   #444
 
elite*gold: 0
Join Date: Aug 2011
Posts: 1
Received Thanks: 0
I have a problem running this bot.. I can make it work on some pc's but not on the others.. A dialogue box appears saying "Process doesn't exists. It however DOES, then something is terribly wrong." I need help how to solve this problem.. Maybe some software I need to install/uninstall..
neil8francis is offline  
Old   #445
 
elite*gold: 0
Join Date: Sep 2011
Posts: 1
Received Thanks: 0
Having an issue where the bot doesn't actually kill the mob. It just uses 1 skill and/or auto-attacks then tabs to the next mob. Is this a problem w/my lvl vs. that of the target mob, or a malfunction of the bot? Thanks.
Amsalon is offline  
Old   #446
 
elite*gold: 0
Join Date: Jan 2010
Posts: 271
Received Thanks: 80
Quote:
Originally Posted by neil8francis View Post
I have a problem running this bot.. I can make it work on some pc's but not on the others.. A dialogue box appears saying "Process doesn't exists. It however DOES, then something is terribly wrong." I need help how to solve this problem.. Maybe some software I need to install/uninstall..
Please list what operating system it does work on and which ones it does not work on. Make sure to specify weather its 32 or 64 bit version if applicable.

That message box displays when the bot looks for the existance of the process named "_Launcher.exe".
Quote:
$Game_Exist = ProcessExists("_Launcher.exe")
If $Game_Exist = 0 then
MsgBox(0,"","The error message your seeing is written here")
endif
If the game is not launched before the bot you will get this error. Also this error may be because of how the bot reads the PID on 32 or 64 bit versions of windows. I have 64 bit win 7 and it works the way I have it written and the way blinko has it written. I can't imagine why it would not work on 32 bit but i suppose it may be a possibility.

@Amsalon
Flow control in this bot isn't quite perfect, but I'm sure blinko is working on it diligently.

The functions which perform things like healing and checking for target are very simple and should be written with more checks and timing in order to operate correctly. This takes experimentation on behalf of blinko.

This has nothing to do with your character.

Keep an eye out in the coming weeks for my next set of releases. SkyBot is being revived and revamped. It is currently in development for three different games. TwelveSky 2, Eden Eternal, and Scions of Fate. Information about SkyBot will be posted on these forums soon.
afkguy is offline  
Old   #447
 
elite*gold: 0
Join Date: Aug 2005
Posts: 499
Received Thanks: 130
Quote:
Originally Posted by afkguy View Post
Please list what operating system it does work on and which ones it does not work on. Make sure to specify weather its 32 or 64 bit version if applicable.

That message box displays when the bot looks for the existance of the process named "_Launcher.exe".


If the game is not launched before the bot you will get this error. Also this error may be because of how the bot reads the PID on 32 or 64 bit versions of windows. I have 64 bit win 7 and it works the way I have it written and the way blinko has it written. I can't imagine why it would not work on 32 bit but i suppose it may be a possibility.

@Amsalon
Flow control in this bot isn't quite perfect, but I'm sure blinko is working on it diligently.

The functions which perform things like healing and checking for target are very simple and should be written with more checks and timing in order to operate correctly. This takes experimentation on behalf of blinko.

This has nothing to do with your character.

Keep an eye out in the coming weeks for my next set of releases. SkyBot is being revived and revamped. It is currently in development for three different games. TwelveSky 2, Eden Eternal, and Scions of Fate. Information about SkyBot will be posted on these forums soon.
It doesn't matter if it be 32bit or 64bit, it should function the same way.
Thing is my boy only checks for the running process once, and that's while it's reading memory.

In the EEMem.au3 file under the _EEMemOpen() function you'll see $DWPROCID = ProcessExists(IniRead(@WorkingDir & "\EEAutoPilot.settings","main","exe","")) This Opens the target process located in the EEAutoPilot.settings file, then allows the memory to be read etc...then it closes the process.

The only other check it does perform is whether or not the Bot window exists, and if it does it doesn't allow multiple instances to run.

$win = WinGetTitle("EE Auto-Pilot") <--- the title of he bot window not the EE Client
If WinExists($win) Then
MsgBox(0,"Warning","Bot already open")
Exit
EndIf

So the issue may be that the EEAutoPilot.settings is not located if you're using the one from the link I posted previously. I'd check to make sure, also if you're working fro mthe source code and not a compiled exe then maybe you altered some code, and need the rest of it changed about?...

And afkguy I'd like to say that the auto-route idea you had was nice, I doubt that will be possible without some sort of packet sending but then again anything is possible. And about the whole flow of control thing...let me just say that the way he described it sounded just like what I'm getting after I removed all the Player Stat information that was visible.

The code hasn't changed however, I just removed some stuff that wasn't needed. So if $target == 0 then Send("{TAB}",0) is how it worked before then why is it targeting, attacking, then targeting ? I've watched the target value and it doesnt change unless I'm attacking a diff mob or of course standing with no target.


***EDITSS***

I'm such a noob lmao. It sounds like the targeting was an issue with the EEAutoPilot.settings. When I stripped the code down to make it smaller, without changing EEAutoPilot.settings to the new EEAP.settings file that I changed it to, however I didn't save it within the code. I just renamed my settings file lol. So I updated the source and it's working fine. So it has to be some kind of setting that you're missing either inside the settings file. Or it doesn't exist maybe? Need an update.?


ANOTHER EDIT ! - Just so everyone knows the lastest Installer-Updater I uploaded as an attachment will update everyone's current EXE file with a new one, and the latest EEautoPilot.settings file. If you already have the Installer-Updater file then just run it again.

I've removed the gui that would overlay over the client sucking up memory.
Added some settings the user can change themselves for a GUI background color and Text color.
All skills will be saved to the settings file after you've hidden the window.
So if you press F1 to show it change ur skill hotkeys then press F1 again to close it it'll save the settings you chose.
Also added delays to the skills.

New HotKeys !!
ESC - closes application
F1 - hides/shows settings box
DEL (Delete) - starts/stops bot functions

I tested this very quickly as I'm about to head to bed so I hope it works for ya guys :P
Attached Files
File Type: zip EEBot_Installer-Updater.zip (347.7 KB, 82 views)
blinko is offline  
Old   #448
 
elite*gold: 0
Join Date: Jan 2010
Posts: 271
Received Thanks: 80
nice nice...

i have been working on my bot pretty much all day today and yesterday. The interface is pretty fuggin sweet! I dont wanna give too much away before it's done, but I will say the user has a lot of control over the bot. I will also say that you can choose to use either skills or potions to heal.

If you choose to use skills the heal function operates much different from the potion method. You get to choose where your stackable instant heal is, and where your main heal is. Plus you get to decide weather or not the bot will use the main heal, and at what level.

For example if you select: Skill Healing, Heal Below 50%, Use Main Heal Below 25%... then the bot will use your stackable skill when your HP is inbetween 25% and 50%, if you HP drops below 25% it will first use you main heal (to gain larger amount of HP in a hurry) then it will proceed to stack heal.

When the bot goes to use stack heal it will attempt to stack 3 to 6 times. I say 6 even tho u can only stack 5 because of the possibility of the bots signal to the game being missed (happens roughly 1 in 10 times).

Oh also if you set the bot to heal below 50% it will actually heal randomly between 50% and 60%. Whatever you set it will randomly heal between that and +10%. This makes it look less like a bot.

I have a few more neat options put in place already but I will save those for later

@blinko
Yea I think packet sending is the only way, aside from a complex pixel/image detection method. Which I can do. Earlier versions of SkyBot for Twelve Sky 2 where based SOLEY on pixel and image detection. I even created my own pixel detection function that took up a good 100 lines, but it could identify pretty much anything on the screen using just 5 pixels. I later improved upon it and used a combination of pixel detection and image detection. Using these methods I could reload potions from the inventory to the hotbar (9 types of potions) and this is also how I filter junk out of the inventory.



EDIT:
Another option is to simply create a database of NPC locations and quest locations and teleport the character there by changing their X and Y position. Some games (very few) will DC you if you do that, if so the other option is to find the addresses for the X and Y position of your pointer on the map when its open (open map look at bottom u will see what i mean) and then set that number to desired location and send mouse down signal (might work).

EDIT AGAIN:
@blinko
you should embed the updater into the bot itself and execute it before running the main loop. I would make it check the versions before downloading though, and display a message to the user when the bot is out of date, asking if they want to download or not. If they choose not display a message saying the bot wont work without update then Exit. This way everyone will know why their shyt dont work after an update, and it forces everyone to be on the same page before coming to you for support.

I had tons of users for skybot and it became a pain in the arse to answer dozens of peoples questions with the same answer every day "why is XXXX not working?? BLAH THIS SUCKS!"... "Download the update please...." lol
afkguy is offline  
Old   #449
 
elite*gold: 0
Join Date: Aug 2005
Posts: 499
Received Thanks: 130
Quote:
Originally Posted by afkguy View Post
nice nice...

i have been working on my bot pretty much all day today and yesterday. The interface is pretty fuggin sweet! I dont wanna give too much away before it's done, but I will say the user has a lot of control over the bot. I will also say that you can choose to use either skills or potions to heal.

If you choose to use skills the heal function operates much different from the potion method. You get to choose where your stackable instant heal is, and where your main heal is. Plus you get to decide weather or not the bot will use the main heal, and at what level.

For example if you select: Skill Healing, Heal Below 50%, Use Main Heal Below 25%... then the bot will use your stackable skill when your HP is inbetween 25% and 50%, if you HP drops below 25% it will first use you main heal (to gain larger amount of HP in a hurry) then it will proceed to stack heal.

When the bot goes to use stack heal it will attempt to stack 3 to 6 times. I say 6 even tho u can only stack 5 because of the possibility of the bots signal to the game being missed (happens roughly 1 in 10 times).

Oh also if you set the bot to heal below 50% it will actually heal randomly between 50% and 60%. Whatever you set it will randomly heal between that and +10%. This makes it look less like a bot.

I have a few more neat options put in place already but I will save those for later

@blinko
Yea I think packet sending is the only way, aside from a complex pixel/image detection method. Which I can do. Earlier versions of SkyBot for Twelve Sky 2 where based SOLEY on pixel and image detection. I even created my own pixel detection function that took up a good 100 lines, but it could identify pretty much anything on the screen using just 5 pixels. I later improved upon it and used a combination of pixel detection and image detection. Using these methods I could reload potions from the inventory to the hotbar (9 types of potions) and this is also how I filter junk out of the inventory.



EDIT:
Another option is to simply create a database of NPC locations and quest locations and teleport the character there by changing their X and Y position. Some games (very few) will DC you if you do that, if so the other option is to find the addresses for the X and Y position of your pointer on the map when its open (open map look at bottom u will see what i mean) and then set that number to desired location and send mouse down signal (might work).

EDIT AGAIN:
@blinko
you should embed the updater into the bot itself and execute it before running the main loop. I would make it check the versions before downloading though, and display a message to the user when the bot is out of date, asking if they want to download or not. If they choose not display a message saying the bot wont work without update then Exit. This way everyone will know why their shyt dont work after an update, and it forces everyone to be on the same page before coming to you for support.

I had tons of users for skybot and it became a pain in the arse to answer dozens of peoples questions with the same answer every day "why is XXXX not working?? BLAH THIS SUCKS!"... "Download the update please...." lol
Awesome ideas there mate. I'll be taking action in embedding the updater into the bot that is a good idea . I'm not much into bots myself nor do I actually use it let alone play EE that often anymore COD and Dead Island got me tied up lol I'm still like lv42 o.o, but I do enjoy making them So I will continue :P

My bad habit is I'll be designing a bot with intent to use it, and I don't put much thought into it. Mainly this is because of the classes that I use. I'll be playing as a Thief or a Ranger and I kind of tend to focus on attacks and skills rather than the healing, stackable heals and buffs this limits the users to instant skills, and melee skills without much work in delays. I don't leave the user many options to mess with. I did add some delays this time around though, so that's a plus. I really like the idea you have with the heals.

Also assuming you're using the Scite Editor available for AutoIt scriptors, there comes with the package a tool called KODA it's a form design wizard, much like that of VB6.0 and a few others. Just drag and drop your labels, combo boxes etc...All accessed from the Tool menu. Unless you already manually typed everything in lol

**EDIT**
Just thought of something. If we can avtually figure out the way these pkg files are packed, and be able to unpack/repack them then auto-routing is possible. Lets say you wish to auto-route to a location for mobbing using any color really but lets say hot pink RGB 255,0,255.
We'd edit the areas map .dds file and put a dot of our color, then on up further on the map make another dot different colors can lead to different areas too. Once everything is done we just pixel search our minimap for the dot we made, then click that spot it'll run until another dot of that same color appears etc..botting and work arounds for other features become massive once we can unpack the files.

Make a new text document then rename the extension .bms
and use quickbms from this will unpack the pkg files. Just not repack them.
Code:
# Aeriagames pkg.idx/pkg???.pkg
#   Eden Eternal
#   Kitsu Saga
# script for QuickBMS
# quickbms . aluigi . org

getdstring DUMMY 260
getdstring SIGN 32
math PKG_OLD = -1
get FULLSIZE asize
do
    get DUMMY long
    get OFFSET long
    get DUMMY long
    get ZSIZE long
    getdstring DUMMY 0x28
    get SIZE long
    getdstring NAME2 260
    getdstring NAME 260
    get DUMMY long
    get PKG long
    get DUMMY long
    if PKG != PKG_OLD
        string PKG_NAME p= "pkg%03d.pkg" PKG
        open FDSE PKG_NAME 1
        math PKG_OLD = PKG
    endif
    string NAME += NAME2
    clog NAME OFFSET ZSIZE SIZE 1
    savepos CURR
while CURR < FULLSIZE
also located here you can grab a python version that will also extract them, and the site gives a bit of info on the idx/pkg system and file offsets etc.
blinko is offline  
Old   #450
 
elite*gold: 0
Join Date: Jun 2009
Posts: 24
Received Thanks: 20
the bot doesnt work anymore =S

how can i make it work?


Verlo is offline  
Closed Thread



« Previous Thread | Next Thread »

Similar Threads
Eden Eternal bot issue
Im trying to use my own bot in the game Eden Eternal. But I'm not getting to use the _SendMessage and _PostMessage functons, i tried a lot to make it...
7 Replies - AutoIt
Eden Eternal
Hallo Leute. Ich wollte fragen ob ihr bei der CB von Eden Eternal dabei wart, was ihr davon haltet und ob es eventuell Server files oder Language...
2 Replies - General Gaming Discussion
WTS Eden Eternal Account.
Hello! Selling my Eden Eternal account from this site here: Eden Eternal - Eden Eternal - A free MMORPG from Aeria Games Game is open to ANYONE...
29 Replies - Trading
eden eternal hacks needed
any1 gonna make hacks for eden eternal ?
3 Replies - General Coding
Eternal Eden OB!
Eden Eternal - Eden Eternal - A free MMORPG from Aeria Games signup here! ^ OB starts today experience the fun!
0 Replies - General Gaming Discussion



All times are GMT +1. The time now is 23:15.


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

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