Open Side Menu Go to the Top
Register
FTCash - free script for FullTilt cash players. FTCash - free script for FullTilt cash players.

01-13-2010 , 02:00 PM
I tried out this program, it seems like it was doing too much. I couldn't click anything in the fulltilt program or any tables. like i couldnt cascade my tables because it would lose focus to fast, I would click layout, and the drop down menu would dissappear before i could click anything. very annoying. i was also using TableNinjaFT, but when i closed FTCash, everything worked fine.
FTCash - free script for FullTilt cash players. Quote
01-13-2010 , 02:11 PM
Just try disabling dealmein and timebank clickers. Why would you like to run this script along with tableninja? Try using this script alone and tableninja alone, shouldn't be any problems. I didn't test them together, can't tell if that is compatibility issue. That can also be custom mod issue, are you using custom background/buttons?

Last edited by Max1mums; 01-13-2010 at 02:33 PM.
FTCash - free script for FullTilt cash players. Quote
01-13-2010 , 02:41 PM
"Little" feedback, please forgive me for my english level.

- OS: XP SP2, Classic mode, no mods (tried it on a "virgin" version of FT), tables overlapped . I guess mentionning it is useful for Maximus.

- Only cash game NLHE 6 max, didn't try for s&g / MTT etc ...

- EDIT: tried it alone no PSC or Table Ninja FT, IDK if there are non compatibility problems.

- before I install mod is your script compatible with table /background / chips modding ?

- join / unjoin waiting list on all tables : works great, it reminds the script called PokerPad !

- auto click "deal me in": works great ! When to toggle a little window appears and let you know if the feature is on or off: perfect.

- auto clic time bank: didn't try, I already use Time Bank Butler which is great.

- all the table hotkeys work fine except sometimes it seems it makes me fold postflop hands without clicking or toggling !!!!!!!!!!!!! If other 2+2ers could confirm.

- BetPot: doesn't work at all, maybe I did something wrong ... except increase / decrease by 1 sb, the kind of feature FT destroyed last summer and promise they'll reimplement it. You've been faster and it works great !

- auto move mouse: quite fine, seems to be less reactive than Table Ninja for FT. problem is that it brings to the little window "waiting list options" which seems useless, manually is better. Another problem: so it brings the mouse and you have to clic two times on yes/no/later to make it work. So no biggie if mouse doesn't move to that little window ;-)

Some features you could add:

- auto buy in (clic yes when get chips message)

- auto clic on "wait for BB" and auto tick "auto post blinds"
- auto clic yes when "are you sure you wish to leave the table" and a hot key to close the active table so it would make a great combo just with one clic.


- a hotkey to activate next pending action table because sometimes you accidentally make your tables overalapp or the soft/script ****s up, with a hotkey you would put on top the active table manually just in case and it would be the perfect duo with auto move mouse.

- How increase the number "attempts to read pot amount from screen" affects reliability of the script and computer performances ?

- sit in / out on all tables like the script PokerPad did.

EDIT: too late you created it !!! You're damn fast ... Apparently you can't assign the same hotkeys for join/sit in all unjoin / sit out all like PokerPad did which is great since when you multitable and have tons of tables overlapped, either you are sit out , either you're not in the waiting list. So now having unactive tables in the background is far less likely to happen. I love you ...

- FT Cash always pops up in the middle of my screen, would be nice if it could save its position when you close / submit.

That's a lot of comments but no misunderstanding you already did a great job, worth a donate soon.

Last edited by Bibabu6; 01-13-2010 at 02:48 PM.
FTCash - free script for FullTilt cash players. Quote
01-13-2010 , 02:59 PM
I don't know if script will work with mods but it SHOULD work with any mod, just there is always possibility that some sneaky mod will screw things up.
Script shouldn't press fold button for you unless you binded and pressed Fold hotkey, that is a serious bug if it happens, please check it out and let me know.
Don't know why wouldn't BetPot work for you, so neither autobet nor manual hotkeys work? Do you have correct table theme chosen on General tab?
Script makes another attempt to read Pot amount from screen if failed with 20ms delay after previous attempt, but remaining attempts will not be used if script succeeded with some attempt.
Just say where mouse should be moved and i'll make it move there
All those functions like auto buy-in, autopost exist in StarsCash already and as i said i will try to make similiar functions for FTCash with time.
Remembering Gui position is not a problem at all yet i thought that minimizing script on startup should be enough since you can make settings changes while not playing.

Last edited by Max1mums; 01-13-2010 at 03:10 PM.
FTCash - free script for FullTilt cash players. Quote
01-15-2010 , 11:11 AM
Have used this for a couple of sessions now and everything I have used has worked superb. Thanks for this great script.
FTCash - free script for FullTilt cash players. Quote
01-18-2010 , 08:32 PM
Full Tilt Poker and Navigation keys.......just a dream
FTCash - free script for FullTilt cash players. Quote
01-19-2010 , 11:31 AM
Hi, is it possible to make "highlight table" blinking? When it's "frozen" it's hard to see the "action needed". Sorry for my english, do you understand what I'm talking about?
FTCash - free script for FullTilt cash players. Quote
01-25-2010 , 07:49 AM
Quote:
Originally Posted by fareals
I tried out this program, it seems like it was doing too much. I couldn't click anything in the fulltilt program or any tables. like i couldnt cascade my tables because it would lose focus to fast, I would click layout, and the drop down menu would dissappear before i could click anything. very annoying. i was also using TableNinjaFT, but when i closed FTCash, everything worked fine.
I have the same problem, i don't use any mods or TableNinja.
Do i have to change something in the Full Tillt Layout optios or isn't it so important?
I don't want to turn off the timebank clicker, thats the best function. But i will try it next time
FTCash - free script for FullTilt cash players. Quote
01-25-2010 , 11:00 AM
Maybe that can happen with some custom background, try changing it and tell me if it helps.
FTCash - free script for FullTilt cash players. Quote
01-25-2010 , 02:15 PM
Table Ninja and FT cash almost work fine together for me except sometimes it can be laggy and action hotkeys don't respond.
EDIT: I didn't notice double click action buttons option at the beginning. Maybe it'll solve the problem ;-)

Here are my settings:

XP SP2, NL SH overlapped tables (12 +)



Table Ninja FT:

- all action hotkeys
- all table control (auto move mouse etc ...), no highlighting
- pot betting: default bets and betpot percentages hotkeys (since because of my mods it doesn't preset betting amounts postflop but it's not that a big deal)
- auto buy in
- auto post blind
- let tables steal focus from other applications

Now FT Cash:

- join waiting list on all tables
- remove sit out on all tables

That's a MONSTER combo since despite having 16 tables overlapped, even if you time out, you cannot have inactive tables in your background. Either you're back in the game, either you join waiting list. Thats PokerPAd script revival !!! Priceless.

- sit out on all tables

- auto timebank
- click ''deal me in auto" + toggle deal me in hotkey

Can't make all betpot stuff work but it seems I'm an exception.

FT Cash more than compensates Table Ninja leaks and allows now heavy multitabling (1100 hands+ / hr NL 6 max)

Some additionnal features I would suggest:

1 - "Activate next pending action table" (bring to forefront) hotkey just in case softwares **** up and overlapp your active table.

2 - Toggle auto post blind on all tables

3 - Automove the "seat available dialog box to the forefront. VERY important.

4 - Close active table hotkey. VERY important too while you play and have tons of tables opened

+ (in combo with)

5 - Close "leave table" or "leave table" dialog box.

6 - Preset a max number of tables you can open (auto click "no" or "later" IDK what is possible)

Number 1 (but doesn't work correctly) 3, 4 and 5 already exists in PSC. Since a 2+2er published PSC content feature by feature and seems that source code is open, do you Max1mums think you could implement them in FT Cash ?

Last edited by Bibabu6; 01-25-2010 at 02:16 PM. Reason: add ImageShack
FTCash - free script for FullTilt cash players. Quote
01-25-2010 , 02:38 PM
Maybe Pot amount is being placed different on some kind of tables, please check whether BetPot function works or not on 6/9max microlimit tables, try also checking it with standard background to localize the problem.
Adding those additional functions is not a problem just give me some time: i'm a bit ill right now and i have to grind poker hard till the end of the month.
FTCash - free script for FullTilt cash players. Quote
01-25-2010 , 10:20 PM
The Nuts!
FTCash - free script for FullTilt cash players. Quote
01-27-2010 , 06:44 PM
Everything works great.

Is it possible to add an Auto post blind and click Wait for Blind feature?
FTCash - free script for FullTilt cash players. Quote
01-29-2010 , 04:22 PM
Can anyone help me?

I have used several AHK programs before and had no problems copying the code into notpad and renaming it.

I have tried numerous time to copy this script and I get an error every time I try to run it.

I get the following
---------------------------------------------
"Error: Parameter#1 invalid"

Specifically:IntergerFast

(Then lines of code from 801 to 808)

The program will exit
--------------------------------------------------------
FTCash - free script for FullTilt cash players. Quote
01-29-2010 , 04:29 PM
do you have the latest version at www.autohotkey.com ?
FTCash - free script for FullTilt cash players. Quote
01-29-2010 , 04:29 PM
Update autohotkey program http://www.autohotkey.com/download/
FTCash - free script for FullTilt cash players. Quote
01-29-2010 , 08:29 PM
Thank you both very much, that was indeed the answer.
FTCash - free script for FullTilt cash players. Quote
02-04-2010 , 08:35 PM
I know what was the problem. I'm playing SNG's and i had to uncheck Click "Deal me in" automatically. Now it's working fine.
It happened everytime preflop when i was waiting for my turn to act. If i was postflop in the hand i hadn't the problem. Perhaps this information helps you.
Are you planning to implement any functions like right mouse button to fold or middle mouse button to push allin?

Really great work!
FTCash - free script for FullTilt cash players. Quote
02-04-2010 , 11:21 PM
tomekplaczek, and were you using custom background?
You can assign right click to Fold function on Table hotkeys tab with "rbutton" and you can set 99999 pot percent for every street to any of Pot function on BetPot tab, that will make it an allin hotkey.
FTCash - free script for FullTilt cash players. Quote
02-05-2010 , 01:43 AM
Added Navigation Keys

Code:
; #### FTCash ####

; AHK version: 1.0.48.05
; date: January 12,2010
  version := "1.02"
; author: Max1mums (max1mums@overcards.com)

#SingleInstance, Force
#NoEnv
Settitlematchmode, 2
OnExit exitSub

StringTrimRight, thisahk, A_ScriptName, 4
SetWorkingDir %A_ScriptDir%

Menu, Tray, NoStandard
Menu, Tray, Add, Settings, menugui
Menu, Tray, Add 
Menu, Tray, Add, Reload, reload
Menu, Tray, Default, Settings
Menu, Tray, Add 
Menu, Tray, Add, Suspend, Suspend
Menu, Tray, Add, Pause, TogglePause
Menu, Tray, Add 
Menu, Tray, Add, Edit, Edit 
Menu, Tray, Add 
Menu, Tray, Add, Exit, ExitSub

OnMessage(0x112,"WM_SYSCOMMAND")
WM_SYSCOMMAND(wParam)
{
  if (A_Gui && wParam = 0xF020) ; SC_MINIMIZE
  {
    Gui, destroy
    return 0
  }
}

boost:=false
; Border of the "Highlighter"
border_color := "ff0000"
border_size := 5
trans := 255

debug:=0

SetBatchLines,-1
SetWinDelay,-1
SendMode Input

SysGet, xbord, 32
SysGet, ybord, 33
SysGet, cap, 4
SysGet, border, 32
SysGet, caption, 4

time_x:=0.9093
time_y:=0.7200
time_x1:=0.8808
t1:=0xdedbde
v:=25
back_x:=0.6534
back_y:=0.9862
back_x1:=0.5859
back1:=0x181818
v1:=5
join_x:=0.6158
join_y:=0.9292
join_x1:=0.8261
join:=0xffffff
v2:=5
once:=true
tablequeue=
ddlist=
Loop 14
ddlist:=ddlist . A_index . "|"

ddlist1=
ddlist1.="ssnl" . "|"
ddlist1.="trny" . "|"
ddlist1.="mix" . "|"
ddlist1.="----" . "|"
gosub,getini

ifwinnotexist,FullTiltPoker ahk_class QWidget
{
if flicker1
{
winwait,Logged In ahk_class QWidget
Process, Exist, FullTiltPoker.exe
if (ErrorLevel)
{
  FTP := ErrorLevel
  Process, Priority, %FTP%, High
}
}
else
{
Process, Exist, FullTiltPoker.exe
if (ErrorLevel)
{
  FTP := ErrorLevel
  Process, Priority, %FTP%, Normal
}
}
if flicker2
{
winwait,Logged In ahk_class QWidget
Process, Exist, AutoHotkey.exe
if (ErrorLevel)
{
  Ahk := ErrorLevel
;  SetAffinity(Ahk,0)
 SetAffinity(Ahk)
}
Process, Exist, FullTiltPoker.exe
if (ErrorLevel)
{
  FTP := ErrorLevel
;  SetAffinity(FTP,0)
 SetAffinity(FTP)
}
}
}
else
winwaitclose,FullTiltPoker ahk_class QWidget



;;;;;;;;;;;;End of init;;;;;;;;;;;;;;


settimer,clickwithdelay,100
settimer,act,55
if Highlight
settimer,Highlighter,43
if dealmein OR Timebank
settimer,check,639
settimer,Colorinit,187
if MoveMouse
settimer,MouseMove,119
settimer,BetPot,87
settimer,onFTclose,1078
if activatetableundermouse
settimer,activateundermouse,133

return

;--------------------------------------------------------------------------------

---------------------
onFTclose:
ifwinexist,FullTiltPoker ahk_class QWidget
{
exitapp
}
return
;--------------------------------------------------------------------------------

---------------------
FoldFT(id)
{
  PostclickFT(0.6834,0.9358,id)
}
CallFT(id)
{
  PostclickFT(0.8032,0.9358,id)
}
RaiseFT(id)
{
  PostclickFT(0.9356,0.9358,id)
}
Fold2anyFT(id)
{
global Racetrack
  if Racetrack
  PostclickFT(0.4325,0.8937,id)
  else
  PostclickFT(0.0088,0.7472,id)
}
;--------------------------------------------------------------------------------

---------------------
NextWindow_Left:
NextWindow_Left("ahk_class QWidget")
return
;--------------------------------------------------------------------------------
---------------------
NextWindow_Right:
NextWindow_Right("ahk_class QWidget")
return
;--------------------------------------------------------------------------------
---------------------
NextWindow_Up:
NextWindow_Up("ahk_class QWidget")
return
;--------------------------------------------------------------------------------
---------------------
NextWindow_Down:
NextWindow_Down("ahk_class QWidget")
return
;--------------------------------------------------------------------------------
---------------------
fold:
If ActOnActiveTable
WinGet, Id, ID, A
else
MousegetPos,,,ID
wingetclass,class,ahk_id%id%
if class=QWidget
{
 FoldFT(id)
}
else
{
ControlGetFocus,ctrl,ahk_id%id%
ControlSend,%ctrl%,%fold%,ahk_id%id%
}
return



call:
If ActOnActiveTable
WinGet, Id, ID, A
else
MousegetPos,,,ID
wingetclass,class,ahk_id%id%
if class=QWidget
{
 callFT(id)
}
else
{
ControlGetFocus,ctrl,ahk_id%id%
ControlSend,%ctrl%,%call%,ahk_id%id%
}
return

raise:
If ActOnActiveTable
WinGet, Id, ID, A
else
MousegetPos,,,ID
wingetclass,class,ahk_id%id%
if class=QWidget
{
 raiseFT(id)
}
else
{
ControlGetFocus,ctrl,ahk_id%id%
ControlSend,%ctrl%,%raise%,ahk_id%id%
}
return

fold2any:
If ActOnActiveTable
WinGet, Id, ID, A
else
MousegetPos,,,ID
wingetclass,class,ahk_id%id%
if class=QWidget
{
 fold2anyFT(id)
}
else
{
ControlGetFocus,ctrl,ahk_id%id%
ControlSend,%ctrl%,%fold2any%,ahk_id%id%
}
return
;--------------------------------------------------------------------------------

---------------------

pot1:
If ActOnActiveTable
WinGet, id, id, A
else
MousegetPos,,,id
if Round1
Roundsb:="smallblind"
else
Roundsb:=0.2
Pot(id,Pot1Pre A_space Pot1Flop A_space Pot1Turn A_space Pot1River, Roundsb, 

Open1, fix1)
if autobet
raiseFT(id)
return

pot2:
If ActOnActiveTable
WinGet, id, id, A
else
MousegetPos,,,id
if Round2
Roundsb:="smallblind"
else
Roundsb:=0.2
Pot(id,Pot2Pre A_space Pot2Flop A_space Pot2Turn A_space Pot2River, Roundsb, 

Open2, fix2)
if autobet
raiseFT(id)
return

pot3:
If ActOnActiveTable
WinGet, id, id, A
else
MousegetPos,,,id
if Round3
Roundsb:="smallblind"
else
Roundsb:=0.2
Pot(id,Pot3Pre A_space Pot3Flop A_space Pot3Turn A_space Pot3River, Roundsb, 

Open3, fix3)
if autobet
raiseFT(id)
return

alt1:
If ActOnActiveTable
WinGet, id, id, A
else
MousegetPos,,,id
if sb1
sb:="sb"
else
sb:=""
AlterAmount(id,"up", incr1, sb)
return

alt2:
If ActOnActiveTable
WinGet, id, id, A
else
MousegetPos,,,id
if sb2
sb:="sb"
else
sb:=""
AlterAmount(id,"down", incr2, sb)
return

alt3:
If ActOnActiveTable
WinGet, id, id, A
else
MousegetPos,,,id
if sb3
sb:="sb"
else
sb:=""
AlterAmount(id,"up", incr3, sb)
return

alt4:
If ActOnActiveTable
WinGet, id, id, A
else
MousegetPos,,,id
if sb4
sb:="sb"
else
sb:=""
AlterAmount(id,"down", incr4, sb)
return
;--------------------------------------------------------------------------------

---------------------
BetPot:
GroupAdd, FullTiltTables,Logged In ahk_class QWidget,,,Full Tilt
if autopot
{
isbetboxnew()
}
return
;--------------------------------------------------------------------------------

---------------------
IsBetBoxNew()
{
global oldid,PotDefPre,PotDefFlop,PotDefTurn,PotDefRiver,RoundDef,OpenDef,FixDef
winget winid,id,A
betboxX:=0.9687
betboxY:=0.8000
relFTclientpoint(winid,betboxX,betboxY,0)
pixelgetcolor,bet,betboxX,betboxY,ahk_id%winid%
if (winid<>oldid)
{
 if bet=0xffffff
 {
  oldid:=winid
  if RoundDef
  Roundsb:="smallblind"
  else
  Roundsb:=0.2
  Pot(winid,PotDefPre A_space PotDefFlop A_space PotDefTurn A_space PotDefRiver, 

Roundsb, OpenDef, FixDef)
 }
 else
 oldid=
 }
else
{ 
 if bet!=0xffffff
 oldid=
}
}
return
;--------------------------------------------------------------------------------

---------------------
act:
id:=act()
 wingetclass,class,A
wingettitle,title,A
 ifwinnotactive,ahk_id%id%
 if class=QWidget
if (instr(title, "Logged In") & instr(title, "/"))
 winactivate,ahk_id%id%
return

act()
{
winget,list,list, Logged In ahk_class QWidget,,Full Tilt
return list1
}
;--------------------------------------------------------------------------------

---------------------
activateundermouse:
activatetableundermouse()
return

activatetableundermouse()
{
    MousegetPos,,,WinID
    WinGetClass, class, ahk_id %WinID%
    WinGetTitle, title, ahk_id %WinID%
    if (class="QWidget")
    winactivate, ahk_id %WinID%
}
return
;--------------------------------------------------------------------------------

---------------------
ActivateBottomWindow:
GroupActivate, FullTiltTables
return
;--------------------------------------------------------------------------------

---------------------
SitOutNextAll:
;ClickImBack:=false
settimer,Check,off
if Racetrack
{
sitx:=0.4263
sity:=0.9264
}
else
{
sitx:=0.0031
sity:=0.7770
}
click_x:=sitx+0.0070
click_y:=sity+0.0070
WinGet, list, List,Logged In ahk_class QWidget,,Full Tilt
Loop, %list%
{
 Z:=list%A_Index%
 WinGetPos,,, W, H, ahk_id %Z%
 if w>1000
 Sittingout:=PixelColorA(0,0,0,sity,sitx,Z,1,15,15)
 else
 Sittingout:=PixelColorA(0,0,0,sity,sitx,Z,1,10,10)
 if !(instr(Sittingout,"-0-")) & !(instr(Sittingout,"1710618"))  ; & !(instr

(Sittingout,"16777215"))
 {
  PostClickFT(click_x, click_y, Z, 0) 
 }       
}
return
;--------------------------------------------------------------------------------

---------------------
RemoveSitout:
;ClickImBack:=true
if dealmein OR Timebank
settimer,Check,639
if Racetrack
{
sitx:=0.4278
sity:=0.9287
}
else
{
sitx:=0.0031
sity:=0.7770
}
click_x:=sitx+0.0070
click_y:=sity+0.0070
WinGet, list, List,Logged In ahk_class QWidget,,Full Tilt
Loop, %list%
{
 Z:=list%A_Index%
 WinGetPos,,, W, H, ahk_id %Z%
 if w>1000
 Sittingout:=PixelColorA(0,0,0,sity,sitx,Z,1,15,15)
 else
 Sittingout:=PixelColorA(0,0,0,sity,sitx,Z,1,10,10)
; FileAppend, %Sittingout%`n`n, test.txt
 if (instr(Sittingout,"-0-")) || (instr(Sittingout,"1710618"))  ; & !(instr

(Sittingout,"16777215"))
  {
  PostClickFT(click_x, click_y, Z, 0) 
 }       
}
return
;--------------------------------------------------------------------------------

---------------------
Layout1:
ifwinactive,Logged In ahk_class QWidget,,Full Tilt
WinGet, WinId, ID, A
else
MousegetPos,,,WinID
wingetclass,class,ahk_id %WinID%
wingettitle,title,ahk_id %WinID%
if class=QWidget
if !instr(title,"Full Tilt")
{
CX:=0.8261
CY:=0.0155
PostclickFT(cx,cy,winid,1)

sleep 100
send {Tab}
Send {down 5}
Send {Enter}
}
return
;--------------------------------------------------------------------------------

---------------------
Layout2:
ifwinactive,Logged In ahk_class QWidget,,Full Tilt
WinGet, WinId, ID, A
else
MousegetPos,,,WinID
wingetclass,class,ahk_id %WinID%
wingettitle,title,ahk_id %WinID%
if class=QWidget
if !instr(title,"Full Tilt")
{
CX:=0.8261
CY:=0.0155
PostclickFT(cx,cy,winid,1)

sleep 100
send {Tab}
Send {down 6}
Send {Enter}
}
return
;--------------------------------------------------------------------------------

---------------------
Layout3:
ifwinactive,Logged In ahk_class QWidget,,Full Tilt
WinGet, WinId, ID, A
else
MousegetPos,,,WinID
wingetclass,class,ahk_id %WinID%
wingettitle,title,ahk_id %WinID%
if class=QWidget
if !instr(title,"Full Tilt")
{
CX:=0.8261
CY:=0.0155
PostclickFT(cx,cy,winid,1)

sleep 100
send {Tab}
Send {down 7}
Send {Enter}
}
return
;--------------------------------------------------------------------------------

---------------------
HighLighter:
HighLighter(1)
return

HighLighter(Highlight=1)  ;x_mouse=0.75, y_mouse=0.75 
{
global OldX,OldY,OldW,OldH
global highlighthero,last_table_id
global border_color
global border_size
global trans
global xbord,ybord
global cap

;act()
foldx:=0.6534
foldy:=0.9662
foldx1:=0.5859
foldy1:=0.9662

back_x:=0.6534
back_y:=0.9862
back_x1:=0.5859
back_y1:=0.9862

join_y:=0.9292
join_x:=0.8261

fold1:=0x181818
v:=15
; id:=act()
; wingetclass,class,A
; wingettitle,title,A
; ifwinnotactive,ahk_id%id%
; if class=QWidget
; if (instr(title, "Logged In") & instr(title, "/"))
; winactivate,ahk_id%id%
; winget,id,id,A
ifwinactive, Logged In ahk_class QWidget,,Full Tilt
{  
 winget,id,id,A
 WinGetActiveStats,ActiveTitle, ActiveW, ActiveH, ActiveX, ActiveY
  relFTclientpoint(id,foldx,foldy,0)
  pixelgetcolor,fold,foldx,foldy,ahk_id%id%
  relFTclientpoint(id,foldx1,foldy1,0)
  pixelgetcolor,bacgr,foldx1,foldy1,ahk_id%id%
  relFTclientpoint(id,back_x,back_y,0)
  pixelgetcolor,deal,back_x,back_y,ahk_id%id%
  relFTclientpoint(id,back_x1,back_y1,0)
  pixelgetcolor,deal1,back_x1,back_y1,ahk_id%id%
 ; relFTclientpoint(id,join_x,join_y,0)
 ; pixelgetcolor,join,join_x,join_y,ahk_id%id%

 if (id != last_table_id) || ((OldX <> ActiveX || OldY <> ActiveY || OldW <> 

ActiveW || OldH <> ActiveH))    
 {
  OldX := ActiveX
  OldY := ActiveY
  OldW := ActiveW
  OldH := ActiveH
  mouse_last:=last_table_id
  last_table_id := id  
  if(!id)
  {
   Gui, 2: Cancel
   Gui, 3: Cancel
   Gui, 4: Cancel
   Gui, 5: Cancel
   return
  }  
  WinGetPos, x, y, w, h, ahk_id%id%
  x := x + xbord
  y := y + xbord + cap
  w := w - (2*xbord)
  h := h - (2*xbord) - cap
 
  ;Makes Border around urgent table
;  if ( Highlight = 1 )
  if (highlighthero=0) || ((highlighthero=1) & (comparecolors(fold,bacgr,v)=0) & 

(comparecolors(fold,fold1,v)=0) & (comparecolors(deal,deal1,v)=1))  ; & 

(comparecolors(join,deal1,v)=1))
  { 
   ;top
   guinum := 2
   Gui, %guinum%: +Alwaysontop +Lastfound +Owner
   Gui, %guinum%: Color, %border_color%
   WinSet, Transparent, %trans%
   Gui, %guinum%: -Caption
   Gui, %guinum%: Show, w%w% h%border_size% x%x% y%y% NoActivate    
   ;left
   guinum++
   Gui, %guinum%: +Alwaysontop +Lastfound +Owner
   Gui, %guinum%: Color, %border_color%
   WinSet, Transparent, %trans%
   Gui, %guinum%: -Caption
   Gui, %guinum%: Show, w%border_size% h%h% x%x% y%y% NoActivate    
   ;bottom
   guinum++
   Gui, %guinum%: +Alwaysontop +Lastfound +Owner
   Gui, %guinum%: Color, %border_color%
   WinSet, Transparent, %trans%
   Gui, %guinum%: -Caption
   y2 := y + h - border_size
   Gui, %guinum%: Show, w%w% h%border_size% x%x% y%y2% NoActivate    
   ;right
   guinum++
   Gui, %guinum%: +Alwaysontop +Lastfound +Owner
   Gui, %guinum%: Color, %border_color%
   WinSet, Transparent, %trans%
   Gui, %guinum%: -Caption
   x2 := x + w - border_size
   Gui, %guinum%: Show, w%border_size% h%h% x%x2% y%y% NoActivate  
  }
  else 
  if highlighthero=1
 ; if comparecolors(fold,bacgr,v)=1
 ; {
 ;  Gui, 2: Cancel
 ;  Gui, 3: Cancel
 ;  Gui, 4: Cancel
 ;  Gui, 5: Cancel
   last_table_id=
 ; }          
 }
 else
 if highlighthero=1
 if comparecolors(fold,bacgr,v)=1
 {
  Gui, 2: Cancel
  Gui, 3: Cancel
  Gui, 4: Cancel
  Gui, 5: Cancel
  last_table_id=
 }
}
else
{
   Gui, 2: Cancel
   Gui, 3: Cancel
   Gui, 4: Cancel
   Gui, 5: Cancel
   last_table_id=
}
}
return
;--------------------------------------------------------------------------------

---------------------
MouseMove:
MoveMouse()
return

MoveMouse(x_mouse=0.7468, y_mouse=0.8735)
{
if IsWindowNew()
{ 
wingetclass,class,A
wingetactivetitle,title
if class=QWidget 
if !instr(title,"Full Tilt") 
{
 winget,id,id,A
 relFTClientPoint(id, x_mouse, y_mouse,0,1)
 DllCall("SetCursorPos", int, x_mouse, int, y_mouse)
}  
}
}
return
;--------------------------------------------------------------------------------

---------------------
IsWindowNew()
{
global oldwinid,stealfocus
winget,id,id,A
wingetclass,class,ahk_id%oldwinid%
if id!=%oldwinid%
{
 oldwinid:=id
 if stealfocus
 return 1
 else
 {
  if class=QWidget
  return 1
  else
  return 0
 }
}
else
return 0
}
;--------------------------------------------------------------------------------

---------------------
Colorinit:
if once
Colorinit()
return

Colorinit()
{
local id,t,col,v1
v1:=15
id:=WinExist("Logged In ahk_class QWidget","","Full Tilt")
if id
{
once:=false
settimer,Colorinit,off
t:=PixelColorA(time_x,time_y,time_x1,time_y,join_x,id)
stringsplit,col,t,-
if (CompareColors(col1,col2,v1)=false)
{
t2:=col2
once:=true
settimer,Colorinit,87
}
else
t2:=col1
t:=PixelColorA(back_x,back_y,back_x1,back_y,join_x,id)
stringsplit,col,t,-
if (CompareColors(col1,col2,v1)=false)
{
back2:=col2
once:=true
settimer,Colorinit,87
}
else
back2:=col1
}
}
return
;--------------------------------------------------------------------------------

---------------------
check:
check()
return

check()
{
local listft,id,t,col
winget,listft,list,Logged In ahk_class QWidget,,Full Tilt
loop %listft%
{
id:=listft%A_index%
t:=PixelColorA(time_x,time_y,back_x,back_y,join_x,id)
stringsplit,col,t,-
if (CompareColors(col1,t1,v)=false) & (CompareColors(col1,t2,v)=false)
{
if !InStr(tablequeue,id)
movetolist(id,A_TickCount)
}
else
if InStr(tablequeue,id)
removefromlist(id)
if dealmein
if (CompareColors(col2,back1,v1)=false) & (CompareColors(col2,back2,v1)=false) & 

(CompareColors(col3,back2,v)=true)
PostclickFT(back_x,back_y,id,0)
}
}
return
;--------------------------------------------------------------------------------

---------------------
relFTClientPoint(id, ByRef x, ByRef y, client=1, screen=0)
{
global xbord,ybord,cap
WinGetPos,x1,y1,w,h,ahk_id%id%
w-=2*xbord
h-=(2*ybord)+cap
x:=floor(W*x)
y:=floor(H*y)
if !client
{
x+=xbord
y+=ybord+cap
}
if screen
{
x+=x1
y+=y1
}
}
return
;--------------------------------------------------------------------------------

---------------------
PostLeftDoubleClick(x, y, table_id, activate=1) {
; ### Max1mums: Send the double left click, then the mouse-up messages,
; some windows can get activated on the down left click so we will use
; left doubleclick instead, don't use on objects which have any functions
; binded to doubleclick unless you want to make doubleclick on them
; NOTE: This is relative to the top left of the client area and NOT the top left 

of the
;       window (ie: It *doesn't* include the title-bar like AHK's MouseClick 

does!!!).
If activate
 WinActivate, ahk_id%table_id%
critical,6
PostMessage, 0x203 , 0, ((y<<16)^x), , ahk_id%table_id% ; without 0x001 as lparam 

which is Lbutton down
PostMessage, 0x202 , 0, ((y<<16)^x), , ahk_id%table_id%
PostMessage, 0x202 , 0, ((y<<16)^x), , ahk_id%table_id%
critical,off
sleep,-1
}
return
;--------------------------------------------------------------------------------

---------------------
PostclickFT(x,y,winid,activate=1,client=1)
{
relFTClientPoint(winid, x, y,client)
DllCall("SetCapture","Uint",winid)
PostLeftDoubleClick(x, y, winid, activate)
DllCall("ReleaseCapture")
}
return
;--------------------------------------------------------------------------------

---------------------
clickwithdelay:
Loop, Parse, tablequeue, `,
{
interval:=interval1*1000
stringsplit,tab,A_loopfield,-
if abs(tab2-A_TickCount)>interval
{
PostclickFT(time_x,time_y,tab1,0)
listDelItem(tablequeue, A_Loopfield) 
}
}
return
;--------------------------------------------------------------------------------

---------------------
PixelColorA(colx,coly,backx,backy,joinx,id,region=0,regionw=70,regionh=15)
{
global boost,xbord,ybord,cap
if boost
critical,6
setwindelay, -1
hdc_frame := DllCall( "GetDC", "UInt", id )
hdc_buffer := DllCall("gdi32.dll\CreateCompatibleDC", "UInt",  hdc_frame)
WinGetPos,,,W,H,ahk_id %id%
hbm_buffer := DllCall("gdi32.dll\CreateCompatibleBitmap", "UInt",hdc_frame, 

"Int",w, "Int",h)
DllCall( "gdi32.dll\SelectObject", "UInt",hdc_buffer, "UInt",hbm_buffer)
DllCall( "PrintWindow", "UInt" , id , "UInt" , hdc_buffer , "UInt" , 0 )
DllCall("RedrawWindow","UInt",id,"UInt",0,"UInt",0,"UInt", 1|16|32|64|1024) 
x:=floor(((W-2*xbord)*colx) + xbord)
y:=floor(((H-(2*ybord)-cap)*coly) + ybord + cap)
pix1=
pix1 := DllCall("GetPixel", "UInt", hdc_buffer, "Int", x, "Int", y) 
x:=floor(((W-2*xbord)*backx) + xbord)
y:=floor(((H-(2*ybord)-cap)*backy) + ybord + cap)
pix2:=DllCall("GetPixel", "UInt", hdc_buffer, "Int", x, "Int", y) 
x:=floor(((W-2*xbord)*joinx) + xbord)
pix3:=DllCall("GetPixel", "UInt", hdc_buffer, "Int", x, "Int", y) 
SetFormat, IntegerFast, hex
pix1 += 0
pix1 .= ""
pix2 += 0
pix2 .= ""
pix3 += 0
pix3 .= ""
SetFormat, IntegerFast, d
pix1.="-" . pix2 . "-" . pix3
if region
{
x:=floor(((W-2*xbord)*joinx) + xbord)
y:=floor(((H-(2*ybord)-cap)*backy) + ybord + cap)
pix1.="*"
loop %regionw%
{
delta:=A_index
loop %regionh%
{
delta1:=A_index
p := DllCall("GetPixel", "UInt", hdc_buffer, "Int", x+delta , "Int", y+delta1)
;p1:=p
;SetFormat, IntegerFast, hex
;p += 0
;p .= ""
;SetFormat, IntegerFast, d
;pix1.=p . "*" . p1 . "-"
pix1.=p . "-"
}
}
}
sleep,1
DllCall( "gdi32.dll\DeleteObject", "Uint", hbm_buffer )
DllCall( "gdi32.dll\ReleaseDC", "Uint", hdc_frame )
DllCall( "gdi32.dll\DeleteDC", "Uint", hdc_frame )
DllCall( "gdi32.dll\ReleaseDC", "Uint", hdc_buffer )
DllCall( "gdi32.dll\DeleteDC", "Uint", hdc_buffer )
if boost
{
critical,off
sleep,-1
}
return pix1
}
;--------------------------------------------------------------------------------

---------------------
CompareColors(ByRef bgr1, ByRef bgr2, ByRef variation) {
	c1 := bgr1 & 0xff
	c2 := bgr2 & 0xff
	if (abs(c1 - c2) > variation)
		return false
	c1 := (bgr1 >> 8) & 0xff
	c2 := (bgr2 >> 8) & 0xff
	if (abs(c1 - c2) > variation)
		return false
	c1 := (bgr1 >> 16) & 0xff
	c2 := (bgr2 >> 16) & 0xff
	if (abs(c1 - c2) > variation)
		return false
	return true
}
;--------------------------------------------------------------------------------

---------------------
listAdd( byRef list, item, del="," ) {
  list:=( list!="" ? ( list . del . item ) : item )
  return list
}
;--------------------------------------------------------------------------------

---------------------
listDelItem( byRef list, item, del=",") {
  ifEqual, item,, return list
  list:=del . list . del
  StringReplace, list, list, %item%%del%
  StringTrimLeft, list, list, 1
  StringTrimRight, list, list, 1
  return list
}
;--------------------------------------------------------------------------------

---------------------
movetolist(winid,time)
{
global tablequeue
listAdd(tablequeue, winid . "-" . time)
}
return
;--------------------------------------------------------------------------------

---------------------
removefromlist(winid)
{
global tablequeue
Loop, Parse, tablequeue, `,
{
if InStr(A_loopfield,winid)
listDelItem(tablequeue, A_Loopfield)
}
}
return
;--------------------------------------------------------------------------------

---------------------
SetAffinity(pid, cpu=1)
{
  h := DllCall("OpenProcess", "UInt", 0x1F0FFF, "Int", false, "UInt", pid)
  DllCall("SetProcessAffinityMask", "UInt", h, "UInt", cpu)
  DllCall("CloseHandle", "UInt" h)
  return
}
;--------------------------------------------------------------------------------

---------------------
register:
ifwinactive, ahk_class QWidget
{
winget,id,id, A
wingettitle,title,ahk_id%id%
if instr(title,"Full Tilt Poker -")
{
reg_x :=0.9080
reg_y :=0.7357
PostclickFT(reg_x,reg_y,id,0)
winwait,Tournament Buy-in ahk_class QWidget,,4
if !errorlevel
{
sleep,50
winget,id,id,Tournament Buy-in ahk_class QWidget
wingetpos,,,,h,ahk_id%id%
reg_x :=0.3608
if h<240
reg_y :=0.4876
else
reg_y :=0.4193
PostclickFT(reg_x,reg_y,id,0)
ifwinExist,Full Tilt Poker - Tournament ahk_class QWidget
winclose,Full Tilt Poker - Tournament ahk_class QWidget
}
}
}
return
;--------------------------------------------------------------------------------

---------------------
unregister:
ifwinactive, ahk_class QWidget
{
winget,id,id, A
wingettitle,title,ahk_id%id%
if instr(title,"Full Tilt Poker -")
{
reg_x:=0.9080
reg_y:=0.6709
PostclickFT(reg_x,reg_y,id,0)
winwait,Full Tilt Poker - Tournament ahk_class QWidget,,4
if not errorlevel
{
winget,id,id, Full Tilt Poker - Tournament ahk_class QWidget
reg_x :=0.8876
reg_y :=0.0776
PostclickFT(reg_x,reg_y,id,0)
winwait,Tournament Buy-in ahk_class QWidget,,0.5
if not errorlevel
{
winclose,Tournament Buy-in ahk_class QWidget
ifwinexist, Full Tilt Poker - Tournament ahk_class QWidget
winclose, Full Tilt Poker - Tournament ahk_class QWidget
}
else
{
winwait, Full Tilt Poker ahk_class QWidget,,4
if not errorlevel
winclose,Full Tilt Poker ahk_class QWidget
ifwinexist, Full Tilt Poker - Tournament ahk_class QWidget
winclose, Full Tilt Poker - Tournament ahk_class QWidget
}
}
}
}
return
;--------------------------------------------------------------------------------

---------------------
Toggledealmein:
If (dealmein=true) {
	dealmein:=false
	T=Off
}
else {
	dealmein:=true
	T=On
}
Gui, 12:Add, Text,, Auto Deal me in: %T%
Gui, 12:+ToolWindow
Gui, 12:Show, w150 h20
Sleep, 1000
Gui, 12:Destroy
return
;--------------------------------------------------------------------------------

---------------------
Joinwaitlist:
winget,listft,list,Logged In ahk_class QWidget,,Full Tilt
loop %listft%
{
id:=listft%A_index%
t:=PixelColorA(join_x,back_y,back_x,join_y,join_x1,id,1)
stringsplit,st,t,*
stringsplit,col,st1,-
if (CompareColors(col1,back1,v1)=false) & (CompareColors(col1,back2,v1)=false)
if !instr(st2,"16777215") & !instr(st2,"67284200") & !instr(st2,"111670350") & !

instr(st2,"148766710")
PostclickFT(back_x,back_y,id,0)
}
return
;--------------------------------------------------------------------------------

---------------------
Unjoinwaitlist:
winget,listft,list,Logged In ahk_class QWidget,,Full Tilt
loop %listft%
{
id:=listft%A_index%
t:=PixelColorA(join_x,back_y,join_x1,join_y,join_x1,id,1)
stringsplit,st,t,*
stringsplit,col,st1,-
if (CompareColors(col1,back1,v1)=false) & (CompareColors(col1,back2,v1)=false)
if instr(st2,"16777215")  or instr(st2,"67284200") or instr(st2,"111670350") or 

instr(st2,"148766710")
PostclickFT(back_x,back_y,id,0)
}
return
;--------------------------------------------------------------------------------

---------------------
AlterAmount(id, dir="", frac=1, unit="")
{
  WinGetTitle, title, ahk_id%id%
  amount := 0
  StringTrimRight, tablename, title, ( StrLen(title) - (InStr(title, " - ")-1) )
  IfWinExist, ahk_id%id% ahk_group FullTiltTables
  {
    StringMid, bb, title, InStr(title, "/") + 1, InStr(title, a_space,"", InStr

(title, "/")) - InStr(title, "/") - 1
  }   
  StringReplace,bb,bb,$,,1
  StringReplace,bb,bb,?,,1
  StringReplace,bb,bb,?,,1
  StringReplace,bb,bb,€,,1 

 ; bb++
 ; bb--
  sb := sb(bb)
;listvars
  If (unit = "" or unit = "bb")
  {
    unit := bb
  }
  Else If (unit = "sb")
  {
    unit := sb
  }
  Else If (unit = "pot")
  {
    pot := 0
    call := 0
    hero_bet := 0
    street := "pre"
    hero_position := ""
    open := 0
    max := 10000000
    IfWinExist, ahk_id%id% ahk_group FullTiltTables
    {
        PotSizeFullTilt2(id, pot, call, sb, bb, hero_bet, street, hero_position, 

open, max)
    }
    pot := ((pot + call + hero_bet) )+ call
    unit := pot
  }
  amount := unit * frac
  if (dir="down")
  {
    amount := amount - (2*amount)
  }
  a:=floor(amount)
  if amount-a=0
  amount:=a
  
  IfWinExist, ahk_id%id% ahk_group FullTiltTables
  {
      oldClipboard = %clipboard%
      clipboard =
      PostStarsClick(767, 440, id)
      Send ^a
      Send ^c
      ClipWait, 0.3
      If !ErrorLevel
      t := clipboard
      clipboard = %oldClipBoard%
      t := t + amount
      if (t < 0)
      {
        t := 0
      }
    t2 := Round(t, 0)
    t1 := Round(t, 2)
    t := Round(t, 3)
    if t-t1=0
    t:=t1
    if t-t2=0
    t:=t2
      PostStarsClick(767, 440, id)
      Send ^a
      Send %t%
  }
}

Pot(id, frac=1, round_bet=0.2, open_adjust="", fixblinds=0)
{
  global debug
  global attempts

  if attempts<=0
  attempts:=1
  pot := 0
  call := 0
  sb := 0
  bb := 0
  hero_bet := 0
  street := ""
  hero_position := ""
  open := 1
  max := 10000000

  IfWinExist, ahk_id%id% ahk_group FullTiltTables
  {
    loop %attempts%
    {
     PotSizeFullTilt2(id, pot, call, sb, bb, hero_bet, street, hero_position, 

open, max)
     if pot>0
     break
     sleep,20 
    }
    }
  Else
  {
    return
  }
 
  StringSplit, fr, frac, %A_SPACE%
  if (fr0 < 4)
  {
    times := 4 - fr0
    Loop, %times%
    {
      n := 5 - A_Index
      fr%n% := fr%fr0% 
    }
  }
  
  if (street = "pre")
  {
    frac:= Round(fr1/100,2)
  }
  else if (street = "flop")
  {
    frac:= Round(fr2/100,2)
  }
  else if (street = "turn")
  {
    frac:= Round(fr3/100,2)
  }
  else if (street = "river")
  {
    frac:= Round(fr4/100,2)
  }
  if (debug)
  {
    TrayTip, BetPot, Pot:`t`t%pot%`nCall:`t`t%call%`nHero_bet:`t%hero_bet%

`n`nPosition:`t%hero_position%`n`nBlinds:`t$%sb%/$%bb%`n`nStreet:`t%street%`n`n%

fr0%`n%fr1% %fr2% %fr3% %fr4%`n`n%frac%,10,17
  }
   ; listvars
  if (fixblinds AND open AND street="pre")
  {
    if (hero_position = "sb" )
    {
      pot := pot - sb
      call := call + sb
    }
    else if (hero_position = "bb")
    {
      pot := pot - bb
      call := call + bb
    }
  }

  pot := ((pot + call + hero_bet)* (frac)) + call  

  if (open=1 AND open_adjust="ssnl" )
  {
    pot := pot + bb - sb
  }
  else if (open=1 AND open_adjust="trny" )
  {
    pot := pot - bb
  }
  else if (open=1 AND open_adjust="mix" )
  {
    if (bb=2)
    {
      pot := pot + bb - sb
    }
  ;  pot := pot + bb + sb
  }
  
  if(round_bet = "smallblind")
  {
   ; if sb<1
    pot := Round((Floor((pot / sb)) * sb),2)
   ; else
   ; pot := Round((Floor((pot / sb)) * sb),0)
  }
  else if(round_bet = "bigblind")
  {
    pot := Round((Floor((pot / bb)) * bb),2)
  }
  else if (round_bet < 1)
  {
    places := round_bet*10
    pot := Round(pot, (places))
  }
  else if (round_bet >= 1)
  {
    pot := Floor(pot / round_bet) * round_bet
  }
 
  p:=floor(pot)
  if pot-p=0
  pot:=p
    
  Else IfWinExist, ahk_id%id% ahk_group FullTiltTables
  {
    PostStarsClick(767, 440, id)
     Send ^a
     Send %pot%
  }
}

PotSizeFullTilt2(id, ByRef pot, ByRef call, ByRef sb, ByRef bb, ByRef hero_bet, 

ByRef street, ByRef hero_position, ByRef open, ByRef max)
{
  global deduct_rake,Racetrack
  rake := 0
  notraked := 0
  maxrake := 3
  max := 7654321
  
  
  WinGetTitle, title, ahk_id%id%
  StringMid, bb, title, InStr(title, "/") + 1, InStr(title, a_space,"", InStr

(title, "/")) - InStr(title, "/") - 1
  StringReplace,bb,bb,$,,1
 ; bb++
 ; bb--
  sb := sb(bb)
  
TotalPotDigitsPosX=393
TotalPotDigitsPosY=277
if Racetrack
{
MainPotDigitsPosX=334
MainPotDigitsPosY=183
}
else
{
MainPotDigitsPosX=285
MainPotDigitsPosY=335
}
;PotDigitsPos6X=338
;PotDigitsPos6Y=340
PotDigitsPosW=80
PotDigitsPosH=14
 

pot:=DigitSearchByPixelCount

(TotalPotDigitsPosX,TotalPotDigitsPosY,PotDigitsPosW,PotDigitsPosH,Id)
if pot is not number
pot:=DigitSearchByPixelCount

(MainPotDigitsPosX,MainPotDigitsPosY,PotDigitsPosW,PotDigitsPosH,Id)

;oldClipboard=%clipboard%
oldClipboard:=clipboard
 clipboard =
PostStarsClick(707, 418, id) ;hit min
PostStarsClick(707, 418, id) ;hit min
PostStarsClick(707, 418, id) ;hit min
;PostStarsClick(707, 418, id) ;hit min
;PostStarsClick(707, 418, id) ;hit min
;PostStarsClick(707, 418, id) ;hit min
PostStarsClick(767, 440, id)

min := sb
Send ^a
Send ^c
ClipWait, 0.3
If !ErrorLevel
 {
  min := clipboard
  clipboard = %oldClipBoard%
 }
 else
 {
 min := 2*bb 
 }
   
  street := "pre" 
  street := GetStreetFT(id)
   
  if (min = bb)
  {
    call := 0
  }
  else if (min > bb)
  {
    call := min / 2
  }
  else if (street != "pre")
  {
    call := bb
  }
  
    call2 := Round(call, 0)
    call1 := Round(call, 2)
    call := Round(call, 3)
    if call-call1=0
    call:=call1
    if call-call2=0
    call:=call2

  if (call != bb || street != "pre")
  {
    open := 0
  }
 pot := Round((Floor((pot / sb)) * sb),2) 
 ;pot := pot - (2 * call)

if call is not number
call:=0
if hero_bet is not number
hero_bet:=0 
return
}

GetStreetFT(id)
{
  CoordMode, Pixel, Screen

  street := "pre"
  
  x1 := 485
  y1 := 214
  x2 := 520
  y2 := 260
  relStarsScreenPoint(id, x1, y1)
  relStarsScreenPoint(id, x2, y2)
  
  If ( GetPixelCount(x1, y1, x2, y2, 0xffffff) > 5 )
  {
    street := "river"
    return street
  }
  
  x1 := 431
  y1 := 214
  x2 := 461
  y2 := 260
  relStarsScreenPoint(id, x1, y1)
  relStarsScreenPoint(id, x2, y2)

  If ( GetPixelCount(x1, y1, x2, y2, 0xffffff) > 5 )
  {
    street := "turn"
    return street
  }

  x1 := 378
  y1 := 214
  x2 := 414
  y2 := 260
  relStarsScreenPoint(id, x1, y1)
  relStarsScreenPoint(id, x2, y2)

  If ( GetPixelCount(x1, y1, x2, y2, 0xffffff) > 5 )
  {
    street := "flop"
    return street
  }
  return street
}

; finds number of specified pixels in a region
GetPixelCount(x1, y1, x2, y2, color, options="")
{
  CoordMode, Pixel, Screen
  pixels := (x2 - x1 + 1)*(y2 - y1 + 1)
  If ( pixels <= 0 )
  {
    ErrorLevel = 1
    return
  }
  count = 0
  x = %x1%
  Loop
  {
    If ( x > x2 )
    {
      break
    }
    y = %y1%
    Loop
    {
      If ( y > y2 )
      {
        break
      }
      PixelGetColor, c, x, y, %options%
      If ( c = color )
      {
        count++
      }
      y++
    }
    x++
  }
  return count
}

sb(bb) {
If bb = .25
 sb := .10
else if bb = 15
 sb = 10
else if bb = 0.05
 sb = 0.02
else
 sb := bb/2
if (sb > 1)
{
  sb := Round(sb, 0)
}
else
{
  sb := Round(sb, 2)
}
return sb
}

StrRep(str,char,rep_char="",all=1)
{
  StringReplace,str,str,%char%,%rep_char%,%all%
  return str
}

StrMid(str,str1,str2,startPos1=1,startPos2=1,caseSense=0){
If startPos1 =
 startPos1 = 1
If startPos2 =
 startPos2 = 1
StringTrimLeft,o,str,InStr(str,str1,cS,startPos1) + StrLen(str1) - 1
StringLeft,o,o,InStr(o,str2,caseSense,startPos2)-1
return o
}

IIf(_boolExpr, _exprTrue, _exprFalse) {
If _boolExpr
 Return _exprTrue
else
 return _exprFalse
}

relStarsClientPoint(id, ByRef x, ByRef y)
{
  global border
  global caption
  rw := 792
  rh := 546
  WinGetPos, , , w, h, ahk_id%id%
  w := w - (2*border)
  h := h - (2*border) - caption
  
  x := Floor( (x / rw ) * w )
  y := Floor( (y / rh) * h  )
  
}

relStarsWindowPoint(id, ByRef x, ByRef y)
{
  global border
  global caption
  relStarsClientPoint(id, x, y)
  x := x + border
  y := y + border + caption
}

relStarsScreenPoint(id, ByRef x, ByRef y)
{
  relStarsWindowPoint(id, x, y)
  WinGetPos, x1, y1, , , ahk_id%id%
  x += x1
  y += y1
}


reverse_calc_stars_client_area(cw, ByRef w, ByRef h)
{
  global border
  global caption
  w := cw + (2*border) 
  h := Floor(cw / 1.45) + (2*border) + caption
}

client_area(id, ByRef x, Byref y, ByRef w, Byref h)
{
  WinGetPos, x, y, w, h, ahk_id%id%
  global border
  global caption
  x := x + border
  y := y + border + caption
  w := w - (2*border)
  h := h - (2*border) - caption
  return
}

PostStarsClick(x, y, id)
{
  relStarsClientPoint(id, x, y)
  PostLeftClick(x, y, id)
}

PostLeftClick(x, y, table_id, activate=1) {
; ### JUK: Send the down left click, then the mouse-up messages.
; NOTE: This is relative to the top left of the client area and NOT the top left 

of the
;       window (ie: It *doesn't* include the title-bar like AHK's MouseClick 

does!!!).
If activate
 WinActivate, ahk_id%table_id%
PostMessage, 0x201, 0x0001, ((y<<16)^x), , ahk_id%table_id%
PostMessage, 0x202 , 0, ((y<<16)^x), , ahk_id%table_id%
}


;;;;;;;;;;;;;;;;;;;;PixelCount function source taken from 

PokerShortCuts;;;;;;;;;;;;;;;;;;;;;

/*
DigitsByPixelCountGetValue()
   Purpose: This function looks for digits by counting pixels in each column of a 

digit and tries to find a match for those counts
               when a column of 0 pixels is found. we search the client area xywh
   Returns:
      DigitString - the numbers found
         A for All In
         S for Sitting Out
         "" if no digits found
   Parameters:
      X - x poistion in standard client area to search for digits
      Y - y "
      W - standardized width of search area
      H - standardized height of search area
      DigitsType - e.g. Bet, Stack or Pot. This var is used to get the colors and 

tolerances from the global variables
      ByRef PixelCountForAllDigitsStringReturned: for test purposes... this is the 

long pixel count string
      WinId: window id

Notes:
      1. I was having problems with the alternate color not reading the digits 

correctly on FT. This is black digits on white background.
      There sometimes seems to be a black pixel in the area below the stack 

numbers, and this would cause one of the columns to read incorrectly.
      To fix it, I had to reduce the Height parameter that it was checking from 15 

down to 12. This seems to be reliable for all table sizes.

      2. Full Tilt on small tables does not have a blank row of pixels above the 

stack digits if the user's name has a decender character in it.
      I had to change the software to allow for a few pixels in this row for it to 

be considered a blank row. I suppose this could be a problem if
      the user only has a stack size of 1, in which case the blank row at the top 

would be intrepreted as the stack digit with on (since it might only have 1 pixel 

in the row.)
      The "y" has one pixel that is right above the stack numbers, and the "g" 

character has 2 pixels...  so we will allow for 2 pixels in the row.
      If the user's name has more than 2 pixels in the decenders, then this code 

won't work at the smallest of table sizes (need a table size that puts in a blank 

row of pixels.)

      3. On small full tilt tables, you can't position the initial starting 

position too far to the left, else the software doesn't read the stack size 

correctly.
      I have found that just to the left of the "Sitting Out" words is about 

right. for some reason it picks up a number of decimal point characters if
      X is too far to the left.

      4. At the larger table sizes, Stars tables go to a stack font that is not 

one solid color. It has the shading of the digits.
      But it does have one dominant color, and that is what I use to do the pixel 

count with. The color variation seems to be at
      least 10 for the other colors. So I captured the pixel counts setting the 

color variation to 1.
      This should work, unless there are some computers that show the color with 

more variation. I know that my alternate sony
      laptop has doesn't show the colors the same as my main sony laptop. So we 

need some color variation in there. So I'll try setting the variation
      to about 5.
      It may be that if this doesn't work, then we'll just have to tell users that 

have too much color variation in their font digits,
      that they can't use the larger table sizes on stars.

      5. One good testing method is to outputdebug the Y paramater to let you know 

if the software is finding the blank line above the digits.
      Also, output the digitstring and alternate and pixel count strings at the 

end of this function.
      In the debug, you can use a mouse position to look for the digit characters.


*/
DigitSearchByPixelCount(X,Y,W,H,WinId)
{  
DigitsColor=0xFFFFFF
DigitsColorTolerance=0

FTMinimumPixelCountPerColumn := 2               ; when counting pixels in a 

column, this is the minimum number to be a valid column (else it is a spacer 

column)
FTMaximumAllowedNumPixelsInRowToBeBlank:=2                                         

          ; FT has some columns with one pixel in them next to a decimal point 

that we need to say these are spacer columns.
                                                   ;    Like the 4 digit has one 

column on the right with one pixel, and this will be right next to the decimal 

point.
                                                ;    Fortunately the decimal point 

has 2 pixels in it, so that it can be detected as a dp.

   ; FT Pixel Count Digits for table (client width) 472-563
   PixelCountDigits52254 := 0
   PixelCountDigits276 := 1
   PixelCountDigits35335 := 2
   PixelCountDigits33335 := 2
   PixelCountDigits23344 := 3
   PixelCountDigits22276 := 4
   PixelCountDigits53335 := 5
   PixelCountDigits53321 := 6
   PixelCountDigits23321 := 7
   PixelCountDigits43344 := 8
   PixelCountDigits23354 := 9
   PixelCountDigits21 := "."
   PixelCountDigits3333332 := "A"
   PixelCountDigits333335 := "S"


   ; FT Pixel Count Digits for table (client width) 564-682
   PixelCountDigits622265 := 0
   PixelCountDigits287 := 1
   PixelCountDigits333336 := 2
   PixelCountDigits223355 := 3
   PixelCountDigits22287 := 4
   PixelCountDigits533346 := 5
   PixelCountDigits533332 := 6
   PixelCountDigits33321 := 7
   PixelCountDigits533355 := 8
   PixelCountDigits333354 := 9
   PixelCountDigits21 := "."
   PixelCountDigits3433432 := "A"
   PixelCountDigits333346 := "S"

   ; FT Pixel Count Digits for table (client width) 683-841
   PixelCountDigits6822865 := 0
   PixelCountDigits2887 := 1
   PixelCountDigits3544536 := 2
   PixelCountDigits2433855 := 3
   PixelCountDigits222787 := 4
   PixelCountDigits653646 := 5
   PixelCountDigits6833632 := 6
   PixelCountDigits47521 := 7
   PixelCountDigits5833855 := 8
   PixelCountDigits3633865 := 9
   PixelCountDigits221 := "."
   PixelCountDigits36636632 := "A"
   PixelCountDigits4644646 := "S"

   ; FT Pixel Count Special situation below 842-881 - looks like only the 2 digit 

is different here
   PixelCountDigits23444647 := 2

   ; FT Pixel Count Digits for table (client width) 842-960
   PixelCountDigits79222976 := 0
   PixelCountDigits22998 := 1
   PixelCountDigits33444647 := 2

   PixelCountDigits22333966 := 3
   PixelCountDigits2222998 := 4
   PixelCountDigits5533757 := 5
   PixelCountDigits68433743 := 6
   PixelCountDigits465421 := 7
   PixelCountDigits69333966 := 8
   PixelCountDigits47334865 := 9
   PixelCountDigits221 := "."
   PixelCountDigits2555355521 := "A"
   PixelCountDigits56333656 := "S"

   ; FT Pixel Count Digits for table (client width) 961-1040
   PixelCountDigits684224865 := 0
   PixelCountDigits22AA9 := 1
   PixelCountDigits354435647 := 2
   PixelCountDigits463337735 := 3
   PixelCountDigits22222AA9 := 4
   PixelCountDigits275335647 := 5
   PixelCountDigits685335632 := 6
   PixelCountDigits3555421 := 7
   PixelCountDigits7A3333A77 := 8
   PixelCountDigits365335865 := 9
   PixelCountDigits332 := "."
   PixelCountDigits3556365532 := "A"
   PixelCountDigits475445746 := "S"

   ; FT Pixel Count Digits for table (client width) 1041-1119
   PixelCountDigits8A42224A87 := 0
   PixelCountDigits22CCB := 1
   PixelCountDigits3544445649 := 2
   PixelCountDigits4623337957 := 3
   PixelCountDigits222222CCB := 4
   PixelCountDigits2863335759 := 5
   PixelCountDigits7954335743 := 6
   PixelCountDigits35555421 := 7
   PixelCountDigits5973337957 := 8
   PixelCountDigits4753345976 := 9
   PixelCountDigits332 := "."
   PixelCountDigits355653565532 := "A"
   PixelCountDigits5864446858 := "S"


   coordmode, pixel, Screen
   WindowScaledPos(X, Y, ClientScaleFactor, "Screen", WinId)
   W := Round(W * ClientScaleFactor)
   H := Round(H * ClientScaleFactor)
   PixelGetColor, ColorRGB,X,Y,RGB
      CheckPrimaryColorFlag := 1
      CheckAlternateColorFlag := 0
   Y += Round(H/2)
   TopRowFound := 0
   loop, % Round(H)
   {
      Xpos := X
      PixelCountInRow := 0
      ScanWidth := Round(W*3/4)
      loop,% ScanWidth
      {
         Xpos += 1
         PixelGetColor, ColorRGB,Xpos,Y,RGB
         if (CheckPrimaryColorFlag AND (ColorWithinTolerance(ColorRGB, 

DigitsColor, DigitsColorTolerance)))
         {
            PixelCountInRow++
            if (PixelCountInRow > FTMaximumAllowedNumPixelsInRowToBeBlank)
               break
         }
      } 
      if (Xpos == (X + ScanWidth))
      {
         TopRowFound := 1
         Y += 1                  ; move back down to the top row of the font
         break
      }
      Y -= 1
   } 
   if NOT TopRowFound
   {
      return ""
   }
   DigitString:=""
   PixelCountForAllDigitsString := ""
   PixelCountForThisDigitString := ""
   loop, %W%
   {
      ColumnNum:= A_Index
      PixelCountInColumn:=0
      FirstPixelPosition := 0
      LastPixelPosition := 0
      loop, %H%
      {
         RowNum:=A_Index
         PixelGetColor, ColorRGB,X+ColumnNum-1,Y+RowNum-1,RGB

         if (ColorWithinTolerance(ColorRGB, DigitsColor, DigitsColorTolerance))
         {
            if (!FirstPixelPosition)
               FirstPixelPosition := RowNum
            LastPixelPosition := RowNum
            PixelCountInColumn++
         }
      }
      if (PixelCountInColumn >= FTMinimumPixelCountPerColumn)
      {
         LastMinusFirstPixelPosition := LastPixelPosition  - FirstPixelPosition
         if (PixelCountInColumn > 9)
         {
            PixelCountInColumn := chr(64 + PixelCountInColumn - 9)
         }
         if PixelCountInColumn is alnum
            PixelCountForThisDigitString .= PixelCountInColumn
      }
      else
      {
         if (PixelCountForThisDigitString != "")
         {

            if (LastMinusFirstPixelPosition > 9)
               LastMinusFirstPixelPosition := chr(64 + LastMinusFirstPixelPosition 

- 9)
            if LastMinusFirstPixelPosition is alnum
               PixelCountForThisDigitString .= LastMinusFirstPixelPosition
            Temp := "PixelCountDigits"
            DigitString .= %Temp%%PixelCountForThisDigitString%
            PixelCountForAllDigitsString .= PixelCountForThisDigitString . A_Space
            PixelCountForThisDigitString := ""
         }
      }
   }
   Loop,
   {
      StringPosition := instr(DigitString,".")    ; find the first decimal point
      if StringPosition
      {
         if ((strlen(DigitString) - StringPosition) > 2)
            StringReplace, DigitString, DigitString,.,,
         else
            break
      }
      else
         break
   }
   if (DigitString)
   {
      PixelCountForAllDigitsStringReturned := PixelCountForAllDigitsString
      return DigitString
   }
}

ColorWithinTolerance(SampleColor, TestColor, Tolerance) {

   if (SampleColor == TestColor)
      return 1
   If (Tolerance == 0)
      return (SampleColor == TestColor)

    SampleColorRed := SampleColor >> 16
    TestColorRed := TestColor >> 16
    SampleColorGreen:= SampleColor >> 8 & 0xff
    TestColorGreen := TestColor >> 8 & 0xff
    SampleColorBlue := SampleColor & 0xff
    TestColorBlue := TestColor & 0xff
    return (    ( (SampleColorRed + Tolerance >= TestColorRed)     && 

(SampleColorRed - Tolerance <= TestColorRed) )
        &&      ( (SampleColorGreen + Tolerance >= TestColorGreen) && 

(SampleColorGreen - Toleranc <= TestColorGreene) )
        &&      ( (SampleColorBlue + Tolerance >= TestColorBlue)   && 

(SampleColorBlue - Tolerance <= TestColorBlue) )           )
}

WindowScaledPos(ByRef PosX, ByRef PosY, ByRef ClientScaleFactor, 

ScaleType="Screen", WinId="")
{
   local TitleBarHeight, WindowBottomBorder, WindowSideBorder, WindowTopBorder 

,WindowX,WindowY,WindowWidth,WindowHeight
   local ClientWidth, ClientHeight , ClientWidthScaleFactor, 

ClientHeightScaleFactor

   StandardClientWidth=794
   StandardClientHeight=547

   SysGet, TitleBarHeight, 4
   SysGet, WindowBottomBorder, 32
   SysGet, WindowSideBorder, 33

   WindowTopBorder := TitleBarHeight + WindowBottomBorder
   WinGetPos,WindowX,WindowY,WindowWidth,WindowHeight,ahk_id%WinId%

  ; if this is a poker table, then scale the XY position based on the size of the 

current table to a standard table size
  ; ifWinExist, ahk_id%WinId%  ahk_group Tables
  ; {
      ClientWidth := WindowWidth - 2 * WindowSideBorder
      ClientHeight := WindowHeight - TitleBarHeight - 2 * WindowBottomBorder
      ClientWidthScaleFactor := ClientWidth / StandardClientWidth
      ClientHeightScaleFactor := ClientHeight / StandardClientHeight 
      ClientScaleFactor := ClientWidthScaleFactor     ; pass back the scaling 

factor in case the calling function needs it
      PosX := Round(PosX * ClientWidthScaleFactor)
      PosY := Round(PosY * ClientHeightScaleFactor)
  ; }
   
    if (ScaleType == "Client")
   {
      return
   }
   else if (ScaleType == "Window")
   {
      PosX += WindowSideBorder
      PosY += WindowTopBorder
   }

   else if (ScaleType == "Screen")
   {
      PosX += WindowX + WindowSideBorder
      PosY += WindowY + WindowTopBorder
   }
}


BuildGui:
Gui, color, white
Gui, add, tab, h490 w300, General|Global hotkeys|BetPot|Table hotkeys|Time
Gui, Tab, General

Gui, Add, Radio, x36 y70 w180 h20 Checked%ClassicTheme% vClassicTheme, Classic
Gui, Add, Radio, x36 y90 w180 h20 Checked%Racetrack% vRacetrack, Racetrack

Gui, add, text,cRed y125 x85, Use these options
Gui, add, text,cRed y140 x50, if you experience flicker problem
Gui, add, Checkbox, y160 x60 Checked%flicker1% Vflicker1
Gui, add, text, y175 x25,set FullTilt process
Gui, add, text, y190 x25,priority to high
Gui, add, Checkbox, y160 x180 Checked%flicker2% Vflicker2
Gui, add, text, y175 x125,set affinity to cpu1 only
Gui, add, text, y190 x125,for FullTilt process 
Gui, add, text, y205 x125,(Dual-core/HT cpu) 
Gui, add, text,cGreen y235 x25,Turning aero theme off (Vista/W7) might help
Gui, add, text,cGreen y250 x25,if these settings don't work.
Gui, add, text,cGreen y270 x25,It is vital to turn aero off for BetPot function.
Gui, Add, Radio, x26 y300 w220 h15 Checked%ActOnActiveTable% vActOnActiveTable, 

Send actions to active table
Gui, Add, Radio, x26 y315 w220 h15 Checked%sendundermouse% vsendundermouse, Send 

actions to table under mouse
Gui, add, text, y335 x25, Activate table under mouse
Gui, add, Checkbox, y335 x220 Checked%activatetableundermouse% 

Vactivatetableundermouse

Gui, add, text, y365 x25, Highlight table
Gui, add, Checkbox, y365 x100 Checked%Highlight% VHighlight
Gui, Add, Radio, x126 y360 w120 h15 Checked%highlightactive% vhighlightactive, 

Active
Gui, Add, Radio, x126 y375 w120 h15 Checked%highlighthero% vhighlighthero, With 

action on hero
Gui, add, text, y405 x25, Move mouse to action buttons
Gui, add, Checkbox, y405 x220 Checked%MoveMouse% VMoveMouse
Gui, add, text, y425 x65, Move mouse from nonfulltilt app
Gui, add, Checkbox, y425 x220 Checked%stealfocus% Vstealfocus

Gui, Add, Button, x75 y455 w55 h20 gSave,Submit
Gui, Add, Button, x135 y455 w55 h20 gCancel,Cancel

Gui, Tab, Global hotkeys

Gui, Add, Text, x25 y75 ,Register
Gui, Add, Edit, x220 y72 w50 h20 vregister, %register%
Gui, Add, Text, x25 y92 ,(join/unjoin waiting list for cash tables)
Gui, Add, Text, x25 y115 ,Unregister
Gui, Add, Edit, x220 y112 w50 h20 vunregister, %unregister%
Gui, Add, Text, x25 y140 ,Join waiting list on all tables
Gui, Add, Edit, x220 y137 w50 h20 vjoinwaitlist, %joinwaitlist%
Gui, Add, Text, x25 y165 ,Unjoin waiting list on all tables
Gui, Add, Edit, x220 y162 w50 h20 vunjoinwaitlist, %unjoinwaitlist%

Gui, Add, Text, x25 y215 ,Activate next table
Gui, Add, Edit, x220 y212 w50 h20 vActivateBottomWindow, %ActivateBottomWindow%
Gui, Add, Text, x25 y245 ,Custom layout 1
Gui, Add, Edit, x220 y242 w50 h20 vlayout1, %layout1%
Gui, Add, Text, x25 y265 ,Custom layout 2
Gui, Add, Edit, x220 y262 w50 h20 vlayout2, %layout2%
Gui, Add, Text, x25 y285 ,Custom layout 3
Gui, Add, Edit, x220 y282 w50 h20 vlayout3, %layout3%

Gui, Add, Text, x25 y315 ,Suspend all hotkeys
Gui, Add, Edit, x220 y312 w50 h20 vsuspend, %suspend%
Gui, Add, Text, x25 y335 ,Pause/unpause
Gui, Add, Edit, x220 y332 w50 h20 vTogglePause, %TogglePause%


Gui, Add, Button, x75 y415 w55 h20 gSave,Submit
Gui, Add, Button, x135 y415 w55 h20 gCancel,Cancel

Gui, Tab, Time

Gui, add, Checkbox, y75 x200 Checked%Timebank% VTimebank
Gui, add, text, y75 x25,Click Timebank automatically
Gui, add, Text, w200 y95 x25, Time delay for pressing Time button 
Gui, add, DropDownList, w40 y90 x220  vInterval1, %ddlist%
Gui, add, text, y135 x25, Click "Deal me in" automatically 
Gui, add, Checkbox, y135 x200 Checked%dealmein% Vdealmein
Gui, Add, Text, x25 y155 w120 h20 , Toggle Deal me in
Gui, Add, Edit, x220 y152 w50 h20 vToggledealmein, %Toggledealmein%
Gui, Add, Text, x25 y180 ,Sitout on all tables
Gui, Add, Edit, x180 y177 w50 h20 vSitOutNextAll, %SitOutNextAll%
Gui, Add, Text, x25 y205 ,Remove sitout on all tables
Gui, Add, Edit, x180 y202 w50 h20 vRemoveSitout, %RemoveSitout%

Gui, Add, Button, x75 y415 w55 h20 gSave,Submit
Gui, Add, Button, x135 y415 w55 h20 gCancel,Cancel

Gui, Tab, Table hotkeys

Gui, Add, Edit, x180 y67 w50 h20 vfold, %fold%
Gui, Add, Text, x25 y70 ,Fold
Gui, Add, Edit, x180 y87 w50 h20 vcall, %call%
Gui, Add, Text, x25 y90 ,Check/Call
Gui, Add, Edit, x180 y107 w50 h20 vraise, %raise%
Gui, Add, Text, x25 y110 ,Bet/Raise
Gui, Add, Edit, x180 y127 w50 h20 vfold2any, %fold2any%
Gui, Add, Text, x25 y130 ,Fold to any

Gui, Font, S8 CDefault Bold, Verdana
Gui, Add, Text, x70 y150 , Navigation Hotkeys
Gui, Font, S8 CDefault norm, Verdana
Gui, Add, Text, x25 y170 , Up
Gui, Add, Edit, x180 y170 w50 h20 vNextWindow_Up, %NextWindow_Up%
Gui, Add, Text, x25 y190 , Down
Gui, Add, Edit, x180 y190 w50 h20 vNextWindow_Down, %NextWindow_Down%
Gui, Add, Text, x25 y210 , Left
Gui, Add, Edit, x180 y210 w50 h20 vNextWindow_Left, %NextWindow_Left%
Gui, Add, Text, x25 y230 , Right
Gui, Add, Edit, x180 y230 w50 h20 vNextWindow_Right, %NextWindow_Right%


Gui, Add, Button, x75 y315 w55 h20 gSave,Submit
Gui, Add, Button, x135 y315 w55 h20 gCancel,Cancel


Gui, Tab, BetPot

Gui, add, Checkbox, y55 x180 Checked%autopot% Vautopot
Gui, add, text, y55 x25,Auto put bet into bet box
Gui, Add, Text, x15 y70 ,Pre*
Gui, Add, Edit, x15 y85 w25 h20 vPotDefPre, %PotDefPre%
Gui, Add, Text, x45 y70 ,Flop*
Gui, Add, Edit, x45 y85 w25 h20 vPotDefFlop, %PotDefFlop%
Gui, Add, Text, x75 y70 ,Turn*
Gui, Add, Edit, x75 y85 w25 h20 vPotDefTurn, %PotDefTurn%
Gui, Add, Text, x105 y70 ,River*
Gui, Add, Edit, x105 y85 w25 h20 vPotDefRiver, %PotDefRiver%
Gui, Add, Text, x140 y70 ,Open
Gui, add, DropDownList, w45 y85 x140  vOpenDef, %ddlist1%
Gui, Add, Text, x175 y70 ,Round(sb)
Gui, add, Checkbox, y85 x200 Checked%RoundDef% VRoundDef
Gui, Add, Text, x230 y70 ,Fix blinds
Gui, add, Checkbox, y85 x250 Checked%FixDef% VFixDef

Gui, Add, Edit, x60 y107 w80 h20 vpot1, %pot1%
Gui, Add, Text, x15 y110 ,Pot1
Gui, Add, Text, x15 y130 ,Pre*
Gui, Add, Edit, x15 y145 w25 h20 vPot1Pre, %Pot1Pre%
Gui, Add, Text, x45 y130 ,Flop*
Gui, Add, Edit, x45 y145 w25 h20 vPot1Flop, %Pot1Flop%
Gui, Add, Text, x75 y130 ,Turn*
Gui, Add, Edit, x75 y145 w25 h20 vPot1Turn, %Pot1Turn%
Gui, Add, Text, x105 y130 ,River*
Gui, Add, Edit, x105 y145 w25 h20 vPot1River, %Pot1River%
Gui, Add, Text, x140 y130 ,Open
Gui, add, DropDownList, w45 y145 x140  vOpen1, %ddlist1%
Gui, Add, Text, x175 y130 ,Round(sb)
Gui, add, Checkbox, y145 x200 Checked%Round1% VRound1
Gui, Add, Text, x230 y130 ,Fix blinds
Gui, add, Checkbox, y145 x250 Checked%Fix1% VFix1

Gui, Add, Edit, x60 y167 w80 h20 vpot2, %pot2%
Gui, Add, Text, x15 y170 ,Pot2
Gui, Add, Edit, x15 y190 w25 h20 vPot2Pre, %Pot2Pre%
Gui, Add, Edit, x45 y190 w25 h20 vPot2Flop, %Pot2Flop%
Gui, Add, Edit, x75 y190 w25 h20 vPot2Turn, %Pot2Turn%
Gui, Add, Edit, x105 y190 w25 h20 vPot2River, %Pot2River%
Gui, add, DropDownList, w45 y190 x140  vOpen2, %ddlist1%
Gui, add, Checkbox, y190 x200 Checked%Round2% VRound2
Gui, add, Checkbox, y190 x250 Checked%Fix2% VFix2

Gui, Add, Edit, x60 y212 w80 h20 vpot3, %pot3%
Gui, Add, Text, x15 y215 ,Pot3
Gui, Add, Edit, x15 y235 w25 h20 vPot3Pre, %Pot3Pre%
Gui, Add, Edit, x45 y235 w25 h20 vPot3Flop, %Pot3Flop%
Gui, Add, Edit, x75 y235 w25 h20 vPot3Turn, %Pot3Turn%
Gui, Add, Edit, x105 y235 w25 h20 vPot3River, %Pot3River%
Gui, add, DropDownList, w45 y235 x140  vOpen3, %ddlist1%
Gui, add, Checkbox, y235 x200 Checked%Round3% VRound3
Gui, add, Checkbox, y235 x250 Checked%Fix3% VFix3

Gui, add, Checkbox, y260 x210 Checked%autobet% Vautobet
Gui, add, text, y260 x55,Additionally press bet button

Gui, Add, Edit, x80 y282 w40 h20 vincr1, %incr1%
Gui, Add, Text, x15 y285 ,Increase by
Gui, Add, Radio, x125 y280 w40 h15 Checked%bb1% vbb1,bb
Gui, Add, Radio, x125 y295 w40 h15 Checked%sb1% vsb1,sb
Gui, Add, Edit, x190 y282 w80 h20 valt1, %alt1%

Gui, Add, Edit, x80 y312 w40 h20 vincr2, %incr2%
Gui, Add, Text, x15 y315 ,Decrease by
Gui, Add, Radio, x125 y310 w40 h15 Checked%bb2% vbb2,bb
Gui, Add, Radio, x125 y325 w40 h15 Checked%sb2% vsb2,sb
Gui, Add, Edit, x190 y312 w80 h20 valt2, %alt2%

Gui, Add, Edit, x80 y342 w40 h20 vincr3, %incr3%
Gui, Add, Text, x15 y345 ,Increase by
Gui, Add, Radio, x125 y340 w40 h15 Checked%bb3% vbb3,bb
Gui, Add, Radio, x125 y355 w40 h15 Checked%sb3% vsb3,sb
Gui, Add, Edit, x190 y342 w80 h20 valt3, %alt3%

Gui, Add, Edit, x80 y372 w40 h20 vincr4, %incr4%
Gui, Add, Text, x15 y375 ,Decrease by
Gui, Add, Radio, x125 y370 w40 h15 Checked%bb4% vbb4,bb
Gui, Add, Radio, x125 y385 w40 h15 Checked%sb4% vsb4,sb
Gui, Add, Edit, x190 y372 w80 h20 valt4, %alt4%

Gui, Add, Text, x15 y400 ,Attempts to read Pot amount from screen
Gui, Add, Edit, x230 y397 w25 h20 vattempts, %attempts%

Gui, Add, Text, x15 y420 ,* Pot percent

Gui, add, text,cRed y440 x35,BetPot function won't be efficient with aero theme on

Gui, Add, Button, x75 y460 w55 h20 gSave,Submit
Gui, Add, Button, x135 y460 w55 h20 gCancel,Cancel

Gosub, GetIni
Gui, show, w316, %thisahk%
Return
;--------------------------------------------------------------------------------

---------------------
GetIni:
Settitlematchmode,2
IfNotExist, %thisahk%.ini
gosub, CreateIni
IniRead, ClassicTheme,%thisahk%.ini, Options, ClassicTheme,0
IniRead, Racetrack,%thisahk%.ini, Options, Racetrack,0
IniRead, ActOnActiveTable, %thisahk%.ini, Options, ActOnActiveTable, 0
IniRead, sendundermouse, %thisahk%.ini, Options, sendundermouse, 0
IniRead, activatetableundermouse, %thisahk%.ini, Settings, 

activatetableundermouse, 0
IniRead, Highlight, %thisahk%.ini, Settings, Highlight, 0
IniRead, highlighthero, %thisahk%.ini, Options, highlighthero, 0
IniRead, highlightactive, %thisahk%.ini, Options, highlightactive, 0
IniRead, MoveMouse, %thisahk%.ini, Settings, MoveMouse, 0
IniRead, stealfocus, %thisahk%.ini, Settings, stealfocus, 0

IniRead, Interval1, %thisahk%.ini, Settings, Interval1
StringReplace, ddlist, ddlist, %interval1%, %Interval1%|
GuiControl, , Interval1, |%ddlist%
StringReplace, ddlist, ddlist, %interval1%|, %Interval1%
IniRead, flicker1, %thisahk%.ini, Settings, flicker1, 0
IniRead, flicker2, %thisahk%.ini, Settings, flicker2, 0
IniRead, dealmein, %thisahk%.ini, Settings, dealmein, 0
IniRead, Toggledealmein, %thisahk%.ini, Settings, Toggledealmein,%A_Space%
If Toggledealmein
{
HotKey, IfWinActive, ahk_class QWidget
Hotkey, %Toggledealmein%, Toggledealmein
}
IniRead, Timebank, %thisahk%.ini, Settings, Timebank, 0
IniRead, SitOutNextAll, %thisahk%.ini, Hotkeys, SitOutNextAll,%A_Space%
IniRead, RemoveSitout, %thisahk%.ini, Hotkeys, RemoveSitout,%A_Space%
if SitOutNextAll
Hotkey, %SitOutNextAll%,SitOutNextAll
if RemoveSitout
Hotkey, %RemoveSitout%,RemoveSitout

IniRead, register, %thisahk%.ini, Settings, register,%A_Space%
IniRead, unregister, %thisahk%.ini, Settings, unregister,%A_Space%
IniRead, joinwaitlist, %thisahk%.ini, Settings, joinwaitlist,%A_Space%
IniRead, Unjoinwaitlist, %thisahk%.ini, Settings, Unjoinwaitlist,%A_Space%
if register
Hotkey, %register%,register
if unregister
Hotkey, %unregister%,unregister
if joinwaitlist
Hotkey, %joinwaitlist%,joinwaitlist
if Unjoinwaitlist
Hotkey, %Unjoinwaitlist%,Unjoinwaitlist
IniRead, ActivateBottomWindow, %thisahk%.ini, Hotkeys, ActivateBottomWindow,%

A_Space%
if ActivateBottomWindow
Hotkey, %ActivateBottomWindow%,ActivateBottomWindow
IniRead, suspend, %thisahk%.ini, Hotkeys, suspend,%A_Space%
if suspend
Hotkey, %suspend%,suspend
IniRead, TogglePause, %thisahk%.ini, Hotkeys, TogglePause,%A_Space%
if TogglePause
Hotkey, %TogglePause%,TogglePause
IniRead, layout1, %thisahk%.ini, Hotkeys, layout1,%A_Space%
if layout1
Hotkey, %layout1%,layout1
IniRead, layout2, %thisahk%.ini, Hotkeys, layout2,%A_Space%
if layout2
Hotkey, %layout2%,layout2
IniRead, layout3, %thisahk%.ini, Hotkeys, layout3,%A_Space%
if layout3
Hotkey, %layout3%,layout3


IniRead, fold, %thisahk%.ini, Hotkeys, fold,%A_Space%
IniRead, call, %thisahk%.ini, Hotkeys, call,%A_Space%
IniRead, raise, %thisahk%.ini, Hotkeys, raise,%A_Space%
IniRead, fold2any, %thisahk%.ini, Hotkeys, fold2any,%A_Space%
if fold
{
;HotKey, IfWinActive, ahk_class QWidget
HotKey, IfWinActive
Hotkey, %fold%,fold
}
if call
{
;HotKey, IfWinActive, ahk_class QWidget
HotKey, IfWinActive
Hotkey, %call%,call
}
if raise
{
;HotKey, IfWinActive, ahk_class QWidget
HotKey, IfWinActive
Hotkey, %raise%,raise
}
if fold2any
{
;HotKey, IfWinActive, ahk_class QWidget
HotKey, IfWinActive
Hotkey, %fold2any%,fold2any
}


IniRead, NextWindow_Up,%thisahk%.ini, Hotkeys, NextWindow_Up,%A_Space%
IniRead, NextWindow_Down,%thisahk%.ini, Hotkeys, NextWindow_Down,%A_Space%
IniRead, NextWindow_Left,%thisahk%.ini, Hotkeys, NextWindow_Left,%A_Space%
IniRead, NextWindow_Right,%thisahk%.ini, Hotkeys, NextWindow_Right,%A_Space%
If NextWindow_Up
{
HotKey, IfWinActive, ahk_class QWidget
Hotkey, %NextWindow_Up%, NextWindow_Up
}

If NextWindow_Down
{
HotKey, IfWinActive, ahk_class QWidget
Hotkey, %NextWindow_Down%, NextWindow_Down
}

If NextWindow_Left
{
HotKey, IfWinActive, ahk_class QWidget
Hotkey, %NextWindow_Left%, NextWindow_Left
}

If NextWindow_Right
{
HotKey, IfWinActive, ahk_class QWidget
Hotkey, %NextWindow_Right%, NextWindow_Right
}




IniRead, OpenDef, %thisahk%.ini, BetPotSettings, OpenDef
StringReplace, ddlist1, ddlist1, %OpenDef%, %OpenDef%|
GuiControl, , OpenDef, |%ddlist1%
StringReplace, ddlist1, ddlist1, %OpenDef%|, %OpenDef%
IniRead, RoundDef, %thisahk%.ini, BetPotSettings, RoundDef, 0
IniRead, FixDef, %thisahk%.ini, BetPotSettings, FixDef, 0
IniRead, PotDefPre, %thisahk%.ini, BetPotSettings, PotDefPre, 0
IniRead, PotDefFlop, %thisahk%.ini, BetPotSettings, PotDefFlop, 0
IniRead, PotDefTurn, %thisahk%.ini, BetPotSettings, PotDefTurn, 0
IniRead, PotDefRiver, %thisahk%.ini, BetPotSettings, PotDefRiver, 0

IniRead, Open1, %thisahk%.ini, BetPotSettings, Open1
StringReplace, ddlist1, ddlist1, %Open1%, %Open1%|
GuiControl, , Open1, |%ddlist1%
StringReplace, ddlist1, ddlist1, %Open1%|, %Open1%
IniRead, Round1, %thisahk%.ini, BetPotSettings, Round1, 0
IniRead, Fix1, %thisahk%.ini, BetPotSettings, Fix1, 0
IniRead, Pot1Pre, %thisahk%.ini, BetPotSettings, Pot1Pre, 0
IniRead, Pot1Flop, %thisahk%.ini, BetPotSettings, Pot1Flop, 0
IniRead, Pot1Turn, %thisahk%.ini, BetPotSettings, Pot1Turn, 0
IniRead, Pot1River, %thisahk%.ini, BetPotSettings, Pot1River, 0
IniRead, pot1, %thisahk%.ini, BetPotHotkeys, pot1,%A_Space%
if pot1
{
;HotKey, IfWinActive,ahk_class QWidget
HotKey, IfWinActive
Hotkey, %pot1%,pot1
}
IniRead, Open2, %thisahk%.ini, BetPotSettings, Open2
StringReplace, ddlist1, ddlist1, %Open2%, %Open2%|
GuiControl, , Open2, |%ddlist1%
StringReplace, ddlist1, ddlist1, %Open2%|, %Open2%
IniRead, Round2, %thisahk%.ini, BetPotSettings, Round2, 0
IniRead, Fix2, %thisahk%.ini, BetPotSettings, Fix2, 0
IniRead, Pot2Pre, %thisahk%.ini, BetPotSettings, Pot2Pre, 0
IniRead, Pot2Flop, %thisahk%.ini, BetPotSettings, Pot2Flop, 0
IniRead, Pot2Turn, %thisahk%.ini, BetPotSettings, Pot2Turn, 0
IniRead, Pot2River, %thisahk%.ini, BetPotSettings, Pot2River, 0
IniRead, pot2, %thisahk%.ini, BetPotHotkeys, pot2,%A_Space%
if pot2
{
;HotKey, IfWinActive,ahk_class QWidget
HotKey, IfWinActive
Hotkey, %pot2%,pot2
}
IniRead, Open3, %thisahk%.ini, BetPotSettings, Open3
StringReplace, ddlist1, ddlist1, %Open3%, %Open3%|
GuiControl, , Open3, |%ddlist1%
StringReplace, ddlist1, ddlist1, %Open3%|, %Open3%
IniRead, Round3, %thisahk%.ini, BetPotSettings, Round3, 0
IniRead, Fix3, %thisahk%.ini, BetPotSettings, Fix3, 0
IniRead, Pot3Pre, %thisahk%.ini, BetPotSettings, Pot3Pre, 0
IniRead, Pot3Flop, %thisahk%.ini, BetPotSettings, Pot3Flop, 0
IniRead, Pot3Turn, %thisahk%.ini, BetPotSettings, Pot3Turn, 0
IniRead, Pot3River, %thisahk%.ini, BetPotSettings, Pot3River, 0
IniRead, pot3, %thisahk%.ini, BetPotHotkeys, pot3,%A_Space%
if pot3
{
;HotKey, IfWinActive,ahk_class QWidget
HotKey, IfWinActive
Hotkey, %pot3%,pot3
}

IniRead, incr1, %thisahk%.ini, BetPotSettings, incr1, 0
IniRead, bb1, %thisahk%.ini, BetPotSettings, bb1, 0
IniRead, sb1, %thisahk%.ini, BetPotSettings, sb1, 0
IniRead, alt1, %thisahk%.ini, BetPotHotkeys, alt1, %A_Space%
if alt1
{
HotKey, IfWinActive, ahk_class QWidget
Hotkey, %alt1%,alt1
}
IniRead, incr2, %thisahk%.ini, BetPotSettings, incr2, 0
IniRead, bb2, %thisahk%.ini, BetPotSettings, bb2, 0
IniRead, sb2, %thisahk%.ini, BetPotSettings, sb2, 0
IniRead, alt2, %thisahk%.ini, BetPotHotkeys, alt2, %A_Space%
if alt2
{
HotKey, IfWinActive, ahk_class QWidget
Hotkey, %alt2%,alt2
}
IniRead, incr3, %thisahk%.ini, BetPotSettings, incr3, 0
IniRead, bb3, %thisahk%.ini, BetPotSettings, bb3, 0
IniRead, sb3, %thisahk%.ini, BetPotSettings, sb3, 0
IniRead, alt3, %thisahk%.ini, BetPotHotkeys, alt3, %A_Space%
if alt3
{
HotKey, IfWinActive, ahk_class QWidget
Hotkey, %alt3%,alt3
}
IniRead, incr4, %thisahk%.ini, BetPotSettings, incr4, 0
IniRead, bb4, %thisahk%.ini, BetPotSettings, bb4, 0
IniRead, sb4, %thisahk%.ini, BetPotSettings, sb4, 0
IniRead, alt4, %thisahk%.ini, BetPotHotkeys, alt4, %A_Space%
if alt4
{
HotKey, IfWinActive, ahk_class QWidget
Hotkey, %alt4%,alt4
}

IniRead, autopot, %thisahk%.ini, BetPotSettings, autopot, 0
IniRead, autobet, %thisahk%.ini, BetPotSettings, autobet, 0
IniRead, attempts, %thisahk%.ini, BetPotVariables, attempts, 0
Return
;--------------------------------------------------------------------------------

---------------------
MakeIni:
If ClassicTheme
IniWrite, %ClassicTheme%, %thisahk%.ini, Options, ClassicTheme
If Racetrack
IniWrite, %Racetrack%, %thisahk%.ini, Options, Racetrack
if ActOnActiveTable
IniWrite, %ActOnActiveTable%, %thisahk%.ini, Options, ActOnActiveTable
if sendundermouse
IniWrite, %sendundermouse%, %thisahk%.ini, Options, sendundermouse
IniWrite, %activatetableundermouse%, %thisahk%.ini, Settings, 

activatetableundermouse
IniWrite, %Highlight%, %thisahk%.ini, Settings, Highlight
if highlighthero
IniWrite, %highlighthero%, %thisahk%.ini, Options, highlighthero
if highlightactive
IniWrite, %highlightactive%, %thisahk%.ini, Options, highlightactive
IniWrite, %MoveMouse%, %thisahk%.ini, Settings, MoveMouse
IniWrite, %stealfocus%, %thisahk%.ini, Settings, stealfocus
IniWrite, %Interval1%, %thisahk%.ini, Settings, Interval1
IniWrite, %flicker1%, %thisahk%.ini, Settings, flicker1
IniWrite, %flicker2%, %thisahk%.ini, Settings, flicker2
IniWrite, %dealmein%, %thisahk%.ini, Settings, dealmein
if Toggledealmein
IniWrite, %Toggledealmein%, %thisahk%.ini, Settings, Toggledealmein
IniWrite, %Timebank%, %thisahk%.ini, Settings, Timebank
if SitOutNextAll
IniWrite, %SitOutNextAll%, %thisahk%.ini, Hotkeys, SitOutNextAll
if RemoveSitout
IniWrite, %RemoveSitout%, %thisahk%.ini, Hotkeys, RemoveSitout

if register
IniWrite, %register%, %thisahk%.ini, Settings, register
if unregister
IniWrite, %unregister%, %thisahk%.ini, Settings, unregister
if joinwaitlist
IniWrite, %joinwaitlist%, %thisahk%.ini, Settings, joinwaitlist
if Unjoinwaitlist
IniWrite, %Unjoinwaitlist%, %thisahk%.ini, Settings, Unjoinwaitlist
if ActivateBottomWindow
IniWrite, %ActivateBottomWindow%, %thisahk%.ini, Hotkeys, ActivateBottomWindow
if suspend
IniWrite, %suspend%, %thisahk%.ini, Hotkeys, suspend
if TogglePause
IniWrite, %TogglePause%, %thisahk%.ini, Hotkeys, TogglePause
if layout1
IniWrite, %layout1%, %thisahk%.ini, Hotkeys, layout1
if layout2
IniWrite, %layout2%, %thisahk%.ini, Hotkeys, layout2
if layout3
IniWrite, %layout3%, %thisahk%.ini, Hotkeys, layout3


if fold
IniWrite, %fold%, %thisahk%.ini, Hotkeys, fold
if call
IniWrite, %call%, %thisahk%.ini, Hotkeys, call
if raise
IniWrite, %raise%, %thisahk%.ini, Hotkeys, raise
if fold2any
IniWrite, %fold2any%, %thisahk%.ini, Hotkeys, fold2any

If NextWindow_Up
IniWrite, %NextWindow_Up%, %thisahk%.ini, Hotkeys, NextWindow_Up

If NextWindow_Down
IniWrite, %NextWindow_Down%, %thisahk%.ini, Hotkeys, NextWindow_Down
 
If NextWindow_Left
IniWrite, %NextWindow_Left%, %thisahk%.ini, Hotkeys, NextWindow_Left

If NextWindow_Right
IniWrite, %NextWindow_Right%, %thisahk%.ini, Hotkeys, NextWindow_Right



IniWrite, %OpenDef%, %thisahk%.ini, BetPotSettings, OpenDef
IniWrite, %RoundDef%, %thisahk%.ini, BetPotSettings, RoundDef
IniWrite, %FixDef%, %thisahk%.ini, BetPotSettings, FixDef
IniWrite, %PotDefPre%, %thisahk%.ini, BetPotSettings, PotDefPre
IniWrite, %PotDefFlop%, %thisahk%.ini, BetPotSettings, PotDefFlop
IniWrite, %PotDefTurn%, %thisahk%.ini, BetPotSettings, PotDefTurn
IniWrite, %PotDefRiver%, %thisahk%.ini, BetPotSettings, PotDefRiver

IniWrite, %Open1%, %thisahk%.ini, BetPotSettings, Open1
IniWrite, %Round1%, %thisahk%.ini, BetPotSettings, Round1
IniWrite, %Fix1%, %thisahk%.ini, BetPotSettings, Fix1
IniWrite, %Pot1Pre%, %thisahk%.ini, BetPotSettings, Pot1Pre
IniWrite, %Pot1Flop%, %thisahk%.ini, BetPotSettings, Pot1Flop
IniWrite, %Pot1Turn%, %thisahk%.ini, BetPotSettings, Pot1Turn
IniWrite, %Pot1River%, %thisahk%.ini, BetPotSettings, Pot1River
if pot1
IniWrite, %pot1%, %thisahk%.ini, BetPotHotkeys, pot1

IniWrite, %Open2%, %thisahk%.ini, BetPotSettings, Open2
IniWrite, %Round2%, %thisahk%.ini, BetPotSettings, Round2
IniWrite, %Fix2%, %thisahk%.ini, BetPotSettings, Fix2
IniWrite, %Pot2Pre%, %thisahk%.ini, BetPotSettings, Pot2Pre
IniWrite, %Pot2Flop%, %thisahk%.ini, BetPotSettings, Pot2Flop
IniWrite, %Pot2Turn%, %thisahk%.ini, BetPotSettings, Pot2Turn
IniWrite, %Pot2River%, %thisahk%.ini, BetPotSettings, Pot2River
if pot2
IniWrite, %pot2%, %thisahk%.ini, BetPotHotkeys, pot2

IniWrite, %Open3%, %thisahk%.ini, BetPotSettings, Open3
IniWrite, %Round3%, %thisahk%.ini, BetPotSettings, Round3
IniWrite, %Fix3%, %thisahk%.ini, BetPotSettings, Fix3
IniWrite, %Pot3Pre%, %thisahk%.ini, BetPotSettings, Pot3Pre
IniWrite, %Pot3Flop%, %thisahk%.ini, BetPotSettings, Pot3Flop
IniWrite, %Pot3Turn%, %thisahk%.ini, BetPotSettings, Pot3Turn
IniWrite, %Pot3River%, %thisahk%.ini, BetPotSettings, Pot3River
if pot3
IniWrite, %pot3%, %thisahk%.ini, BetPotHotkeys, pot3


IniWrite, %incr1%, %thisahk%.ini, BetPotSettings, incr1
if bb1
IniWrite, %bb1%, %thisahk%.ini, BetPotSettings, bb1
if sb1
IniWrite, %sb1%, %thisahk%.ini, BetPotSettings, sb1
if alt1
IniWrite, %alt1%, %thisahk%.ini, BetPotHotkeys, alt1

IniWrite, %incr2%, %thisahk%.ini, BetPotSettings, incr2
if bb2
IniWrite, %bb2%, %thisahk%.ini, BetPotSettings, bb2
if sb2
IniWrite, %sb2%, %thisahk%.ini, BetPotSettings, sb2
if alt2
IniWrite, %alt2%, %thisahk%.ini, BetPotHotkeys, alt2

IniWrite, %incr3%, %thisahk%.ini, BetPotSettings, incr3
if bb3
IniWrite, %bb3%, %thisahk%.ini, BetPotSettings, bb3
if sb3
IniWrite, %sb3%, %thisahk%.ini, BetPotSettings, sb3
if alt3
IniWrite, %alt3%, %thisahk%.ini, BetPotHotkeys, alt3

IniWrite, %incr4%, %thisahk%.ini, BetPotSettings, incr4
if bb4
IniWrite, %bb4%, %thisahk%.ini, BetPotSettings, bb4
if sb4
IniWrite, %sb4%, %thisahk%.ini, BetPotSettings, sb4
if alt4
IniWrite, %alt4%, %thisahk%.ini, BetPotHotkeys, alt4


IniWrite, %autopot%, %thisahk%.ini, BetPotSettings, autopot
IniWrite, %autobet%, %thisahk%.ini, BetPotSettings, autobet
IniWrite, %attempts%, %thisahk%.ini, BetPotVariables, attempts

Return
;--------------------------------------------------------------------------------

---------------------
CreateIni:
Racetrack:=0
ClassicTheme:=1
ActOnActiveTable:=1
sendundermouse:=0
activatetableundermouse:=0
Highlight:=0
highlighthero:=0
highlightactive:=1
MoveMouse:=0
stealfocus:=1
NextWindow_Up=Up
NextWindow_Down=Down
NextWindow_Left=Left
NextWindow_Right=Right


flicker1:=1
flicker2:=0
Interval1:=1
dealmein:=0
Timebank:=0

register=^r
unregister=^u

autopot:=0
autobet:=0
OpenDef=ssnl
Open1=ssnl
Open2=trny
Open3=----
RoundDef:=1
Round1:=1
Round2:=1
Round3:=1
fixDef:=1
fix1:=1
fix2:=1
fix3:=1
PotDefPre:=75
PotDefFlop:=75
PotDefTurn:=66
PotDefRiver:=66
Pot1Pre:=75
Pot1Flop:=75
Pot1Turn:=66
Pot1River:=66
Pot2Pre:=100
Pot2Flop:=80
Pot2Turn:=80
Pot2River:=80
Pot3Pre:=999
Pot3Flop:=100
Pot3Turn:=100
Pot3River:=100
Pot1=mbutton
Pot2=xbutton1
Pot3=xbutton2
incr1:=1
incr2:=1
incr3:=1
incr4:=1
bb1:=1
sb1:=0
bb2:=1
sb2:=0
bb3:=0
sb3:=1
bb4:=0
sb4:=1
alt1=wheelup
alt2=wheeldown
alt3=^wheelup
alt4=^wheeldown
attempts:=1

gosub, MakeIni
gosub, buildgui
return
;--------------------------------------------------------------------------------

---------------------
GuiClose:
gosub, cancel
return
;--------------------------------------------------------------------------------

---------------------
menuGui:
gosub, getini
winget,id,id, %thisahk% ahk_class AutoHotkeyGUI
if !DllCall( "IsWindowVisible", "UInt",id)
gosub, buildgui
Gui, Submit,nohide
return
;--------------------------------------------------------------------------------

---------------------
reload:
reload
return
;--------------------------------------------------------------------------------

---------------------
Save:
Gui, Submit
FileDelete, %thisahk%.ini
gosub, MakeIni
Reload
return
;--------------------------------------------------------------------------------

---------------------
Cancel:
Gui, Destroy
Return
;--------------------------------------------------------------------------------

---------------------
TogglePause:
pause,toggle
return
;--------------------------------------------------------------------------------

---------------------
Suspend:
suspend
if A_IsSuspended=0
{
 T=Off
}
else
{
 T=On
}
Gui, 13:Add, Text,,Suspend: %T%
Gui, 13:+ToolWindow
Gui, 13:Show, w150 h20
Sleep, 1500
Gui, 3:Destroy
return
;--------------------------------------------------------------------------------

---------------------
Edit:
edit
return
;--------------------------------------------------------------------------------

---------------------
exitSub:
if flicker1
{
Process, Exist, FullTiltPoker.exe
if (ErrorLevel)
{
  FTP := ErrorLevel
  Process, Priority, %FTP%, Normal
;  SetAffinity(FTP)
}
}
;FileDelete, %thisahk%.ini
;gosub, makeini
exitApp
return
;--------------------------------------------------------------------------------

---------------------
/*  License:
 *  	NextWindow v0.1 by Xander
 *  	GNU General Public License 3.0 or higher: http://www.gnu.org/licenses/gpl

-3.0.txt
 * 
 *  Usage:
 *  	Navigate windows that match the specified title.
 *  
 *  Listeners:
 *  	Supports Listening for a specific class that has been activated by 

defining an OnActivate_%class% subroutine.
 *  
 *  Example:
 *  	#IfWinActive ahk_class Notepad
 *  	Left:: NextWindow_Left("ahk_class Notepad")
 *  	Right:: NextWindow_Right("ahk_class Notepad")
 *  	Up:: NextWindow_Up("ahk_class Notepad")
 *  	Down:: NextWindow_Down("ahk_class Notepad")
 *  
 *  Listener Example:
 *  	GroupAdd, Windows, ahk_class Notepad
 *  	GroupAdd, Windows, ahk_class TfPSPad
 *  	#IfWinActive ahk_group Windows
 *  	Left:: NextWindow_Left("ahk_group Windows")
 *  	Right:: NextWindow_Right("ahk_group Windows")
 *  	Up:: NextWindow_Up("ahk_group Windows")
 *  	Down:: NextWindow_Down("ahk_group Windows")
 *  	OnActivate_TfPSPad:
 *  		MsgBox, PSPad was activated
 *  		return
 */

NextWindow_Calc(ByRef perp, ByRef parallel, ByRef id, ByRef min, ByRef minID) {
	parallel /= 2
	d := Sqrt(parallel*parallel+perp*perp)
	if (d < min) {
		min := d
		minID := id
	}
}

NextWindow_Activate(Byref id1, ByRef id2, Byref id3) {
	local id := id1 ? id1 : id2 ? id2 : id3 ? id3 : ""
	if !id
		return
	WinActivate, ahk_id %id%
	local window
	WinGetClass, window, ahk_id %id%
	window := "OnActivate_" . window
	if IsLabel(window)
		GoSub, %window%
}

NextWindow_Left(title) {
	WinGet, cId, ID, A
	WinGetPos, cX, cY, , cH
	cH_half := cH/2
	min := A_ScreenWidth
	minRight := min
	maxY := 0
	maxX := 0
	WinGet windows, List, %title%
	Loop, %windows%	{
		id := windows%A_Index%
		if (id == cID)
			continue
		WinGetPos, x, y, w, , ahk_id %id%
		dx := cX - x
		if (dx < 0) {
			dx := A_ScreenWidth - x - w
			if (dx < 0)
				dx := 0
			dy := y - cY
			if (dy < 0)
				NextWindow_Calc(dy, dx, id, minRight, minRightID)
		} else if (dx > 9) {
			dy := abs(cY - y)
			if (dy < cH_half)
				NextWindow_Calc(dy, dx, id, min, minID)
		}
		if (y >= maxY) {
			if (x >= maxX || y > maxY + cH) {
				maxX := x
				maxY := y
				oppID := id
			}
		}
	}
	NextWindow_Activate(minId, minRightID, oppID)
}

NextWindow_Right(title) {
	WinGet, cId, ID
	WinGetPos, cX, cY, , cH
	cH_half := cH/2
	min := A_ScreenWidth
	minLeft := min
	minY := min
	minX := min
	WinGet windows, List, %title%
	Loop, %windows%	{
		id := windows%A_Index%
		if (id == cID)
			continue
		WinGetPos, x, y, w, , ahk_id %id%
		dx := x - cX
		if (dx < 0) {
			dx := x
			if (dx < 0)
				dx := 0
			dy := cY - y
			if (dy < 0)
				NextWindow_Calc(dy, dx, id, minLeft, minLeftID)
		} else if (dx > 9) {
			dy := abs(cY - y)
			if (dy < cH_half)
				NextWindow_Calc(dy, dx, id, min, minID)
		}
		if (y <= minY) {
			if (x <= minX || y < minY - cH_half) {
				minX := x
				minY := y
				oppID := id
			}
		}
	}
	NextWindow_Activate(minId, minLeftID, oppID)
}

NextWindow_Up(title) {
	WinGet, cID, ID
	WinGetPos, cX, cY, cW
	cW_half := cW/2
	min := A_ScreenHeight
	minDown := min
	minX := min
	maxY := 0
	WinGet windows, List, %title%
	Loop, %windows%	{
		id := windows%A_Index%
		if (id == cID)
			continue
		WinGetPos, x, y, , h, ahk_id %id%
		dy := cY - y
		if (dy < 0) {
			dy := A_ScreenHeight - y - h
			if (dy < 0)
				dy := 0
			dx := cX - x
			if (dx < 0)
				NextWindow_Calc(dx, dy, id, minDown, minDownId)
		} else if (dy > 9) {
			dx := abs(cX - x)
			if (dx < cW_half)
				NextWindow_Calc(dx, dy, id, min, minID)
		}
		if (x <= minX) {
			if (y >= maxY || x < minX - cW_half) {
					minX := x
					maxY := y
					oppID := id
			}
		}
	}
	NextWindow_Activate(minId, minDownID, oppID)
}

NextWindow_Down(title) {
	WinGet, cID, ID
	WinGetPos, cX, cY, cW
	cW_half := cW/2
	min := A_ScreenWidth
	minUp := min
	maxX := 0
	minY := min
	WinGet windows, List, %title%
	Loop, %windows%	{
		id := windows%A_Index%
		if (id == cID)
			continue
		WinGetPos, x, y, , , ahk_id %id%
		dy := y - cY
		dx := x - cX
		if (dy < 0) {
			dy := y
			if (dy < 0)
				dy := 0
			dx := x - cX
			if (dx < 0)
				NextWindow_Calc(dx, dy, id, minUp, minUpID)
		} else if (dy > 9) {
			dx := abs(cX - x)
			if (dx < cW_half)
				NextWindow_Calc(dx, dy, id, min, minID)
		}
		if (x >= maxX) {
			if (y <= minY || x > maxX + cW_half) {
				maxX := x
				minY := y
				oppID := id
			}
		}
	}
	NextWindow_Activate(minId, minUpID, oppID)
}
FTCash - free script for FullTilt cash players. Quote
02-05-2010 , 02:00 AM
Any chance of adding Activate Previous Table? I like to be able to scroll through my cascade in both directions.

Thanks.
FTCash - free script for FullTilt cash players. Quote
02-05-2010 , 07:08 AM
Any chance on adding an "answer wait list" option to automatically answer yes to the "seat available" wait list?
FTCash - free script for FullTilt cash players. Quote
02-05-2010 , 07:48 AM
I'll try to make new update within few days.
FTCash - free script for FullTilt cash players. Quote
02-06-2010 , 02:32 PM
I saw you have a script like this for PokerStars as well. Why don't you take over Poker Shortcuts? It's open source and you seem to be very competent.
It would be very useful to have something to play on Full Tilt and Stars at the same time.

Also, could you add a Hotkey to only click the fold check box and NOT the fold button (prevents misclicks when stacking tables)? I suppose it could also click Quick Fold on Rush tables.
Or is there something like that that I missed?
FTCash - free script for FullTilt cash players. Quote
02-06-2010 , 02:52 PM
I've never played on rush tables but i guess it should be easy to add such hotkey. And it is not easy at all to work with huge project like PSC. I want to play poker like you and you want to give me tons of work to do
FTCash - free script for FullTilt cash players. Quote

      
m