Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Guild Wars > GW Bots
You last visited: Today at 21:55

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

Advertisement



Need help Func

Discussion on Need help Func within the GW Bots forum part of the Guild Wars category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Feb 2009
Posts: 71
Received Thanks: 2
Wink Need help Func

Hi all, I have a little issue with the bot I'm doin using the tt6 move to engine. I'm trying the make it scan in front of my charc on the minimap to check if enemies are present.
So here's the func:
Code:
;scan if enemy is in front of us
Func ScanEnemy1()
	 PixelSearch(86, 460, 173, 516, $MonsterColor_Red, 10)
    If @error then 
        Sleep( 100 )
        PixelSearch(86, 460, 173, 516, $MonsterColor_Red, 10)
        if @error then return False
    EndIf
    return True
EndFunc
And here's how I've used it in my script:
Code:
;go to Lissah
	PrepMoveTo()
	
	MoveTo(1, 17619, -17449)
	MoveTo(1, 15697, -15812)
 	MoveTo(1, 13328, -14471)
 	MoveTo(1, 11022, -12727)
	MoveTo(1, 10985, -12696)
	RndSleep(200)
	
	;check enemy in path
	StopMoveTo()
	RndSleep(500)
	InitDest(4140, -11602)
	If ScanEnemy1() Then
		Sleep(100)
	EndIf
	If Not ScanEnemy1() Then
		ContinueLoop
	;resume
	PrepMoveTo()
	MoveTo(1, 9504, -12488)
	MoveTo(1, 7695, -10883)
	MoveTo(1, 4239, -11442)
	MoveTo(1, 4140, -11602)
	EndIf
Still it doesnt seem to be working as my charc moves to the next waypoint while there is or isnt any enemies in front. So I was wondering if anyone could help me out.

Thx
sweetlady is offline  
Old 03/23/2009, 19:02   #2
 
elite*gold: 0
Join Date: Mar 2009
Posts: 75
Received Thanks: 12
I am really sorry, i have tried to replicate your problem because i was looking to add a similar bit of code to something i am working on but i am very new to autoit so i could not get it working

Have you found a fix for the problem?
T1CM4D is offline  
Old 03/24/2009, 06:49   #3


 
buFFy!'s Avatar
 
elite*gold: 1826
Join Date: Mar 2009
Posts: 4,310
Received Thanks: 6,284
Quote:
Originally Posted by sweetlady View Post
Hi all, I have a little issue with the bot I'm doin using the tt6 move to engine. I'm trying the make it scan in front of my charc on the minimap to check if enemies are present.
So here's the func:
Code:
;scan if enemy is in front of us
Func ScanEnemy1()
	 PixelSearch(86, 460, 173, 516, $MonsterColor_Red, 10)
    If @error then 
        Sleep( 100 )
        PixelSearch(86, 460, 173, 516, $MonsterColor_Red, 10)
        if @error then return False
    EndIf
    return True
EndFunc
And here's how I've used it in my script:
Code:
;go to Lissah
	PrepMoveTo()
	
	MoveTo(1, 17619, -17449)
	MoveTo(1, 15697, -15812)
 	MoveTo(1, 13328, -14471)
 	MoveTo(1, 11022, -12727)
	MoveTo(1, 10985, -12696)
	RndSleep(200)
	
	;check enemy in path
	StopMoveTo()
	RndSleep(500)
	InitDest(4140, -11602)
	If ScanEnemy1() Then
		Sleep(100)
	EndIf
	If Not ScanEnemy1() Then
		ContinueLoop
	;resume
	PrepMoveTo()
	MoveTo(1, 9504, -12488)
	MoveTo(1, 7695, -10883)
	MoveTo(1, 4239, -11442)
	MoveTo(1, 4140, -11602)
	EndIf
Still it doesnt seem to be working as my charc moves to the next waypoint while there is or isnt any enemies in front. So I was wondering if anyone could help me out.

Thx
There's an static Memory Address, you could use Cheat Engine to find it.
Returns 1 or 0.
buFFy! is offline  
Old 04/02/2009, 06:27   #4
 
elite*gold: 0
Join Date: Feb 2009
Posts: 71
Received Thanks: 2
Quote:
Originally Posted by eF_Hacks View Post
There's an static Memory Address, you could use Cheat Engine to find it.
Returns 1 or 0.
I'm not really used to cheat Engine, might get to it someday but I preffer putting my efforts in autoit right now.

Thx

Oh, I've resolved my problem.

I was wondering If you could show me how you'd do it with memoryreading. I uses the tt6 engine. Plus I wanted to make one monitoring hp and energy. I have updated my memoryadresses in the update.ini but my character simply turns around. What have I done wrong?
sweetlady is offline  
Old 04/02/2009, 14:53   #5
 
Rosemarie Lein's Avatar
 
elite*gold: 0
Join Date: Jan 2009
Posts: 388
Received Thanks: 113
Quote:
Originally Posted by sweetlady View Post
I'm not really used to cheat Engine, might get to it someday but I preffer putting my efforts in autoit right now.

Thx

Oh, I've resolved my problem.

I was wondering If you could show me how you'd do it with memoryreading. I uses the tt6 engine. Plus I wanted to make one monitoring hp and energy. I have updated my memoryadresses in the update.ini but my character simply turns around. What have I done wrong?
You need an actual update.ini and the newest version of the tt6.au3.
There are 3(?) static addresses for checking if you look to your enemy:
0x00A23B79
0x00A23C50
0x00A24DF9
Rosemarie Lein is offline  
Thanks
1 User
Old 04/02/2009, 17:57   #6
 
elite*gold: 0
Join Date: Feb 2009
Posts: 71
Received Thanks: 2
I'll try to see what I can do. But right now my tt6 doesnt seem to be working. All it does is turn in circles instead of moveto.
sweetlady is offline  
Old 04/02/2009, 20:48   #7
 
elite*gold: 0
Join Date: Feb 2009
Posts: 71
Received Thanks: 2
Nvm that I found my answer. But I have a question tho. With the adresses you gave me, yes I add them in my update.ini. That I can do, but how do I know wich one is to check if theres an enemy in the path of my character.

Thx
sweetlady is offline  
Old 04/04/2009, 14:28   #8
 
elite*gold: 0
Join Date: Feb 2009
Posts: 71
Received Thanks: 2
UP
sweetlady is offline  
Old 04/05/2009, 16:15   #9
 
elite*gold: 0
Join Date: Feb 2009
Posts: 71
Received Thanks: 2
I was also wondering how you use the
Code:
P_HEALTH				= 0xd28a70
;_M_HP					= 0x130
;_M_E					= 0x11c
;_M_MAX_HP				= 0x134
;_M_MAX_E
I have tested it a bit and both M_HP/M_E and M_MAX_HP/M_MAX_E codes returns 0. The thing is I dont know how to set it for a specific energy amout.

EX: Wait till the energy rise to 15 then cast...

This is what I have tried:
Code:
Const $HPMIN = 			IniRead("update.ini","SECTION D","_M_HP","Not found") ;HP at Minimum
Const $HPMAX = 			IniRead("update.ini","SECTION D","_M_MAX_HP","Not found") ;HP at Maximum
Const $ENMIN = 			IniRead("update.ini","SECTION D","_M_E","Not found") ;Energy at min
Const $ENMAX = 			IniRead("update.ini","SECTION D","_M_MAX_E","Not found") ;Energy at max

$Emin = _memoryread($ENMIN,$hprocess,'float') = 0
$Emax = _memoryread($ENMAX,$hprocess,'float') = 0
	If $Emin < $Emax Then
	MsgBox(0,"Energy Status", "Energy is Not FULL",10)
	WinSetOnTop("Energy Status","",1)
	EndIf
sweetlady is offline  
Old 04/07/2009, 12:31   #10


 
buFFy!'s Avatar
 
elite*gold: 1826
Join Date: Mar 2009
Posts: 4,310
Received Thanks: 6,284
Quote:
Originally Posted by sweetlady View Post
I was also wondering how you use the
Code:
P_HEALTH				= 0xd28a70
;_M_HP					= 0x130
;_M_E					= 0x11c
;_M_MAX_HP				= 0x134
;_M_MAX_E
I have tested it a bit and both M_HP/M_E and M_MAX_HP/M_MAX_E codes returns 0. The thing is I dont know how to set it for a specific energy amout.

EX: Wait till the energy rise to 15 then cast...

This is what I have tried:
Code:
Const $HPMIN = 			IniRead("update.ini","SECTION D","_M_HP","Not found") ;HP at Minimum
Const $HPMAX = 			IniRead("update.ini","SECTION D","_M_MAX_HP","Not found") ;HP at Maximum
Const $ENMIN = 			IniRead("update.ini","SECTION D","_M_E","Not found") ;Energy at min
Const $ENMAX = 			IniRead("update.ini","SECTION D","_M_MAX_E","Not found") ;Energy at max

$Emin = _memoryread($ENMIN,$hprocess,'float') = 0
$Emax = _memoryread($ENMAX,$hprocess,'float') = 0
	If $Emin < $Emax Then
	MsgBox(0,"Energy Status", "Energy is Not FULL",10)
	WinSetOnTop("Energy Status","",1)
	EndIf

There are Offsets...

So,
Code:
$PHEALTH = 0xd28ab8
$P_CURR_ENERGY = 0xd28ab8 + 0x11c
$P_CURR_HEALTH = 0xd28ab8 + 0x130
$P_MAX_ENERGY  = 0xd28ab8 + 0x120
$P_MAX_HEALTH  = 0xd28ab8 + 0x134
Of course yours Returns 0 because

P_HEALTH = 0xd28ab8
;_M_HP = 0x130
;_M_E = 0x11c
;_M_MAX_HP = 0x134
;_M_MAX_E = 0x120

Those are declaring an Comment.
<> That means u cant read them Out.
buFFy! is offline  
Old 04/07/2009, 14:00   #11
 
Jacob_G's Avatar
 
elite*gold: 0
Join Date: Aug 2006
Posts: 515
Received Thanks: 95
This code should help you:

HTML Code:
#include<NomadMemory.au3>

Global Const $process_id = WinGetProcess("Guild Wars")
Global $hp_en_base = 0xd28ab8 

Func _hp()
	
	$handle = _MemoryOpen($process_id)
	
	Dim $offset_health[2] = [0x0, 0x130]
	Dim $offset_health_max[2] = [0x0, 0x134]

	$ret_hp_max = _MemoryPointerRead($hp_en_base, $handle,$offset_health_max)
	$ret_hp = _MemoryPointerRead($hp_en_base, $Handle, $offset_health, 'float')
	_MemoryClose($handle)

	$health_atm = $ret_hp_max[1] * $ret_hp[1]
	$health_atm = Round($health_atm)

	If $health_atm Then
		Return $health_atm
	Else
		Return "dead"
	EndIf

EndFunc

Func _en()

	$handle = _MemoryOpen($process_id)
	
	Dim $offset_energy[2] = [0x0, 0x11c]
	Dim $offset_energy_max[2] = [0x0, 0x120]

	$ret_energy_max = _MemoryPointerRead($hp_en_base, $handle,$offset_energy_max)
	$ret_energy = _MemoryPointerRead($hp_en_base, $handle, $offset_energy, 'float')
	_MemoryClose($handle)

	$energy_atm = $ret_energy_max[1] * $ret_energy[1]
	$energy_atm = Round($energy_atm)

	If $energy_atm Then
		Return $energy_atm
	Else
		Return "no energy"
	EndIf

EndFunc



MsgBox(0,"Health & Energy","hp: " &_hp()& " | en: " &_en() ) ;
Jacob_G is offline  
Old 04/11/2009, 00:51   #12
 
elite*gold: 0
Join Date: Feb 2009
Posts: 71
Received Thanks: 2
Thanks a lot eF Hacks and Xninja. I havent had time to check it out yet, but you pointed me to the right direction thx. Xninja, I'll try out the script you gave me tonight see how it goes. I'll use it with credits.

Thx a lot again
sweetlady is offline  
Old 04/11/2009, 17:43   #13
 
elite*gold: 0
Join Date: Feb 2009
Posts: 71
Received Thanks: 2
Ok, maybe I dont have the right NomadMemory because I'm missing this func
Code:
_MemoryPointerRead
Nvm, found the updated version
sweetlady is offline  
Reply


Similar Threads Similar Threads
wr func net
04/02/2010 - WarRock Hacks, Bots, Cheats & Exploits - 1 Replies
Wenn ich wr starte und auf game starten klcike steht da "ERROR:Cannot Find Exeute file! was muss ich machen habe win 7
Func in IE.au3
10/15/2009 - AutoIt - 26 Replies
Hallo, mal eine Frage zur IE.au3 Ich möchte im gleichen Fenster eine andere Adresse aufrufen, kann ich das hiermit machen ? IENavigate(ByRef $o_object, $s_Url, $f_wait = 1) dann hab ich da mal 2 weitere fragen zu. Was genau kommt bei $o_object rein und was ist mit dem ByRef ? Vielen Dank falls mir geholfen werden kann.
loot func
11/17/2008 - Guild Wars - 15 Replies
Hi Ich weis sowas gabs schonmal in dem Thermalquellen Bot von Blackworkxx glaub ich. Ich hab mich auch grad dran versucht, aber ich find den Fehler einfach nicht mehr. Im moment siehts so aus: func _loot() for $a= 0 to 8 step 1 sleep(100)
move to func.
10/21/2008 - Guild Wars - 46 Replies
ich hab also die speicher addresse von x und y und auch die jewaligen anfangs und endwerte möchte nun aber das sich die spielfigur von x1/y1 zu x2/y2 bewegt. schreibe ich dafür die jewligen werte einfach nur um und das wird dann als bewegung interpretiert oder wäre das sozusagen ein teleport vorgang (clientside) und der server würde das nicht verstehen und einfach wieder an den startpunkt setzen?? bei reequia gab es eine moveto function allerdings hab ich keine ahnung wie genau die aussah bzw...
Func hilfe....
05/25/2008 - Guild Wars - 2 Replies
Hi, ich bräuchte mal hilfe bei ner function.... Ich habe in meinem Bot 2 Farm gebiete drin.... und man kann halt auch mit Ele oder Monk Farmen. Dies kann man per GUI auswählen // checkboxen... so soweit so gut.. Wenn man jetzt z.B. "Farm TQ und Farm mit Monk TQ" ausgewählt hat dann macht der das auch, wenn man dann "Farm Elona und Farm mit Monk Elona" ausgewählt hat dann funktioniert das auch. So aber wenn man "Farm Elona und Farm mit Ele Elona" ausgewählt hat dann macht der nicht das...



All times are GMT +2. The time now is 21:55.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2024 elitepvpers All Rights Reserved.