Jump to content

Is there a number detection function?


 Share

Recommended Posts

Can AutoIt search for a number(image) and then translate it to a number(text)?

I want to convert small data table and auto-enter them into an excell document.

For an example:

1. Search for an image" 6fH0d.png "(this cannot be hilighted as text)

2. Know this image is "14"

3. Enter 14 onto microsoft excell

the 14 is taken from a chart where the numbers are not hilightable. ex:6fHrS.png

Is there some auto number detection function for autoit?

If not, what are some ways where I can approach this situation?

What I have thought of is search for 1 2 3 4 5 6 7, ... , 99 and set each image manually. So it image searches from 1-99 until there is a match, then it will input "14"

 

I am kind of new to autoit. This is very important and I am willing to pay (paypal) if someone is able to talk to me to meet my needs. *I hope offering money is not against the terms (which I read)"

Edited by likevvii
Link to comment
Share on other sites

I haven't tried this but I think it might be what you need.  Just give it your best shot and then come back and ask questions.

'?do=embed' frameborder='0' data-embedContent>>

Link to comment
Share on other sites

I haven't tried this but I think it might be what you need.  Just give it your best shot and then come back and ask questions.

'?do=embed' frameborder='0' data-embedContent>>

I am very sorry, but I just don't know how to implement this into my script. Thank you for showing me that this does exsist! I googled "how to use Optical character recognition in autoit" But there are too many functions and symbols to understand.

If you could help me implement this into my current script, that would be so awesome for my dad.

I currently want to "imagesearch", then OCR the value on the right (odds), Imagesearch the (*x&), then input the value onto the excell document (rates)

Basically converting data on a table to excell.

6fVaQ.png

So far, I have only figured out how to imagesearch and do simple clicks, from youtube and guides

#include <ImageSearch.au3>

HotKeySet("S", "Start")

$X = 0
$Y = 0

Func Start()
   $Search = _ImageSearch('1A.bmp', 0, $X, $Y, 0)
   If $Search = 1 Then
      $Search = _ImageSearch('99.bmp', 0, $X, $Y, 0)
         If $Search = 1 Then
            $Search = _ImageSearch('*x&.bmp', 0, $X, $Y, 0)
               If $Search = 1 Then
                  MouseClick($X, $Y, 0)
         EndIf
      EndIf
   EndIf
EndFunc

While 1
   sleep(100)
Wend

My on the second image search "$Search = _ImageSearch('*x&.bmp', 0, $X, $Y, 0)" (soon to be OCR if possible), I dont know how to search a specific region. Since I dont want to do anything with numbers from 6fVzp.png, how do I only focus the region horizontal to me?

 

Then after I image search the (*x&), I want to use it as a refrence point, how would I set the coordinates to the first Box to input my data? Just entering some (x,y) in MouseClick would just use top left corner of my screen as the reference point, but I want to use (*x&) as my ref point. ( my dad isnt good with computers at all, so I just want it make it as easy as possible for him)

): sorry for so much begging.I am new to AutoIt, and everything is very complicated for me.

If you dont understand what I am talking about, what I am doing this for, or anything else, just tell me and I will try my best to explain it!

Edited by likevvii
Link to comment
Share on other sites

This Horse racing. This is where the chart is: http://www.twinspires.com/tstv-lite

If you try it, you will see that numbers are produced with adobe flashplayer. (not able to copy paste anything)

If possible can you please teach me how to do other stuff? Since you never used OCR before and I don't want you to waste your time learning it, if you are never going to use it.

I found a different site that IS ABLE TO COPY AND PASTE my values so I don;t have to use OCR anymore!

-Image search on a specific area based on a previous image search.

Example:
First I image search: 6glBk.png from:6glzW.png

Then After I found: 6glBk.png, I want to copy (and paste later) the number directly to the right of the: 6glBk.png. (for this case: 6glSh.png, it is the value "1")      another example: ( 6gm0D.png, is the value: "8/5")

I want to copy directly right of the 6glBk.png, because that value is linked directly to the 6glBk.png.

so right now, my code is:

#include <ImageSearch.au3>

HotKeySet("S", "Start")

$X = 0
$Y = 0

Func Start()
   $Search = _ImageSearch('1A.bmp', 0, $X, $Y, 0)
   If $Search = 1 Then
         If $Search = 1 Then
            MouseClick( "left", $X, $Y, 3, 5) ;So what do i do for the x/y coordinates?
            MouseClick( "left", $X, $Y, 3, 5)
            MouseClick( "left", $X, $Y, 3, 5)
            Sleep( 10 )
            Send("{ctrl V}")
   EndIf
EndFunc

While 1
   sleep(100)
Wend

So right now my code searches for the: 6glBk.png , then proceeds to triple click, and then press ctrl+V.

My problem is the MouseClick's  X,Y  coordinates. How do i set the mouse click coordinates to move (50 pixels to the right, and 5 pixels down. BASED ON WHERE THE 6glBk.png is.)

I was thinking (MouseClick( "left", $X+50, $Y-5, 3, 5)), but that didnt work.

Sorry if I am not clear enough, I really dont know how to present my situation well.

Edited by likevvii
Link to comment
Share on other sites

Well, the rules may not allow for the discussion of this because it's related to game playing.  Sorry.  Have to wait and see what a mod/mvp/glorious leader says about it.

Link to comment
Share on other sites

I think OCR is way beyond what you want to or should even try to do.   Trying to target a portion of the screen and capture it , then OCR it would be a frustrating and futile effort.

Maybe try reverse engineering the swf code of the horse racing app.  There are swf decompilers out there.  You might be able to glean something about the values from swf code variables.

Or use a mem hack tool dll that you could use with autoit to search for the values in the app/browser that's running the horse racing swf.

Link to comment
Share on other sites

Could you use the odds from this page instead?  They are text and can be copy/pasted.  Use cURL or AutoIT to read the data.

https://www.tvg.com/horse-race-results

thats after the race, so there wouldnt be much use for the data anymore. But thanks for mentioning about the swf codes, i will check those out.

is anyone able to teach me the command for image search in a specific area?

Link to comment
Share on other sites

  • Moderators

Hi,

I regard this as a real edge case as regards the "game interaction" rule. The participant is not in any way interacting with the "game" - the horses do not run faster or slower because of the betting (or at least I hope not ;)) - and the script seems to merely read data from a screen. So I am happy for the thread to remain open for the time being. :)

However, as the possible "game" problem was raised by an earlier poster I am somewhat disappointed that no-one thought to report the thread so that the Mods were aware of it. We do try and look in on most things, but it is not always obvious that we need to get involved. So please, if there is a doubt of any kind about a thread/post just report it and we will come and take a look. ;)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

  • Moderators

jaberwocky6669,

If several people report the same post it is all amalgamated by the forum software into a single report, so do not worry about swamping us. ;)

And now we return to our normal programming. :)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

Ok likevvii.

 

I was thinking (MouseClick( "left", $X+50, $Y-5, 3, 5)), but that didnt work.

 

50 pixels might be too far or it might not be enough.  I think it might be good to download a pixel ruler such as the one found here: http://www.soft.tahionic.com/download-ruler/index.html.  Make sure to get that one because there are some stolen versions floating around.

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...