GaryFrost Posted October 2, 2006 Posted October 2, 2006 (edited) This is my 1st game, normally I don't even look at the game scripts.Usually to busy with applications.Started It Saturday Night, worked on it Off and On SundayCleaned it up some this morning1 Player against the ComputerCurrently this is a single deck, when the deck gets down to 10 or less and deal button is pressed cards are shuffled.v1.2:When the deck is depleated it is shuffled, if any cards are already dealt, those cards are not in the shuffle.Fixed some bugs, and added the 6 card win for the user.v1.3:Fixed incorrect number of cards showing when drawing more than 4 cardsFixed status messagesChanged so when shuffle after a hand, the cards on the table get removedTo Do:Counters: WinLosePush Average(s)Betting:Starting AmountUpDown or Input for betDouble Downv2.0Added:4 menusFile ExitConfig Deck Back (Picture shown on the back of the deck) # of Decks (1 - 8) Sound (Shuffel Sound) Reset StatsBets $1 $5 $10 $50 $100 $1000Help AboutBetting, starts out with $10,000 in the bankDouble DownStatusBar (6 panels) Dealer card total If split left side total If split right side total, else hand total Win/Lose/Push Bet BankChanged/RemovedBeing I have allowed multiple deck shoe, no longer display a deck of cards (Removed 52 graphic controls, added 2)v2.1Fixed initialization of variable from ini fileFixed betting, not enough money no bet, no deal, no double down, no split depending on the situationBlackJack v2.1 Skinned (No Source code)BlackJack v2.1 No Skin (Source code) Edited December 12, 2006 by gafrost SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference.
layer Posted October 2, 2006 Posted October 2, 2006 (edited) pretty nice, im hanging on to this script because ive been wanting to play blackjack for a while now, i won with a jack and ace my first go and just now got a 20 when the comp got a 19 the skinned version looks very nice as wellexcept at first i didnt see where it said "You win" .. but now i just noticed that it says what your cards amount up to and if your busted.. pretty neatmaybe when you do all the betting stuff, you could make it more clear that someone has won ? its completley optional, because the more i play it, the more i like it where it is, but just something to think about .. i like how its very clean and organized, good work edit ok so i just looked over the code and now i see why you _ReduceMemory, all is good though Edited October 2, 2006 by layer FootbaG
GaryFrost Posted October 2, 2006 Author Posted October 2, 2006 Have fun layer. Haven't seen you around that much in a while. SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference.
layer Posted October 2, 2006 Posted October 2, 2006 (edited) Have fun layer.Haven't seen you around that much in a while.thanks lost interest in computers for a while.. may be back now, especially now that winter will be making its way in in a seasonedit: when do you think you're gonna add the betting functions/skins ? the betting seems like it'll be really cool and the skin just looks really good Edited October 2, 2006 by layer FootbaG
nitekram Posted October 2, 2006 Posted October 2, 2006 I keep loosing even though the dealer is busted - happen two times - you may have missed a if statement. 2¢ All by me:"Sometimes you have to go back to where you started, to get to where you want to go." "Everybody catches up with everyone, eventually" "As you teach others, you are really teaching yourself." From my dad "Do not worry about yesterday, as the only thing that you can control is tomorrow." WIKI | Tabs; | Arrays; | Strings | Wiki Arrays | How to ask a Question | Forum Search | FAQ | Tutorials | Original FAQ | ONLINE HELP | UDF's Wiki | AutoIt PDF AutoIt Snippets | Multple Guis | Interrupting a running function | Another Send StringRegExp | StringRegExp Help | RegEXTester | REG TUTOR | Reg TUTOT 2 AutoItSetOption | Macros | AutoIt Snippets | Wrapper | Autoit Docs SCITE | SciteJump | BB | MyTopics | Programming | UDFs | AutoIt 123 | UDFs Form | UDF Learning to script | Tutorials | Documentation | IE.AU3 | Games? | FreeSoftware | Path_Online | Core Language Programming Tips Excel Changes ControlHover.UDF GDI_Plus Draw_On_Screen GDI Basics GDI_More_Basics GDI Rotate GDI Graph GDI CheckExistingItems GDI Trajectory Replace $ghGDIPDll with $__g_hGDIPDll DLL 101? Array via Object GDI Swimlane GDI Plus French 101 Site GDI Examples UEZ GDI Basic Clock GDI Detection Ternary operator
GaryFrost Posted October 2, 2006 Author Posted October 2, 2006 thanks lost interest in computers for a while.. may be back now, especially now that winter will be making its way in in a seasonedit: when do you think you're gonna add the betting functions/skins ? the betting seems like it'll be really cool and the skin just looks really good Not sure when on the To Do List, just threw this together in pretty much a day.The Skinned version I should have on here tonight. SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference.
layer Posted October 2, 2006 Posted October 2, 2006 Not sure when on the To Do List, just threw this together in pretty much a day.The Skinned version I should have on here tonight.sounds good FootbaG
nitekram Posted October 2, 2006 Posted October 2, 2006 (edited) I put a delay in so you could see that indeed you do loose if the dealer is busted - you must change it somewhere else though. If $hit_left Then $hit_left = 0 $UserHandTotalRight = 0 _Hit($a_UserHandR, $UserHandTotalRight, $deck, $a_cards, $user_cards_pic, $bdeck, "R") _GUICtrlStatusBarSetText($StatusBar, @TAB & "Your Hand: " & $UserHandTotalRight, 2) Else GUICtrlSetState($btn_hit, $GUI_DISABLE) GUICtrlSetImage($dealer_cards_pic[6], @ScriptDir & "\cards\" & $deck[$a_DealerHand[2]]) _GUICtrlStatusBarSetText($StatusBar, @TAB & "Dealer Hand:" & $DealerHandTotal, 0) Local $num_cards = 2 While $DealerHandTotal < 16 And $num_cards < 6 _Hit($a_DealerHand, $DealerHandTotal, $deck, $a_cards, $dealer_cards_pic, $bdeck, "R") _GUICtrlStatusBarSetText($StatusBar, @TAB & "Dealer Hand:" & $DealerHandTotal, 0) $num_cards += 1 WEnd ; this is what I added If $DealerHandTotal >= 21 Then _GUICtrlStatusBarSetText($StatusBar, @TAB & "You WIN", 2) sleep(10000) ; end what I added If $is_split Then _ShowStatus($DealerHandTotal, $UserHandTotalLeft, $StatusBar, 1) _ShowStatus($DealerHandTotal, $UserHandTotalRight, $StatusBar, 2) Else _ShowStatus($DealerHandTotal, $UserHandTotalRight, $StatusBar, 2) EndIf GUICtrlSetState($btn_hit, $GUI_DISABLE) GUICtrlSetState($btn_hold, $GUI_DISABLE) GUICtrlSetState($btn_deal, $GUI_ENABLE) $is_split = 0 EndIf - EDIT changed tags Edited October 2, 2006 by nitekram 2¢ All by me:"Sometimes you have to go back to where you started, to get to where you want to go." "Everybody catches up with everyone, eventually" "As you teach others, you are really teaching yourself." From my dad "Do not worry about yesterday, as the only thing that you can control is tomorrow." WIKI | Tabs; | Arrays; | Strings | Wiki Arrays | How to ask a Question | Forum Search | FAQ | Tutorials | Original FAQ | ONLINE HELP | UDF's Wiki | AutoIt PDF AutoIt Snippets | Multple Guis | Interrupting a running function | Another Send StringRegExp | StringRegExp Help | RegEXTester | REG TUTOR | Reg TUTOT 2 AutoItSetOption | Macros | AutoIt Snippets | Wrapper | Autoit Docs SCITE | SciteJump | BB | MyTopics | Programming | UDFs | AutoIt 123 | UDFs Form | UDF Learning to script | Tutorials | Documentation | IE.AU3 | Games? | FreeSoftware | Path_Online | Core Language Programming Tips Excel Changes ControlHover.UDF GDI_Plus Draw_On_Screen GDI Basics GDI_More_Basics GDI Rotate GDI Graph GDI CheckExistingItems GDI Trajectory Replace $ghGDIPDll with $__g_hGDIPDll DLL 101? Array via Object GDI Swimlane GDI Plus French 101 Site GDI Examples UEZ GDI Basic Clock GDI Detection Ternary operator
rambo3889 Posted October 2, 2006 Posted October 2, 2006 I founded a bug i got 21 as a start and pressed hold and the comp got 22 and won ? how is that possible Attached a pic to show u the bug My Scripts:Radioblog Club Music DownloaderOther stuff:Fun movieIm serious read the help file it helps :PFight 'Till you drop. Never stop, You Cant give up. Til you reach the top Fight! youre the best in town Fight!
GaryFrost Posted October 2, 2006 Author Posted October 2, 2006 Both bugs should be fixed (one if statement should fix both problems, no sleep) see 1st post for download SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference.
GaryFrost Posted October 2, 2006 Author Posted October 2, 2006 Wouldn't count on it.... get back to jokes SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference.
GaryFrost Posted October 2, 2006 Author Posted October 2, 2006 somebody left the gate open at jokes, please close the gate SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference.
ame1011 Posted October 2, 2006 Posted October 2, 2006 (edited) lol ^ Two things, the bottom left corner where it displays what the dealer has does not get cleared after every hand. It always shows what the dealer previously had last hand. Also, i drew to the computer when I had BlackJack and the computer had a regular 21. All in all, great job. Edited October 2, 2006 by ame1011 [font="Impact"] I always thought dogs laid eggs, and I learned something today. [/font]
GaryFrost Posted October 2, 2006 Author Posted October 2, 2006 (edited) lol ^ Two things, the bottom left corner where it displays what the dealer has does not get cleared after every hand. It always shows what the dealer previously had last hand. Also, i drew to the computer when I had BlackJack and the computer had a regular 21. 1st problem is easy to fix, currently don't have blackjack programmed in as a win Maybe add that to todo list put the following code, 1st line after the $btn_deal _GUICtrlStatusBarSetText($StatusBar, "", 0) Edited October 2, 2006 by gafrost SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference.
GaryFrost Posted October 2, 2006 Author Posted October 2, 2006 Fixed source, updated download on 1st post ignoring peanut gallery SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference.
Moderators SmOke_N Posted October 2, 2006 Moderators Posted October 2, 2006 Nice and compact Gary, I expected it to be much larger from our conversations. I still think you should change "Draw" to "Push" Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.
GaryFrost Posted October 2, 2006 Author Posted October 2, 2006 Nice and compact Gary, I expected it to be much larger from our conversations. I still think you should change "Draw" to "Push" If I add the betting in I'll make sure to change that. SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference.
no4ndth3n Posted October 2, 2006 Posted October 2, 2006 One thing I noticed in your code, unless you meant it to be this way...is that the dealer holds on 16, when usually dealers hold on 17 or higher... other than that it looks good, I had actually just started to make a blackjack game earlier in the week but got sidetracked.
GaryFrost Posted October 2, 2006 Author Posted October 2, 2006 One thing I noticed in your code, unless you meant it to be this way...is that the dealer holds on 16, when usually dealers hold on 17 or higher...other than that it looks good, I had actually just started to make a blackjack game earlier in the week but got sidetracked.I haven't worked in the rule for Hard 16 hand and Soft 17 hand yet. SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now