Sign in to follow this  
Followers 0
hefty

Search String

25 posts in this topic

#1 ·  Posted (edited)

Hi. I have a game called "Guild Wars", and I am attempting too make a bot that will search for creeps to kill based on their name. However I cannot find a way to search for a string on the screen in-game.

Thankyou for any help anyone can give.

Edited by hefty

Share this post


Link to post
Share on other sites



Hi. I have a game called "Guild Wars", and I am attempting too make a bot that will search for creeps to kill based on their name. However I cannot find a way to search for a string on the screen in-game.

Thankyou for any help anyone can give.

Is the text readable via AutoInfo.exe? If so try ControlGetText() if not, then you may have to create an OCR and use PixelCheckSum() for the letters.

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

Is the text readable via AutoInfo.exe? If so try ControlGetText() if not, then you may have to create an OCR and use PixelCheckSum() for the letters.

how do i create a ocr?

Share this post


Link to post
Share on other sites

Quite a bit of detail involved... type in OCR in the search enging and look in scripts and scraps when you do, and you'll find a few examples to maybe get an idea from.


[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

Quite a bit of detail involved... type in OCR in the search enging and look in scripts and scraps when you do, and you'll find a few examples to maybe get an idea from.

and how do i search for letters using pixelchecksum?

Share this post


Link to post
Share on other sites

and how do i search for letters using pixelchecksum?

Just do the search like I said (for OCR), they all use it.

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

Just do the search like I said (for OCR), they all use it.

i just looked and it is way too much trouble.

ohh well .

Edited by hefty

Share this post


Link to post
Share on other sites

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

Share this post


Link to post
Share on other sites

what i meant is ocr is too hard

Well, if you can't get the information with WinGetText()/ControlGetText() then you'll be left with no choice. Good Luck.

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

Would this work?

WinActivate ( "Guild Wars" )

sleep(800)

Func Kill()

;

Sleep(500)

$Name = WinGetText("Lvl 0 Plague Wormr")

;

If IsString($Name) Then

Sleep(500)

; A worm was found

Send("1")

Sleep(500)

Else ; No Worm FOund

EndIf

EndFunc

Share this post


Link to post
Share on other sites

WinGetText("Lvl 0 Plague Wormr")

is lvl 0 plague wormr the name of the window your looking for text in? or is that the type of person your trying to kill.

im a noob to autoit but as far as i know wingettext gets text inside of a window.

Share this post


Link to post
Share on other sites

Would this work?

WinActivate ( "Guild Wars" )

sleep(800)

Func Kill()

;

Sleep(500)

$Name = WinGetText("Lvl 0 Plague Wormr")

;

If IsString($Name) Then

Sleep(500)

; A worm was found

Send("1")

Sleep(500)

Else ; No Worm FOund

EndIf

EndFunc

No.

WinGetText("Lvl 0 Plague Wormr")

is lvl 0 plague wormr the name of the window your looking for text in? or is that the type of person your trying to kill.

im a noob to autoit but as far as i know wingettext gets text inside of a window.

Correct

#)

Share this post


Link to post
Share on other sites

#14 ·  Posted (edited)

Perhaps this will work?

WinActivate ( "Guild Wars" )

sleep(800)

Func Kill()

;

Sleep(500)

$Name = WinGetText("Lvl 0 Plague Worm")

;

If StringIsASCII ( $Name ) Then

Sleep(500)

; A worm was found

Send("1")

Sleep(500)

Else ; No Worm FOund

EndIf

Edited by hefty

Share this post


Link to post
Share on other sites

again i think the wingettext("lvl 0 plague worm") isnt going to do anything for you. if your playing guild wars i think it should be wingettext("Guild Wars", "").

Replace guild wars with whatever the window title is.

but i dont know if this will work since it is inside a game?

Share this post


Link to post
Share on other sites

again i think the wingettext("lvl 0 plague worm") isnt going to do anything for you. if your playing guild wars i think it should be wingettext("Guild Wars", "").

Replace guild wars with whatever the window title is.

but i dont know if this will work since it is inside a game?

Not sure about Guild Wars specifically, but in previous experiences with games, reading text from a game window doesn't happen. The text and graphics are drawn directly to the window, which means that any control-related function, or win-related function trying to get inside the game is not going to work. Ever.

Share this post


Link to post
Share on other sites

Not sure about Guild Wars specifically, but in previous experiences with games, reading text from a game window doesn't happen. The text and graphics are drawn directly to the window, which means that any control-related function, or win-related function trying to get inside the game is not going to work. Ever.

your right. it did not work.

me and my dad tryed everything.

So how would i use ocr with guild wars?

Share this post


Link to post
Share on other sites

your right. it did not work.

me and my dad tryed everything.

So how would i use ocr with guild wars?

It's not a matter of "using" one, you would have to make one, and I gave you the links to study theirs that they made. There is no manual on how to make one.

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

It's not a matter of "using" one, you would have to make one, and I gave you the links to study theirs that they made. There is no manual on how to make one.

Autoit cant find the controls used in my game.

So how do I find them myself?

Share this post


Link to post
Share on other sites

Autoit cant find the controls used in my game.

So how do I find them myself?

read this post:

http://www.autoitscript.com/forum/index.ph...ndpost&p=144675

then read the entire thread and remember not to ask for help in that forum... ask in this one "v 3Support"


[size="1"][font="Arial"].[u].[/u][/font][/size]

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0