Jump to content

Search String


 Share

Recommended Posts

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
Link to comment
Share on other sites

  • Moderators

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.

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.

Link to comment
Share on other sites

  • Moderators

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.

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.

Link to comment
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?

Link to comment
Share on other sites

  • Moderators

and how do i search for letters using pixelchecksum?

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

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.

Link to comment
Share on other sites

  • Moderators

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.

Link to comment
Share on other sites

Link to comment
Share on other sites

  • Moderators

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.

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.

Link to comment
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

Link to comment
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.

Link to comment
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

#)

Link to comment
Share on other sites

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
Link to comment
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?

Link to comment
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.

Link to comment
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?

Link to comment
Share on other sites

  • Moderators

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.

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.

Link to comment
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?

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...