Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > AutoIt
You last visited: Today at 22:34

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

Advertisement



AutoIT getElementBy...

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

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Aug 2016
Posts: 8
Received Thanks: 0
AutoIT getElementBy...

Can anyone help me out here?
i'm trying to make a bot thats just clicks the buttons without using mouse u know getting the "API"? i guess it's called totally new to this only made some pixel bots :-D but im trying to find this button

<a href="http://s21.en.bitefight.gameforge.com/robbery/index" target="_top">Hunt</a>

How would i do that any example would be deeply appreciatet!

Tried some different stuff tried like this


Code:
	$btnHunt = .document.getElementsByTagName("Example")

	for $b in $btnHunt
		if $b.innerHTML = "Hunt" Then
			$b.click()
		EndIf
	Next
Code:
$ie = ObjCreate("InternetExplorer.Applicaion") <- Found the fail missed a T .. lol 
#include <IE.au3>

With $ie

		.visible = True
		.navigate("http://s21.en.bitefight.gameforge.com/")

	While($ie.busy)
	WEnd

		$getHunt = _IE_Example("button")
		$hunt = _IEGetObjByName($getHunt,"Hunt")
		_IEAction($hunt, "click")

EndWith
Tried the code above, it wont even create / open Internet explorer =(

Tried another way too,

Element i need to click.

I've also found it as a image but how do i make it click a image? (the image works as a link but doesnt show a link in the code. :/ )
Dequalityy is offline  
Old 08/10/2016, 03:35   #2
 
elite*gold: 0
Join Date: Apr 2011
Posts: 363
Received Thanks: 167
if u want to click a button that call a defined function in js, it's more simple to inject javascript with your browser developer console (i prefer Chrome)

Make sure that u have selected top in Chrome's console or the script won't work


Code:
function doSth(){
//Bot logic here
doHunt(1) //this will call the function that Farm button does when is clicked.
}

var myInterval
start()//Starts the bot, to stop the bot print stop() in javascript console and hit enter...

function start(){
myInterval = setInterval(doSth(),100)
}

function stop(){
clearInterval(myInterval)
}
elmarcia is offline  
Reply




All times are GMT +1. The time now is 22:34.


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.