Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > AutoIt
You last visited: Today at 15:01

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

Advertisement



script logic wrong

Discussion on script logic wrong within the AutoIt forum part of the Coders Den category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Apr 2007
Posts: 26
Received Thanks: 0
script logic wrong

Hi guys! I hope you can help me correct this script I have done. The problem is that I have memory address for enemy and when it is 0 bot should press TAB to switch to a new enemy. But it does so before HP is 0

Code might look a bit strange but I have tried many different possibilities but same result

Code:
HotKeySet ("{ESC}", "_exit")
HotKeySet ("{F12}", "_pause")
#include "NoMadMemory.AU3"
$ID=_MemoryOpen(0x00001484)
$Address= 0x02EE20DC ;Player HP
$Address5= 0x02EE7AAC ;Player Max HP
$Address2= 0x02ED54AC ;CTU energy
$Address3= 0x02EE7AE4 ;Enemy HP
$Address6= 0x02EE7AF4 ;Enemy Max HP
$Address4= 0x02ED9A94 ;CTU HP

$HP=_MemoryRead($Address,$ID)
$enemyHP=_MemoryRead($Address3,$ID)
$enemyMAX=_MemoryRead($Address6,$ID)

WinActivate("Bounty Hounds Online 1.094.41")

While 1
_Fight() ;Start fighting enemy

If $enemyHP = 0 Then
_Switch() ;If enemy is dead switch to next target
EndIf

 WEnd


Func _exit()
    Exit
EndFunc


Func _pause()
    while 1
    Sleep(9999999)
WEnd
EndFunc


Func _Fight()

	If $HP > 500 And $enemyHP = $enemyMAX Then
		Sleep(50)
		_Attack() ;Start attacking because enemy has full health and you enough
	ElseIf $HP > 500 And $enemyHP < $enemyMAX Then
		Sleep(50)
		_Attack() ;Keep attacking
	ElseIf $HP < 500 Then ;If HP to low, do nothing
		_noFight()
			EndIf
	EndFunc

Func _Attack() ;Attack sequence
Sleep(30)
Send("2")
Sleep(10)
Send("2")
Sleep(10)
Send("2")
Sleep(10)
Send("4")
Sleep(10)
Send("3")
Sleep(10)
EndFunc

Func _Switch() ;Wait a little and then switch to next target, if current target is dead
	Sleep(200)
If $enemyHP = 0 Then
Send("{TAB}")
Sleep(50)
Send("z")
Sleep(10)
Send("z")
Sleep(10)
Send("z")
Sleep(10)
Send("z")
Sleep(50)

ElseIf $HP < 500 Then
	_Fight()

EndIf
EndFunc

Func _noFight()
	while 1
	WEnd
	EndFunc
pixellegolas is offline  
Old 10/17/2011, 17:09   #2
 
Ludder231's Avatar
 
elite*gold: 0
Join Date: Aug 2010
Posts: 880
Received Thanks: 113
If $enemyHP = 0 Then
_Switch() ;If enemy is dead switch to next target
EndIf

Test: If $enemyHP < 0 Then ....
Ludder231 is offline  
Old 10/17/2011, 23:07   #3
 
Imaginär's Avatar
 
elite*gold: 255
Join Date: Nov 2009
Posts: 2,900
Received Thanks: 1,408
Are you sure you got the right address?
Have you looked at the value of the address while fighting with an enemy?
(to be sure 0 = enemy dead; maybe it's another value ...)
Imaginär is offline  
Old 10/17/2011, 23:18   #4
 
elite*gold: 0
Join Date: Apr 2007
Posts: 26
Received Thanks: 0
yeah I am sure...I think The funny thing with this game is that you find the GREEN address immediatly so it's the pointer address. No matter if I restart etc its still the same.

When clicking on an enemy I get hp and hp max. Then I switch to a different enemy and get new hp and hp max.

These of course are the same first. When hitting enemy I get the hp because it's lower and the hp max.

This address is the same all the time and I am scripting this address to be the 0 to switch. I will look again for address to make sure it is correct. Is the logic...logical otherwise?
pixellegolas is offline  
Old 10/18/2011, 17:09   #5
 
elite*gold: 35
Join Date: Apr 2011
Posts: 800
Received Thanks: 214
Quote:
Originally Posted by Ludder231 View Post
If $enemyHP = 0 Then
_Switch() ;If enemy is dead switch to next target
EndIf

Test: If $enemyHP <= 0 Then ....
I think <= is better
.AppleTree. is offline  
Old 10/18/2011, 23:55   #6
 
elite*gold: 0
Join Date: Apr 2007
Posts: 26
Received Thanks: 0
don't have time to test but even if it is 0 or less than zero it should not switch before. It sometimes switches almost at 100% of the enemy hp I put in some sleep to make sure that it actually registers everything in time

And it also checks twice for hp = 0

First if it is 0 it start the switch, then the function again checks if hp is zero and then executes tab. So I actually ask it 2 times and still it does it beforehand....weird
pixellegolas is offline  
Reply


Similar Threads Similar Threads
marius aka mRs' 's geile logic
07/29/2011 - Quotes - 9 Replies
]18:37:1618:37:21vIrus18:37:31vIrus18:37:48vIrus18 :37:58vIrus18:38:0218:38:10vIrus18:38:17vIrus18:38 :22vIrus18:38:3518:38:37brainpain18:38:4018:38:41b rainpain18:38:45brainpain18:38:4718:38:4818:38:491 8:38:49vIrus18:38:50brainpain18:38:5018:38:53brain pain18:38:53vIrus18:38:54brainpain18:38:57vIrus18: 39:00vIrus18:39:3918:39:5518:39:58vIrus18:40:0318: 40:1618:40:25vIrus[x> sags ihnen inner schule -.-
My Logic Screen
04/16/2010 - EO PServer Hosting - 5 Replies
I Edited an old picture of a eo picture, Tell me if you think it looks likes on a scale 1-10 http://img11.imageshack.us/i/theloginscreen.png/
MxO - Double Logic Cannon 2.0 Exploit
12/25/2008 - General Gaming Discussion - 3 Replies
1)Just go in interlock 2)click logic cannon 2.0 or other hacker abilities (probably work for martial art too but I haven't try it) 3)while logic cannon icon is moving from right to left just click two or three times on an other ability like logic barrage and quickly on logic cannon 2.0 again,you'll have two logic cannon 2.0 with a 2600 or less damage in about 6 seconds. Enjoy



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


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.