Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Panic..... ipoker have done an update..... any help appreciated with AHK?

  • 21-03-2008 2:51pm
    #1
    Registered Users, Registered Users 2 Posts: 3,201 ✭✭✭


    My bet pot script has stopped working on Cardoza Poker since the last update... any idea what has changed or acan anyone fix it for me? Modest fee offered?

    I'm really lost without it.....


Comments

  • Registered Users, Registered Users 2 Posts: 10,894 ✭✭✭✭phantom_lord




  • Registered Users, Registered Users 2 Posts: 2,513 ✭✭✭RoadSweeper


    I think the problem is that in the upper left it used to say:

    Quote:
    Current hand:
    Previous hand:
    Total pot: a
    Rake:
    They have removed the "previous hand" line. So now when the script looks for a to run its calculations, it's looking ~12 pixels too low. The y coordinate is probably ~59 but should now be ~47 (for the miniview anyway). I don't have time to look at it in any more detail right now so I'm not totally sure if that's the (only) problem.

    Also, pretty sure the script above is the exact one I'm using, so maybe Carlos just haven't done this update yet? I know Chili and NoIQ have.


    This dude hit the nail on head.


  • Registered Users, Registered Users 2 Posts: 1,880 ✭✭✭MuddyDog


    what exactly where the changes made to ipoker today? The last hand was taken out a few days ago and now there was another update today. Any drastic stuff?


  • Registered Users, Registered Users 2 Posts: 2,953 ✭✭✭dvdfan


    Yeah im missing it too:( Not sure which is more shocking though, having to deal with auto reloading and bet sizing myself or ipoker actually doing an update.


  • Registered Users, Registered Users 2 Posts: 6,854 ✭✭✭zuutroy


    This dude hit the nail on head.

    so how does I fix it?


  • Advertisement
  • Registered Users, Registered Users 2 Posts: 2,513 ✭✭✭RoadSweeper


    Play the waiting game and watch the thread P_L posted.


  • Registered Users, Registered Users 2 Posts: 4,039 ✭✭✭Theresalwaysone


    The cards in mini view are bigger too.


  • Closed Accounts Posts: 834 ✭✭✭peeko


    so i shouldn't open and close ipoker then!?


  • Registered Users, Registered Users 2 Posts: 2,953 ✭✭✭dvdfan


    Ill post something on scriptlance.com and see if someone is willing to edit the script, these guys especially the ones from India would do this for fairly cheap, anyone thats interested let me know for what skin you want it compatible with and ill see what offers i get. Of course im sure someone on 2+2 will figure it out soon but i dont mind paying $20-30 or so and possibly less as its such a pain working without it. Anyway ill post it up and see what kind of prices i get


  • Registered Users, Registered Users 2 Posts: 2,953 ✭✭✭dvdfan


    Also on Carlos the Total Pot amount is shown on top of the words Total and obscures the view to unreadable


  • Advertisement
  • Registered Users, Registered Users 2 Posts: 2,513 ✭✭✭RoadSweeper


    dvdfan wrote: »
    Also on Carlos the Total Pot amount is shown on top of the words Total and obscures the view to unreadable

    I noticed this, I'd say they have another update to do. Its all messed up.


  • Registered Users, Registered Users 2 Posts: 2,953 ✭✭✭dvdfan


    Not getting any responses on scriptlance but if someone comes across someone who can edit AHK scripts let me know and ill chip in if someone dosent figure it out in the meantime.


  • Registered Users, Registered Users 2 Posts: 2,953 ✭✭✭dvdfan


    Anyone ever used this or heard anything on it, have to be careful downloading the unknown, its been mentioned lately on 2+2 and nobody knew anything about it?

    http://n9monk.narod.ru/betpot/eng.html


  • Registered Users, Registered Users 2 Posts: 3,201 ✭✭✭Macspower


    also willing to chip in for a fix....


  • Registered Users, Registered Users 2 Posts: 2,513 ✭✭✭RoadSweeper


    You try it yt DVD? Looks pretty sweet!


  • Closed Accounts Posts: 1,019 ✭✭✭HoLLLLLaments


    so whats the verdict on this?


  • Registered Users, Registered Users 2 Posts: 2,953 ✭✭✭dvdfan


    You try it yt DVD? Looks pretty sweet!

    I havent tried the russian one yet, obviously suspicious that he posted it on 2+2 but never replied since and why is it freeware, looks pretty cool allright but im just afraid ill be downloading some virus that will give him access to my pc or something. I guess ill just have to wait till someone else on 2+2 checks it out first


  • Registered Users, Registered Users 2 Posts: 2,513 ✭✭✭RoadSweeper


    I installed it and it seems not great. Didnt realy get it, so un installed it.


  • Registered Users, Registered Users 2 Posts: 2,953 ✭✭✭dvdfan


    I installed it and it seems not great. Didnt realy get it, so un installed it.


    Id do a few virus scans to be safe, just dosent add up, Free software that posted on a poker forum by someone who then never responds after original post, 1 page website with cool looking pictures but no actual details about what it does, no contact details or forum etc

    Could easily be trying to target poker players with a virus that installs with the software with anything from a keylogger to a screen grabber.


  • Registered Users, Registered Users 2 Posts: 2,513 ✭✭✭RoadSweeper


    Will scan now nd let ye know!


  • Advertisement
  • Registered Users, Registered Users 2 Posts: 2,513 ✭✭✭RoadSweeper




  • Registered Users, Registered Users 2 Posts: 2,953 ✭✭✭dvdfan


    Where did you get that RS? is there any instructions i can only get it half working


  • Registered Users, Registered Users 2 Posts: 2,513 ✭✭✭RoadSweeper


    You need 4 mouse buttons to bet pot.

    It was posted on 2+2 but i cant find thread. Its called titan little helper.


  • Registered Users, Registered Users 2 Posts: 2,953 ✭✭✭dvdfan


    Damn, ill have to paint on the 4th button as ive only 3, Its very buggy at the moment but well worth keeping an eye on especially with the auto reload functions.


  • Registered Users, Registered Users 2 Posts: 2,513 ✭✭✭RoadSweeper


    yea same, only 3. The scroll works however.


  • Registered Users, Registered Users 2 Posts: 2,513 ✭✭✭RoadSweeper


    ; ========================================
    ; NOTES ON THE UPDATE:
    ; ----------------------------------------
    ;
    ; THIS VERSION HASN'T BEEN TESTED!
    ;
    ; I have made some modifications to the 
    ; GetPotLocation methode (line741) and the 
    ; GetPotTextColor methode (line 389).
    ;
    ; After modifying butcha's code to make it 
    ; read the potsize correctly after Ipoker 
    ; changed where the "Total pot" is displayed 
    ; on the miniview tables I realized that there 
    ; were missing a }. I'm fairly certain that 
    ; I didn't delete it from butcha's code, but 
    ; on the other hand it seems very weird that 
    ; something like that didn't mess things 
    ; up before. Maybe that was what prevented 
    ; myself and others from modifying the script 
    ; earlier (and the fact that Ibolide untill 
    ; recently would occcationally write text on 
    ; top of where the "Total pot" is displayed.
    ; - Sigurd
    ; ========================================
    ;
    ; ========================================
    ; AHK Bet Pot Script for iPoker by butcha
    ; ----------------------------------------
    ; Includes mouse wheel functionality
    ; Supports both full view and mini view
    ; ----------------------------------------
    ; Latest version is available at:
    ; http://hem.passagen.se/perg/iPokerBetPot.txt
    ; ========================================
    ;
    ; INSTRUCTIONS:
    ; ----------------------------------------
    ; 1. Check the 'User Settings'-section below,
    ;    so that all 3 options (WheelUnit,
    ;    WhiteBetBox and ButtonsOnLeft) are ok.
    ;    (Defaults should be working for most.)
    ; 2. Rename the script file so that it has the
    ;    file extension .ahk.
    ; 3. Start the script.
    ; 4. Right click the mouse button anywhere on a
    ;    iPoker table, where it's your turn to act,
    ;    to set the betting box to a pot bet.
    ; 5. Scroll the mouse wheel up or down to change
    ;    the betting amount.
    ;
    ;
    ; CONFIRMED SUPPORTED SKINS:
    ; ----------------------------------------
    ; - CD Poker
    ; - Expekt Poker
    ; - Noble Poker
    ; - Paddy Power Poker
    ; - Titan Poker
    ; Feel free to add to this list by contacting me.
    ;
    ;
    ; HOW DOES THE SCRIPT WORK?
    ; ----------------------------------------
    ; The short version is that it reads the pot size
    ; from the text on the table and it reads the call-
    ; and raise sizes from the text on the Call- and
    ; Raise-button respectively.
    ; If you are interested in a more technical 
    ; explanation go to line 520 in this script.
    ; 
    ;
    ; TROUBLESHOOTING:
    ; ----------------------------------------
    ; Since the script reads the text off the screen
    ; it is extremely important that the table you
    ; want to act on has both the pot size-text and
    ; the Call- and Raise-buttons fully visible.
    ; This includes overlay statistics programs like
    ; PokerAce Hud and GameTime+.
    ;
    ; The next thing to note is that I haven't tested
    ; this script with every iPoker skin out there.
    ; It should work with all skins that writes out
    ; the pot size, call size and raise size with one
    ; color only (although possibly a different one for
    ; each), no anti-aliasing and with the font
    ; Tahoma 11 pts.
    ; It also works on skins that use Tahoma, 12 pts
    ; bold to write out the call or raise size on the
    ; buttons in full view, which I believe most skins
    ; do.
    ;
    ; If you have changed the appearance of your iPoker
    ; table by modding the graphics-files the script
    ; should still be in effect, but this is not 100%.
    ;
    ; If you still have no success the best thing you
    ; can do is take a screenshot of the table in a
    ; situation where you would expect it to work.
    ; Save the image in a format without compression,
    ; like BMP or PNG. Then upload the screenshot 
    ; somewhere and give me the link. I will not accept
    ; file transfers over Msn, but you can contact me
    ; for help.
    ;
    ; One last note. If the iPoker client ever gets
    ; redesigned, this script will stop working.
    ;
    ;
    ; KNOWN BUGS:
    ; ----------------------------------------
    ; - If you move the mouse wheel very fast
    ;   there might be strange behavior
    ;
    ;
    ; CONTACT ME:
    ; ----------------------------------------
    ; 2+2 Forums Name: butcha
    ; All comments are welcome.
    ;
    ;
    ; ----------------------------------------
    ; ========================================
    ;
    ;
    ; ====================
    ; SCRIPT SETTINGS 1
    ; ====================
    #NoEnv
    #Persistent
    #SingleInstance, Force
    ; ====================
    ; USER SETTINGS
    ; ====================
    ; Mouse Wheel Unit
    ; --------------------
    ; The amount your bet changes up or down
    ; when you scroll the wheel. This value
    ; can be either the words sb or bb, or a 
    ; number, e.g. 0.50 or 10
    WheelUnit = bb
    ; --------------------
    ; White Betting Box
    ; --------------------
    ; Set this value to 1 if the background of the
    ; box where you type in your bets is white.
    ; Change this to 0 if the background is NOT white.
    ; If you don't have a white background the script
    ; may send the betting amount to the chat-box if
    ; you act out of turn, no matter of this setting.
    ; (Note 1: White means the exact color 0xFFFFFF.)
    ; (Note 2: This setting has no effect if the area
    ; behind the betting box is always white.)
    WhiteBetBox := 1
    ; --------------------
    ; Buttons On Left
    ; --------------------
    ; This option is only for those of you playing
    ; at a skin where the Action-buttons (Fold, Call,
    ; Raise) and the box where you type in your bets
    ; is more to the left than most skins.
    ; If you do, set this option to 1.
    ; The only skin I know so far that this applies
    ; to is BetFred Poker.
    ; The default is 0 (zero).
    ; This setting ONLY effects full view.
    ButtonsOnLeft := 1
    ; ====================
    ; ERROR CHECK USER SETTINGS
    ; ====================
    If (WheelUnit != "sb" AND WheelUnit != "bb")
      If WheelUnit Is Not Number
      {
        MsgBox, 16, Configuration error,
          (LTrim
          Check the 'User settings'-section at the top of the script.
          The variable WheelUnit must be either the words sb or bb or a number.
          )
        ExitApp
      }
    ; --------------------
    If (WhiteBetBox != 0 AND WhiteBetBox != 1)
    {
      MsgBox, 16, Configuration error,
        (LTrim
        Check the 'User settings'-section at the top of the script.
        The variable WhiteBetBox must be 1 for a white betting
        box background and 0 for a non-white betting box background.
        )
      ExitApp
    }
    ; --------------------
    If (ButtonsOnLeft != 0 AND ButtonsOnLeft != 1)
    {
      MsgBox, 16, Configuration error,
        (LTrim
        Check the 'User settings'-section at the top of the script.
        The variable ButtonsOnLeft must be 0 for most skins and 1
        ONLY for those skins that have Action buttons more to the
        left, like for example BetFred Poker.
        )
      ExitApp
    }
    ; --------------------
    ; ====================
    ; SCRIPT SETTINGS 2
    ; ====================
    SetBatchLines, -1
    SetKeyDelay, -1
    SetMouseDelay, -1
    SetWinDelay, -1
    SetTitleMatchMode, 2
    SendMode, Input
    CoordMode, Mouse, Screen
    CoordMode, Pixel, Screen
    ; ====================
    ; GLOBAL VARIABLES
    ; ====================
    SysGet, Sb, 7
    SysGet, Sc, 4
    TableSize := 0  
    PotTextColor := 0x0
    CallTextColor := 0x0
    RaiseTextColor := 0x0 
    MouseX := 0
    MouseY := 0 
    BetSize := 0
    ButtonOffset := -18*ButtonsOnLeft
    ; ====================
    Return
    ; HOT KEYS
    ; ====================
    ; Right Mouse Button
    ; --------------------
    ~RButton::
      BetPot()
    Return
    ; --------------------
    ; Mouse Wheel Up
    ; --------------------
    ~WheelUp::
      ChangeBet(1)
    Return
    ; --------------------
    ; Mouse Wheel Down
    ; --------------------
    ~WheelDown::
      ChangeBet(-1)
    Return
    ; --------------------
    ; ====================
    ; MAIN FUNCTIONS
    ; ====================
    ; Bet Pot
    ; --------------------
    ; Sets the betting box to a pot size bet.
    BetPot()
    {
      global
      Id := GetTableId()
      If (NOT Id)
        Return
        
      TableSize := GetTableSize(Id)
      If (NOT TableSize)
        Return
        
      If (WhiteBetBox AND NOT WhiteBetBoxVisible())
        Return
      
      PotTextColor := GetPotTextColor() 
      PotLocationFound := GetPotLocation()
      If (NOT PotLocationFound)
        Return
    
      PotSize := GetPotSize()
      If (NOT PotSize)
        Return
    
      CallTextColor := GetCallTextColor()
      
      CallLocationFound := GetCallLocation()
      If (CallLocationFound)
        CallSize := GetCallSize()
      Else
        CallSize := 0
                    
      BetSize := FormatBet(PotSize + 2*CallSize)
          
      SaveMousePos()
      SetBet(BetSize)
      RestoreMousePos()
    }
    ; --------------------
    ; Change Bet
    ; --------------------
    ; Changes the bet by the parameter unit multiplied
    ; by WheelUnit, as specified at the top of the script
    ChangeBet(unit)
    {
      global
      Id := GetTableId()
      If (NOT Id)
        Return
        
      TableSize := GetTableSize(Id)
      If (NOT TableSize)
        Return
        
      If (WhiteBetBox AND NOT WhiteBetBoxVisible())
        Return
      
      RaiseTextColor := GetRaiseTextColor()
      
      RaiseLocationFound := GetRaiseLocation()
      If (NOT RaiseLocationFound)
        Return
        
      RaiseSize := GetRaiseSize()
      If (NOT RaiseSize)
        Return
      
        
      If WheelUnit Is Number
      {
        BetSize := FormatBet(RaiseSize + unit*WheelUnit)
      } Else
      {
        Blind := GetBlind(Id,WheelUnit)
        BetSize := FormatBet(RaiseSize + unit*Blind)
      }
      
      SaveMousePos()
      SetBet(BetSize) 
      RestoreMousePos()
    }
    ; --------------------
    ; ====================
    ; HELP FUNCTIONS
    ; ====================
    ; Get Table Id
    ; --------------------
    ; Returns the unique ID number of the window under
    ; the mouse if it is a iPoker table. If it is not
    ; the return value is zero.
    GetTableId()
    {
      MouseGetPos, ,,id
      WinGet, id, ID, - ahk_id %id% ahk_class PTIODEVICE
      Return id
    }
    ; --------------------
    ; Get Table Size
    ; --------------------
    ; Returns the position and size of a iPoker table.
    ; The size can take on one of three values, 1 for
    ; a full view table, 2 for a mini view table and
    ; 0 if the table size could not be determined.
    ; The parameter is the unique ID number of a table-
    ; window.
    GetTableSize(id)
    { 
      global Vx,Vy,Sb,Sc
      WinGetPos, Vx,Vy,Width,Height, ahk_id %id%
      Vx += Sb
      Vy += Sb+Sc
      Width -= (2*Sb)
      Height -= (2*Sb+Sc)
      
      If Width Between 798 And 802
        If Height Between 598 And 602
          Return 1
      
      If Width Between 510 And 514
        If Height Between 322 And 326
          Return 2
                
      Return 0
    }
    ; --------------------
    ; White Bet Box Visible
    ; --------------------
    ; Self-explanatory.
    ; Returns True if a White Betting Box is visible,
    ; otherwise it returns False.
    WhiteBetBoxVisible()
    {
      global TableSize,Vx,Vy
      If (TableSize = 1)
      {
        PixelSearch, ,,Vx+557,Vy+462,Vx+601,Vy+472, 0xFFFFFF, 0, RGB
        If (ErrorLevel = 0)
          Return True
        Else
          Return False
      }
      If (TableSize = 2)
      {
        PixelSearch, ,,Vx+401,Vy+266,Vx+436,Vy+272, 0xFFFFFF, 0, RGB
        If (ErrorLevel = 0)
          Return True
        Else
          Return False    
      }
      Return False
    }
    ; --------------------
    ; Get Pot Text Color
    ; --------------------
    ; Self-explanatory.
    GetPotTextColor()
    {
      global
      If (TableSize = 1)
      {
        Return % GetOddColor(Vx+359,Vy+131,40,8)
      }
      If (TableSize = 2)
      {
        Return % GetOddColor(Vx+51,Vy+16,24,12)
    	;Replaced Vy+28 with Vy+16 after Ipoker update
      }
      Return 0
    }
    ; --------------------
    ; Get Call Text Color
    ; --------------------
    ; Self-explanatory.
    GetCallTextColor()
    {
      global
      If (TableSize = 1)
      {
        Return % GetOddColor(Vx+414+ButtonOffset,Vy+513,24,12)
      }
      If (TableSize = 2)
      {
        Return % GetOddColor(Vx+296,Vy+293,24,12)
      }
      Return 0
    }
    ; --------------------
    ; Get Raise Text Color
    ; --------------------
    ; Self-explanatory.
    GetRaiseTextColor()
    {
      global
      If (TableSize = 1)
      {
        Return % GetOddColor(Vx+541+ButtonOffset,Vy+513,24,12)
      }
      If (TableSize = 2)
      {
        Return % GetOddColor(Vx+386,Vy+293,24,10)
      }
      Return 0
    }
    ; --------------------
    ; Get Pot Size
    ; --------------------
    ; Self-explanatory.
    GetPotSize()
    { 
      global Px,Py,Pw,Ph,PotTextColor
      If (Ph = 10)
      {
        GetTextMatrix("st",Px,Py,Pw,Ph,PotTextColor)
        Return % ParseSmallTextMatrix()
      }
      Return 0
    }
    ; --------------------
    ; Get Call Size
    ; --------------------
    ; Self-explanatory.
    GetCallSize()
    {
      global Cx,Cy,Cw,Ch,CallTextColor
      If (Ch = 11)
      {
        GetTextMatrix("lt",Cx,Cy,Cw,Ch,CallTextColor)
        Return % ParseLargeTextMatrix()
      } Else If (Ch = 10)
      {
        GetTextMatrix("st",Cx,Cy,Cw,Ch,CallTextColor)
        Return % ParseSmallTextMatrix()
      }
      Return 0
    }
    ; --------------------
    ; Get Raise Size
    ; --------------------
    ; Self-explanatory.
    GetRaiseSize()
    {
      global Rx,Ry,Rw,Rh,RaiseTextColor
      If (Rh = 11)
      {
        GetTextMatrix("lt",Rx,Ry,Rw,Rh,RaiseTextColor)
        Return % ParseLargeTextMatrix()
      } Else If (Rh = 10)
      {
        GetTextMatrix("st",Rx,Ry,Rw,Rh,RaiseTextColor)
        Return % ParseSmallTextMatrix()
      }
      Return 0
    }
    ; --------------------
    ; Get Blind
    ; --------------------
    ; Returns the big or small blind.
    ; The type parameter can be "bb" or "sb".
    GetBlind(id,type)
    {
      WinGetTitle, title, ahk_id %id%
      If InStr(title, "/$") {
        StringGetPos, s1, title, $
        StringGetPos, s2, title, $,, s1+1
        StringGetPos, s3, title, %A_Space%,, s2
        If (s3 = -1) {
          StringLen, s3, title
        }
        StringMid, sb, title, s1+2,s2-s1-2
        StringMid, bb, title, s2+2,s3-s2-1
      } Else {
        StringLen, len, title
        StringGetPos, s1, title, /
        StringGetPos, s2, title, %A_Space%, R, len-s1
        StringGetPos, s3, title, %A_Space%,, s1
        If (s3 = -1) {
          s3 := len
        }
        StringMid, sb, title, s2+2,s1-s2-1
        StringMid, bb, title, s1+2,s3-s1-1
      }
      StringReplace, sb, sb, `,, 
      StringReplace, bb, bb, `,, 
      
      val := %type%
      If val Is Not Number
      	Return 0
      	
      Return val
    }
    ; --------------------
    ; Format Bet
    ; --------------------
    ; Returns 0 if the parameter is less than 0,
    ; otherwise it formats the input so that it has
    ; 2 decimals if it is a floating point.
    ; Integers are not altered.
    FormatBet(bet)
    {
      If (bet < 0)
        Return 0
        
      If bet Is Float
      {
        OldFormat := A_FormatFloat
        SetFormat, Float, 0.2
        bet += 0.0
        SetFormat, Float, %OldFormat%
      }
      Return bet
    }
    ; --------------------
    ; Set Bet
    ; --------------------
    ; Sets the betting box at the iPoker table
    ; to be the specified parameter.
    SetBet(bet)
    {
      global TableSize,Vx,Vy,ButtonOffset
      If (TableSize = 1)
        MouseMove, Vx+597+ButtonOffset,Vy+472
      Else If (TableSize = 2)
        MouseMove, Vx+432,Vy+270
      Else
        Return
      
      Click, Left 2
      Send, %bet%
    }
    ; --------------------
    ; Save Mouse Position
    ; --------------------
    SaveMousePos()
    {
      global MouseX,MouseY
      MouseGetPos, MouseX,MouseY
    }
    ; --------------------
    ; Restore Mouse Position
    ; --------------------
    RestoreMousePos()
    {
      global MouseX,MouseY
      MouseMove, MouseX,MouseY
    }
    ; --------------------
    ; ====================
    ; COLOR & PIXEL FUNCTIONS
    ; ====================
    ; Here follows a more detailed explanation of how this script works. I have chosen to write
    ; this section mostly because I am more interested in the technical aspects of this script
    ; than its functionality. Also, if someone out there tries to modify this script it will
    ; be a lot easier if I provide comments here.
    ;
    ; Basically what this script does is read the color of each pixel in a specific area and
    ; match the result to a known color, thus extracting only wanted pixels.
    ; These pixels can then be matched to a known pattern to produce numbers.
    ;
    ; STEP 1:
    ; Identify the color of the text.
    ; This is done by the help of the GetOddColor-method. What this method does is extract
    ; the color in a specified area, which differs the MOST from the average color in that
    ; area. If the area only consist of 2 colors it will yield the one with the least amount
    ; of pixels.
    ;
    ; STEP 2:
    ; Locate the pot-, call- and/or raise-text on screen.
    ; Here we use the GetColorBounds-method. This method gives us the bounding rectangle of
    ; a specific color within a specific area. In other words, it gives us the smallest
    ; possible rectangle that contains ALL the pixels of the input-color within the input-area.
    ;
    ; STEP 3:
    ; Retrieve the pot/call/raise text
    ; This is done in two steps:
    ; Step 3.A) Read the pixel color of every pixel within the area from Step 2.
    ;   Getting the pixel information is a piece of cake. Storing it in a way that makes sense
    ;   is somewhat harder. What I have chosen to do is to store each pixel that corresponds to
    ;   my text color as a 1 and each pixel that doesn't as a 0.
    ;   I store the information in a numbered variable for each pixel column in the area.
    ;   This variable is made to 0 before start and then I use bitwise-or to change the
    ;   corresponding bit in the variable to a 1.
    ;   The method GetTextMatrix is used for this step.
    ; Step 3.B) Transform this pixel information into numbers
    ;   This is the step that probably makes the least sense when looking at the code, but once
    ;   you know what bits are and how they are used it's pretty easy.
    ;   From the last step we have all the information needed stored as arrays of 1's and 0's,
    ;   but how? Well, the information is really not interpreted as an array of 1's and 0's,
    ;   but instead as an integer. If you are familiar with computer arithmetic you know that!
    ;   We can then simply figure out what value each column must take to match a certain number
    ;   and Tada!, we have our number!
    ;   Let's take the number 4 as an example:
    ;   Here is how it is stored in step 3.A (assuming Tahoma 11pts):
    ;       Column 1:   00011000
    ;       Column 2:   00101000
    ;       Column 3:   01001000
    ;       Column 4:   11111111
    ;       Column 5:   00001000
    ;   If this makes no sense, let's turn it, flip it and change the 1's and 0's to something pretty:
    ;       Column:   54321
    ;                 ---M-
    ;                 --MM-
    ;                 -M-M-
    ;                 M--M-
    ;                 MMMMM
    ;                 ---M-
    ;                 ---M-
    ;   It's a freaking four!!
    ;   If we now go back to the columns we note that each column is a binary number. Some simple
    ;   binary arithmetic gives us:
    ;       00011000 = 24,
    ;       00101000 = 40,
    ;       01001000 = 72,
    ;       11111111 = 255,
    ;       00001000 = 8
    ;   And these are the numbers we use to match the columns in the ParseSmallText.
    ;   The ParseLargeText-method works exactly the same, but for use with Tahoma, 12pts bold.
    ;
    GetOddColor(X,Y,Width,Height)
    {
      odd_color := 0
      colors := ""
      reds := 0x0
      greens := 0x0
      blues := 0x0
      count := 0
      Loop, %Width%
      {
        sx := X+A_Index-1
        Loop, %Height%
        {
          sy := Y+A_Index-1
          PixelGetColor, px_color, sx,sy, RGB
          
          If (NOT InStr(colors,px_color))
          {
            px_r := SubStr(px_color, 1, 4)
            px_g := "0x" . SubStr(px_color, 5, 2)
            px_b := "0x" . SubStr(px_color, 7, 2)
              
            reds += px_r
            greens += px_g
            blues += px_b
            
            colors := colors . "`n" . px_color
            count++
          }
          c%px_color%++
        }
      }
      red_avg := reds / count
      green_avg := greens / count
      blue_avg := blues / count   
        
      StringTrimLeft, colors, colors, 1
      
      If (StrLen(colors) < 20)
      {
        min_px_count := 99999
        Loop, Parse, colors, `n
        {
          If (A_LoopField != "")
          {
            If (c%A_LoopField% < min_px_count)
            {
              min_px_count := c%A_LoopField%
              odd_color := A_LoopField
            }
          }
        }
        Return odd_color
      }
      
      max_variation := 0
            
      Loop, Parse, colors, `n
      {
        If (A_LoopField != "")
        {
          px_r := SubStr(A_LoopField, 1, 4)
          px_g := "0x" . SubStr(A_LoopField, 5, 2)
          px_b := "0x" . SubStr(A_LoopField, 7, 2)
            
          SetFormat, Integer, D
          px_r += 0
          px_g += 0
          px_b += 0
          
          red_var := Sqrt( (red_avg - px_r)**2 )
          green_var := Sqrt( (green_avg - px_r)**2 )
          blue_var := Sqrt( (blue_avg - px_r)**2 )      
          
          variation := (red_var + green_var + blue_var) / 3
          If (variation > max_variation)
          {
            max_variation := variation
            odd_color := A_LoopField
          }
          c%A_LoopField% := 0
        }
      }
      Return odd_color
    }
    ; --------------------
    ; Get Pot Location
    ; --------------------
    ; Returns the boundaries for the rectangle
    ; around the Pot size-text
    GetPotLocation()
    {
      global TableSize,Vx,Vy,PotTextColor,Px,Py,Pw,Ph
      If (TableSize = 1)
      {
        PotFound := GetColorBounds("P",Vx+403,Vy+127,90,16,PotTextColor)
        If (NOT PotFound)
          Return False
          
        Pw++
        If (Ph = 11)
          Ph--
        Else If (Ph = 10)
          Py--
        Else If (Ph = 9)
          Ph++
        Else If (Ph = 8)
        {
          Ph += 2
          Py--
        } Else
          Return False
          
        Return True   
      }
      If (TableSize = 2)
      {
        PotFound := GetColorBounds("P",Vx+45,Vy+16,58,12,PotTextColor)
    	;Replaced Vy+28 with Vy+16
        If (NOT PotFound)
    	{
          Return False 
    	  }
        Pw++
        If (Ph = 11)
          Ph--
        Else If (Ph = 10)
          Py--
        Else If (Ph = 9)
          Ph++
        Else If (Ph = 8)
        {
          Ph += 2
          Py--
        } Else
        {
          Px := 0
          Py := 0
          Pw := 0
          Ph := 0
          Return False
        }
        Return True   
      }
      Return False
    }
    ; --------------------
    ; Get Call Location
    ; --------------------
    ; Returns the boundaries for the rectangle
    ; around the Call size-text
    GetCallLocation()
    {
      global TableSize,Vx,Vy,ButtonOffset,CallTextColor,Cx,Cy,Cw,Ch
      If (TableSize = 1)
      {
        CallFound := GetColorBounds("C",Vx+386+ButtonOffset,Vy+510,80,18,CallTextColor)
        If (NOT CallFound)
          Return False
        
        Cx--        
        Cw += 2
        
        If (Ch = 13)
        {
        	Cy++
          Ch -= 2
        } Else If (Ch = 12 OR Ch = 11)
        {
          Ch--
        } Else If (Ch = 9 OR Ch = 8)
        {
          Cy--
          Ch += 2
        } Else
        {
          Cx := 0
          Cy := 0
          Cw := 0
          Ch := 0
          Return False
        }
          
        Return True   
      }
      If (TableSize = 2)
      {
        CallFound := GetColorBounds("C",Vx+270,Vy+292,77,18,CallTextColor)
        If (NOT CallFound)
          Return False
          
        Cx--        
        Cw += 2
        If (Ch = 11)
          Ch--
        Else If (Ch = 10)
          Cy--
        Else If (Ch = 9)
          Ch++
        Else If (Ch = 8)
        {
          Ch += 2
          Cy--
        } Else
        {
          Cx := 0
          Cy := 0
          Cw := 0
          Ch := 0
          Return False
        }   
          
        Return True   
      }
      Return False
    }
    ; --------------------
    ; Get Raise Location
    ; --------------------
    ; Returns the boundaries for the rectangle
    ; around the Raise size-text
    GetRaiseLocation()
    {
      global TableSize,Vx,Vy,ButtonOffset,RaiseTextColor,Rx,Ry,Rw,Rh
      If (TableSize = 1)
      {
        RaiseFound := GetColorBounds("R",Vx+513+ButtonOffset,Vy+510,80,18,RaiseTextColor)
        If (NOT RaiseFound)
          Return False
          
        Rx--        
        Rw += 2
        If (Rh = 13)
        {
        	Ry++
          Rh -= 2
        } Else If (Rh = 12 OR Rh = 11)
        {
          Rh--
        } Else If (Rh = 9 OR Rh = 8)
        {
          Rh += 2
          Ry--
        } Else
        {
          Rx := 0
          Ry := 0
          Rw := 0
          Rh := 0
          Return False
        }
          
        Return True   
      }
      If (TableSize = 2)
      {
        RaiseFound := GetColorBounds("R",Vx+360,Vy+292,77,12,RaiseTextColor)
        If (NOT RaiseFound)
          Return False
              
        Rx--        
        Rw += 2
        If (Rh = 11)
          Rh--
        Else If (Rh = 10)
          Ry--
        Else If (Rh = 9)
          Rh++
        Else If (Rh = 8)
        {
          Rh += 2
          Ry--
        } Else
        {
          Rx := 0
          Ry := 0
          Rw := 0
          Rh := 0
          Return False
        }
          
        Return True   
      }
      Return False
    }
    ; --------------------
    ; Get Color Bounds
    ; --------------------
    ; Calculates the smallest possible rectangle
    ; that encloses all the pixels within the
    ; provided area of the provided color.
    ; The result is stored in variables with the
    ; provided prefix.
    GetColorBounds(prefix,X,Y,Width,Height,Color)
    {
      global
      local min_x,max_x,min_y,max_y,i
      min_x := 9999
      max_x := 0
      min_y := 9999
      max_y := 0
      Loop, %Width%
      {
        i := A_Index - 1
        PixelSearch, ,, X+i,Y,X+i,Y+Height-1, %Color%, 0, RGB
        If (ErrorLevel = 0)
        {
          If (i < min_x)
            min_x := i          
          If (i > max_x)
            max_x := i
        }
      }
      If (min_x >= max_x OR max_x = 9999)
      {
        %prefix%x := 0
        %prefix%y := 0
        %prefix%w := 0
        %prefix%h := 0
        Return False
      }
      %prefix%x := X + min_x
      %prefix%w := max_x - min_x + 1
        
      Loop, %Height%
      {
        i := A_Index - 1
        PixelSearch, ,, %prefix%x,Y+i,%prefix%x+%prefix%w,Y+i, %Color%, 0, RGB
        If (ErrorLevel = 0)
        {
          If (i < min_y)
            min_y := i          
          If (i > max_y)
            max_y := i
        }
      }
      If (min_y >= max_y OR max_y = 9999)
      {
        %prefix%x := 0
        %prefix%y := 0
        %prefix%w := 0
        %prefix%h := 0
        Return False
      }
      %prefix%y := Y + min_y
      %prefix%h := max_y - min_y + 1
            
      Return True
      
    }
    ; --------------------
    ; Get Text Matrix
    ; --------------------
    ; Returns a matrix where each element is a 1
    ; if the corresponding pixel in the provided
    ; area is the provided color. If it is not
    ; the element is 0.
    ; The result is stored in separate variables
    ; for each column of the matrix.
    ; The col-variable contains the number of 
    ; columns and the sep-variable contains a string
    ; with each column number in the matrix that
    ; is only zeros.
    ; The variables begin with the provided prefix.
    GetTextMatrix(prefix,X,Y,Width,Height,Color)
    {
      global
      local col,i,j,px_color
      col := 0
      %prefix%_sep := 0
      Loop, %Width%
      {
        col++
        %prefix%_col%col% := 0
        i := A_Index - 1
        Loop, %Height%
        {
          j := A_Index - 1
          PixelGetColor, px_color, X+i,Y+j, RGB
          If (px_color = Color)
          {
            %prefix%_col%col% := %prefix%_col%col% | 2**(Height-j-1)
          }
        }
        If (%prefix%_col%col% = 0)
        {
          %prefix%_sep := %prefix%_sep . "`n" . col
        }
      }
      %prefix%_col := col
    }
    ; --------------------
    ; Parse Small Text Matrix
    ; --------------------
    ; Parses a text matrix with pixel information.
    ; The font is Tahoma, 11 pts.
    ParseSmallTextMatrix()
    {
      global
      local number,this,next,a,b,c,d,e
      number := ""
      StringSplit, st_sep, st_sep, `n
      If (st_sep0 > 1)
      {
        Loop, %st_sep0%
        {
          If (A_Index = %st_sep0%)
            Break
            
          this := st_sep%A_Index%
          next := A_Index + 1
          next := st_sep%next%
          If (this = next)
            Continue
            
          If (this + 2 = next)
          {
            a := this + 1
            a := st_col%a%
            If (a = 6)
              number := number . "."
          }
          If (this + 4 = next)
          {
            a := this + 1
            a := st_col%a% >> 1
            b := this + 2
            b := st_col%b% >> 1
            c := this + 3
            c := st_col%c% >> 1
            If (a = 65 AND b = 255 AND c = 1)
              number := number . "1"
          }
          If (this + 6 = next)
          {
            a := this + 1
            a := st_col%a% >> 1
            b := this + 2
            b := st_col%b% >> 1
            c := this + 3
            c := st_col%c% >> 1
            d := this + 4
            d := st_col%d% >> 1
            e := this + 5
            e := st_col%e% >> 1
            If (a = 67 AND b = 133 AND c = 137 AND d = 145 AND e = 97)
              number := number . "2"
            If (a = 66 AND b = 129 AND c = 145 AND d = 145 AND e = 110)
              number := number . "3"
            If (a = 24 AND b = 40 AND c = 72 AND d = 255 AND e = 8)
              number := number . "4"
            If (a = 242 AND b = 145 AND c = 145 AND d = 145 AND e = 142)
              number := number . "5"
            If (a = 62 AND b = 81 AND c = 145 AND d = 145 AND e = 14)
              number := number . "6"
            If (a = 128 AND b = 131 AND c = 140 AND d = 176 AND e = 192)
              number := number . "7"
            If (a = 110 AND b = 145 AND c = 145 AND d = 145 AND e = 110)
              number := number . "8"
            If (a = 112 AND b = 137 AND c = 137 AND d = 138 AND e = 124)
              number := number . "9"
            If (a = 126 AND b = 129 AND c = 129 AND d = 129 AND e = 126)
              number := number . "0"
          }
        }
      }
      Loop, %st_col%
      {
        st_col%A_Index% := 0
      }
      If number is Number
        Return number
        
      Return 0
    }
    ; --------------------
    ; Parse Large Text Matrix
    ; --------------------
    ; Parses a text matrix with pixel information.
    ; The font is Tahoma, 12 pts bold. Although
    ; the digit 2 is missing 1 pixel. Don't ask me
    ; why.
    ParseLargeTextMatrix()
    {
      global
      local number,this,next,a,b,c,d,e,f,g
      number := ""
      StringSplit, lt_sep, lt_sep, `n
      If (lt_sep0 > 1)
      {
        Loop, %lt_sep0%
        {
          If (A_Index = %lt_sep0%)
            Break
            
          this := lt_sep%A_Index%
          next := A_Index + 1
          next := lt_sep%next%
          If (this = next)
            Continue
            
          If (this + 3 = next)
          {
            a := this + 1
            a := lt_col%a%
            b := this + 2
            b := lt_col%b%
            If (a = 6 AND b = 6)
              number := number . "."
          }
          If (this + 7 = next)
          {
            a := this + 1
            a := lt_col%a% >> 1
            b := this + 2
            b := lt_col%b% >> 1
            c := this + 3
            c := lt_col%c% >> 1
            d := this + 4
            d := lt_col%d% >> 1
            e := this + 5
            e := lt_col%e% >> 1
            f := this + 6
            f := lt_col%f% >> 1
            If (a = 129 AND b = 129 AND c = 511 AND d = 511 AND e = 1 AND f = 1)
              number := number . "1"
          }
          If (this + 8 = next)
          {
            a := this + 1
            a := lt_col%a% >> 1
            b := this + 2
            b := lt_col%b% >> 1
            c := this + 3
            c := lt_col%c% >> 1
            d := this + 4
            d := lt_col%d% >> 1
            e := this + 5
            e := lt_col%e% >> 1
            f := this + 6
            f := lt_col%f% >> 1
            g := this + 7
            g := lt_col%g% >> 1
            If (a = 193 AND b = 259 AND c = 263 AND d = 269 AND e = 281 AND f = 497 AND g = 225)
              number := number . "2"
            If (a = 130 AND b = 257 AND c = 273 AND d = 273 AND e = 273 AND f = 511 AND g = 238)
              number := number . "3"
            If (a = 24 AND b = 40 AND c = 72 AND d = 136 AND e = 511 AND f = 511 AND g = 8)
              number := number . "4"
            If (a = 2 AND b = 481 AND c = 481 AND d = 289 AND e = 289 AND f = 319 AND g = 286)
              number := number . "5"
            If (a = 126 AND b = 255 AND c = 417 AND d = 289 AND e = 289 AND f = 319 AND g = 30)
              number := number . "6"
            If (a = 256 AND b = 256 AND c = 263 AND d = 287 AND e = 376 AND f = 480 AND g = 384)
              number := number . "7"
            If (a = 238 AND b = 511 AND c = 273 AND d = 273 AND e = 273 AND f = 511 AND g = 238)
              number := number . "8"
            If (a = 240 AND b = 505 AND c = 265 AND d = 265 AND e = 267 AND f = 510 AND g = 252)
              number := number . "9"
            If (a = 254 AND b = 511 AND c = 257 AND d = 257 AND e = 257 AND f = 511 AND g = 254)
              number := number . "0"
          }
        }
      }
      Loop, %lt_col%
      {
        lt_col%A_Index% := 0
      }
      If number is Number
        Return number
        
      Return 0
    }
    ; --------------------
    ; ====================
    ; END OF SCRIPT
    ; ====================
    


    fixed


  • Registered Users, Registered Users 2 Posts: 11,097 ✭✭✭✭zuroph


    *totally doesnt get this thread*

    wow, i didnt know how much of a noob i was!


  • Registered Users, Registered Users 2 Posts: 2,953 ✭✭✭dvdfan


    Does the reload function work for you RS? Its F1 or F2 you press right?


  • Registered Users, Registered Users 2 Posts: 6,646 ✭✭✭cooker3


    I must be only person who has never used a bet pot script


  • Advertisement
  • Registered Users, Registered Users 2 Posts: 11,097 ✭✭✭✭zuroph


    zuroph wrote: »
    *totally doesnt get this thread*

    wow, i didnt know how much of a noob i was!
    cooker3 wrote: »
    I must be only person who has never used a bet pot script
    *waves*

    hadnt even realised they existed til this thread. must adapt it to be used with a wiimote at some stage! projector +wiimote sounds like the perfect way to play...


  • Closed Accounts Posts: 3,163 ✭✭✭Slash/ED


    Yeah beyond pre flop I'd never bet the pot anyway..


  • Registered Users, Registered Users 2 Posts: 2,513 ✭✭✭RoadSweeper


    dvdfan wrote: »
    Does the reload function work for you RS? Its F1 or F2 you press right?


    I'll check when i get home,

    I think your stats might be in the way on HM. I moved them all down a bit as it was blocking the reload.


  • Registered Users, Registered Users 2 Posts: 6,854 ✭✭✭zuutroy


    Slash/ED wrote: »
    Yeah beyond pre flop I'd never bet the pot anyway..

    me either, but the reload and mouse wheel bet sizing also make it worth having


  • Closed Accounts Posts: 834 ✭✭✭peeko


    bet pot script working, reload unconfirmed


Advertisement