Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > AutoIt
You last visited: Today at 10:40

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

Advertisement



AutoIt help

Discussion on AutoIt help within the AutoIt forum part of the Coders Den category.

Closed Thread
 
Old   #1
 
elite*gold: 0
Join Date: Jan 2008
Posts: 18
Received Thanks: 0
AutoIt help

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
nobleman07 is offline  
Old 03/24/2011, 10:50   #2

 
Adroxxx's Avatar
 
elite*gold: 15
Join Date: Nov 2005
Posts: 13,021
Received Thanks: 5,324
Adroxxx is offline  
Closed Thread




All times are GMT +1. The time now is 10:40.


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.