Sign in to follow this  
Followers 0
Jefferds44

OCR Question

3 posts in this topic

Hi guys, here's what I'm trying to do.

I am creating a script that opens poker tables automatically so that I can play. The Full Tilt poker lobby that I want to automate is completely image based. I don't have access to the controls and I can't read from them. The Window Info tool gives me nothing in the control properties and the window itself comes up as class QWidget.

It looks like I'm going to have to use an OCR strategy.

My strategy is as follows;

- The poker lobby lists 18 rows each with a different table.

- I want to break down the lobby into 18 different images (1 per row).

- I will then scrape the text of each row

- Based on the scraped text, I will register the table or not depending on the info I get back.

What I would like to know is, are there any UDF's for auto-it that help me out with any of these? Is there an OCR collection of UDFs that allow me to break down the poker lobby into separate images and give me back the text?

Thanks for any help you guys may offer up!

Thanks,

Jeff

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Your going about it the wrong way. I have made scripts for Full Tilt and none of them consisted of OCR. Screen-scraping using pixel recognition on the other hand is a whole different story....But...they have gone completely graphical on everything in their client so I have a feeling your not going to get what you want done anytime soon (most likely not at all).

Edit: And reading your topics I'd say pretty much all of them are related to making this script for Full Tilt and most of them you've provided no code. You need to stop being so lazy and learn the AutoIt language before trying to make something like this and at the same time have everyone else do it for you. I've seen enough of this garbage on the 2+2 forums, don't bring it over here.

Edited by Hypertrophy

Share this post


Link to post
Share on other sites

What the heck are you talking about? I had a fully functioning auto-it script working for me before Full Tilt's graphical update. My script was registering tournaments for me and placing my windows fine. For all intents and purposes I learned auto-it myself and have read through the entire help file many times over.

Why the hate? I always read the help file and search the forums first before posting. I'm hitting a wall and that's why I'm calling out to the community here.

With respect to your post, why do you feel I'm going about it all wrong? The many scripts I've made for Full Tilt have also never consisted of using OCR. But things have changed. Now, I lay out my strategy for all to see and if you feel I'm not looking at this problem from the right angle, feel free to nudge me in the right direction. I'm not asking anyone to do the work for me, all I ask is for guidance and wisdom.

I don't generally provide code, because I'm just asking for general design philosophy. But if you must, here's a snippet of my script. It used to read through the lobby and pull the table information from each line. Now that it is completely graphical, I can't do it that way anymore. [Note: Don't try running it, there are a few other outside functions and variables; but you'll get the general idea]

Func GetPlayableTable($SlotNum) ;Checks lobby to get Table ID's that mach session/buy-in parameters

    Dim $FoundTable = False;
    Dim $LobbyItemCount; # of lines in lobby
    Dim $LobbyItem0Text; Table ID
    Dim $LobbyItem1Text; Game
    Dim $LobbyItem2Text; Type
    Dim $LobbyItem3Text; Buy-In
    Dim $LobbyItem4Text; Status
    Dim $LobbyItem5Text; Plrs
    Dim $Line; Line number in tournament list

    If $SlotTournamentID[$SlotNum] == -1 Then
        EnsureWinActive($LobbyhWnd)
        dbg("SlotTournamentID #" & $SlotNum & " == -1. Attempting to get playable table...")
        Dim $ListViewHandle = ControlGetHandle($FTPLobbyTitle, "", 520)
        $LobbyItemCount = ControlListView($FTPLobbyTitle, "", 520, "GetItemCount");
        dbg("Number of registering tournaments: " & $LobbyItemCount)

        For $Line = 0 To $LobbyItemCount - 1 Step +1
            $FoundTable = False
            ControlListView($FTPLobbyTitle, "", 520, "Select", $Line);
            dbg("Listing lobby fields")
            $LobbyItem0Text = ControlListView($FTPLobbyTitle, "", 520, "GetText", $Line, 0);
            dbg($LobbyItem0Text)
            $LobbyItem1Text = ControlListView($FTPLobbyTitle, "", 520, "GetText", $Line, 1);
            dbg($LobbyItem1Text)
            $LobbyItem2Text = ControlListView($FTPLobbyTitle, "", 520, "GetText", $Line, 2);
            dbg($LobbyItem2Text)
            $LobbyItem3Text = ControlListView($FTPLobbyTitle, "", 520, "GetText", $Line, 3);
            dbg($LobbyItem3Text)
            $LobbyItem4Text = ControlListView($FTPLobbyTitle, "", 520, "GetText", $Line, 4);
            dbg($LobbyItem4Text)
            $LobbyItem5Text = ControlListView($FTPLobbyTitle, "", 520, "GetText", $Line, 5);
            dbg($LobbyItem5Text)
            $RegTableSuccess = False
            If (Not CheckAlreadyRegistered($LobbyItem0Text) And ($LobbyItem1Text == $FTPGame) And ($LobbyItem2Text == $FTPType) And ($LobbyItem3Text == $FTPBuyIn) And ($LobbyItem4Text == $Status) And (CheckTableCapacity($LobbyItem5Text))) Then
                $FoundTable = True;
                dbg("Found new table #" & $SlotTournamentID[$SlotNum] & " at line " & $Line & ".")
                $SlotTournamentID[$SlotNum] = $LobbyItem0Text;
                _GUICtrlListView_SetItemSelected($ListViewHandle, $Line, True, True)
                EnsureWinActive($LobbyhWnd)
                ControlClick($FTPLobbyTitle, "", 1031);
                RegisterTable($SlotTournamentID[$SlotNum])
                If $RegTableSuccess == True Then
                    $SlotRegistration[$SlotNum] = 1
                    ExitLoop
                Else
                    dbg("$RegTableSuccess Error")
                EndIf
            EndIf
            ControlListView($FTPLobbyTitle, "", 520, "DeSelect", $Line);
        Next
    EndIf
EndFunc   ;==>GetPlayableTable

Your going about it the wrong way. I have made scripts for Full Tilt and none of them consisted of OCR. Screen-scraping using pixel recognition on the other hand is a whole different story....But...they have gone completely graphical on everything in their client so I have a feeling your not going to get what you want done anytime soon (most likely not at all).

Edit: And reading your topics I'd say pretty much all of them are related to making this script for Full Tilt and most of them you've provided no code. You need to stop being so lazy and learn the AutoIt language before trying to make something like this and at the same time have everyone else do it for you. I've seen enough of this garbage on the 2+2 forums, don't bring it over here.

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