Register for your free account! | Forgot your password?

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

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

Advertisement



autoIT simple Target&attack bot help

Discussion on autoIT simple Target&attack bot help within the AutoIt forum part of the Coders Den category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: May 2009
Posts: 5
Received Thanks: 0
autoIT simple Target&attack bot help

ok got something here and im stucked please.. could anyone have a tip or suggestion in this code:
Code:
#include <GUIConstantsEx.au3>

GUICreate("Forsaken's Bot", 335, 100)

GUISetState(@SW_SHOW)

$startbutton = GUICtrlCreateButton("Start", 190, 8, 60)

HotKeySet("{ESC}", "Terminate")

Func Terminate()
	Exit 0
EndFunc

func find()
	send("{TAB}")
EndFunc

func atk()
	send("{1}")
	Sleep(3000)
	send("{1}")
	sleep(3000)
EndFunc

While 1
find()
atk()
WEnd
it just wont tab at the right time.. it just keeps on pressing "1" dunno what part im wrong or eveything is wrong T_T
please help
clied is offline  
Old 01/24/2010, 23:24   #2
 
AutoItDude's Avatar
 
elite*gold: 0
Join Date: Oct 2009
Posts: 93
Received Thanks: 315
It is sending "1" and probably "TAB" for all the time because your bot does not know if any target has been found. atk() function must be executed only if find() succed, in your case both functions are executed for all the time. you know what i mean?

Add one more function to check if desired target is selected and try like this:
Code:
; ======================================
; HOTKEYS
; ======================================
HotKeySet("{HOME}","_OnOFF")

; ======================================
; GLOBAL VARIABLES
; ======================================
Global $bRUN=0		; switch for bot

; ======================================
; MAINLOOP
; ======================================
While 1
	If $bRUN Then
		_FindTarget()
		_Attack()
	EndIf
WEnd

; ======================================
; FUNCTIONS
; ======================================
Func _FindTarget()
	Send("{TAB}")
EndFunc

Func _Attack()
	While _isTarget()
		Send(1)
		Sleep(3000)
	WEnd
EndFunc

Func _isTarget()
;~ 	check if target is selected.
;~ 	try to get monster HP Or whatever
;~ 	what makes you able to verify the target
EndFunc

; ======================================
; SWITCHES
; ======================================
Func _OnOFF()
	$bRUN=Not $bRUN
EndFunc
hope it helps.
AutoItDude is offline  
Old 01/25/2010, 04:26   #3
 
elite*gold: 0
Join Date: May 2009
Posts: 5
Received Thanks: 0
ok here i put pixelgetcolor for the monster hp bar but it gives me error i think im doing it wrong.
some suggestion on checking if monster is selected/alive please...

Code:
HotKeySet("{ESC}", "Terminate")

Func Terminate()
	Exit 0
EndFunc

func find() 
Send("{TAB}") 
sleep(1000) 
EndFunc 

func atk()
	send("{1}")
	sleep(3000)
	send("{1}")
	sleep(3000)
EndFunc

While 1 
	sleep(5000)
	find()
	If PixelGetColor( 510,38 ) = 16226964 then
	atk()	
	EndIf
Wend
clied is offline  
Old 01/25/2010, 06:18   #4
 
AutoItDude's Avatar
 
elite*gold: 0
Join Date: Oct 2009
Posts: 93
Received Thanks: 315
what error?

Use memory functions instead of pixel searching/checking. Search in memory for address where game writes INT/FLOAT value of target HP. If value > 0 then monster is selected.
AutoItDude is offline  
Old 01/25/2010, 16:59   #5
 
elite*gold: 0
Join Date: May 2009
Posts: 5
Received Thanks: 0
uhm how can i search for the enemies hp value? i know how to search mine using cheat engine..
clied is offline  
Old 01/26/2010, 03:26   #6
 
AutoItDude's Avatar
 
elite*gold: 0
Join Date: Oct 2009
Posts: 93
Received Thanks: 315
If you don't have access to any data about monsters HP from webpages, forums, etc. then try to find it like this.

1) select target, search: unknown initial value
2) hit target once, search: smaller value, repeat this stage untill you find correct value or target is killed.

if this won't work try this method:
1) make sure nothing is selected, search for: 0xFFFFFFFF
2) select monster, search: CHANGED VALUE
3) hit once, search: SMALLER VALUE, repeat.

note: in most MMO games HP value of 0xFFFFFFFF, instead of 0x00 is used to describe ZERO.

btw. what's the name of the game you work on?
AutoItDude is offline  
Old 01/27/2010, 04:24   #7
 
elite*gold: 0
Join Date: Mar 2009
Posts: 58
Received Thanks: 3
hey, the script can work fot the game am playing too , ive tried diff scripts and so on the only prob i have is that when i do activate the scripts nothing ever happens in the game, ive tested it in notepad(i know its not the same) and they work, even a simple send wont work, any help? and idk if the game is blocking the scripts
zhadow32 is offline  
Old 01/29/2010, 00:23   #8
 
AutoItDude's Avatar
 
elite*gold: 0
Join Date: Oct 2009
Posts: 93
Received Thanks: 315
you won't be able to simulate mouse clicks or key strokes if there is some antihack shield watching game process. there are couple of ways how to solve it:
1) run game process suspended and inject your automated dll
2) remove anti hack shield hooks
3) completely disable anti hack shield
AutoItDude is offline  
Reply


Similar Threads Similar Threads
Target Simple Shadows
12/05/2009 - CO2 Weapon, Armor, Effects & Interface edits - 4 Replies
I've made a Simple Shadow as a target. It's not too great, but I had to start from scratch, because I couldn't find the simpleshadow.dds. If anyone could tell me how to make the shadow a circle instead of a square, that would be great. Locate your Conquer 2.0 Folder. Once instead navigate to: Place the entire "shadow" folder given inside the .Rar in the pic folder. You will need WinRar to open this.
NEED help making simple auto attack script
06/28/2008 - Lineage 2 - 0 Replies
I have walker 2.03 and i need help making a SIMPLE auto attack script. All i wanna do is target mod, attack, pick up items, target closest mod and repeat. I can add heals and all that stuff later just need help starting a basic combat script.
Simple AutoIT Bot
12/09/2007 - SRO Hacks, Bots, Cheats & Exploits - 8 Replies
Hello Everybody, i made a simple bot for those who don't like T-Bot or for those where it won't works. File-Upload.net - Ihr kostenloser File Hoster! other dl link: 2shared - download MaIn_bot.exe
Simple Auto attack bot
10/08/2007 - Archlord - 5 Replies
Hi, i bring you ALAAB, ArchLord Auto Attack Bot ;), it is a bot...that just attacks automatically..i see other bots that always target other monsters constantly..and never kill them, this bot is not that. Download: WikiFortio - Download details Note: You must have your normal attack in slot 3 Note 2: This is 50% memory-based, so if it doesn't work, this is because the addresses are different on each computer.. Note 3: This is sort of a test, if it DOES work, i will add more...



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


Powered by vBulletin®
Copyright ©2000 - 2025, 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 ©2025 elitepvpers All Rights Reserved.