Register for your free account! | Forgot your password?

Go Back   elitepvpers > General Gaming > General Gaming Discussion
You last visited: Today at 12:27

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

 

how to use .ct with autoit

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Nov 2008
Posts: 365
Received Thanks: 276
how to use .ct with autoit

hi,

u can use the code as example 4 u bot. there is no while{} u have to implemented by u own. Perhaps u can write some function better (too drunk). But here is the code (seen too much asking about a bot in mining etc....)

Hope it will help someone to script his bot
U need the nomad.au3 extension to use the memory func

If u use it, please post u bot/solution (4 the community)!

Code:
; chit of me (schlat)
; there is no while -> create it 4 U
; chust to see some example
; controlsend is not working with hero only with chat

#include <NomadMemory.au3>
#include <Misc.au3>

Opt("SendKeyDownDelay", 50)
Opt("WinTitleMatchMode", 3)

Global $ID = _MemoryOpen(ProcessExists ( "Hero.exe" ))
Global $dll = DllOpen("user32.dll")
Global $timer[12], $cooldown[12] ;init it
Global $timer_health = TimerInit(), $timer_chi = TimerInit(), $timer_target	;init it
Global $trig_chi, $trig_health, $trig_injury, $trig_tele_health	; init it

;static base memory -> check my .ct
$static_mem = 0x009B3348
$static_pet =0x009B334c
;offsets
$health_off = 1356;0x54c
$chi_off = 1360;0x550
$injury_off = 1380;0x564
$chi_max_off = 1376;560
$health_max_off = 1372;55c
Dim $test[2] = ['NULL',Dec("55C")]

;global read nemory
$mem_base = _MemoryRead($static_mem,$ID)
;memory vars
$health_addr = '0x' & Hex($mem_base + $health_off)
$chi_addr = '0x' & Hex($mem_base + $chi_off)
$injury_addr = '0x' & Hex($mem_base + $injury_off)
$chi_max_addr = '0x' & Hex($mem_base + $chi_max_off)
$health_max_addr = '0x' & Hex($mem_base + $health_max_off)

;Slots F1-F4 amount offsets
$slot_base_off = 184 ;B8
$slot_end_off =  3086;C0E
DIM $slot_1_off[4] = ['NULL',Dec("B8"),Dec("1DC"),Dec("c0e")];1DC
DIM $slot_2_off[4] = ['NULL',Dec("B8"),Dec("1E0"),Dec("c0e")]
DIM $slot_3_off[4] = ['NULL',Dec("B8"),Dec("1E4"),Dec("c0e")]

;Slot amount values
Dim $slot_amount[16]

;pet
Dim $pet_maxHealth_off[4] = ['NULL',Dec("410"),Dec("290"),Dec("1E4")]
Dim $pet_Health_off[4] = ['NULL',Dec("410"),Dec("290"),Dec("1F4")]
Dim $pet_injury_off[4] = ['NULL',Dec("410"),Dec("298"),Dec("1F4")]


Func getALife()
	$health = _MemoryRead($health_addr,$ID)
	$chi = _MemoryRead($chi_addr,$ID)
	$injury = _MemoryRead($injury_addr, $ID)
	
	$value = _MemoryPointerRead($static_pet,$ID,$pet_Health_off,"Byte")
	$pet_health = $value[1]
	;$pet_chi =
	$value = _MemoryPointerRead($static_pet,$ID,$pet_injury_off,"Byte")
	$pet_hunger = $value[1]
	$value = _MemoryPointerRead($static_pet,$ID,$slot_1_off,"Byte")
	$slot_amount[0] = $value[1]	
	$value = _MemoryPointerRead($static_pet,$ID,$slot_2_off,"Byte")
	$slot_amount[1] = $value[1]	
	$value = _MemoryPointerRead($static_pet,$ID,$slot_3_off,"Byte")
	$slot_amount[2] = $value[1]
	$value = _MemoryPointerRead($static_pet,$ID,$slot_4_off,"Byte")
	$slot_amount[3] = $value[1]
EndFunc

Func heal()
	If $chi < $trig_chi Then
		If TimerDiff($timer_chi) >=800 AND $slot_amount[1] > 0 Then
			Send("2")	;chi healing
			$timer_chi = TimerInit()
		EndIf
	EndIf
	If $health < $trig_health Then
		If TimerDiff($timer_health) >=800 AND $slot_amount[2] > 0 Then
			Send("3")	;health healing
			$timer_health = TimerInit()
		EndIf
	EndIf
	If $health <= $trig_tele_health OR $slot_amount[1] == 0 OR $slot_amount[2] == 0 Then ; lol its that really necessary what about else or funstion
		Send("1")
		$counter1=1
	EndIf
;~ 	If $pet_hunger < 90 AND $slot_amount[3] > 0 Then
;~ 		If TimerDiff($timer[3]) >=800 Then
;~ 			Send("4")
;~ 			$timer[3] = TimerInit()
;~ 		EndIf
;~ 	EndIf
EndFunc

Func pick()
	Send("q")
EndFunc

Func simple_5_skill()
	If $skill Then	;u really wanna use skills -> yeah
		If TimerDiff($timer[3] >= $cooldown[3]) Then
			Send("4")	;the hotkey u want to use
			$timer[3] = TimerInit()	;cooldown init -> must set up first
			Send("{SPACE}")  ;Select new target -> need to change if uz other key settings
		EndIf
		If TimerDiff($timer[4] >= $cooldown[4]) Then
			Send("5")
			$timer[4] = TimerInit()
			Send("{SPACE}")
		EndIf
		If TimerDiff($timer[5] >= $cooldown[5]) Then
			Send("6")
			$timer[5] = TimerInit()
			Send("{SPACE}")
		EndIf
		If TimerDiff($timer[6] >= $cooldown[6]) Then
			Send("7")
			$timer[6] = TimerInit()
			Send("{SPACE}")
		EndIf
		If TimerDiff($timer[7] >= $cooldown[7]) Then
			Send("8")
			$timer[7] = TimerInit()
			Send("{SPACE}")
		EndIf
		;Send($Stack.Pop)
	Else
		$skill = True
		$timer[3] = TimerInit()
		$timer[4] = TimerInit()
		$timer[5] = TimerInit()
		$timer[6] = TimerInit()
		$timer[7] = TimerInit()
;~ 		$Stack.Push("4")
;~ 		$Stack.Push("5")
;~ 		$Stack.Push("6")
;~ 		$Stack.Push("7")
;~ 		$Stack.Push("8")
		Send("{SPACE}")
	EndIf
	Send("a")
EndFunc



schlat is offline  
Old   #2
 
elite*gold: 0
Join Date: Apr 2009
Posts: 4
Received Thanks: 0
what does this script do ?


rammeg1 is offline  
Old   #3
 
elite*gold: 0
Join Date: Jun 2009
Posts: 60
Received Thanks: 100
,k,jk
blackwolf96 is offline  
Reply



« Previous Thread | Next Thread »



All times are GMT +1. The time now is 12:27.


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

Support | Contact Us | FAQ | Advertising | Privacy Policy | Abuse
Copyright ©2017 elitepvpers All Rights Reserved.