I have had two problems:
1) The DDEPoke and DDERequest seemed to work well when I was using a blank Spreadsheet called My Test. It the cards AsKs, etc, showed in the cells R6C15, etc. The cards also showed in the variables hand1, etc, in the Watch List window.
When I changed the file to c:\Poker\Deal Hands.xls it failed to work. The cards didn't show in the Deal Hands cells even though they showed in the variable hand1, etc. And when I changed some of the cells in DDERequest to cells that already had cards in them (R6C7 to R9C7) the hand1 etc variables were blank.
I had an earlier version of this script that took text from another Workbook. It got the wrong cells (from a worksheet that wasn't on top I think). When I changed the file to Deal Hands.xls (which only has one sheet) the hand1 etc variables still had wrong data and it was the same data from the wrong sheet from the original file!! It seemed as though DDERequest or the variables had data in it that wouldn't update.
2) The cards (AsKs, etc) show in PokerStove (PS) when I use SetControlText>PokerStove - [PStove1],Edit,2,hand1 etc. The problem is that PS doesn't recognize them. When I copy he hands from PS and paste them into Word there is no problem that I can find. There are no errant spaces or CRLFs in the card text. Even more confusing: when I copy and paste the same card text back into PS it recognizes it and does the calculations. It also works when I copy/paste from excel.
Is it possible that the SetControlText command sends some strange text that is not recognized? I've tried variations on font with no success.
PS doen't have the underlined commands such as Paste so the Press Alt send>ea won't work. Any other options?
Any/All help is appreciated.
Code: Select all
//Specify the path of the Excel filename here
Let>filename=c:\Poker\Deal Hands.xls
//MessageModal>%filename%
IfFileExists>filename
IfWindowOpen>Microsoft Excel - Deal Hands.xls,GetCells,OpenExcel
Label>OpenExcel
ExecuteFile>filename
WaitWindowOpen>Microsoft Excel - Deal Hands.xls
//: Minimize the window
//WindowAction>2,Microsoft Excel - Deal Hands.xls
Label>GetCells
SetFocus>Microsoft Excel - Deal Hands.xls
Wait>1
DDEPoke>Excel,c:\Poker\Deal Hands.xls,R6C15,AsKs
DDEPoke>Excel,c:\Poker\Deal Hands.xls,R7C15,QsJs
DDEPoke>Excel,c:\Poker\Deal Hands.xls,R8C15,Ts9s
DDEPoke>Excel,c:\Poker\Deal Hands.xls,R9C15,AdKd
DDEPoke>Excel,c:\Poker\Deal Hands.xls,R10C15,QdJd
DDEPoke>Excel,c:\Poker\Deal Hands.xls,R11C15,3d4d
DDEPoke>Excel,c:\Poker\Deal Hands.xls,R12C15,AhKh
DDEPoke>Excel,c:\Poker\Deal Hands.xls,R13C15,QhJh
DDEPoke>Excel,c:\Poker\Deal Hands.xls,R14C15,Th9h
DDEPoke>Excel,c:\Poker\Deal Hands.xls,R15C15,AcKc
SetFocus>Microsoft Excel - Deal Hands.xls
Wait>1
DDERequest>Excel,filename,R6C7,hand1,60
DDERequest>Excel,filename,R7C7,hand2,60
DDERequest>Excel,filename,R8C7,hand3,60
DDERequest>Excel,filename,R9C7,hand4,60
DDERequest>Excel,filename,R10C15,hand5,60
DDERequest>Excel,filename,R11C15,hand6,60
DDERequest>Excel,filename,R12C15,hand7,60
DDERequest>Excel,filename,R13C15,hand8,60
DDERequest>Excel,filename,R14C15,hand9,60
DDERequest>Excel,filename,R15C15,hand10,60
//remove the CRLF that Excel adds
StringReplace>hand1,CRLF,,hand1
StringReplace>hand2,CRLF,,hand2
StringReplace>hand3,CRLF,,hand3
StringReplace>hand4,CRLF,,hand4
StringReplace>hand5,CRLF,,hand5
StringReplace>hand6,CRLF,,hand6
StringReplace>hand7,CRLF,,hand7
StringReplace>hand8,CRLF,,hand8
StringReplace>hand9,CRLF,,hand9
StringReplace>hand10,CRLF,,hand10
IfWindowOpen>PokerStove - [PStove1]
PushButton>PokerStove - [PStove1],Clear All
PushButton>PokerStove - [PStove1],Monte Carlo
Wait>1
Else
Run Program>C:\Program Files\PokerStove\PokerStove.exe
WaitWindowOpen>PokerStove - [PStove1]
PushButton>PokerStove - [PStove1],Clear All
PushButton>PokerStove - [PStove1],Monte Carlo
EndIf
SetFocus>PokerStove - [PStove1]
SetControlText>PokerStove - [PStove1],Edit,2,hand1
SetControlText>PokerStove - [PStove1],Edit,3,hand2
SetControlText>PokerStove - [PStove1],Edit,4,hand3
SetControlText>PokerStove - [PStove1],Edit,5,hand4
SetControlText>PokerStove - [PStove1],Edit,6,hand5
SetControlText>PokerStove - [PStove1],Edit,7,hand6
SetControlText>PokerStove - [PStove1],Edit,8,hand7
SetControlText>PokerStove - [PStove1],Edit,9,hand8
SetControlText>PokerStove - [PStove1],Edit,10,hand9
SetControlText>PokerStove - [PStove1],Edit,11,hand10
Wait>1
PushButton>PokerStove - [PStove1],Evaluate
Wait>5
PushButton>PokerStove - [PStove1],Stop
Else
MessageModal>Could not find: %filename%
Endif