Amateur FFXIV EXP/GRINDING Bot with autoit

01/22/2011 14:30 antonbb#16
Hey Dok33, how is it going with the bot? :)
01/22/2011 20:06 Dok33#17
Hey,

I've worked on it as far as i could, meaning that i changed everything i could read directly in the game's memory. Unfortunatly we still don't have the target's informations, so actually I would say it works 70% by memory checks and 30% by pixel detection.

So in your case, that won't solve the problem you first had (even if i fixed a few bugs like the emote/sitting one).

What i'm going to do is put online the new version tomorrow, and tell on the bot's page the appropriate settings for the window position.

By the way one question did you reset your interface parameters to default in game ?
01/23/2011 21:09 Dok33#18
NEW VERSION AVAILABLE ON THE WEBSITE
01/27/2011 12:51 moghrath#19
Hey Chefes:bandit:, this code of yours (noob here) my eyes tell me that it calculates the dynamic adress of in this case player X position.

However does it also give me the value? ex 45.522346 (the position on the x axis ingame)

if not how can i calculate it? And to make the value saved in a varible so that i can use it in the same function (i want to be able to call the function and receve the value of x position in a varible that can be accesed later in the script)

Code:
Func playerxpos()                                                                  ; Player X pos 
	OPENAIONMEMORY()
	$STATICOFFSET = Dec("00D0A36C")
	Global $PID
	Global $CUROFFSET[1]
	$CUROFFSET[0] = 0
	$BASEADDR = _MEMORYMODULEGETBASEADDRESS($PID, "ffxivgame.exe")
	$FINALADDR = "0x" & Hex($BASEADDR + $STATICOFFSET)
	$MEMTEST = _MEMORYREAD($FINALADDR, $OPENMEM)
	$MEMTEST = _MEMORYREAD($MEMTEST + 0x154, $OPENMEM)
	$MEMTEST = _MEMORYREAD($MEMTEST + 0x18, $OPENMEM)
	$MEMTEST = _MEMORYREAD($MEMTEST + 0x10, $OPENMEM, "Float")
;~ 	MsgBox( 0 , "foeget" , $MEMTEST )
	Return $MEMTEST
EndFunc
01/28/2011 19:21 Chefes#20
If you call this function it will give you the value of of X Pos like
you mentioned...

ok if you press "w" button you will walk in the direction your
cam is looking...

to calculate in what direction you are looking... lets say North is
0 or 360 degree (circle)... Now you know your Chara Pos and
the Pos of your Camera.... Make a line across these points (draw
it on a paper)... now make a triangle with 1X90 degree angle so
you can calculate the othe angles...

like that you can calculate how many degree away from North
you are looking...

do the same with your current Pos and the Target Pos where to walk
to... and you know the angle you should be looking to in order to walk
streight to your Target Point...

seems a bit complicated with my bad english... maybe the code helps
its only for 2 dimensional walk points.. but can be extended the same
way for 3-dimensional walking (like for flying in Aion..)

this should help:
http://en.wikipedia.org/wiki/Slope

Calculate the view angle (incl. translation 90 to 360 degree...)
Code:
Func playerrotation()
;~ 	Return MEMREADDLL($playerrotation, "float")
	OPENAIONMEMORY()
	$STATICOFFSET = Dec("00D149AC")
	Global $PID
	Global $CUROFFSET[1]
	$CUROFFSET[0] = 0
	$BASEADDR = _MEMORYMODULEGETBASEADDRESS($PID, "ffxivgame.exe")
	$FINALADDR = "0x" & Hex($BASEADDR + $STATICOFFSET)
	$MEMTEST = _MEMORYREAD($FINALADDR, $OPENMEM)
	$MEMTEST = _MEMORYREAD($MEMTEST + 0x40  , $OPENMEM)
	$MEMTEST = _MEMORYREAD($MEMTEST + 0x64  , $OPENMEM )
	$MEMTEST = _MEMORYREAD($MEMTEST + 0x1A4 , $OPENMEM )
	$MEMTEST = _MEMORYREAD($MEMTEST         , $OPENMEM )
	$MEMTEST = _MEMORYREAD($MEMTEST + 0x10  , $OPENMEM )


	$camx = _MEMORYREAD($MEMTEST    + 0x030 , $OPENMEM, "Float")
	$camy = _MEMORYREAD($MEMTEST    + 0x038 , $OPENMEM, "Float")


	$playerxcoord = playerxpos()
	$playerycoord = playerypos()

	$diffy = round( $camy - $playerycoord,6)
	$diffx = round($camx - $playerxcoord,6)
	$Steigung = $diffy/ $diffx
	$pi = 3.14159265358979
	$RADZUGRAD = 180 / $pi
	$GRAD = atan( $Steigung ) * $RADZUGRAD
    $GRAD = 90  - $GRAD

if      $diffy > 0 and $diffx > 0 Then
		$GRAD = 90 - $GRAD +270
		Return $GRAD
ElseIf  $diffy < 0 and $diffx < 0 Then
		$grad =   180 - $GRAD
		Return   $GRAD
ElseIf  $diffy > 0 and $diffx < 0 Then
		$grad = ( 180 - $GRAD )
		Return $GRAD
ElseIf  $diffy < 0 and $diffx > 0 Then
		$grad =  (180 - $GRAD ) +180
		Return $GRAD
EndIf
EndFunc


other useful stuff:
Code:
func switchrotate($target, $now)
	if($target < $now) then
	if(($now - $target) > 180) then
	$rot_key = GUICtrlRead($rightkey)
	else
	$rot_key = GUICtrlRead($leftkey)
	Endif
	else
	if(($target - $now) > 180) then
	$rot_key = GUICtrlRead($leftkey)
	else
	$rot_key = GUICtrlRead($rightkey)
	endif
	endif
	endfunc
func getangle($diffx, $diffy)
	$Steigung = $diffy/ $diffx
	$pi = 3.14159265358979
	$RADZUGRAD = 180 / $pi
	$GRAD = atan( $Steigung ) * $RADZUGRAD
    $GRAD = 90  - $GRAD

if      $diffy > 0 and $diffx > 0 Then    ;   
		$GRAD = 180 -  $GRAD
;~ 		MsgBox( 0 , "after1" ,  $GRAD  )
		Return $GRAD

ElseIf  $diffy < 0 and $diffx < 0 Then    ; 
		$grad =   270 + $GRAD
;~ 		MsgBox( 0 , "after2" ,  $GRAD  )
		Return   $GRAD

ElseIf  $diffy > 0 and $diffx < 0 Then    ;  
		$grad = ( 180 - $GRAD ) + 180
;~ 		MsgBox( 0 , "after3" ,  $GRAD  )
		Return $GRAD

ElseIf  $diffy < 0 and $diffx > 0 Then    ;  
		$grad =  (180 - $GRAD )
;~ 		MsgBox( 0 , "after4" ,  $GRAD  )
		Return $GRAD

EndIf

endfunc

func getthreesixty($angle, $flag = false)
	if($flag) then
	if($angle < 0) then
	$angle = (360 - ($angle * -1))
	endif
	else
	if($angle > 360)then
	$angle = $angle - 360
	elseif($angle < 0)then
	$angle = $angle + 360
	endif
	endif
	return $angle
endfunc


func AlignRotation($x, $y, $z , $move = false)
	$playerxcoord = playerxpos()
	$playerycoord = playerypos()
	$playerzcoord = playerzpos()

	if onflight() <> 0  then
		$higth  = $zcoord - $playerzcoord
		$length = $Ycoord - $playerYcoord
			if $length < 0 Then
				$length = $length * -1
			EndIf
		$slope = ($higth / $length)
		$pi =  3.14159265358979
		$radToDeg = 180 / $pi
		$winkelff = (ATan($slope) * $radToDeg  ) / 2
		$winkel = round( $winkelff  * -1 , 8)
		MemWriteDLL($camy, $winkel )                        ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
	EndIf

;....


	$diffy = round($y - $playerycoord,2)
	$diffx = round($x - $playerxcoord,2)
	$angle = getangle($diffx, $diffy)
	$nowang =  playerrotation()


if $readmemwrite = 1 Then

		MemWriteDLL($camx, $angle )                      ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

	$higth  = $zcoord - $playerzcoord
	$length = $Ycoord - $playerYcoord
	if $length < 0 Then
		$length = $length * -1
	EndIf
	$slope = ($higth / $length)
	$pi =  3.14159265358979
	$radToDeg = 180 / $pi
	$winkelff = (ATan($slope) * $radToDeg  ) / 2
	$winkel = round( $winkelff  * -1 , 8)
	MemWriteDLL($camy, $winkel )                          ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;

Else

	switchrotate($angle, $nowang)
	If ($angle + 14) < $nowang or ($angle - 14) > $nowang Then
	If ($angle+14) < $nowang Then
	$nowang = playerrotation()
	switchrotate($angle, $nowang)
	ControlSend("FINAL FANTASY XIV" , "" , "" , "{"&$rot_key&' down'&"}")
	While 1
	$nowang= playerrotation()
	IF ($angle+4) > $nowang Then
	ExitLoop
	ElseIf calcdist($xcoord,$ycoord) < 5 Then
	ExitLoop
	EndIf
	WEnd
	ElseIf ($angle-14) >$nowang Then
	$nowang = playerrotation()
	switchrotate($angle, $nowang)
	ControlSend("FINAL FANTASY XIV" , "" , "" , "{"&$rot_key&' down'&"}")
	While 1
	$nowang=playerrotation()
	IF ($angle-4) < $nowang Then
	ExitLoop
	ElseIf calcdist($xcoord,$ycoord) < 5 Then
	ExitLoop
	EndIf
	WEnd
	EndIf
	ControlSend("FINAL FANTASY XIV" , "" , "" , "{"&$rot_key&' UP'&"}")
	EndIf
EndIf
endfunc
sample for walkpoints (has to be tuned a bit):

Code:
func walkpoints($wptype,$WPmax, $gatheronlytype )

	$wporgp = "itswp"
	$who = guictrlread($whocombo)
	$wpX=0
	buff()

	while $wpX < ($WPmax-1)
		for $zx = 1 to $WPmax-1
			$wpX=$wpX+1
			GUICtrlSetData($status,"Walking to "&$wptype& " "& $zx)
			StatusListviewUpdate("Walking to "&$wptype& " "& $zx)
			AlignRotation($xcoord, $ycoord, $zcoord , true)

			$value=StringSplit(IniRead("Setup.ini",$who,$wptype&$zx,""),"|")
			If @error Then MsgBox(0+262144,"",$wptype &" "&$zx  & "  - WPS")
			$xcoord=$value[2]
			$ycoord=$value[3]
			$zcoord=$value[4]
			$type  =$value[5]
			$distance = calcdist($xcoord,$ycoord)
			
			while $distance > 8
				ControlSend("FINAL FANTASY XIV" , "" , "" , "{"&Guictrlread($upkey)&' down'&"}")
				AlignRotation($xcoord, $ycoord, $zcoord , true)
				$Distance = calcDist($xCoord, $yCoord)
			wend
		Next
			if $wptype = "wp" then
				$wpX=0
			EndIf
	wend

	if $wptype = "gwp" then
		send("{"&GUICtrlRead($upkey)&' up'&"}")

	    $wpX=0
		walkpoints("wp",$countmax ,$gatheronly)
	EndIf
endfunc
should keep you busy for a bit ;)

Peace

Chefes
01/30/2011 15:10 moghrath#21
Quote:
Originally Posted by Chefes View Post
should keep you busy for a bit ;)

Peace

Chefes
indeed ^^ thx a bunch i see now that i need to study memory functions more before i rush into things :D
02/06/2011 23:47 Dok33#22
Hi guys.

Just updated a new version (1.2) of the exp bot on the website which bring the following changes and fixes :

- Improved detection of pixels (so it should work better despite of the colors settings of the pc)
- Fixed camera issue
- Fixed "NO" typing issue
- Fixed various other issues
- Can now shut down the bot using « x » hotkey

Also updated the tutorial on the page, hope it will work better for everyone.
02/23/2011 19:17 Belfi#23
Help please. Im trying to find HP static address and offset.
1. I found current hp address:
[Only registered and activated users can see links. Click Here To Register...]
2. I checked what writes to this address:
[Only registered and activated users can see links. Click Here To Register...]
mov [edi+01], al
EDI = 230B6020
3. Im trying to find Hex 230B6020, but there is no results found :(
[Only registered and activated users can see links. Click Here To Register...]
Trying to use this guide:
06/03/2011 20:00 Dok33#24
June 6 2011 - BOT UPDATED TO LATEST VERSION. Works with current version of Final Fantasy XIV though they made naughty changes to the interface & fight system.

A few fixes has been made to make sure it works for everyone.

For new users, make sure to read the full post on [Only registered and activated users can see links. Click Here To Register...] and feel free to post your review.

Have fun
06/12/2011 15:36 greeeed#25
Thank you.
But... am I the only one who can't download the English version?
(QWERTY)

Edit: I download the AZERTY version
but it's stop working after some time T_T
06/13/2011 00:31 Sayael#26
Is it also working for QWERTZ keyboards?
06/13/2011 11:05 greeeed#27
Quote:
Originally Posted by Sayael View Post
Is it also working for QWERTZ keyboards?
QWERTZ new version: I can't download it >..<
QWERTZ old version: heal >>> run >>> heal...etc

AZERTY work fine but only for few kill than stop ( limited version )
( you can add French Keyboard from control panel>>>regional and language options)
07/28/2011 18:11 dinin991#28
Does this still work with the newest ff14 patch?
09/05/2011 21:51 IYAAYAZ#29
How long has the download link been down?