Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > AutoIt
You last visited: Today at 02:33

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


Requests - AutoIt only

Discussion on Requests - AutoIt only within the AutoIt forum part of the Coders Den category.

Old 03/01/2019, 19:31   #286
elite*gold: 0
Join Date: Apr 2011
Posts: 255
Received Thanks: 86
Originally Posted by buglyff View Post
hi i have a request, Im playing a certain game that needs a lot of farming.. i already have a code that finds the monster and kill it but my code is not yet complete. If someone could write me a code that will determine if the monster im killing is still alive and wait until my character kills it before switching to other monster.. I could post my code here if someone will be willing to add some revisions of it.. btw im playing Flyff private server..

I refactor your code, can't test it because i don't play the game, but you will have to change to your values in the code, there is a bunch of comments and image reference for u to make it work.

#Include <FastFind.au3>

Global $Running = False

; $states -> "unknown","fighting","searching"
Global $state = "unknown"

HotKeySet("{PGUP}", "start")
HotKeySet("{PGDN}", "stop")
HotKeySet("{F10}", "pause")

;Function called to check if a monster is selected, it determines it by searching for blue bar that is below HP bar
;Check image for reference
Func checkMonsterSelected()

;searchBoxX0  left coordinate of pixel search area
;searchBoxY0  top coordinate of pixel search area
;searchBoxX1 right coordinate of pixel search area
;searchBoxY2 bottom coordinate of pixel search area

;From image reference this is the rectangle in violet
   ;║	HP Bar	 =============================  	 ║
   ;║			     								 ║
   ;║	Blue Bar ============================= 		 ║
;Change this to your box search coordinates (u can use autoit window info for this)
$searchBoxX0 = 100
$searchBoxY0 = 100
$searchBoxX1 = 400
$searchBoxY1 = 400

$mobSelectedBlueBarColor = 0x00000000

;If monster found change state to fighting otherwise unknown
$pixel = FFNearestSpot( $searchBoxX0,$searchBoxY0,$searchBoxX1,$searchBoxY1, $mobSelectedBlueBarColor, false)
 If IsArray($pixel) = True Then
	$state = "fighting"
	$state = "unknown"

While Sleep(15)

If $Running Then
;if state unknown or searching
If $state <> "fighting" Then
$state = "searching"
;[I belive this is for clicking a monster]
$pixel = FFNearestSpot( 1, 1, 1237, 91, 0xFFFAA5, false)
   If IsArray($pixel) = True Then
	MouseMove($pixel [0], $pixel [1], 1)
	MouseDown ("Left")
;[and this for walking around if no monster found]
	Dim $box[4] = [253, 178, 555, 376]
	MouseClick("left", Random($box[0], $box[2]), Random($box[1], $box[3]))




ToolTip($state,0,0,"Current State")


Func start()
   $Running = Not $Running
   WinActive("Mighty Flyff - ThomaShelby")
   WinMove("Mighty Flyff - ThomaShelby", "", 0, 0)

Func pause()
$Running = False

Func stop()
    Exit 0
EndFunc   ;==>stop

elmarcia is offline  

« Looking for example code (all info in thread) | Keylogger Script for own use »

Similar Threads
AutoIt Script Requests
07/31/2008 - Dekaron - 10 Replies
Meh...bored with my scripts atm (releasing another tomorrow...), so I'm gonna ask you all what you want in a script. Post your ideas here.

All times are GMT +1. The time now is 02:33.

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

BTC: 3KeUpz52VCbhmLwuwydqxu6U1xsgbT8YT5
ETH: 0xc6ec801B7563A4376751F33b0573308aDa611E05

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