AutoIt help

03/23/2011 02:39 nobleman07#1
I have made a bot that will attack and do a delay for my attacks if needed. I have been trying to add in this autoheal program that I found online but when I add it to my bot it does not work, it works as a stand alone program though. I need help adding it to my program so if anyone can please help me.


here is my current code with the added autoheal program.
Code:
#include <GUIConstantsEx.au3>

GUICreate("Jaret's Bot", 335, 200)

GUICtrlCreateLabel("Skill 1", 8, 10)
$key1 = GUICtrlCreateInput("", 40, 8, 50)
GUICtrlCreateLabel("Delay", 8, 44)
$time1 = GUICtrlCreateInput("", 40,40, 50)
GUICtrlCreateLabel("Skill 2", 8, 74)
$key2 = GUICtrlCreateInput("", 40,72, 50)
GUICtrlCreateLabel("Delay", 8, 104)
$time2 = GUICtrlCreateInput("", 40,104, 50)

$x = 0
$y = 0
$color = 0
$newColor = 0
$status = "off"

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

GUISetState(@SW_SHOW)

HotKeySet("{END}", "close")
HotKeySet("{Insert}", "_getDefault")

While 1
		$msg = GUIGetMsg()
	
		Select
		
				Case $msg = $startbutton
						WinActive ("Lineage II")	
							_skills()
							_autoHeal
				Case $msg = $GUI_EVENT_CLOSE
						GUIDelete()
						ExitLoop
						Exit
		
		EndSelect
			
WEnd
		
Func close() ;This is a function and doesn't actually run unless you tell it to.
	
	Exit
	
EndFunc

Func _skills
			$send1 = GUICtrlRead($key1)
			$sleep1 = GUICtrlRead($time1)
	While 1
			Send($send1)
			Sleep($sleep1)
		WEnd
EndFunc
	
Func _autoHeal
	While 1

	If $status = "on" Then
		If _getCurrentColor($x, $y) <> $color Then
			Send("3")
		EndIf
	EndIf
WEnd
	
Func _getDefault()
	$coord = MouseGetPos()
	$x = $coord[0]
	$y = $coord[1]
	$color = Hex(PixelGetColor( $coord[0], $coord[1]), 6)
	$status = "on"
EndFunc

Func _getCurrentColor($xDef, $yDef)
	$newColor = Hex(PixelGetColor( $xDef, $yDef), 6)
	Return ($newColor)
EndFunc
here is the autoheal program by itself

Code:
HotKeySet("{Insert}", "_getDefault")

$x = 0
$y = 0
$color = 0
$newColor = 0
$status = "off"

While 1
	If $status = "on" Then
		If _getCurrentColor($x, $y) <> $color Then
			Send("3")
		EndIf
	EndIf
WEnd

Func _getDefault()
	$coord = MouseGetPos()
	$x = $coord[0]
	$y = $coord[1]
	$color = Hex(PixelGetColor( $coord[0], $coord[1]), 6)
	$status = "on"
EndFunc

Func _getCurrentColor($xDef, $yDef)
	$newColor = Hex(PixelGetColor( $xDef, $yDef), 6)
	Return ($newColor)
EndFunc
03/24/2011 10:50 Adroxxx#2
[Only registered and activated users can see links. Click Here To Register...]