Open Side Menu Go to the Top
Register
Quick Questions & Answers Thread Quick Questions & Answers Thread

08-19-2010 , 06:06 PM
just copy/paste it over the one already present in the betpot folder
Quick Questions & Answers Thread Quote
08-19-2010 , 06:11 PM
That's it working now, but right click in the bet box brings up cut, copy, paste etc. So I need to change to the more suitable keys.
Quick Questions & Answers Thread Quote
08-19-2010 , 06:36 PM
Quote:
Originally Posted by pureklas
I'll copy the ahk details below. Maybe you can tell me what to change?

So for the $ to bb convertor i'd like to use tab as 1.5 = 2.5bb; / as 2 = 3bb; * as 2.5 = pot
no idea what you mean by these numbers, they don't match the BB? e.g. how can 2 = 3bb? anyhow, here is the keys set up for the bb amounts. just copy paste, remove anything else. I left the wheel in, remove that too if you don't want it.

Code:
;------------ START OF HOTKEY SETUP SECTION --------------------

Tab::
AlterAmount(getid(),"down", 99999)
AlterAmount(getid(),"up", 2.5)
return

NumpadDiv::
AlterAmount(getid(),"down", 99999)
AlterAmount(getid(),"up", 3)
return

NumpadMult::
Pot(getid(),"1")
return



WheelUp::
AlterAmount(getid(),"up")
return

WheelDown::
AlterAmount(getid(),"down")
return
Quick Questions & Answers Thread Quote
08-19-2010 , 06:54 PM
This works perfectly now. Can we add in the num pad - for half pot post flop and the + for pot?

Also, I just tried using the long hud, which is how we started It says on the website that stars allow it and I had no probs on my laptop, but when I tried it on my poker playing desktop I got a continuous German pop up that seemed like it was on the prohibited list possibly because of the hand chart things.

I only want it for $ to bb, which is where the 2.5 etc come from because typing 1 in the bet box + 2bb. 1.5 + 2.5bb etc instead of what I would have assumed 2.5bb + 2.5bb etc.

I know i'm prob a pain now. I will ship you $20 on stars for goodwill.

On their website it says:

What must I edit if I just need the $ 2BB?

* LongsSHC.xml (Installationsverzeichnis) mit einem Editor &oouml;ffnen (zB notepad) LongsSHC.xml (installation directory) Commonly Open with an editor (eg notepad)
* Nach den Einträgen <playerstatwindow visible="true" und <gameplaywindow (...) visible="true"> suchen. the entries <playerstatwindow visible = "true" and <gameplaywindow (...) visible="true"> Find.
* visible jeweils auf visible="false" ändern visible change on each visible = "false"
* visible ist case sensitiv, und "true" ist default. visible case is sensitive, and "true" is default. ("False", "false ", "FALSE" wird als "true interpretiert, "false" als false) ("False", "false", "FALSE" is interpreted as "true," false "as false)

However since i'm computer illiterate I found it very confusing when looking at this:
Code:
<?xml version="1.0" encoding="ISO-8859-1"?>
<longsTrainerConfig version="1.0" >
	<defcolors>
		<color name="DarkBlue" value="#00008B" />
		<color name="Navy" value="#000080" />
		<color name="RoyalBlue" value="#4169E1" />
		<color name="MediumBlue" value="#0000CD" />
		<color name="SkyBlue" value="#87CEEB" />
		<color name="Cyan" value="#00FFFF" />
		<color name="Brown" value="#A52A2A" />
		<color name="DarkRed" value="#8B0000" />
		<color name="FireBrick" value="#B22222" />
		<color name="Red" value="#FF0000" />
		<color name="OrangeRed" value="#FF4500" />
		<color name="Magenta" value="#FF00FF" />
		<color name="DarkSalmon" value="#E9967A" />
		<color name="LightSalmon" value="#FFA07A" />
		<color name="Orange" value="#FFA500" />
		<color name="Yellow" value="#FFFF00" />
		<color name="GreenYellow" value="#ADFF2F" />
		<color name="LightGreen" value="#90EE90" />
		<color name="Lime" value="#00FF00" />
		<color name="LimeGreen" value="#32CD32" />
		<color name="LawnGreen" value="#7CFC00" />
		<color name="Green" value="#008000" />
		<color name="ForestGreen" value="#228B22" />
		<color name="DarkGreen" value="#006400" />
		<color name="White" value="#000000" />
		<color name="LightGray" value="#D3D3D3" />
		<color name="Gray" value="#808080" />
		<color name="DarkGray" value="#A9A9A9" />
		<color name="White" value="#ffffff" />
		<color name="black" value="#000000" />
   
   
	</defcolors>
	<deffonts>
		<fontdef name="stdfont" face="Arial" size="12" bold="true" italic="false" underline="false" />
		<fontdef name="bigfont" face="Arial" size="14" bold="true" italic="false" underline="false" />
   
   
	</deffonts>
	<statcollection name="std" >
		<stat name="Misc::MyHoleCards" line="1" visible="true" font="stdfont" forecolor="White" />
		<stat name="Misc::MyPos" line="1" visible="true" font="stdfont" forecolor="White" />
		<stat name="Misc::PreflopTrafficLight" line="1" visible="true" font="bigfont" forecolor="none" format="%s" />
		<stat name="Misc::StartingHandUnraised" line="1" visible="true" font="bigfont" forecolor="White" format="%s" />
		<stat name="Misc::StartingHandRaisedBefore" line="1" visible="true" font="bigfont" forecolor="Yellow" format="/%s" />
		<stat name="Misc::StartingHandRaisedAfter" line="1" visible="true" font="bigfont" forecolor="Red" format="(%s)" />
		<stat name="Misc::StartingHandComment" line="2" visible="true" font="bigfont" forecolor="White" format="%s" />
		<stat name="Misc::PotSize" line="3" visible="false" font="stdfont" forecolor="White" format="Pot: %s " />
		<stat name="Misc::PotOdds" line="3" visible="true" font="bigfont" forecolor="White" datatyp="f" format=" PotOdds: %0.1f:1" />
		<stat name="Misc::PotOddsPer" line="3" visible="false" font="stdfont" forecolor="White" datatyp="f" format="(%0.0f%%)" />
		<stat name="Misc::OutsNeeded" line="3" visible="true" font="stdfont" forecolor="White" format="{%s}" />

	</statcollection>
	<statcollection name="playerstat" >
		<stat name="Player::PreflopAggressorMarker" line="1" visible="true" font="stdfont" forecolor="none" />
		<stat name="Player::Position" line="1" visible="true" font="stdfont" forecolor="White" />
		<stat name="Player::EffMFaktor" line="1" visible="true" font="bigfont" forecolor="White" >
			<range min="0" max="1" color="FireBrick" />
			<range min="1" max="5.01" color="Red" />
			<range min="5" max="10.01" color="Orange" />
			<range min="10" max="20" color="Yellow" />
			<range min="20" max="10000" color="ForestGreen" />

		</stat>
		<stat name="Player::BettingSequence" line="1" visible="true" font="stdfont" forecolor="White" />
		<stat name="Player::Stacksize" line="2" visible="false" font="stdfont" forecolor="White" />
		<stat name="Player::Name" line="2" visible="false" font="bigfont" forecolor="White" />
		<stat name="Player::BigBlinds" line="2" visible="false" font="bigfont" forecolor="White" />
		<stat name="Player::MFaktor" line="2" visible="false" font="bigfont" forecolor="White" />

	</statcollection>
	<statcollection name="oddsonly" >
		<stat name="Misc::PotOdds" line="1" visible="true" font="bigfont" forecolor="White" datatyp="f" format=" PotOdds: %0.1f:1" />
		<stat name="Misc::PotOddsPer" line="1" visible="false" font="stdfont" forecolor="White" datatyp="f" format="(%0.0f%%)" />
		<stat name="Misc::OutsNeeded" line="1" visible="true" font="stdfont" forecolor="White" format="{%s}" show_empty="true" />

	</statcollection>
	<layout site="PTY" seats="6" size="old" >
		<gameplaywindow gameType="all" x="488" y="245" visible="true" transparency="95" preferredSeat="-1" >
			<addstatcollection name="std" />
			      
		</gameplaywindow>
		<playerstatwindow visible="true" transparency="220" preferredSeat="-1" >
			<positions>
				<pos seat="1" x="473" y="78" />
				<pos seat="2" x="690" y="228" />
				<pos seat="3" x="455" y="404" />
				<pos seat="4" x="213" y="404" />
				<pos seat="5" x="2" y="233" />
				<pos seat="6" x="219" y="79" />
				<pos seat="7" x="0" y="0" />
         
         
			</positions>
			<addstatcollection name="playerstat" />
      
		</playerstatwindow>
   
   
	</layout>
	<layout site="PTY" seats="10" size="old" >
		<gameplaywindow gameType="all" x="488" y="245" visible="true" transparency="95" preferredSeat="-1" >
			<addstatcollection name="std" />
						      
		</gameplaywindow>
		<playerstatwindow visible="true" transparency="220" preferredSeat="-1" >
			<positions>
				<pos seat="1" x="473" y="78" />
				<pos seat="2" x="648" y="134" />
				<pos seat="3" x="690" y="228" />
				<pos seat="4" x="643" y="379" />
				<pos seat="5" x="455" y="404" />
				<pos seat="6" x="213" y="404" />
				<pos seat="7" x="39" y="362" />
				<pos seat="8" x="2" y="233" />
				<pos seat="9" x="44" y="113" />
				<pos seat="10" x="219" y="79" />
				<pos seat="11" x="0" y="0" />
         
         
			</positions>
			<addstatcollection name="playerstat" />
      
      
		</playerstatwindow>
   
	</layout>
	<layout site="PTY" seats="6" size="new" >
		<gameplaywindow gameType="all" x="488" y="245" visible="true" transparency="95" preferredSeat="-1" >
			<addstatcollection name="std" />
			      
		</gameplaywindow>
		<playerstatwindow visible="true" transparency="220" preferredSeat="-1" >
			<positions>
				<pos seat="1" x="561" y="6" />
				<pos seat="2" x="676" y="250" />
				<pos seat="3" x="535" y="388" />
				<pos seat="4" x="364" y="387" />
				<pos seat="5" x="16" y="250" />
				<pos seat="6" x="339" y="24" />
				<pos seat="7" x="0" y="0" />
         
			</positions>
			<addstatcollection name="playerstat" />
			 
      
		</playerstatwindow>
   
   
	</layout>
	<layout site="PTY" seats="10" size="new" >
		<gameplaywindow gameType="all" x="488" y="245" visible="true" transparency="95" preferredSeat="-1" >
			<addstatcollection name="std" />

		</gameplaywindow>
		<playerstatwindow visible="true" transparency="220" preferredSeat="-1" >
			<positions>
				<pos seat="1" x="559" y="2" />
				<pos seat="2" x="654" y="129" />
				<pos seat="3" x="677" y="248" />
				<pos seat="4" x="592" y="373" />
				<pos seat="5" x="531" y="389" />
				<pos seat="6" x="362" y="388" />
				<pos seat="7" x="99" y="374" />
				<pos seat="8" x="15" y="248" />
				<pos seat="9" x="96" y="130" />
				<pos seat="10" x="338" y="26" />
				<pos seat="11" x="0" y="0" />
         
         
         
			</positions>
			<addstatcollection name="playerstat" />
			      
      
		</playerstatwindow>
   
	</layout>
	<layout site="STARS" seats="2" >
		<gameplaywindow gameType="all" x="488" y="245" visible="true" transparency="95" preferredSeat="-1" >
			<addstatcollection name="std" />
			      
		</gameplaywindow>
		<playerstatwindow visible="true" transparency="180" preferredSeat="-1" >
			<positions>
				<pos seat="1" x="677" y="316" />
				<pos seat="2" x="36" y="312" />
				<pos seat="3" x="0" y="0" />

			</positions>
			<addstatcollection name="playerstat" />
      
      
      
		</playerstatwindow>

	</layout>
	<layout site="STARS" seats="6" >
		<gameplaywindow gameType="all" x="488" y="245" visible="true" transparency="95" preferredSeat="-1" >
			<addstatcollection name="std" />
			      
      
		</gameplaywindow>
		<playerstatwindow visible="true" transparency="180" preferredSeat="-1" >
			<positions>
				<pos seat="1" x="698" y="140" />
				<pos seat="2" x="690" y="325" />
				<pos seat="3" x="483" y="389" />
				<pos seat="4" x="226" y="389" />
				<pos seat="5" x="12" y="324" />
				<pos seat="6" x="8" y="123" />
				<pos seat="7" x="0" y="0" />
         
         
			</positions>
			<addstatcollection name="playerstat" />
			      
		</playerstatwindow>
   
   
	</layout>
	<layout site="STARS" seats="9" >
		<gameplaywindow gameType="all" x="486" y="236" visible="true" transparency="95" preferredSeat="-1" >
			<addstatcollection name="std" />
			      
		</gameplaywindow>
		<playerstatwindow visible="true" transparency="180" preferredSeat="-1" >
			<positions>
				<pos seat="1" x="557" y="84" />
				<pos seat="2" x="698" y="140" />
				<pos seat="3" x="689" y="326" />
				<pos seat="4" x="483" y="388" />
				<pos seat="5" x="400" y="464" />
				<pos seat="6" x="224" y="391" />
				<pos seat="7" x="13" y="328" />
				<pos seat="8" x="8" y="138" />
				<pos seat="9" x="151" y="66" />
				<pos seat="10" x="0" y="0" />
         
         
         
			</positions>
			<addstatcollection name="playerstat" />

		</playerstatwindow>

	</layout>
	<layout site="STARS" seats="10" >
		<gameplaywindow gameType="all" x="488" y="245" visible="true" transparency="95" preferredSeat="-1" >
			<addstatcollection name="std" />
						      
		</gameplaywindow>
		<playerstatwindow visible="true" transparency="180" preferredSeat="-1" >
			<positions>
				<pos seat="1" x="559" y="78" />
				<pos seat="2" x="696" y="140" />
				<pos seat="3" x="695" y="301" />
				<pos seat="4" x="586" y="410" />
				<pos seat="5" x="441" y="458" />
				<pos seat="6" x="362" y="408" />
				<pos seat="7" x="109" y="272" />
				<pos seat="8" x="7" y="300" />
				<pos seat="9" x="5" y="136" />
				<pos seat="10" x="172" y="79" />
				<pos seat="11" x="0" y="0" />
         
         
			</positions>
			<addstatcollection name="playerstat" />
			      
   
		</playerstatwindow>
   
	</layout>
	<layout site="IPoker" seats="6" size="small" >
		<gameplaywindow gameType="all" x="421" y="300" visible="true" transparency="95" preferredSeat="-1" >
			<addstatcollection name="std" />
			      
		</gameplaywindow>
		<playerstatwindow visible="true" transparency="95" preferredSeat="-1" >
			<positions>
				<pos seat="1" x="492" y="22" />
				<pos seat="3" x="535" y="363" />
				<pos seat="5" x="342" y="363" />
				<pos seat="6" x="157" y="363" />
				<pos seat="8" x="165" y="20" />
				<pos seat="10" x="328" y="23" />
				<pos seat="11" x="0" y="0" />
         
         
			</positions>
			<addstatcollection name="playerstat" />
			      
		</playerstatwindow>
   
   
	</layout>
	<layout site="IPoker" seats="10" size="small" >
		<gameplaywindow gameType="all" x="425" y="297" visible="true" transparency="95" preferredSeat="-1" >
			<addstatcollection name="std" />
						      
      
		</gameplaywindow>
		<playerstatwindow visible="true" transparency="95" preferredSeat="-1" >
			<positions>
				<pos seat="1" x="493" y="20" />
				<pos seat="2" x="626" y="115" />
				<pos seat="3" x="624" y="237" />
				<pos seat="4" x="530" y="363" />
				<pos seat="5" x="340" y="364" />
				<pos seat="6" x="151" y="363" />
				<pos seat="7" x="18" y="239" />
				<pos seat="8" x="13" y="118" />
				<pos seat="9" x="165" y="20" />
				<pos seat="10" x="327" y="22" />
				<pos seat="11" x="0" y="0" />
         
         
			</positions>
			<addstatcollection name="playerstat" />

		</playerstatwindow>
   
   
	</layout>
	<layout site="IPoker" seats="6" size="big" >
		<gameplaywindow gameType="all" x="439" y="245" visible="true" transparency="95" preferredSeat="-1" >
			<addstatcollection name="std" />
			      
		</gameplaywindow>
		<playerstatwindow visible="true" transparency="95" preferredSeat="-1" >
			<positions>
				<pos seat="1" x="450" y="16" />
				<pos seat="3" x="654" y="236" />
				<pos seat="5" x="424" y="359" />
				<pos seat="6" x="224" y="360" />
				<pos seat="8" x="6" y="233" />
				<pos seat="10" x="202" y="17" />
				<pos seat="11" x="0" y="0" />
         
         
			</positions>
			<addstatcollection name="playerstat" />
			      
		</playerstatwindow>
    
	</layout>
	<layout site="IPoker" seats="10" size="big" >
		<gameplaywindow gameType="all" x="432" y="248" visible="true" transparency="95" preferredSeat="-1" >
			<addstatcollection name="std" />
						      
      
		</gameplaywindow>
		<playerstatwindow visible="true" transparency="95" preferredSeat="-1" >
			<positions>
				<pos seat="1" x="448" y="15" />
				<pos seat="2" x="609" y="70" />
				<pos seat="3" x="654" y="235" />
				<pos seat="4" x="601" y="320" />
				<pos seat="5" x="428" y="358" />
				<pos seat="6" x="225" y="359" />
				<pos seat="7" x="61" y="321" />
				<pos seat="8" x="4" y="233" />
				<pos seat="9" x="21" y="75" />
				<pos seat="10" x="202" y="16" />
				<pos seat="11" x="0" y="0" />
               
			</positions>
			<addstatcollection name="playerstat" />

		</playerstatwindow>
   
    
	</layout>
	<settings>
		<ShowAboutDlgBox value="off" />
		<EnableDollarToBB value="on" />
		<showShortTexts value="1" />
		<showPreflopAggressors value="1" />
		<fl_showShorthanded value="0" />
		<nl_strategyname value="ps.de NL FR BSS Chart" />
		<fl_strategyname value="ps.de FL SH chart" />
		<movabelPreflopAggressors value="0" />
		<logCharts2File value="0" />
		<logChartsStack value="10" />
     
	</settings>
</longsTrainerConfig>
Any chance you could shorten it to the necessary adjustments? Sorry if i'm officially a pain. Once again I will ship you $20 on stars for goodwill.

Last edited by _dave_; 08-19-2010 at 07:13 PM. Reason: [code] tags! [code] tags! [code] tags! [code] tags! [code] tags!
Quick Questions &amp; Answers Thread Quote
08-19-2010 , 06:55 PM
I have a copy of HEM and it has failed to connect to postgres server. I have tried everything that was suggested from HEM FAQs and still nothing. I tried to uninstall postgres and reinstall it but it's telling me the combo tool on HEMs website is the best way to download it so it will auto set up all coordinated info. If I uninstall HEM and then reinstall both postgres and HEM using combo tool to install, will my serial code still be usable to activate my copy of HEM?
Quick Questions &amp; Answers Thread Quote
08-19-2010 , 07:20 PM
omg use code tags!

I'm illiterate in German try this, copy/paste replace the entire thing.

Code:
<?xml version="1.0" encoding="ISO-8859-1"?>
<longsTrainerConfig version="1.0" >
	<defcolors>
		<color name="DarkBlue" value="#00008B" />
		<color name="Navy" value="#000080" />
		<color name="RoyalBlue" value="#4169E1" />
		<color name="MediumBlue" value="#0000CD" />
		<color name="SkyBlue" value="#87CEEB" />
		<color name="Cyan" value="#00FFFF" />
		<color name="Brown" value="#A52A2A" />
		<color name="DarkRed" value="#8B0000" />
		<color name="FireBrick" value="#B22222" />
		<color name="Red" value="#FF0000" />
		<color name="OrangeRed" value="#FF4500" />
		<color name="Magenta" value="#FF00FF" />
		<color name="DarkSalmon" value="#E9967A" />
		<color name="LightSalmon" value="#FFA07A" />
		<color name="Orange" value="#FFA500" />
		<color name="Yellow" value="#FFFF00" />
		<color name="GreenYellow" value="#ADFF2F" />
		<color name="LightGreen" value="#90EE90" />
		<color name="Lime" value="#00FF00" />
		<color name="LimeGreen" value="#32CD32" />
		<color name="LawnGreen" value="#7CFC00" />
		<color name="Green" value="#008000" />
		<color name="ForestGreen" value="#228B22" />
		<color name="DarkGreen" value="#006400" />
		<color name="White" value="#000000" />
		<color name="LightGray" value="#D3D3D3" />
		<color name="Gray" value="#808080" />
		<color name="DarkGray" value="#A9A9A9" />
		<color name="White" value="#ffffff" />
		<color name="black" value="#000000" />
   
   
	</defcolors>
	<deffonts>
		<fontdef name="stdfont" face="Arial" size="12" bold="true" italic="false" underline="false" />
		<fontdef name="bigfont" face="Arial" size="14" bold="true" italic="false" underline="false" />
   
   
	</deffonts>
	<statcollection name="std" >
		<stat name="Misc::MyHoleCards" line="1" visible="true" font="stdfont" forecolor="White" />
		<stat name="Misc::MyPos" line="1" visible="true" font="stdfont" forecolor="White" />
		<stat name="Misc::PreflopTrafficLight" line="1" visible="true" font="bigfont" forecolor="none" format="%s" />
		<stat name="Misc::StartingHandUnraised" line="1" visible="true" font="bigfont" forecolor="White" format="%s" />
		<stat name="Misc::StartingHandRaisedBefore" line="1" visible="true" font="bigfont" forecolor="Yellow" format="/%s" />
		<stat name="Misc::StartingHandRaisedAfter" line="1" visible="true" font="bigfont" forecolor="Red" format="(%s)" />
		<stat name="Misc::StartingHandComment" line="2" visible="true" font="bigfont" forecolor="White" format="%s" />
		<stat name="Misc::PotSize" line="3" visible="false" font="stdfont" forecolor="White" format="Pot: %s " />
		<stat name="Misc::PotOdds" line="3" visible="true" font="bigfont" forecolor="White" datatyp="f" format=" PotOdds: %0.1f:1" />
		<stat name="Misc::PotOddsPer" line="3" visible="false" font="stdfont" forecolor="White" datatyp="f" format="(%0.0f%%)" />
		<stat name="Misc::OutsNeeded" line="3" visible="true" font="stdfont" forecolor="White" format="{%s}" />

	</statcollection>
	<statcollection name="playerstat" >
		<stat name="Player::PreflopAggressorMarker" line="1" visible="true" font="stdfont" forecolor="none" />
		<stat name="Player::Position" line="1" visible="true" font="stdfont" forecolor="White" />
		<stat name="Player::EffMFaktor" line="1" visible="true" font="bigfont" forecolor="White" >
			<range min="0" max="1" color="FireBrick" />
			<range min="1" max="5.01" color="Red" />
			<range min="5" max="10.01" color="Orange" />
			<range min="10" max="20" color="Yellow" />
			<range min="20" max="10000" color="ForestGreen" />

		</stat>
		<stat name="Player::BettingSequence" line="1" visible="true" font="stdfont" forecolor="White" />
		<stat name="Player::Stacksize" line="2" visible="false" font="stdfont" forecolor="White" />
		<stat name="Player::Name" line="2" visible="false" font="bigfont" forecolor="White" />
		<stat name="Player::BigBlinds" line="2" visible="false" font="bigfont" forecolor="White" />
		<stat name="Player::MFaktor" line="2" visible="false" font="bigfont" forecolor="White" />

	</statcollection>
	<statcollection name="oddsonly" >
		<stat name="Misc::PotOdds" line="1" visible="true" font="bigfont" forecolor="White" datatyp="f" format=" PotOdds: %0.1f:1" />
		<stat name="Misc::PotOddsPer" line="1" visible="false" font="stdfont" forecolor="White" datatyp="f" format="(%0.0f%%)" />
		<stat name="Misc::OutsNeeded" line="1" visible="true" font="stdfont" forecolor="White" format="{%s}" show_empty="true" />

	</statcollection>
	<layout site="PTY" seats="6" size="old" >
		<gameplaywindow gameType="all" x="488" y="245" visible="false" transparency="95" preferredSeat="-1" >
			<addstatcollection name="std" />
			      
		</gameplaywindow>
		<playerstatwindow visible="false" transparency="220" preferredSeat="-1" >
			<positions>
				<pos seat="1" x="473" y="78" />
				<pos seat="2" x="690" y="228" />
				<pos seat="3" x="455" y="404" />
				<pos seat="4" x="213" y="404" />
				<pos seat="5" x="2" y="233" />
				<pos seat="6" x="219" y="79" />
				<pos seat="7" x="0" y="0" />
         
         
			</positions>
			<addstatcollection name="playerstat" />
      
		</playerstatwindow>
   
   
	</layout>
	<layout site="PTY" seats="10" size="old" >
		<gameplaywindow gameType="all" x="488" y="245" visible="false" transparency="95" preferredSeat="-1" >
			<addstatcollection name="std" />
						      
		</gameplaywindow>
		<playerstatwindow visible="false" transparency="220" preferredSeat="-1" >
			<positions>
				<pos seat="1" x="473" y="78" />
				<pos seat="2" x="648" y="134" />
				<pos seat="3" x="690" y="228" />
				<pos seat="4" x="643" y="379" />
				<pos seat="5" x="455" y="404" />
				<pos seat="6" x="213" y="404" />
				<pos seat="7" x="39" y="362" />
				<pos seat="8" x="2" y="233" />
				<pos seat="9" x="44" y="113" />
				<pos seat="10" x="219" y="79" />
				<pos seat="11" x="0" y="0" />
         
         
			</positions>
			<addstatcollection name="playerstat" />
      
      
		</playerstatwindow>
   
	</layout>
	<layout site="PTY" seats="6" size="new" >
		<gameplaywindow gameType="all" x="488" y="245" visible="false" transparency="95" preferredSeat="-1" >
			<addstatcollection name="std" />
			      
		</gameplaywindow>
		<playerstatwindow visible="fasle" transparency="220" preferredSeat="-1" >
			<positions>
				<pos seat="1" x="561" y="6" />
				<pos seat="2" x="676" y="250" />
				<pos seat="3" x="535" y="388" />
				<pos seat="4" x="364" y="387" />
				<pos seat="5" x="16" y="250" />
				<pos seat="6" x="339" y="24" />
				<pos seat="7" x="0" y="0" />
         
			</positions>
			<addstatcollection name="playerstat" />
			 
      
		</playerstatwindow>
   
   
	</layout>
	<layout site="PTY" seats="10" size="new" >
		<gameplaywindow gameType="all" x="488" y="245" visible="false" transparency="95" preferredSeat="-1" >
			<addstatcollection name="std" />

		</gameplaywindow>
		<playerstatwindow visible="fasle" transparency="220" preferredSeat="-1" >
			<positions>
				<pos seat="1" x="559" y="2" />
				<pos seat="2" x="654" y="129" />
				<pos seat="3" x="677" y="248" />
				<pos seat="4" x="592" y="373" />
				<pos seat="5" x="531" y="389" />
				<pos seat="6" x="362" y="388" />
				<pos seat="7" x="99" y="374" />
				<pos seat="8" x="15" y="248" />
				<pos seat="9" x="96" y="130" />
				<pos seat="10" x="338" y="26" />
				<pos seat="11" x="0" y="0" />
         
         
         
			</positions>
			<addstatcollection name="playerstat" />
			      
      
		</playerstatwindow>
   
	</layout>
	<layout site="STARS" seats="2" >
		<gameplaywindow gameType="all" x="488" y="245" visible="false" transparency="95" preferredSeat="-1" >
			<addstatcollection name="std" />
			      
		</gameplaywindow>
		<playerstatwindow visible="false" transparency="180" preferredSeat="-1" >
			<positions>
				<pos seat="1" x="677" y="316" />
				<pos seat="2" x="36" y="312" />
				<pos seat="3" x="0" y="0" />

			</positions>
			<addstatcollection name="playerstat" />
      
      
      
		</playerstatwindow>

	</layout>
	<layout site="STARS" seats="6" >
		<gameplaywindow gameType="all" x="488" y="245" visible="false" transparency="95" preferredSeat="-1" >
			<addstatcollection name="std" />
			      
      
		</gameplaywindow>
		<playerstatwindow visible="false" transparency="180" preferredSeat="-1" >
			<positions>
				<pos seat="1" x="698" y="140" />
				<pos seat="2" x="690" y="325" />
				<pos seat="3" x="483" y="389" />
				<pos seat="4" x="226" y="389" />
				<pos seat="5" x="12" y="324" />
				<pos seat="6" x="8" y="123" />
				<pos seat="7" x="0" y="0" />
         
         
			</positions>
			<addstatcollection name="playerstat" />
			      
		</playerstatwindow>
   
   
	</layout>
	<layout site="STARS" seats="9" >
		<gameplaywindow gameType="all" x="486" y="236" visible="false" transparency="95" preferredSeat="-1" >
			<addstatcollection name="std" />
			      
		</gameplaywindow>
		<playerstatwindow visible="false" transparency="180" preferredSeat="-1" >
			<positions>
				<pos seat="1" x="557" y="84" />
				<pos seat="2" x="698" y="140" />
				<pos seat="3" x="689" y="326" />
				<pos seat="4" x="483" y="388" />
				<pos seat="5" x="400" y="464" />
				<pos seat="6" x="224" y="391" />
				<pos seat="7" x="13" y="328" />
				<pos seat="8" x="8" y="138" />
				<pos seat="9" x="151" y="66" />
				<pos seat="10" x="0" y="0" />
         
         
         
			</positions>
			<addstatcollection name="playerstat" />

		</playerstatwindow>

	</layout>
	<layout site="STARS" seats="10" >
		<gameplaywindow gameType="all" x="488" y="245" visible="false" transparency="95" preferredSeat="-1" >
			<addstatcollection name="std" />
						      
		</gameplaywindow>
		<playerstatwindow visible="false" transparency="180" preferredSeat="-1" >
			<positions>
				<pos seat="1" x="559" y="78" />
				<pos seat="2" x="696" y="140" />
				<pos seat="3" x="695" y="301" />
				<pos seat="4" x="586" y="410" />
				<pos seat="5" x="441" y="458" />
				<pos seat="6" x="362" y="408" />
				<pos seat="7" x="109" y="272" />
				<pos seat="8" x="7" y="300" />
				<pos seat="9" x="5" y="136" />
				<pos seat="10" x="172" y="79" />
				<pos seat="11" x="0" y="0" />
         
         
			</positions>
			<addstatcollection name="playerstat" />
			      
   
		</playerstatwindow>
   
	</layout>
	<layout site="IPoker" seats="6" size="small" >
		<gameplaywindow gameType="all" x="421" y="300" visible="false" transparency="95" preferredSeat="-1" >
			<addstatcollection name="std" />
			      
		</gameplaywindow>
		<playerstatwindow visible="false" transparency="95" preferredSeat="-1" >
			<positions>
				<pos seat="1" x="492" y="22" />
				<pos seat="3" x="535" y="363" />
				<pos seat="5" x="342" y="363" />
				<pos seat="6" x="157" y="363" />
				<pos seat="8" x="165" y="20" />
				<pos seat="10" x="328" y="23" />
				<pos seat="11" x="0" y="0" />
         
         
			</positions>
			<addstatcollection name="playerstat" />
			      
		</playerstatwindow>
   
   
	</layout>
	<layout site="IPoker" seats="10" size="small" >
		<gameplaywindow gameType="all" x="425" y="297" visible="false" transparency="95" preferredSeat="-1" >
			<addstatcollection name="std" />
						      
      
		</gameplaywindow>
		<playerstatwindow visible="false" transparency="95" preferredSeat="-1" >
			<positions>
				<pos seat="1" x="493" y="20" />
				<pos seat="2" x="626" y="115" />
				<pos seat="3" x="624" y="237" />
				<pos seat="4" x="530" y="363" />
				<pos seat="5" x="340" y="364" />
				<pos seat="6" x="151" y="363" />
				<pos seat="7" x="18" y="239" />
				<pos seat="8" x="13" y="118" />
				<pos seat="9" x="165" y="20" />
				<pos seat="10" x="327" y="22" />
				<pos seat="11" x="0" y="0" />
         
         
			</positions>
			<addstatcollection name="playerstat" />

		</playerstatwindow>
   
   
	</layout>
	<layout site="IPoker" seats="6" size="big" >
		<gameplaywindow gameType="all" x="439" y="245" visible="false" transparency="95" preferredSeat="-1" >
			<addstatcollection name="std" />
			      
		</gameplaywindow>
		<playerstatwindow visible="false" transparency="95" preferredSeat="-1" >
			<positions>
				<pos seat="1" x="450" y="16" />
				<pos seat="3" x="654" y="236" />
				<pos seat="5" x="424" y="359" />
				<pos seat="6" x="224" y="360" />
				<pos seat="8" x="6" y="233" />
				<pos seat="10" x="202" y="17" />
				<pos seat="11" x="0" y="0" />
         
         
			</positions>
			<addstatcollection name="playerstat" />
			      
		</playerstatwindow>
    
	</layout>
	<layout site="IPoker" seats="10" size="big" >
		<gameplaywindow gameType="all" x="432" y="248" visible="false" transparency="95" preferredSeat="-1" >
			<addstatcollection name="std" />
						      
      
		</gameplaywindow>
		<playerstatwindow visible="false" transparency="95" preferredSeat="-1" >
			<positions>
				<pos seat="1" x="448" y="15" />
				<pos seat="2" x="609" y="70" />
				<pos seat="3" x="654" y="235" />
				<pos seat="4" x="601" y="320" />
				<pos seat="5" x="428" y="358" />
				<pos seat="6" x="225" y="359" />
				<pos seat="7" x="61" y="321" />
				<pos seat="8" x="4" y="233" />
				<pos seat="9" x="21" y="75" />
				<pos seat="10" x="202" y="16" />
				<pos seat="11" x="0" y="0" />
               
			</positions>
			<addstatcollection name="playerstat" />

		</playerstatwindow>
   
    
	</layout>
	<settings>
		<ShowAboutDlgBox value="off" />
		<EnableDollarToBB value="on" />
		<showShortTexts value="1" />
		<showPreflopAggressors value="1" />
		<fl_showShorthanded value="0" />
		<nl_strategyname value="ps.de NL FR BSS Chart" />
		<fl_strategyname value="ps.de FL SH chart" />
		<movabelPreflopAggressors value="0" />
		<logCharts2File value="0" />
		<logChartsStack value="10" />
     
	</settings>
</longsTrainerConfig>
Quick Questions &amp; Answers Thread Quote
08-19-2010 , 07:21 PM
Quote:
Originally Posted by the ANOMALY
I have a copy of HEM and it has failed to connect to postgres server. I have tried everything that was suggested from HEM FAQs and still nothing. I tried to uninstall postgres and reinstall it but it's telling me the combo tool on HEMs website is the best way to download it so it will auto set up all coordinated info. If I uninstall HEM and then reinstall both postgres and HEM using combo tool to install, will my serial code still be usable to activate my copy of HEM?
awaiting Fozzy's expert help

I'd bet your serial will be fixable should any problems occur, but if you're real scared you might wanna wait to make sure.
Quick Questions &amp; Answers Thread Quote
08-19-2010 , 07:24 PM
I don't know what code tags are . Also, can we add post flop half pot bet "num pad -" and pot "num +" to the stars bet pot? Is that possible? Trying the other thing now.
Quick Questions &amp; Answers Thread Quote
08-19-2010 , 07:41 PM
Ok so $ to BB is working and I just have to run it as admin. When I try to bet pot: Weird white boxes that go to the middle, up to the pot size and then down to the bet box read 3.4 but raised 13.6bb. It's also slow whereas the other two are instant and correct pf. Also, an info thing also appears on bottom right of screen when i try pot.
Quick Questions &amp; Answers Thread Quote
08-19-2010 , 08:10 PM
Quote:
Originally Posted by pureklas
I don't know what code tags are .
[code] when you are writing a post, use
Code:
[code ] code goes here [ /code]
(without spaces) just as you would for quote or image etc.
Quote:
Also, can we add post flop half pot bet "num pad -" and pot "num +" to the stars bet pot? Is that possible? Trying the other thing now.
Code:
NumpadSub::
Pot(getid(),"0.5")
return
will get you half pot. the * key will continue to work postflop for full pot. use NumpadAdd:: if you wanna use the + key for another function.


Quote:
Originally Posted by pureklas
Ok so $ to BB is working and I just have to run it as admin. When I try to bet pot: Weird white boxes that go to the middle, up to the pot size and then down to the bet box read 3.4 but raised 13.6bb. It's also slow whereas the other two are instant and correct pf. Also, an info thing also appears on bottom right of screen when i try pot.
edit the main Betpot-0.2s.ahk file, right at the top there is a line "debug := 1", change the 1 to a 0 (zero), save reload and those boxes won't appear any more.

What are you saying about the bet amounts, how exactly are they wrong? The info popup that appears (when debug mode is on) will show the values betpot is reading for pot size, and call amount. are they correct?
Quick Questions &amp; Answers Thread Quote
08-19-2010 , 08:14 PM
Quote:
Originally Posted by the ANOMALY
I have a copy of HEM and it has failed to connect to postgres server. I have tried everything that was suggested from HEM FAQs and still nothing. I tried to uninstall postgres and reinstall it but it's telling me the combo tool on HEMs website is the best way to download it so it will auto set up all coordinated info. If I uninstall HEM and then reinstall both postgres and HEM using combo tool to install, will my serial code still be usable to activate my copy of HEM?
You do not need to uninstall HM if you are having postgresql problems. Our combo installer has the option to install HM and/or SQL. You just want to make sure the [ ] Holdem Manager option is deselected when you are using it to reinstall only postgresql.


Here is my canned response (from Everlong's NoteAbbs.ahk script) for PostgreSQL connection issues:


This is usually a firewall or windows update issue.

http://faq.holdemmanager.com/questio...rt+PostgreSQL+

First try to reboot.

If no help, try this:

Start > Programs > PostgreSQL > 8.x > Stop Service

Start > Programs > PostgreSQL > 8.x > Start Service

If that doesnt help delete the \postgresql\8.x\data\postmaster.pid file, if you see it.

Add exceptions to the windows firewall, even if it is off. If you have a 3rd party firewall, do the equivalent or uninstall it temporarily - http://faq.holdemmanager.com/questio...ender+Problems

Please try following these FAQs, step by step:

1) http://faq.holdemmanager.com/questio...rt+PostgreSQL+
2) reinstall the same version of postgresql, using the same \data folder - http://faq.holdemmanager.com/questio...g+Old+Database
3) http://www.holdemmanager.net/forum/s...ead.php?t=8261

If that doesn't help you will probably have to reinstall PostgreSQL completely and reimport your hands using these instructions

1) Uninstall PostgreSQL from the Windows Control Panel.
2) Use our combo installer to reinstall PostgreSQL. Make sure you un-check Holdem Manager during installation. http://rvgsoftware.fileburst.com/Hol...ager_Setup.exe

If that installer fails to install PostgreSQL, please reinstall PostgreSQL using the following instructions:
A) Start > Programs > Accessories > Command Prompt > Right-Click > Run As Administrator
[PHP]net user postgres /delete [/PHP]
B) Reboot.
C) Try installing this version of PostgreSQL - http://rvgsoftware.fileburst.com/Pos...3.9-v1.0.7.exe
Quick Questions &amp; Answers Thread Quote
08-19-2010 , 08:17 PM
It appears to add a 0 on to everything for pot or numpad *

Edit: I'm seriosuly tired. I'm not evensure if it is a zero being added. It's just overbetting huge like otb it was 35 and a 3bet was allin. I need to go to bed I'll check back this thread in the morning and if I still have a problem I will give accurate details. Thanks again for all your help, greatly appreciated.

Last edited by pureklas; 08-19-2010 at 08:34 PM.
Quick Questions &amp; Answers Thread Quote
08-19-2010 , 08:35 PM
are you using English Stars client? no funky numerical punctuations? not using longhud yet?

give a concrete example with numbers for both call and potsize, both what is on thew table and what betpot info reports. and try using the other StarsPics if it is missing decimal points.
Quick Questions &amp; Answers Thread Quote
08-20-2010 , 04:46 AM
Pot button works absolutely fine without long hud. With longhud however the numbers you type in the bet box don't correlate to the same number of bb's.

For 2.5bb it is 0.63 in the bet box and this shows correct in the bet button
For 3bb it is 0.75 and is correct also.
I have tried 1 in the bet box and it = 4bb in the bet button.

For pot it types 3 the bet pox which is 13.6bb in the bet button utg/mp/CO/btn. Folded to sb 2.6 = 10.4bb

I haven't tried adding the postflop 1/2 and full pot bits. I will do that now.
Quick Questions &amp; Answers Thread Quote
08-20-2010 , 05:32 AM
Those numbers change per stake. For the above everything was done at 25nl. At 50nl 2.5bb = 1.25 in the bet box and 2.5bb in the bet button. Pot is 3.50 bet box, but 7bb in the bet button. At 100nl antes 4.7 in bet box = 4.7bb whereas 2.5 is 2.5 and 3 is 3.
Interesting 100nl without antes EVERYTHING seems to work fine.

I also tried the half pot post flop and it is fine without longhud. With longhud it read 1/2 pot in bb which = 2x pot on the bet pot button except at 100nl w/o antes where it is fine.
Quick Questions &amp; Answers Thread Quote
08-20-2010 , 12:12 PM
does longHUD change the 'POT:' value on the top of hte table? maybe thats the problem
Quick Questions &amp; Answers Thread Quote
08-20-2010 , 03:36 PM
just have to spend some time with the gf for a bit then i'll check.
Quick Questions &amp; Answers Thread Quote
08-20-2010 , 05:03 PM
I tried a 50nl antes table, which takes $0.10 per person 6max and with 5 sat in it rounded to 1bb. I tired a non ante table at 50nl and it had the correct amount of bb's in the pot i.e. Bb + SB.
Quick Questions &amp; Answers Thread Quote
08-20-2010 , 05:16 PM
As I mentioned in PM we need to edit one of the functions in BetPot before it'll work at any level that isn't $100nl when LongHud is enabled.

As for Cash+Ante tables, it may be making an error in getting the SB/BB sizes? debug info will confirm if this is the case.
Quick Questions &amp; Answers Thread Quote
08-20-2010 , 05:18 PM
Ok so what do we need to do? or what is the edit?
Quick Questions &amp; Answers Thread Quote
08-20-2010 , 05:42 PM
edit the main BetPot-0.2s.ahk file, replace the entire PotSizeStars function with this version:
Code:
PotSizeStars(id, ByRef pot, ByRef call, ByRef sb, ByRef bb, ByRef hero_bet, ByRef street, ByRef hero_position, ByRef open)
{
  global use_old_stars_buttons
  CoordMode, Pixel, Screen
  WinGetPos, x, y, w, h, ahk_id%id%

  x1 := 700
  y1 := 440
  x2 := 770
  y2 := 450
  relStarsScreenPoint(id, x1, y1)
  relStarsScreenPoint(id, x2, y2)
  
  bb := GetBBStars(id, GameTypeStars(WinGetTitle(id)))
  sb := sb(bb)

  col := GetPredominateColor(x1, y1, x2, y2)
  ;Msgbox, %col%
  if (col = "0x00327F")
  {
    ;ThemeDir := "normal"
    PotThemeDir := "classic"
    CallThemeDir := "classic"
  
  }
  else if (col = "0xDDD7CC")
  {
    PotThemeDir := "hypersimple"
    CallThemeDir := "hypersimple"
  
  }
  else
  {
    if (debug)
    {
      Msgbox, Unable to match slider colour: %col% to a known theme
    }
    return
  }
  if (use_old_stars_buttons)
  {
    CallThemeDir := CallThemeDir . "\old"
  }
 
  street := GetStreetStars(id)

  if (w <= 526)
  {
    SizeDir := 0
  }
  else if (w <= 621)
  {
    SizeDir := 1
  }
  else if (w <= 736)
  {
    SizeDir := 2
  }
  else if (w <= 875)
  {
    SizeDir := 3
  }
  else if (w <= 1037)
  {
    SizeDir := 4
  }
  else if (w <= 1227)
  {
    SizeDir := 5
  }
  else
  {
    SizeDir := 6
  } 

 
  PicDir := "StarsPics"
  potPicDir := PicDir . "\" . PotThemeDir . "\pot\" . SizeDir
  buttonPicDir := PicDir . "\" . CallThemeDir . "\call\" . SizeDir
  ;Msgbox, %potPicDir%`n%buttonPicDir%

  pot_x1 := 380
  pot_y1 := 8
  pot_x2 := 460
  pot_y2 := 32
  relStarsWindowPoint(id, pot_x1, pot_y1)
  relStarsWindowPoint(id, pot_x2, pot_y2)
  pot := DigitSearch(pot_x1, pot_y1, pot_x2, pot_y2, id, potPicDir, "", 50)

  pot := pot * bb
  
  call_x1 := 550
  call_y1 := 510
  call_x2 := 645
  call_y2 := 533
  relStarsWindowPoint(id, call_x1, call_y1)
  relStarsWindowPoint(id, call_x2, call_y2)
  call := DigitSearch(call_x1, call_y1, call_x2, call_y2, id, buttonPicDir, "", 50)
  call := iif( call, call, 0 )

  call := call * bb
  
  
  if (street = "pre")
  {
    ControlGetText, t, Edit7, ahk_id%id%
    ControlSetText, Edit7, 0, ahk_id%id%
    raise_x1 := 675
    raise_y1 := 510
    raise_x2 := 770
    raise_y2 := 533
    relStarsWindowPoint(id, raise_x1, raise_y1)
    relStarsWindowPoint(id, raise_x2, raise_y2)
    minraise := DigitSearch(raise_x1, raise_y1, raise_x2, raise_y2, id, buttonPicDir, "", 50)
    
    minraise := minraise * bb

    t := Round(t, 2)
    ControlSetText, Edit7, %t%, ahk_id%id%
    Sleep, -1
    
    if (minraise > (2*bb))
    {
      ;pot has been raised
      if (call = bb)
      {
        ;pot was minraised, and we are the BB
        hero_bet := bb
        hero_position := "bb"
      }
      else if (call < (bb*2))
      {
        ;pot was minraised, and we are the SB
        hero_bet := sb
        hero_position := "sb"
      }
    }
    else if (call = bb)
    {
      ;hero is not a blind, unraised pot, do nothing
    }
    else if (call = 0)
    {
      ;unraised pot, hero is the BB
      hero_bet := bb
      hero_position := "bb"
    }
    else if (call < bb)
    {
      ;unraised pot, hero is the SB
      hero_bet := sb
      hero_position := "sb"
    }
    else
    {
      ;pot has been raised, we are not opening
      open := 0
    }
  }
  else
  {
    ;not pre-flop, no need for open adjustment
    open := 0
  }
 
  return
}
it's about 3/4 down the file in a text editor.

Annoyingly overcards is down! but I think this is a modified current function.

Of course this will then stop BetPot working correctly on any table (except 100nl) when LongHud is not in use!
Quick Questions &amp; Answers Thread Quote
08-20-2010 , 06:05 PM
This is what I got in code tags I can't find any mention of pot size stars. I scrolled up and down. I tried ctrl F. Can you see anything?

Code:
; GENERAL SETTINGS
debug := 0
act_only_on_active_table := 0
fix_blinds := 1
deduct_rake := 1
fold_to_any := 0

move_cursor := 0 	;move cursor to raise button after writing out bet on party and ipoker

; IPOKER SPECIFIC
Ipoker_miniview := 0

; these are site-specific I think :(
; it is number of TABS to highlight the betbox, while holding shift.
; these work for me on NoblePoker

; MAKE SURE to click (activate) the table before preessing TAB, this resets the count.

miniview_tabstops := 6
fullview_tabstops := 8

ipoker_test_betbox := 0

; PARTY SPECIFIC
party_uses_commas_for_decimals := 0
fphg_party_hh_folder := "C:\FreePHG_HandHistories\"
; **** SET TO 0 (zero) if using old FPHG without "live" folder, else 1 (one)
fphg_uselive = 1

;FTP SPECIFIC
; **** SET TO 0 (zero) if using FTP official client, 1 (one) if using the Beta
; THERE IS NO LONGER AN NEED TO CHANGE THIS... BETA IS THE NEW OFFICIAL
FTP_Beta := 1

;STARS SPECIFIC
use_old_stars_buttons := 0
stars_editbox = PokerStarsSliderEditorClass1
;Uncomment for PokerStars Client version < 2.286
;stars_editbox = Edit7

;AHK STUFF, DO NOT EDIT
#MaxHotkeysPerInterval 300|
#SingleInstance, Force
SendMode Input
SetTitleMatchMode 2
caller_hwnd := ""
SysGet, border, 32
SysGet, caption, 4
caption := border + caption
#NoEnv

SetBatchLines, -1
SetWinDelay, 0
;END OF AHK STUFF

;--------------- Copy / Paste --- Add other Crypto skins here ---------------;
WinGet, interpoker, pid,  InterPoker - Lobby
if (interpoker)
{
  GroupAdd, CryptoTables, ahk_pid%interpoker%,,, Lobby
}

WinGet, sunpoker, pid,  SunPoker.com - Lobby
if (sunpoker)
{
  GroupAdd, CryptoTables, ahk_pid%sunpoker%,,, Lobby
}

WinGet, willhill, pid,  William Hill Poker - Lobby
if (willhill)
{
  GroupAdd, CryptoTables, ahk_pid%willhill%,,, Lobby
}

WinGet, betsafe, pid, Betsafe Poker - Lobby
if (betsafe)
{
  GroupAdd, CryptoTables, ahk_pid%betsafe%,,, Lobby
}

WinGet, parbet, pid, Parbet.com Poker - Lobby
if (parbet)
{
  GroupAdd, CryptoTables, ahk_pid%parbet%,,, Lobby
}

WinGet, lw, pid, Littlewoods Poker - Lobby
if (lw)
{
  GroupAdd, CryptoTables, ahk_pid%lw%,,, Lobby
}

WinGet, dtd, pid, DTD Poker - Lobby
if (dtd)
{
  GroupAdd, CryptoTables, ahk_pid%dtd%,,, Lobby
}

;----------- END OF CRYPTO SKINS --------------


WinGet, ub, pid, UltimateBet  
if (ub)
{
  GroupAdd, UBTables, ahk_pid%ub%,,, UltimateBet
}


GroupAdd, StarsTables, Logged In as ,,, PokerStars Lobby
;GroupAdd, PartyTables, Good Luck ahk_class #32770,,, : Poker Lobby
GroupAdd, FullTiltTables, ahk_class FTC_TableViewFull
GroupAdd, PrimaTables, ahk_class POPUP_INT_DLG_WINDOW
GroupAdd, MiniFT, MiniFT ahk_class AutoHotkeyGUI
GroupAdd, iPokerTables, ahk_class PTIODEVICE,,, : Nickname:


PartyGetPid()

return

#include betpot_default_hotkeys.txt

#Include include\acc.ahk
#Include include\com.ahk

  ;--------- IPOKER COORDINATES -------------------
iPokerSetCoords(id)
{
  global border, caption, iPokerRaiseX, iPokerRaiseY, ipokerCallX, ipokerCallY, iPokerFoldX, iPokerFoldY, iPokerLoop, miniview_tabstops, fullview_tabstops

  WinGetPos, ,,w, ahk_id%id%
  ;msgbox, w: %w%
  if (w < 600)
  {
    ;this is miniview
    iPokerLoop := miniview_tabstops
    
    iPokerRaiseX := 358
    iPokerRaiseY := 287
    ipokerCallx := 274
    ipokerCallY:= 287
    iPokerFoldX := 187
    iPokerFoldY := 288
  }
  else
  {
    ;this is normalview
    iPokerLoop := fullview_tabstops
    
    iPokerRaiseX := 554
    iPokerRaiseY := 545
    ipokerCallX := 380
    ipokerCallY := 500
    iPokerFoldX := 253
    iPokerFoldY := 500
  }
}

PartyGetPid()
{
  global
  WinGet, partypid, pid, PartyPoker.com: Poker Lobby
  if (partypid)
  {
    GroupAdd, PartyTables,$ ahk_pid%partypid%,,, Lobby
  }
  WinGet, empirepid, pid, EmpirePoker.com: Poker Lobby
  if (empirepid)
  {
    GroupAdd, PartyTables,$ ahk_pid%empirepid%,,, Lobby
  }
}

Fold(id)
{
  PartyGetPid()
  IfWinExist, ahk_id%id% ahk_group MiniFT
  {
    WinGetTitle, t, ahk_id%id%
    StringTrimLeft, t, t, Instr(t, "hwnd:", true, 0)+4
    id := t
  }

  IfWinExist, ahk_id%id% ahk_group StarsTables
  {
    FoldStars(id)
  }
  Else IfWinExist, ahk_id%id% ahk_group FullTiltTables
  {
    FoldFT(id)
  }
  Else IfWinExist, ahk_id%id% ahk_group PartyTables
  {
    FoldParty(id)
  }
  Else IfWinExist, ahk_id%id% ahk_group CryptoTables
  {
    FoldCrypto(id)
  }
  Else IfWinExist, ahk_id%id% ahk_group UBTables
  {
    FoldUB(id)
  }
  Else IfWinExist, ahk_id%id% ahk_group iPokerTables
  {
    FoldIPoker(id)
  }
}
  
Call(id)
{
  PartyGetPid()
  IfWinExist, ahk_id%id% ahk_group MiniFT
  {
    WinGetTitle, t, ahk_id%id%
    StringTrimLeft, t, t, Instr(t, "hwnd:", true, 0)+4
    id := t
  }

  IfWinExist, ahk_id%id% ahk_group StarsTables
  {
    CallStars(id)
  }
  Else IfWinExist, ahk_id%id% ahk_group FullTiltTables
  {
    CallFT(id)
  }
  Else IfWinExist, ahk_id%id% ahk_group PartyTables
  {
    CallParty(id)
  }
  Else IfWinExist, ahk_id%id% ahk_group CryptoTables
  {
    CallCrypto(id)
  }
  Else IfWinExist, ahk_id%id% ahk_group UBTables
  {
    CallUB(id)
  }
  Else IfWinExist, ahk_id%id% ahk_group iPokerTables
  {
    CallIPoker(id)
  }
}

Raise(id)
{
  PartyGetPid()
  IfWinExist, ahk_id%id% ahk_group MiniFT
  {
    WinGetTitle, t, ahk_id%id%
    StringTrimLeft, t, t, Instr(t, "hwnd:", true, 0)+4
    id := t
  }

  IfWinExist, ahk_id%id% ahk_group StarsTables
  {
    RaiseStars(id)
  }
  Else IfWinExist, ahk_id%id% ahk_group FullTiltTables
  {
    RaiseFT(id)
  }
  Else IfWinExist, ahk_id%id% ahk_group PartyTables
  {
    RaiseParty(id)
  }
  Else IfWinExist, ahk_id%id% ahk_group CryptoTables
  {
    RaiseCrypto(id)
  }
  Else IfWinExist, ahk_id%id% ahk_group UBTables
  {
    RaiseUB(id)
  }
  Else IfWinExist, ahk_id%id% ahk_group IPokerTables
  {
    RaiseIPoker(id)
  }
}

 
AlterAmount(id, dir="", frac=1, unit="")
{
  global party_uses_commas_for_decimals, stars_editbox, move_cursor
  
  PartyGetPid()
  

  IfWinExist, ahk_id%id% ahk_group MiniFT
  {
    WinGetTitle, t, ahk_id%id%
    StringTrimLeft, t, t, Instr(t, "hwnd:", true, 0)+4
    id := t
  }
  
  WinGetTitle, title, ahk_id%id%
  amount := 0
  
  IfWinExist, ahk_id%id% ahk_group StarsTables
  {
    If ((InStr(title, "No Limit") OR InStr(title, "Pot Limit")) AND InStr(title, "Tournament") = 0)
    {
      StringMid, bb, title, InStr(title, "/") + 1, InStr(title, a_space,"", InStr(title, "/")) - InStr(title, "/") - 1
    }
    else if (InStr(title, "No Limit") <> 0 AND InStr(title, "Tournament") <> 0)
    {
      StringMid, bb, title, InStr(title, "/", "", InStr(title, "Blinds")) + 1, InStr(title, a_space, "", InStr(title, "Blinds") + 8) - InStr(title, "/", "", InStr(title, "Blinds")) - 1 ;___so we retrieve the big blind instead
    }
    
  }
   
  Else IfWinExist, ahk_id%id% ahk_group PartyTables
  {
    If ((InStr(title, "NL") || InStr(title, "PL")) && !InStr(title, "Buy-in"))
    {
      ;StringMid, bb, title, InStr(title, "/")+1, InStr(title, ". ", InStr(title,"/")) - InStr(title, "/") -1
      StringTrimLeft, bb, title, InStr(title, "$", true, 0) 
      ;msgbox, %bb%
    }
    else
    {
      ControlGetText, text, Blinds, ahk_id%id%
      IfNotInString, text, Blinds-Antes
      {
        StringMid, bb, text, InStr(text, "/") + 1, InStr(text, ")") - InStr(text, "/") - 1
      }
      else
      {
        StringMid, bb, text, InStr(text, "/") + 1, InStr(text, "-","",InStr(text, "/")) - InStr(text, "/") - 1
      }
    }
    if (party_uses_commas_for_decimals)
    {
      StringReplace, bb, bb, `,,., All
    }
  }
  
  Else IfWinExist, ahk_id%id% ahk_group CryptoTables
  {
    StringMid, bb, title, InStr(title, "/") + 1, InStr(title, a_space,"", InStr(title, "/")) - InStr(title, "/") - 1
    
  }
  
  Else IfWinExist, ahk_id%id% ahk_group FullTiltTables
  {
    StringMid, bb, title, InStr(title, "/") + 1, InStr(title, a_space,"", InStr(title, "/")) - InStr(title, "/") - 1
  }
  
  Else IfWinExist, ahk_id%id% ahk_group PrimaTables
  {
    StringTrimLeft, bb, title, InStr(title, "$", true, 0) 
    StringMid, bb, bb, InStr(bb, " ")-1,, L
  }
  
  Else IfWinExist, ahk_id%id% ahk_group UBTables
  {
    StringTrimLeft, bb, title, InStr(title, "$", true, 0)-1 
    StringTrimRight, bb, bb, Strlen(bb) - InStr(bb, A_Space)
    StringReplace, bb, bb, $., $0., All
    StringReplace, bb, bb, $,, All
    StringReplace, bb, bb, %A_Space%,, All
    
    ;StringMid, bb, bb, InStr(bb, "$")-1,, L
    ;MsgBox, %bb%
  }
  
  Else IfWinExist, ahk_id%id% ahk_group iPokerTables
  {
  	StringTrimLeft, bb, title, InStr(title, "/$")
  }
  
  Else
  {
    Send {%A_ThisHotkey%}
    return
  }
  
  StringReplace,bb,bb,$,,1
  StringReplace,bb,bb,Ł,,1
  StringReplace,bb,bb,€,,1
  
  sb := sb(bb)
  
  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 StarsTables
    {
      PotSizeStars(id, pot, call, sb, bb, hero_bet, street, hero_position, open)
    } 
    Else IfWinExist, ahk_id%id% ahk_group PartyTables
    {
      PotSizeParty(id, pot, call, sb, bb, hero_bet, street, hero_position, open)
      if (party_uses_commas_for_decimals)
      {
        StringReplace, call, call, `,,., All
      }
    }
    Else IfWinExist, ahk_id%id% ahk_group CryptoTables
    {
      PotSizeCrypto(id, pot, call, sb, bb, hero_bet, street, hero_position, open)
    }
    Else IfWinExist, ahk_id%id% ahk_group FullTiltTables
    {
      ControlGet, v, Visible, , Edit1, ahk_id%id%
      if (v)
      {
        PotSizeFullTilt2(id, pot, call, sb, bb, hero_bet, street, hero_position, open, max)
      }
      else
      {
        return
      }
      ;msgbox, %pot%
    }
    Else IfWinExist, ahk_id%id% ahk_group PrimaTables
    {
      PotSizePrima(id, pot, call, sb, bb, hero_bet, street, hero_position, open)
    }
    Else IfWinExist, ahk_id%id% ahk_group iPokerTables
    {
      PotSizeIPoker(id, pot, call, sb, bb, hero_bet, street, hero_position, open)
    }    

    pot := ((pot + call + hero_bet) )+ call
    ;Msgbox, %pot%
    unit := pot
  }
  amount := unit * frac
  
  if (dir="down")
  {
    amount := amount - (2*amount)
  }
  
  
  
  ;Msgbox, %sb%/%bb%
  /*
  IfWinExist, ahk_id%id% ahk_group MiniFT
  {
    ControlGet, v, Visible, , Edit1, ahk_id%id%
    if (v)
    {
      ControlGetText, t, Edit1, ahk_id%id%
      t := t + amount
      if (t < 0)
      {
        t := 0
      }
      t := Round(t, 2)
      ControlSetText, Edit1, %t%, ahk_id%id%
      WinSet, Redraw,, ahk_id%id%
    }
  }
  */
  
  IfWinExist, ahk_id%id% ahk_group StarsTables
  {
    ControlGetText, t, %stars_editbox%, ahk_id%id%
    ;Msgbox, %t%
    t := t + amount
    if (t < 0)
    {
      t := 0
    }
    t := Round(t, 2)
    ControlSetText, %stars_editbox%, %t%, ahk_id%id%
    Sleep, -1
    ;ControlGetText, t, %stars_editbox%, ahk_id%id%
    WinSet, Redraw,, ahk_id%id%
  } 
  Else IfWinExist, ahk_id%id% ahk_group PartyTables
  {
    ControlGetText, t, Edit2, ahk_id%id%
    if (party_uses_commas_for_decimals)
    {
      StringReplace, t, t, `,,., All
    }
    else
    {
      StringReplace, t, t, `,,, All
    }
    t := t + amount
    if (t < 0)
    {
      t := 0
    }
    t := Round(t, 2)
    if (party_uses_commas_for_decimals)
    {
      StringReplace, t, t, .,`,, All
    }
    ControlSetText, Edit2, %t%, ahk_id%id%
    ;WinSet, Redraw,, ahk_id%id%

    If(move_cursor)
    {
	ControlGet, vis, visible, , AfxWnd42u19, ahk_id%id% 
	if vis
	{
		ControlGetPos, x, y, , , AfxWnd42u19, ahk_id%id%
		MouseMove, x + 40, y + 15
    	}
     }
  }
  Else IfWinExist, ahk_id%id% ahk_group CryptoTables
  {
    ControlGetText, t, Edit3, ahk_id%id%
    t := t + amount
    if (t < 0)
    {
      t := 0
    }
    t := Round(t, 2)
    ControlSetText, Edit3, %t%, ahk_id%id%
    WinSet, Redraw,, ahk_id%id%
  }
  Else IfWinExist, ahk_id%id% ahk_group FullTiltTables
  {
    ControlGet, v, Visible, , Edit1, ahk_id%id%
    if (v)
    {
      ControlGetText, t, Edit1, ahk_id%id%
      t := t + amount
      if (t < 0)
      {
        t := 0
      }
      t := Round(t, 2)
      ControlSetText, Edit1, %t%, ahk_id%id%
      ;WinSet, Redraw,, ahk_id%id%
    }
  }
  Else IfWinExist, ahk_id%id% ahk_group PrimaTables
  {
    ControlGetText, t, Edit1, ahk_id%id%
    t := t + amount
    if (t < 0)
    {
      t := 0
    }
    t := Round(t, 2)
    ControlSetText, Edit1, %t%, ahk_id%id%
    WinSet, Redraw,, ahk_id%id%
  }
  Else IfWinExist, ahk_id%id% ahk_group UBTables
  {
    ControlGetText, t, Edit1, ahk_id%id%
    t := t + amount
    if (t < 0)
    {
      t := 0
    }
    t := Round(t, 2)
    ControlSetText, Edit1, %t%, ahk_id%id%
    ;WinSet, Redraw,, ahk_id%id%
  }

  Else IfWinExist, ahk_id%id% ahk_group iPokerTables
  {
  	t := ReadBetBoxIPoker(id)
  	
  	if (t = -1)
  	   return
  
  	t := t + amount
  
  	if (t <= 0)
      	  return
  
  	t := Round(t, 2)
  	;Msgbox, %A_EventInfo%
  	WriteBetBoxIPoker(id, t)
  }
}

Pot(id, frac=1, round_bet=0.2, open_adjust="", autoBet=0)
{
  global debug
  global fix_blinds
  global caller_hwnd
  global party_uses_commas_for_decimals
  global stars_editbox
  global move_cursor

  PartyGetPid()
  

  caller_hwnd := ""
  pot := 0
  call := 0
  sb := 0
  bb := 0
  hero_bet := 0
  street := ""
  hero_position := ""
  open := 1
  max := 10000000
  
  IfWinExist, ahk_id%id% ahk_group MiniFT
  {
    WinGetTitle, t, ahk_id%id%
    caller_hwnd := id
    StringTrimLeft, t, t, Instr(t, "hwnd:", true, 0)+4
    id := t
  }

  IfWinExist, ahk_id%id% ahk_group StarsTables
  {
    PotSizeStars(id, pot, call, sb, bb, hero_bet, street, hero_position, open)
  } 
  Else IfWinExist, ahk_id%id% ahk_group PartyTables
  {
    PotSizeParty(id, pot, call, sb, bb, hero_bet, street, hero_position, open)
    if (party_uses_commas_for_decimals)
    {
      StringReplace, call, call, `,,., All
    }
  }
  Else IfWinExist, ahk_id%id% ahk_group CryptoTables
  {
    PotSizeCrypto(id, pot, call, sb, bb, hero_bet, street, hero_position, open)
  }
  Else IfWinExist, ahk_id%id% ahk_group FullTiltTables
  {
    ControlGet, v, Visible, , Edit1, ahk_id%id%
    if (v)
    {
      PotSizeFullTilt2(id, pot, call, sb, bb, hero_bet, street, hero_position, open, max)
    }
    else
    {
      return
    }
    ;msgbox, %pot%
  }
  Else IfWinExist, ahk_id%id% ahk_group PrimaTables
  {
    PotSizePrima(id, pot, call, sb, bb, hero_bet, street, hero_position, open)
  }
  Else IfWinExist, ahk_id%id% ahk_group UBTables
  {
    ControlGet, v, Visible, , Edit1, ahk_id%id%
    if (v)
    {
      PotSizeUB(id, pot, call, sb, bb, hero_bet, street, hero_position, open)
    }
    else
    {
      return
    }
  }

  Else IfWinExist, ahk_id%id% ahk_group iPokerTables
  {
    PotSizeIPoker(id, pot, call, sb, bb, hero_bet, street, hero_position, open)
  }

  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 = %fr1%
  }
  else if (street = "flop")
  {
    frac = %fr2%
  }
  else if (street = "turn")
  {
    frac = %fr3%
  }
  else if (street = "river")
  {
    frac = %fr4%
  }

  if (debug)
  {
    TrayTip, BetPot, Pot:`t`t%pot%`nCall:`t`t%call%`nHero_bet:`t%hero_bet%`n`nBlinds:`t$%sb%/$%bb%`n`nStreet:`t%street%`n`n%fr0%`n%fr1% %fr2% %fr3% %fr4%`n`n%frac%,10,17
  }
    
  if (fix_blinds 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
    }
  }

  ;msgbox, %pot%
  pot := ((pot + call + hero_bet)* (frac) )+ call
  ;msgbox, %pot%
  
  if (open=1 AND open_adjust="ssnl" )
  {
    pot := pot + bb - sb
  }
  else if (open=1 AND open_adjust="tourney" )
  {
    pot := pot - bb
  }
  else if (open=1 AND open_adjust="mix" )
  {
    if (bb=2)
    {
      pot := pot + bb - sb
    }
  }
  
  if(round_bet = "smallblind")
  {
    pot := Round((Floor((pot / sb)) * sb),2)
  }
  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
  }
  ;msgbox, %pot%
  
  
     
  IfWinExist, ahk_id%id% ahk_group StarsTables
  {
    ControlSetText, %stars_editbox%, %pot%, ahk_id%id%
    Sleep, -1
    if (autobet)
    {
      RaiseStars(id)
    }
  }
  Else IfWinExist, ahk_id%id% ahk_group PartyTables
  {
    if (party_uses_commas_for_decimals)
    {
      StringReplace, pot, pot, .,`,, All
    }
    ;Msgbox, %pot%
    ControlSetText, Edit2, %pot%, ahk_id%id%
    Sleep -1
    Sleep, 50
    WinSet, Redraw,, ahk_id%id%
    If(autobet)
    {
      ControlClick, AfxWnd42u19, ahk_id%id%
    }

    If(move_cursor)
    {
	    ControlGet, vis, visible, , AfxWnd42u19, ahk_id%id% 
	    if vis
	    {
		    ControlGetPos, x, y, , , AfxWnd42u19, ahk_id%id%
		    MouseMove, x + 40, y + 15
    	}
    }
  }
  Else IfWinExist, ahk_id%id% ahk_group CryptoTables
  {
    ControlSetText, Edit3, %pot%, ahk_id%id%
    Sleep -1
    WinSet, Redraw,, ahk_id%id%
    If(autobet)
    {
      PostLeftClick(730, 540, id)
    } 
  }
  Else IfWinExist, ahk_id%id% ahk_group FullTiltTables
  {
    ControlGet, v, Visible, , Edit1, ahk_id%id%
    if (v)
    {
      ;Msgbox, %pot%
      if (pot > max)
      {
        pot := max
      }
      ControlSetText, Edit1, %pot%, ahk_id%id%
      Sleep -1
      ;WinSet, Redraw,, ahk_id%id%
      If(autobet)
      {
        ab := 0
        Loop, 20
        {
          ControlGetText, t, Edit1, ahk_id%id%
          if (t < pot || t > pot)
          {
            Sleep, 100
          }
          else
          {
            ;TrayTip, ,  %ab% %t% %pot%
            Sleep, 200
            
            RaiseFT(id)
            
            /*
            if (FTP_Beta)
            {
              ControlFocus, FTCButton14, ahk_id%id%
              Sleep, -1
              ControlClick, FTCButton14, ahk_id%id%
            }
            else
            {
              ControlFocus, FTCButton13, ahk_id%id%
              Sleep, -1
              ControlClick, FTCButton13, ahk_id%id%
            }
            */
            
            break
          }
        }
        ;TrayTip, ,  %ab% %t% %pot%
        ;if (ab)
        ;{
        ;  ControlFocus, FTCButton11, ahk_id%id%
        ;  Sleep, -1
        ;  ControlClick, FTCButton11, ahk_id%id%
        ;}
      }
    }
  }
  Else IfWinExist, ahk_id%id% ahk_group PrimaTables
  {
    ControlFocus, Edit1, ahk_id%id%
    ControlSetText, Edit1, %pot%, ahk_id%id%
    Sleep, -1
    WinSet, Redraw,, ahk_id%id%
    If(autobet)
    {
      WinActivate, ahk_id%id%
      WinWaitActive, ahk_id%id%, , 1
      If (errorlevel<>1)
      {
        Send, {ENTER}
      }
      
    } 
  }
  Else IfWinExist, ahk_id%id% ahk_group UBTables
  {
    ControlSetText, Edit1, %pot%, ahk_id%id%
    Sleep -1
    WinSet, Redraw,, ahk_id%id%
    If(autobet)
    {
      RaiseUB(id)
    } 
  }

  Else IfWinExist, ahk_id%id% ahk_group iPokerTables
  {
     if pot != 0
     {
	;don't write if bet box not visible
	t:= ReadBetBoxIpoker(id)

	if (t = -1)
	   return

		WriteBetBoxIpoker(id, pot)	
		If(autobet)
		   {
		      readPot := ReadBetBoxIpoker(id)
		      if (readPot = pot)
		      {
		      	WinActivate, ahk_id%id%
		      	WinWaitActive, ahk_id%id%, , 1
		      	If (errorlevel<>1)
		      	{
		      	  Send, {ENTER}
		     	}
		    }
	}
      }
   }
}


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
  global FTP_Beta
  rake := 0
  notraked := 0
  maxrake := 3
  max := 7654321
  
  ftp_btn_max = FTCSkinButton24
  ftp_btn_max_pl = FTCSkinButton24
  ftp_btn_max_cap = FTCSkinButton28
  ftp_btn_min = FTCSkinButton23
  ftp_btn_pot = FTCSkinButton25
  ftp_btn_pot_pl = FTCSkinButton27
  
  WinGetTitle, title, ahk_id%id%
  StringMid, bb, title, InStr(title, "/") + 1, InStr(title, a_space,"", InStr(title, "/")) - InStr(title, "/") - 1
  StringReplace,bb,bb,$,,1
  sb := sb(bb)
  ;msgbox, %bb%`n%sb%
  ControlGetText, t, Edit1, ahk_id%id%

  min := sb
  

    if (InStr(title, "Pot Limit"))
    {
      ControlGet, v, Visible, , %ftp_btn_pot_pl%, ahk_id%id% 
      if (v)
      {
        ;TrayTip, BetPot,`nPOT to zero,10,17
        x := ""
        ControlSetText, Edit1,%min%, ahk_id%id%
        Loop, 50
        {
          ControlGetText, x, Edit1, ahk_id%id%
          if (x = min)
          {
            break
            ;Traytip
          }
          sleep, 40
          ;Traytip
        }
        
        
        Loop, 50
        {
         ; TrayTip, BetPot,`nPOT result,10,17
          ControlFocus, %ftp_btn_pot_pl%, ahk_id%id%
          ControlClick, %ftp_btn_pot_pl%, ahk_id%id%
          Sleep, -1
          ControlGetText, pot, Edit1, ahk_id%id%
          if (pot != "")
          {
            break
            ;Traytip
          }
          sleep, 40
         ; TrayTip
        }
      }
    }
    else  ;unlimited betting
    {
      ControlGet, v, Visible, , %ftp_btn_pot%, ahk_id%id%
      if (v)
      {
        ;TrayTip, BetPot,`nPOT to zero,10,17
        x := ""
        ControlSetText, Edit1,%min%, ahk_id%id%
        Loop, 50
        {
          ControlGetText, x, Edit1, ahk_id%id%
          if (x = min)
          {
            break
            ;Traytip
          }
          sleep, 40
          ;Traytip
        }
        
        
        Loop, 50
        {
         ; TrayTip, BetPot,`nPOT result,10,17
          ControlFocus, %ftp_btn_pot%, ahk_id%id%
          ControlClick, %ftp_btn_pot%, ahk_id%id%
          Sleep, -1
          ControlGetText, pot, Edit1, ahk_id%id%
          if (pot != "")
          {
            break
            ;Traytip
          }
          sleep, 40
         ; TrayTip
        }
      }
      
    
    ControlGet, v, Visible, , %ftp_btn_min%, ahk_id%id%
      if (v)
      {
        ;TrayTip, BetPot,`nMIN to zero,10,17
        x := ""
        ControlSetText, Edit1,%pot%, ahk_id%id%
        Loop, 50
        {
          ControlGetText, x, Edit1, ahk_id%id%
          if (x = pot)
          {
            break
            ;Traytip
          }
          sleep, 40
          ;Traytip
        }
        
        
        Loop, 50
        {
          ;TrayTip, BetPot,`nMIN result,10,17
          ControlFocus, %ftp_btn_min%, ahk_id%id%
          ControlClick, %ftp_btn_min%, ahk_id%id%
          Sleep, -1
          ControlGetText, min, Edit1, ahk_id%id%
          if (min != pot)
          {
            break
            ;TrayTip
          }
          sleep, 40
          ;TrayTip
        }
      }
    }
    
    
  
  
  ControlSetText, Edit1, %t%, ahk_id%id%
  
  
  street := "pre"
  
  street := GetStreetFT(id)
  
  
  if (min = bb)
  {
    call := 0
  }
  else if (min > bb)
  {
    call := min / 2
  }
  else if (street != "pre")
  {
    call := bb
  }
  
  if (call != bb || street != "pre")
  {
    open := 0
  }
  
  pot := pot - (2 * call)
  
  
  
  /*
  if (deduct_rake AND street<>"pre")
  {
    rake := Floor(pot - notraked) * 0.05
    if (rake > maxrake)
    {
      rake := maxrake
    }
    pot := pot - rake
  }
  */
  
  ;Msgbox, Pot: %pot%`nRake: %rake%`nNot Raked: %notraked%
  
  
  return
}






PotSizePrima(id, ByRef pot, ByRef call, ByRef sb, ByRef bb, ByRef hero_bet, ByRef street, ByRef hero_position, ByRef open)
{
  global deduct_rake
  rake := 0
  notraked := 0
  maxrake := 3

  
  
  ;Msgbox %title%
  nl_actions = called for $,raised for $,bet for $,went all-in for $,posted small blind,posted big blind
  
  
  WinGetTitle, title, ahk_id%id%
  StringMid, hero, title, InStr(title, " - Blinds ")-1, , L
  StringTrimLeft, hero, hero, InStr(hero, " - ", true, 0)+2
  ;Msgbox %hero%
  
  ;ControlGetText, hh, RichEdit20W3, ahk_id%id%
  Loop, 10
  {
    ControlGetText, hh, RichEdit20W3, ahk_id%id%
    If hh
    {
      break
    }
    Sleep, 80
  }
  StringTrimLeft, hh, hh, InStr(hh, " wins ", true, 0)
  
  ;Msgbox, %hh%
  
  Loop, Parse, hh, `n
  {
    If a_loopfield contains %nl_actions%
    {
      StringMid, amount, a_loopfield, InStr(a_loopfield, "$")+1
      StringReplace, amount, amount, )
      StringReplace, amount, amount, `,,, All
      StringReplace, amount, amount, `n
      StringReplace, amount, amount, `r
      pot += amount
      
      IfInString, a_loopfield, raised for $
      {
        open := 0
      }
      
      IfInString, a_loopfield, posted small blind
      {
        sb := amount
        If a_loopfield contains %hero%
        {
          hero_position := "sb"
        }  
      }
      Else IfInString, a_loopfield, posted big blind
      {
        bb := amount
        If a_loopfield contains %hero%
        {
          hero_position := "bb"
        }
      }
      
    }
  }
   
  street := "pre"
  
  If InStr(hh, "> Dealing the river(")
  {
    StringTrimLeft, hh2, hh, InStr(hh, "> Dealing the river(", true, 0)
    street := "river"
    open := 0
  }
  Else If InStr(hh, "> Dealing the turn(")
  {
    StringTrimLeft, hh2, hh, InStr(hh, "> Dealing the turn(", true, 0)
    street := "turn"
    open := 0
  }
  Else If InStr(hh, "> Dealing the Flop(")
  {
    StringTrimLeft, hh2, hh, InStr(hh, "> Dealing the Flop(", true, 0)
    street := "flop"
    open := 0
  }
  Else
  {
    hh2 := hh
  }

  Loop, Parse, hh2, `n
  {
    ;Msgbox %hh2%
    If a_loopfield contains %nl_actions%
    {
      StringMid, amount, a_loopfield, InStr(a_loopfield, "$")+1
      StringReplace, amount, amount, `)
      Stringreplace, amount, amount, `n
      Stringreplace, amount, amount, `,,, All
      
      notraked += amount
         
      IfInString, a_loopfield, > %hero%
      {
        hero_bet += amount
      }
      Else
      {
        call := amount
      }
        
    }
  }
  
  if(hero_bet >= call)
  { 
    call := 0
  }
  Else
  {
    call -= hero_bet
  }
  call := iif( call, call, 0 )

  
  if(deduct_rake AND street<>"pre")  
  {
    rake := Floor(pot - notraked) * 0.05
    If (rake > maxrake)
    {
      rake := maxrake
    }
    pot := pot - rake
  }
  return
}


PotSizeCrypto(id, ByRef pot, ByRef call, ByRef sb, ByRef bb, ByRef hero_bet, ByRef street, ByRef hero_position, ByRef open)
{
  global deduct_rake
  rake := 0
  notraked := 0
  maxrake := 3
  
  nl_actions = calls $,raises to $,bets $,posts ante $,posts small blind $,posts big blind $
  WinGetTitle, title, ahk_id%id%
  StringMid, hero, title, InStr(title, "logged in as ") + 13
  
  ControlGetText, hh, RICHEDIT1, ahk_id%id%
  StringTrimLeft, hh, hh, InStr(hh, "Starting new hand: #", true, 0)
  StringReplace, hh, hh, €,$, All
  StringReplace, hh, hh, Ł,$, All
  Loop, Parse, hh, `n
  {
    If a_loopfield contains %nl_actions%
    {
      StringMid, amount, a_loopfield, InStr(a_loopfield, "$") + 1
      StringReplace, amount, amount, `r,, All
      StringReplace, amount, amount, `n,, All
      StringReplace, amount, amount, %A_SPACE%,, All
      StringReplace, amount, amount, %A_TAB%,, All
      
      pot += amount
      
      IfInString, a_loopfield, raises to $
      {
        open := 0  
      }
     
      IfInString, a_loopfield, posts small blind $
      {
        sb := amount
        If a_loopfield contains %hero%
        {
          hero_position := "sb"
        }  
      }
      Else IfInString, a_loopfield, posts big blind $
      {
        bb := amount
        If a_loopfield contains %hero%
        {
          hero_position := "bb"
        }
      }
    }
  }
  ;Msgbox, %sb% %bb%
  hh2 := hh
  street := "pre"
  If InStr(hh2, "Dealer: Dealing River:")
  {
    StringTrimLeft, hh2, hh2, InStr(hh, "Dealer: Dealing River:", true, 0)
    open := 0
    street := "river"
  }
  Else If InStr(hh2, "Dealer: Dealing Turn:")
  {
    StringTrimLeft, hh2, hh2, InStr(hh, "Dealer: Dealing Turn:", true, 0)
    open := 0
    street := "turn"
  }
  Else If InStr(hh2, "Dealer: Dealing Flop:")
  {
    StringTrimLeft, hh2, hh2, InStr(hh, "Dealer: Dealing Flop:", true, 0)
    open := 0
    street := "flop"
  }

  ;Msgbox, %hh2%
  Loop, Parse, hh2, `n
  {
    If a_loopfield contains %nl_actions%
    {
      StringMid, amount, a_loopfield, InStr(a_loopfield, "$") + 1
      StringReplace, amount, amount, `r,, All
      StringReplace, amount, amount, `n,, All
      StringReplace, amount, amount, %A_SPACE%,, All
      StringReplace, amount, amount, %A_TAB%,, All
      notraked += amount
      If a_loopfield contains %hero%
      {
        hero_bet += amount
      }
      Else
      {
        call := amount
      }
    }
  
    if(hero_bet >= call)
    { 
      call := 0
    }
    Else
    {
      call -= hero_bet
    }
  }
  call := iif( call, call, 0 )

  if (deduct_rake AND street<>"pre")
  {
    rake := Floor(pot - notraked) * 0.05
    if (rake > maxrake)
    {
      rake := maxrake
    }
    pot := pot - rake
  }
  
  return
}

FoldParty(id)
{
  ControlGet, v, Visible, , AfxWnd42u22, ahk_id%id%
  if (v)
  {
    ControlFocus, AfxWnd42u22, ahk_id%id%
    Sleep, -1
    ControlClick, AfxWnd42u22, ahk_id%id%
  }
  else
  {
  ControlGet, v, Visible, , AfxWnd42u17, ahk_id%id%
    if (v)
    {
      ControlFocus, AfxWnd42u17, ahk_id%id%
      Sleep, -1
      ControlClick, AfxWnd42u17, ahk_id%id%
    }
  }
}

CallParty(id)
{
  ControlGet, v, Visible, , AfxWnd42u18, ahk_id%id%
  if (v)
  {
    ControlFocus, AfxWnd42u18, ahk_id%id%
    Sleep, -1
    ControlClick, AfxWnd42u18, ahk_id%id%
  }
}

RaiseParty(id)
{
  ControlGet, v, Visible, , AfxWnd42u19, ahk_id%id%
  if (v)
  {
    ControlFocus, AfxWnd42u19, ahk_id%id%
    Sleep, -1
    ControlClick, AfxWnd42u19, ahk_id%id%
  }
}

PotSizeParty(id, ByRef pot, ByRef call, ByRef sb, ByRef bb, ByRef hero_bet, ByRef street, ByRef hero_position, ByRef open)
{
  global deduct_rake
  global fphg_party_hh_folder
  global debug
  global fphg_uselive
  WinGetTitle, title, ahk_id%id%
  
  nl_actions = calls [,raises [,bets [,all-In  [,posts ante [,posts small blind [,posts big blind [, posts big blind + dead [
  
  notraked := 0
  maxrake := 3
  tourney := 0
  
  StringTrimRight, tablename, title, ( StrLen(title) - (InStr(title, " - ")-1) )
  
  
  ;Get hero's screen name from the window title
  StringMid, hero, title, InStr(title, "Luck ") + 5
  StringMid, hero, hero, InStr(hero, "!")-2,, L
  StringReplace, hero, hero, %A_SPACE%,, All
  ;Msgbox %hero%
  hhf := fphg_party_hh_folder . tablename . ".hhf"
  
  if (fphg_uselive)
  {
    ControlGetText, handnum, This hand#, ahk_id%id%
    StringTrimLeft, handnum, handnum, InStr(handnum, "#")
    StringReplace, handnum, handnum, `,,, All
    StringReplace, handnum, handnum, .,, All
    StringReplace, handnum, handnum, %A_SPACE%,, All
    ;Msgbox, %handnum%
    hhf := fphg_party_hh_folder . "live\" . handnum . ".live"
  }
  
  ;Msgbox %hhf%
  FileRead, hh, %hhf%
  if not ErrorLevel
  {
    ControlGetText, currenthand, This Hand, ahk_id%id%
    StringReplace, currenthand, currenthand, `,,, All
    StringTrimLeft, currenthand, currenthand, InStr(currenthand, "#")
    StringReplace, currenthand, currenthand, %A_SPACE%,, All
    currenthand := "Hand History for Game " . currenthand
    ;Msgbox, %currenthand%
    StringTrimLeft, hh, hh, InStr(hh, currenthand, true, 0)-1
    IfNotInString, hh, %currenthand%
    {
      TrayTip, BetPot,`nParty HHF reader`n`n%currenthand% not found in file %hhf%,10,17
      Exit
    }
    ;Msgbox, %hh%
  }
  else
  {
    if (fphg_uselive)
    {
      TrayTip, BetPot,`nParty HHF reader`n`nFPHG live file not found for game# %handnum%,10,17
      Exit
    }
    else
    {
      TrayTip, BetPot,`nParty HHF reader`n`nTable %tablename% hand history not found,10,17
      Exit
    }
  }
  
  ;get hero sn from hhf
  Loop, Parse, hh, `n
   {
    if(InStr(A_LoopField, "Dealt to "))
    {
      StringTrimLeft, hero, a_loopfield, 9
      StringTrimRight, hero, hero, StrLen(hero) - (InStr(hero, " [ ")-1)
      break
    }
  }
  ;msgbox, %hero%
  
  Loop, Parse, hh, `n
   {
    If a_loopfield contains %nl_actions%
     {
      StringMid, amount, a_loopfield, InStr(a_loopfield, "[") + 1, (InStr(a_loopfield, "]")-0) - InStr(a_loopfield, "[") - 1
      StringReplace, amount, amount, €
      StringReplace, amount, amount, Ł
      StringReplace, amount, amount, $
      StringReplace, amount, amount, `,,, All
      StringReplace, amount, amount, A_SPACE
      amount := RegExReplace(amount, "[A-Za-z]")
      pot += amount
      IfInString, a_loopfield, posts Small Blind [
      {
        ;StringMid, amount, a_loopfield, InStr(a_loopfield, "[") + 1, (InStr(a_loopfield, "]")-0) - InStr(a_loopfield, "[") - 1
        ;StringReplace, amount, amount, $
        sb := amount
        If a_loopfield contains %hero%
        {
          hero_position := "sb"
        }  
      }
      Else IfInString, a_loopfield, posts Big Blind [
      {
        ;StringMid, amount, a_loopfield, InStr(a_loopfield, "[") + 1, (InStr(a_loopfield, "]")-0) - InStr(a_loopfield, "[") - 1
        ;StringReplace, amount, amount, $
        bb := amount
        If a_loopfield contains %hero%
        {
          hero_position := "bb"
        }
      }
      Else If(open = 1 AND InStr(a_loopfield, "raises [", true, 0))
      {
        open := 0
        ;Msgbox "Pre flop Raise"
      }
      Else If(open = 1 AND InStr(a_loopfield, "all-In  [", true, 0))
      {
        open := 0
        ;Msgbox "Pre flop All-In"
      }
      ;msgbox, %amount%
      ;msgbox, %pot%
     }
   }

  if(bb = 0)
  {
    tourney := 1
    ControlGetText, text, Blinds, ahk_id%id%
    ;msgbox, %text%
    IfNotInString, text, Blinds-Antes
      StringMid, bb, text, InStr(text, "/") + 1, InStr(text, ")") - InStr(text, "/") - 1 ;___so we retrieve the big blind from the static instead
    else
      StringMid, bb, text, InStr(text, "/") + 1, InStr(text, "-","",InStr(text, "/")) - InStr(text, "/") - 1
    ;msgbox, %bb%
    
    sb := bb / 2
  
  }
  ;Msgbox, %bb%
  ;Msgbox, %sb%
  
  hh2 := hh
  street := "pre"
  If InStr(hh2, "** Dealing River **")
  {
    StringTrimLeft, hh2, hh2, InStr(hh, "** Dealing River **", true, 0)
    open := 0
    street := "river"
  }
  Else If InStr(hh2, "** Dealing Turn **")
  {
    StringTrimLeft, hh2, hh2, InStr(hh, "** Dealing Turn **", true, 0)
    open := 0
    street := "turn"
  }
  Else If InStr(hh2, "** Dealing Flop **")
  {
    StringTrimLeft, hh2, hh2, InStr(hh, "** Dealing Flop **", true, 0)
    open := 0
    street := "flop"
  }
  
  ;Msgbox, %hero%`n`n`n%hh2%
  Loop, Parse, hh2, `n
  {
    If a_loopfield contains %hero%
    {
      ;Msgbox %a_loopfield%
      If a_loopfield contains %nl_actions%
      {
        StringMid, amount, a_loopfield, InStr(a_loopfield, "[") + 1, (InStr(a_loopfield, "]")-0) - InStr(a_loopfield, "[") - 1
        StringReplace, amount, amount, $
        StringReplace, amount, amount, €
        StringReplace, amount, amount, Ł
        StringReplace, amount, amount, A_SPACE
        amount := RegExReplace(amount, "[A-Za-z]")
        hero_bet += amount
      }
    }
  }
  
  
  If (tourney <> 1)
  {
    If(deduct_rake <> 0 AND InStr(hh, "** Dealing Flop"))  
    {
      StringTrimLeft, hh, hh, InStr(hh, "** Dealing ", true, 0)
      c := InStr, hh, "** Dealing "
      ;Msgbox %hh%
      Loop, Parse, hh, `n
      {
        If a_loopfield contains %nl_actions%
        {
          StringMid, amount, a_loopfield, InStr(a_loopfield, "[") + 1, (InStr(a_loopfield, "]")-0) - InStr(a_loopfield, "[") - 1
          StringReplace, amount, amount, $
          StringReplace, amount, amount, €
          StringReplace, amount, amount, Ł
          amount := RegExReplace(amount, "[A-Za-z]")
          notraked += amount
        }
      }

      rake := Floor(pot - notraked) * 0.05
      If rake > %maxrake%
      {
        rake := maxrake
      }

      If(rake >= 0.25 AND InStr(tablename, "Jackpot"))
	rake += 0.5

      ;msgbox, rake = %rake%
      If (tourney <> 1)
      {
        pot := pot - rake
      }
    }
  }
  
  ;Msgbox %pot% 
  
  If (tourney = 1)
  {
    pot := pot + sb + bb
  }
    
  match_mode = %a_titlematchmode%
  SettitleMatchMode 2
  ControlGetText, call, Call, ahk_id%id%
  SettitleMatchMode %match_mode%
  StringMid, call, call, InStr(call, "(") + 1, InStr(call, ")") - InStr(call, "(") - 1
  StringReplace, call, call, $
  StringReplace, call, call, €
  StringReplace, call, call, Ł
  call := iif( call, call, 0 )
    
  ;Msgbox %pot%
  return
}


;******************************************************** IPOKER *******************************************

IE_InjectJS(hIESvr, JS_to_Inject, VarNames_to_Return="")
{
   ;Initialize the COM interface. code modified from SEAN
   IID_IHTMLWindow2   := "{332C4427-26CB-11D0-B483-00C04FD90119}"
   ACC_Init()
   pacc := ACC_AccessibleObjectFromWindow(hIESvr)
   pwin := COM_QueryService(pacc,IID_IHTMLWindow2,IID_IHTMLWindow2)
   COM_Release(pacc)
   ;Execute the Javascript (if there is any). Thanks LEXIKOS.
   If JS_to_Inject
      COM_Invoke(pwin, "execscript", JS_to_Inject)
   ;Get the value of the variables, if any.
   If VarNames_to_Return {
      ;Split the passed variable names into a psuedo array of ahk variables
      StringSplit, Vars_, VarNames_to_Return, `,
      ;Get the value of each javascript variable in the order it was passed
      Loop, %Vars_0%
         Ret .= COM_Invoke(pwin,Vars_%A_Index%) . ","
      ;Remove the trailing comma
      StringTrimRight, Ret, Ret, 1
      }
   ; Cleanup
   COM_Release(pwin)
   ACC_Term()
   ;Return a comma seperated list of variables in the order they were passed
   Return Ret
}



PotSizeIPoker(id, ByRef pot, ByRef call, ByRef sb, ByRef bb, ByRef hero_bet, ByRef street, ByRef hero_position, ByRef open)
{
  global deduct_rake, debug

  rake := 0
  notraked := 0
  maxrake := 3
  tourney := 0

  nl_actions = calls $, raises to $, bets $, All-in $, posts Small Blind $, posts Big Blind $
  
  WinGetTitle, title, ahk_id %id%
  StringLeft, tableName, title, InStr(title, "-") -2
  StringTrimLeft, tableName, tableName, InStr(tableName, ":") + 1

  ;Get hero's screen name from the lobby title
  WinGetTitle, lobby, Nickname: ahk_class PTIODEVICE
  StringTrimLeft, hero, lobby, InStr(lobby, "Nickname:") + 9
  StringLeft, hero, hero, InStr(hero, A_space)
  ;Msgbox %hero%
 
  ;grab HH from chat box
  hh :=
  

  ControlGet, chat_id, Hwnd,,Internet Explorer_Server3, ahk_id%id%
  ahkret1 := IE_InjectJS(chat_id, "ahkret1=document.body.innerHTML", "ahkret1")

  ahkret1 := RegExReplace(ahkret1, "i)<(.|\n)+?>", "")
  Stringreplace, ahkret1, ahkret1, `r`n`r`n, `n, All
  Stringreplace, ahkret1, ahkret1, `r`n, `n, All
  ;Msgbox, %ahkret1%

  StringGetPos, pos, ahkret1, (#, R
  StringTrimLeft, hh, ahkret1, pos

  ;Msgbox, %hh%
  ;FileAppend, %hh%`n`n, test.txt
  
  Loop, Parse, hh, `n
  {
    If a_loopfield contains %nl_actions%
    {	
    	StringTrimRight, amount, a_loopfield, 0
    	StringGetPos, pos, amount,%a_space%, R	
    	StringRight, amount, amount, StrLen(amount) - pos
    	StringReplace, amount, amount, `,,, All
    	StringReplace, amount, amount, %a_space%
    	StringReplace, amount, amount, $,,All
    	pot += amount
    	;msgbox %amount%
      IfInString, a_loopfield, posts Small Blind $
      {       
        sb := amount
        ;msgbox, %sb%
        If a_loopfield contains %hero%
        {
          hero_position := "sb"
        }  
      }
      Else IfInString, a_loopfield, posts Big Blind $
      {
        bb := amount
        If a_loopfield contains %hero%
        {
          hero_position := "bb"
        }
      }
      Else If(open = 1 AND InStr(a_loopfield, "raises $", true, 0))
      {
        open := 0
        ;Msgbox "Pre flop Raise"
      }
      Else If(open = 1 AND InStr(a_loopfield, "All-in $", true, 0))
      {
        open := 0
        ;Msgbox "Pre flop All-In"
      }
      ;msgbox, %amount%
      ;msgbox, %pot%
     }
   }

  IfNotInString, hh, $
    tourney := 1
   
  ;msgbox tourney: %tourney%
 
  ;Msgbox, BB: %bb%
  ;Msgbox, SB: %sb%
  
  hh2 := hh
  street := "pre"
  If InStr(hh2, "Dealing River")
  {
    StringTrimLeft, hh2, hh2, InStr(hh, "Dealing River", true, 0)
    open := 0
    street := "river"
  }
  Else If InStr(hh2, "Dealing Turn")
  {
    StringTrimLeft, hh2, hh2, InStr(hh, "Dealing Turn", true, 0)
    open := 0
    street := "turn"
  }
  Else If InStr(hh2, "Dealing Flop")
  {
    StringTrimLeft, hh2, hh2, InStr(hh, "Dealing Flop", true, 0)
    open := 0
    street := "flop"
  }
  ;msgbox %street%
  ;Msgbox, %hero%`n`n`n%hh2%
  Loop, Parse, hh2, `n
  {    
      ;Msgbox %a_loopfield%
      If a_loopfield contains %nl_actions%
      {
      	StringTrimRight, amount, a_loopfield, 0
      	StringGetPos, pos, amount,%a_space%, R	
      	StringRight, amount, amount, StrLen(amount) - pos
      	;StringReplace, amount, amount, `r,,, All
      	StringReplace, amount, amount, `,,, All
      	StringReplace, amount, amount, %a_space%
      	StringReplace, amount, amount, $,,All
      	notraked += amount       
        ;Msgbox %a_loopfield%`n%amount%
      	If a_loopfield contains %hero%
        {
      		hero_bet += amount
        }
      	Else
        {
        	call := amount
        	;Msgbox, %call%
        }
     }
  } 
  
  if(hero_bet >= call)
  {
    call := 0
  }
  Else
  {
    call -= hero_bet
  }

  call := iif( call, call, 0 )

  If (tourney <> 1)
  {
    If(deduct_rake AND street <>"pre")  
    {

      rake := Floor(pot - notraked) * 0.05
      If (rake > maxrake)
      {
        rake := maxrake
      }
      pot := pot - rake
    }
  }
  ;Msgbox Pot: %pot%`nrake:%rake%`nhero bet:%hero_bet%`ncall:%call%

  
   return
}


;returns the amount currently written into the ipoker bet box, or -1 if it can't be read
ReadBetBoxIPoker(id)
{      
	global border, caption, iPokerLoop, ipoker_test_betbox ;, iPokerBetBoxX, iPokerBetBoxY
  iPokerSetCoords(id)
  ;return -1
  
  ;Critical, On
	MouseGetPos, x, y
	PostLeftClick(1, 1, id, 1)
	WinWaitActive, ahk_id %id%

	;move the cursor to the box using tab
	loop, %ipokerLoop%
	  Send +{tab}

	sleep 50
	;MouseGetPos, x2, y2

;msgbox %ipokerbetboxx% %x2% %ipokerbetboxy% %y2%
;	if (x2 = iPokerBetBoxX AND y2 = iPokerBetBoxY)
;	{
		oldClipboard = %clipboard%
		clipboard =

		Send {HOME}+{END}^c
		ClipWait, 0.3
		If !ErrorLevel
	    	  t := clipboard
 		clipboard = %oldClipBoard%
;	}

	MouseMove, x, y, 0
	if t=
	  t = -1

	return t
}

;writes the bet amount into the bet box if it is visible
WriteBetBoxIpoker(id, amount)
{
	global border, caption, ipoker_test_betbox, iPokerLoop, iPokerRaiseX, iPokerRaiseY, move_cursor ;, iPokerBetBoxX, iPokerBetBoxY
  ;Critical, On
  iPokerSetCoords(id)
	
  
  MouseGetPos, x, y
	PostLeftClick(1, 1, id, 1)
	WinWaitActive, ahk_id %id%
	loop, %ipokerLoop%
	  Send +{tab}

;	sleep 50
;	MouseGetPos, x2, y2
;msgbox %ipokerbetboxx% %ipokerbetboxy% %x2% %y2%
	
	;if (x2 = iPokerBetBoxX AND y2 = iPokerBetBoxY)
	;{
	   Send {HOME}
	   Send +{END}
	   Send %amount%
	;}

sleep, 5
	If (move_cursor)
		MouseMove, ipokerRaiseX, (iPokerRaiseY + caption), 0
	else
	  MouseMove, x, y, 0
}


/*

ReadBetBoxIPoker(id)
{
  global border,caption
  Critical, On
  clipboard=
  PostLeftClick(1, 1, id, 1)
	WinWaitActive, ahk_id %id%
  
  foundit := 0
  VarSetCapacity(CurrentCursorStruct, 20, 0)
  InsertInteger(20, CurrentCursorStruct, 0)
  CoordMode, Mouse, Screen
  MouseGetPos, ox, oy
  WinGetPos, x, y, w, h, ahk_id%id%
  Loop, 30
  {
    ;ControlSend,,{TAB},ahk_id%id%
    Send +{TAB}
    Sleep, -1
    MouseGetPos, mx, my
    rx := mx - (x + border)
    ry := my - (y + caption)
    ;TrayTip, mpos, %rx% %ry%
    if (ry > ((h - caption)/2))
    {
      if (rx > ((w - border)/2))
      {
        InsertInteger(20, CurrentCursorStruct, 0)
        result := DllCall("GetCursorInfo", "str", CurrentCursorStruct)
        hcursor := ExtractInteger(CurrentCursorStruct, 8)
        if (hcursor = 65557)
        {
          ;Sleep, 3000
          ;TrayTip, mpos, %rx% %ry%`n`n%hcursor%
          ;msgbox, ding
          foundit := 1
          ;Traytip, dsada,%A_Index%
          
          ;ControlSend,,+{END},ahk_id%id%
          break
        }
      }
    }
  }
  if (foundit)
  {
    ControlSend,,{HOME}+{END}^c,ahk_id%id%
    ClipWait, 0.3
		if (!ErrorLevel)
		{
	    t := clipboard
      if (!t)
      {
        t = -1
      }
    }
	}
	else
	{
    t = -1
  }
	MouseMove, ox, oy
  return t
}

WriteBetBoxIPoker(id, amount)
{
  global border,caption
  Critical, On
  PostLeftClick(1, 1, id, 1)
	WinWaitActive, ahk_id %id%
  
  foundit := 0
  VarSetCapacity(CurrentCursorStruct, 20, 0)
  InsertInteger(20, CurrentCursorStruct, 0)
  CoordMode, Mouse, Screen
  MouseGetPos, ox, oy
  WinGetPos, x, y, w, h, ahk_id%id%
  Loop, 30
  {
    ;ControlSend,,{TAB},ahk_id%id%
    Send +{TAB}
    Sleep, -1
    MouseGetPos, mx, my
    rx := mx - (x + border)
    ry := my - (y + caption)
    ;TrayTip, mpos, %rx% %ry%
    if (ry > ((h - caption)/2))
    {
      if (rx > ((w - border)/2))
      {
        InsertInteger(20, CurrentCursorStruct, 0)
        result := DllCall("GetCursorInfo", "str", CurrentCursorStruct)
        hcursor := ExtractInteger(CurrentCursorStruct, 8)
        if (hcursor = 65557)
        {
          ;Sleep, 3000
          ;TrayTip, mpos, %rx% %ry%`n`n%hcursor%
          ;msgbox, ding
          foundit := 1
          Traytip, dsada,%A_Index%
          
          ;ControlSend,,+{END},ahk_id%id%
          break
        }
      }
    }
  }
  if (foundit)
  {
    ;ControlSend,,{HOME}+{END},ahk_id%id%
    ;ControlSend,,%amount%,ahk_id%id%
    Send {HOME}
	  Send +{END}
	  Send %amount%
  }
	else
	{
    return 0
  }
	MouseMove, ox, oy
  return 1
}
*/

ExtractInteger(ByRef pSource, pOffset = 0, pIsSigned = false, pSize = 4)
; pSource is a string (buffer) whose memory area contains a raw/binary integer at pOffset.
; The caller should pass true for pSigned to interpret the result as signed vs. unsigned.
; pSize is the size of PSource's integer in bytes (e.g. 4 bytes for a DWORD or Int).
; pSource must be ByRef to avoid corruption during the formal-to-actual copying process
; (since pSource might contain valid data beyond its first binary zero).
{
	Loop %pSize%  ; Build the integer by adding up its bytes.
		result += *(&pSource + pOffset + A_Index-1) << 8*(A_Index-1)
	if (!pIsSigned OR pSize > 4 OR result < 0x80000000)
		return result  ; Signed vs. unsigned doesn't matter in these cases.
	; Otherwise, convert the value (now known to be 32-bit) to its signed counterpart:
	return -(0xFFFFFFFF - result + 1)
}

InsertInteger(pInteger, ByRef pDest, pOffset = 0, pSize = 4)
; The caller must ensure that pDest has sufficient capacity.  To preserve any existing contents in pDest,
; only pSize number of bytes starting at pOffset are altered in it.
{
	Loop %pSize%  ; Copy each byte in the integer into the structure as raw binary data.
		DllCall("RtlFillMemory", "UInt", &pDest + pOffset + A_Index-1, "UInt", 1, "UChar", pInteger >> 8*(A_Index-1) & 0xFF)
}


PotSizeStars(id, ByRef pot, ByRef call, ByRef sb, ByRef bb, ByRef hero_bet, ByRef street, ByRef hero_position, ByRef open)
{
  global use_old_stars_buttons, stars_editbox
  CoordMode, Pixel, Screen
  WinGetPos, x, y, w, h, ahk_id%id%

  x1 := 700
  y1 := 440
  x2 := 770
  y2 := 450
  relStarsScreenPoint(id, x1, y1)
  relStarsScreenPoint(id, x2, y2)  

  col := GetPredominateColor(x1, y1, x2, y2)
  ;Msgbox, %col%
  if (col = "0x00327F")
  {
    ;ThemeDir := "normal"
    PotThemeDir := "classic"
    CallThemeDir := "classic"
  
  }
  else if (col = "0xDDD7CC")
  {
    PotThemeDir := "hypersimple"
    CallThemeDir := "hypersimple"
  
  }
  else
  {
    if (debug)
    {
      Msgbox, Unable to match slider colour: %col% to a known theme
    }
    return
  }
  if (use_old_stars_buttons)
  {
    CallThemeDir := CallThemeDir . "\old"
  }
 
  street := GetStreetStars(id)

  if (w <= 526)
  {
    SizeDir := 0
  }
  else if (w <= 621)
  {
    SizeDir := 1
  }
  else if (w <= 736)
  {
    SizeDir := 2
  }
  else if (w <= 875)
  {
    SizeDir := 3
  }
  else if (w <= 1037)
  {
    SizeDir := 4
  }
  else if (w <= 1227)
  {
    SizeDir := 5
  }
  else
  {
    SizeDir := 6
  } 

 
  PicDir := "StarsPics"
  potPicDir := PicDir . "\" . PotThemeDir . "\pot\" . SizeDir
  buttonPicDir := PicDir . "\" . CallThemeDir . "\call\" . SizeDir
  ;Msgbox, %potPicDir%`n%buttonPicDir%

  pot_x1 := 380
  pot_y1 := 8
  pot_x2 := 460
  pot_y2 := 32
  relStarsWindowPoint(id, pot_x1, pot_y1)
  relStarsWindowPoint(id, pot_x2, pot_y2)
  pot := DigitSearch(pot_x1, pot_y1, pot_x2, pot_y2, id, potPicDir, "", 50)
  
  call_x1 := 550
  call_y1 := 510
  call_x2 := 645
  call_y2 := 533
  relStarsWindowPoint(id, call_x1, call_y1)
  relStarsWindowPoint(id, call_x2, call_y2)
  call := DigitSearch(call_x1, call_y1, call_x2, call_y2, id, buttonPicDir, "", 50)
  call := iif( call, call, 0 )

  bb := GetBBStars(id, GameTypeStars(WinGetTitle(id)))
  sb := sb(bb)
  
  
  if (street = "pre")
  {
    ControlGetText, t, %stars_editbox%, ahk_id%id%
    ControlSetText, %stars_editbox%, 0, ahk_id%id%
    raise_x1 := 675
    raise_y1 := 510
    raise_x2 := 770
    raise_y2 := 533
    relStarsWindowPoint(id, raise_x1, raise_y1)
    relStarsWindowPoint(id, raise_x2, raise_y2)
    minraise := DigitSearch(raise_x1, raise_y1, raise_x2, raise_y2, id, buttonPicDir, "", 50)
    t := Round(t, 2)
    ControlSetText, %stars_editbox%, %t%, ahk_id%id%
    Sleep, -1
    
    if (minraise > (2*bb))
    {
      ;pot has been raised
      if (call = bb)
      {
        ;pot was minraised, and we are the BB
        hero_bet := bb
        hero_position := "bb"
      }
      else if (call < (bb*2))
      {
        ;pot was minraised, and we are the SB
        hero_bet := sb
        hero_position := "sb"
      }
    }
    else if (call = bb)
    {
      ;hero is not a blind, unraised pot, do nothing
    }
    else if (call = 0)
    {
      ;unraised pot, hero is the BB
      hero_bet := bb
      hero_position := "bb"
    }
    else if (call < bb)
    {
      ;unraised pot, hero is the SB
      hero_bet := sb
      hero_position := "sb"
    }
    else
    {
      ;pot has been raised, we are not opening
      open := 0
    }
  }
  else
  {
    ;not pre-flop, no need for open adjustment
    open := 0
  }
 
  return
}


PotSizeUB(id, ByRef pot, ByRef call, ByRef sb, ByRef bb, ByRef hero_bet, ByRef street, ByRef hero_position, ByRef open)
{
  
  
  CoordMode, Pixel, Screen
  WinGetPos, x, y, w, h, ahk_id%id%

  
  street := GetStreetStars(id)

 
 
  PicDir := "UBPics"
  potPicDir := PicDir  ;. "\" . PotThemeDir . "\pot\" . SizeDir
  buttonPicDir := PicDir ;. "\" . CallThemeDir . "\call\" . SizeDir
  ;Msgbox, %potPicDir%`n%buttonPicDir%

  pot_x1 := 580
  pot_y1 := 460
  pot_x2 := 700
  pot_y2 := 480
  relStarsWindowPoint(id, pot_x1, pot_y1)
  relStarsWindowPoint(id, pot_x2, pot_y2)
  pot := DigitSearch(pot_x1, pot_y1, pot_x2, pot_y2, id, potPicDir, "", 50)
  
  call_x1 := 350
  call_y1 := 460
  call_x2 := 460
  call_y2 := 480
  relStarsWindowPoint(id, call_x1, call_y1)
  relStarsWindowPoint(id, call_x2, call_y2)
  call := DigitSearch(call_x1, call_y1, call_x2, call_y2, id, buttonPicDir, "", 50)
  call := iif( call, call, 0 )


  WinGetTitle, title, ahk_id%id%
  
  StringTrimLeft, bb, title, InStr(title, "$", true, 0)-1 
  StringTrimRight, bb, bb, Strlen(bb) - InStr(bb, A_Space)
  StringReplace, bb, bb, $., $0., All
  StringReplace, bb, bb, $,, All
  StringReplace, bb, bb, %A_Space%,, All

  ;bb := GetBBStars(id, GameTypeStars(WinGetTitle(id)))
  sb := sb(bb)
  
  
  if (street = "pre")
  {
    ControlGetText, t, Edit1, ahk_id%id%
    ControlSetText, Edit1, 0, ahk_id%id%
    raise_x1 := 460
    raise_y1 := 460
    raise_x2 := 580
    raise_y2 := 480
    relStarsWindowPoint(id, raise_x1, raise_y1)
    relStarsWindowPoint(id, raise_x2, raise_y2)
    minraise := DigitSearch(raise_x1, raise_y1, raise_x2, raise_y2, id, buttonPicDir, "", 50)
    t := Round(t, 2)
    ControlSetText, Edit1, %t%, ahk_id%id%
    Sleep, -1
    
    if (minraise > (2*bb))
    {
      ;pot has been raised
      if (call = bb)
      {
        ;pot was minraised, and we are the BB
        hero_bet := bb
        hero_position := "bb"
      }
      else if (call < (bb*2))
      {
        ;pot was minraised, and we are the SB
        hero_bet := sb
        hero_position := "sb"
      }
    }
    else if (call = bb)
    {
      ;hero is not a blind, unraised pot, do nothing
    }
    else if (call = 0)
    {
      ;unraised pot, hero is the BB
      hero_bet := bb
      hero_position := "bb"
    }
    else if (call < bb)
    {
      ;unraised pot, hero is the SB
      hero_bet := sb
      hero_position := "sb"
    }
    else
    {
      ;pot has been raised, we are not opening
      open := 0
    }
  }
  else
  {
    ;not pre-flop, no need for open adjustment
    open := 0
  }
  ;pot := pot - (2*hero_bet)
  pot := pot - (2 * call) - hero_bet
  return
}



DigitSearch(startX,startY,endX,endY,win,dir,ex="",shades=1) {

global debug

If ex =
 ex = bmp
batchlines = %A_BatchLines%
SetBatchLines -1
;WinGetPos,Xwin,Ywin,,,ahk_id%win%
WinGetPos,Xwin,Ywin,w,h,ahk_id%win%

;Msgbox, %startX%,%startY%`n%endX% %endY%


CoordMode, Pixel, Screen
Loop, 11 {
  i = %a_index%
  If i = 10
    i = 0
  else if i = 11
    i = -1
  lastXpos := startX + Xwin
  Loop {
    
    
    
    
    x1 := lastXpos + 1
    y1 := startY + Ywin
    x2 :=  endX + Xwin
    y2 := endY + Ywin
    
    if (debug)
    {
      debug_gui(id, x1, y1, x2, y2, 50)
    }
    
    ImageSearch, lastXpos,, x1, y1, x2, y2, *%shades% %dir%\%i%.%ex%
    
    
    If ( errorLevel )
    {
      break
    }
    p++
    p%p% = %lastXpos%
    If i = -1
      t = .
    else
      t = %i%
    StringReplace, xpos, lastXpos, -, _
    c%xpos% = %t%
   }
 }

Loop, %p%
 p_all := p_all "," p%a_index%

Sort, p_all, N D, U
;Msgbox %p_all%
Loop, Parse, p_all, `,
{
 StringReplace, xpos, a_loopfield, -, _
    
 amount := amount "" c%xpos%
 ;Msgbox,%amount%
} 
CoordMode, Pixel, Relative
SetBatchLines %batchlines%
return amount
}



;Juks rocks
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%
}

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




GetBBStars(id, game_type) {
WinGetTitle, title, ahk_id%id%
game_type = NL Ring
If (game_type = "NL Ring")
 return StrRep(StrMid(title,"/",a_space), "$")
else if (game_type = "NL Tourney")
 return StrRep(StrMid(title,"/",a_space,InStr(title," - Blinds")),"$")
}


GameTypeStars(title) {
If InStr(title, " - Limit Stud")
 return "Stud"
else if ((InStr(title, " - No Limit Hold'em") || InStr(title, " - Pot Limit Hold'em"))
  && InStr(title, "Tournament"))
 return "NL Tourney"
else if (InStr(title, " - No Limit Hold'em") || InStr(title, " - Pot Limit Hold'em"))
 return "NL Ring"
else
 return "Limit"
}

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
}






GetStreetStars(id)
{
  global debug
  CoordMode, Pixel, Screen

  street := "pre"
  
  x1 := 490
  y1 := 155
  x2 := 525
  y2 := 205
  relStarsScreenPoint(id, x1, y1)
  relStarsScreenPoint(id, x2, y2)
  
  
  
  
  if (debug)
    {
      debug_gui(id, x1, y1, x2, y2)
    }
  If ( GetPixelCount(x1, y1, x2, y2, 0xffffff) > 5 )
  {
    street := "river"
    return street
  }
  
  x1 := 435
  y1 := 155
  x2 := 470
  y2 := 205
  relStarsScreenPoint(id, x1, y1)
  relStarsScreenPoint(id, x2, y2)
  if (debug)
    {
      debug_gui(id, x1, y1, x2, y2)
    }
  If ( GetPixelCount(x1, y1, x2, y2, 0xffffff) > 5 )
  {
    street := "turn"
    return street
  }



  x1 := 382
  y1 := 155
  x2 := 415
  y2 := 205
  relStarsScreenPoint(id, x1, y1)
  relStarsScreenPoint(id, x2, y2)
  if (debug)
    {
      debug_gui(id, x1, y1, x2, y2)
    }
  If ( GetPixelCount(x1, y1, x2, y2, 0xffffff) > 5 )
  {
    street := "flop"
  }

  return street
}

GetStreetFT(id)
{
  global debug
  global caller_hwnd
  if (caller_hwnd != "")
  {
    id := caller_hwnd
  }
  CoordMode, Pixel, Screen

  street := "pre"
  
  x1 := 485
  y1 := 214
  x2 := 520
  y2 := 260
  relStarsScreenPoint(id, x1, y1)
  relStarsScreenPoint(id, x2, y2)
  
  
  
  
  if (debug)
    {
      debug_gui(id, x1, y1, 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 (debug)
    {
      debug_gui(id, x1, y1, 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 (debug)
    {
      debug_gui(id, x1, y1, x2, y2)
    }
  If ( GetPixelCount(x1, y1, x2, y2, 0xffffff) > 5 )
  {
    street := "flop"
  }

  return street
}





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
}


WinGetTitle(win) {
WinGetTitle, title, ahk_id%win%
return title
}

; 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
}
; finds the predomatinate color in a region
GetPredominateColor(x1,y1,x2,y2,options="") {
global debug

if (debug)
  {
    debug_gui(id, x1, y1, x2, y2)
  }  
pixels := (x2 - x1 + 1)*(y2 - y1 + 1)
If ( pixels <= 0 ) {
        ErrorLevel = -1
        return
 }
x = %x1%
Loop {
        If ( x > x2 )
                break
        y = %y1%
        Loop {
                        If ( y > y2 )
                                break
                        PixelGetColor, c, x, y, %options%
                        num%c%++
                        all_colors = %all_colors%|%c%
                        y++
                        ;done++
                        ;Tooltip % Floor((done/pixels)*100) "%"
         }
        x++
 }
StringTrimLeft, all_colors, all_colors, 1
num%pred_c% = 0
Loop, Parse, all_colors, |
 {
        If ( num%a_loopfield% > num%pred_c% )
                pred_c = %a_loopfield%
 }
ErrorLevel := num%pred_c%
return pred_c
}



getid()
{
  global act_only_on_active_table
  ;ut := UrgentTable()
  ;if (ut)
  ;{
  ;  id := ut
  ;}
  ;else
  ;{
    tn := TableNav()
    if (tn)
    {
      id := tn
    }
    else
    {
      id := ""
      if (act_only_on_active_table = 1)
      {
        ;MsgBox, Active Table Mode
        WinGet,id,,A
      }
      else
      {
        ;MsgBox, Table Under Cursor Mode
        MouseGetPos, , , id
      }
    }
  ;}
  return id
}

TableNav()
{
  If ! WinExist("blue_bar ahk_class AutoHotkeyGUI")
    return 0
  SendMessage, 0x5555
  return WinExist("ahk_id" errorLevel )
}

UrgentTable()
{
  If ! WinExist("urgent_table ahk_class AutoHotkeyGUI")
    return 0
  SendMessage, 0x5555
  return WinExist("ahk_id" errorLevel )
}


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
}


debug_gui(id, x1, y1, x2, y2, delay=500)
{
  Gui, 2: +Alwaysontop +Lastfound +Owner
  Gui, 2: Color, ffffff
  WinSet, Transparent, 200
  Gui, 2: -Caption
  w1 := x2 - x1
  h1 := y2 - y1
  Gui, 2: Show, w%w1% h%h1% x%x1% y%y1% NoActivate
  Sleep, %delay%
  Gui,2: Destroy
}

FoldUB(id)
{
  ControlGet, v, Visible, , Button29, ahk_id%id%
  if (v)
  {
    ControlFocus, Button29, ahk_id%id%
    Sleep, -1
    ControlClick, Button29, ahk_id%id%
  }
  else
  {
    ControlGet, v, Visible, , Button16, ahk_id%id%
    if (v)
    {
      ControlFocus, Button16, ahk_id%id%
      Sleep, -1
      ControlClick, Button16, ahk_id%id%
    }
    else
    {
      ControlGet, v, Visible, , Button18, ahk_id%id%
      if (v)
      {
        ControlFocus, Button18, ahk_id%id%
        Sleep, -1
        ControlClick, Button18, ahk_id%id%
      }
      else
      {
        ControlGet, v, Visible, , Button13, ahk_id%id%
        if (v)
        {
          ControlFocus, Button13, ahk_id%id%
          Sleep, -1
          ControlClick, Button13, ahk_id%id%
        }
      }
    }
  }
}

CallUB(id)
{
  ControlGet, v, Visible, , Button19, ahk_id%id%
  if (v)
  {
    ControlFocus, Button19, ahk_id%id%
    Sleep, -1
    ControlClick, Button19, ahk_id%id%
  }
}

RaiseUB(id)
{
  ControlGet, v, Visible, , Button51, ahk_id%id%
  if (v)
  {
    ControlFocus, Button51, ahk_id%id%
    Sleep, -1
    ControlClick, Button51, ahk_id%id%
  }
}

FoldStars(id)
{
  PostStarsClick(416,501,id)
  Sleep, 20
  PostStarsClick(416,478,id)
 
}

CallStars(id)
{
  PostStarsClick(600,533,id)
}
RaiseStars(id)
{
  PostStarsClick(730,520,id)
}

FoldIPoker(id)
{
  ;msgbox, sdad
  global iPokerFoldX, iPokerFoldY
  ;Click, %iPokerFoldx%, %iPokerFoldY%
  iPokerSetCoords(id)
  PostLeftClick(iPokerFoldx,(iPokerFoldY+10),id)
  PostLeftClick(iPokerFoldx,iPokerFoldY,id)
  ;PostLeftClick(378,(522),id)
  
}

CallIPoker(id)
{
  global iPokerCallx, ipokerCally
  Click, %iPokerCallX%, %iPokerCallY%
}

RaiseIPoker(id)
{
  global iPokerRaiseX, ipokerRaiseY
  Click, %ipokerRaiseX%, %iPokerRaiseY%
}

FoldCrypto(id)
{
  PostStarsClick(480,500,id)
}

CallCrypto(id)
{
  PostStarsClick(602,534,id)
}
RaiseCrypto(id)
{
  PostStarsClick(726,534,id)
}


FoldFT(id)
{
  global FTP_Beta
  global fold_to_any
  
  if (FTP_Beta)
  {
    if (fold_to_any)
    {
      ControlGet, v, Visible, , FTCSkinButton35, ahk_id%id%
      if (v)
      {
        ControlFocus, FTCSkinButton35, ahk_id%id%
        Sleep, -1
        ControlClick, FTCSkinButton35, ahk_id%id%
      }
    }
    
    else
    {
      ControlGet, v, Visible, , FTCSkinButton29, ahk_id%id%
      if (v)
      {
        ControlFocus, FTCSkinButton29, ahk_id%id%
        Sleep, -1
        ControlClick, FTCSkinButton29, ahk_id%id%
      }
      else
      {
        ControlGet, v, Visible, , FTCSkinButton11, ahk_id%id%
        if (v)
        {
          ControlFocus, FTCSkinButton11, ahk_id%id%
          Sleep, -1
          ControlClick, FTCSkinButton11, ahk_id%id%
        }
      }
    }
  }
  else
  {
    /*
    ControlGet, v, Visible, , FTCButton31, ahk_id%id%
    if (v)
    {
      ControlFocus, FTCButton31, ahk_id%id%
      Sleep, -1
      ControlClick, FTCButton31, ahk_id%id%
    }
    */
  }
}

CallFT(id)
{
  global FTP_Beta
  if (FTP_Beta)
  {
    ControlGet, v, Visible, , FTCSkinButton12, ahk_id%id%
    if (v)
    {
      ControlFocus, FTCSkinButton12, ahk_id%id%
      Sleep, -1
      ControlClick, FTCSkinButton12, ahk_id%id%
    }
  }
  /*
  else
  {
    ControlGet, v, Visible, , FTCButton11, ahk_id%id%
    if (v)
    {
      ControlFocus, FTCButton11, ahk_id%id%
      Sleep, -1
      ControlClick, FTCButton11, ahk_id%id%
    }
    else
    {
      ControlGet, v, Visible, , FTCButton11, ahk_id%id%
      if (v)
      {
        ControlFocus, FTCButton11, ahk_id%id%
        Sleep, -1
        ControlClick, FTCButton11, ahk_id%id%
      }
    }
  }
  */
}

RaiseFT(id)
{
  global FTP_Beta
  if (FTP_Beta)
  {
    ControlGet, v, Visible, , FTCSkinButton13, ahk_id%id%
    if (v)
    {
      ControlFocus, FTCSkinButton13, ahk_id%id%
      Sleep, -1
      ControlClick, FTCSkinButton13, ahk_id%id%
    }
  }
  /*
  else
  {
    ControlGet, v, Visible, , FTCButton13, ahk_id%id%
    if (v)
    {
      ControlFocus, FTCButton13, ahk_id%id%
      Sleep, -1
      ControlClick, FTCButton13, ahk_id%id%
    }
  }
  */
}



/*

ControlClick, AfxWnd42u19, ahk_id%id%
    } 
  }
  Else IfWinExist, ahk_id%id% ahk_group CryptoTables
  {
    ControlSetText, Edit3, %pot%, ahk_id%id%
    Sleep -1
    WinSet, Redraw,, ahk_id%id%
    If(autobet)
    {
      PostLeftClick(730, 540, id)
    } 
  }
  Else IfWinExist, ahk_id%id% ahk_group FullTiltTables
  {
    ControlGet, v, Visible, , Edit1, ahk_id%id%
    if (v)
    {
      ;Msgbox, %pot%
      if (pot > max)
      {
        pot := max
      }
      ControlSetText, Edit1, %pot%, ahk_id%id%
      Sleep -1
      ;WinSet, Redraw,, ahk_id%id%
      If(autobet)
      {
        ab := 0
        Loop, 20
        {
          ControlGetText, t, Edit1, ahk_id%id%
          if (t < pot || t > pot)
          {
            Sleep, 100
          }
          else
          {
            ;TrayTip, ,  %ab% %t% %pot%
            Sleep, 200
            ControlFocus, FTCButton11, ahk_id%id%
            Sleep, -1
            ControlClick, FTCButton11, ahk_id%id%
            ;ab := 1
            break
          }
        }
        ;TrayTip, ,  %ab% %t% %pot%
        ;if (ab)
        ;{
        ;  ControlFocus, FTCButton11, ahk_id%id%
        ;  Sleep, -1
        ;  ControlClick, FTCButton11, ahk_id%id%
        ;}
      }
    }
  }
  Else IfWinExist, ahk_id%id% ahk_group PrimaTables
  {
    ControlFocus, Edit1, ahk_id%id%
    ControlSetText, Edit1, %pot%, ahk_id%id%
    Sleep, -1
    WinSet, Redraw,, ahk_id%id%
    If(autobet)
    {
      WinActivate, ahk_id%id%
      WinWaitActive, ahk_id%id%, , 1
      If (errorlevel<>1)
      {
        Send, {ENTER}
      }   
    } 
  }
}
Quick Questions &amp; Answers Thread Quote
08-20-2010 , 06:08 PM
it's there lol, about 2/3 -3/4 of the way down PotSizeStars no spaces

Last edited by _dave_; 08-20-2010 at 06:10 PM. Reason: nice work on the code tags :)
Quick Questions &amp; Answers Thread Quote
08-20-2010 , 06:11 PM
I've said it before, but man AHK is an ugly ass language.
Quick Questions &amp; Answers Thread Quote
08-20-2010 , 06:16 PM
indeed it is, but BetPot is far more ugly than need be lol.
Quick Questions &amp; Answers Thread Quote

      
m