Sign in to follow this  
Followers 0
nitekram

For/Next issue again

2 posts in this topic

OK - I created this script and want to make it deals cards the right way ( after getting some help on a new deck ). My problem is that my script has already been created and I really do not want to start over again - maybe I have to though.

What I need help on is to create the For/Next loop to go through the loop and only pass each person a card and then go back and deal another card to each person - then call my _Points() function and add the points.

I am really tired or this is impossible - can you help.

The function that is in question is line 669

Func _Deal()
    ;MsgBox(0, "test", "_Deal")
    
    $BestHand = 0
    If @error Then MsgBox('', 'ERROR DEALING', @error)
    
    If $FirstDeal And Not $TESTING Then
        _ClearGUI(0)
    Else
        $FirstDeal = 0
    EndIf
    
    If $FirstRun Then
        SoundPlay($SoundsFileShuffle, 1)
        For $i = 0 To $TotalPlayers * 2 - 1
            $iCard[$i] = _NewCard()
            ConsoleWrite($i & ' ' & $iCard[$i] & @CRLF)
            GUICtrlSetImage($aPic[$i], "Cards\blank.jpg")
            Sleep($DealDelay)
            ;
            GUICtrlSetImage($aPic[$i], "Cards\" & $iCard[$i] & ".gif")
            If $Sounds Then SoundPlay($SoundsFileDeal, $SoundsFast)
            ;_Percent($i) ; calls with value of $i the value of the card
            _Points($i)
        Next
        $FirstRun = 0
    Else
        
    EndIf

EndFunc   ;==>_Deal

Thanks


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."

 

WindowsError.gif

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

Share this post


Link to post
Share on other sites



Nevermind - found a way to make it work.

For $i = 0 To $TotalPlayers * 2 - 1 Step 2
                $iCard[$i] = _NewCard()
                ConsoleWrite($i & ' ' & $iCard[$i] & @CRLF)
                GUICtrlSetImage($aPic[$i], "Cards\blank.jpg")
                Sleep($DealDelay)
                ;
                GUICtrlSetImage($aPic[$i], "Cards\" & $iCard[$i] & ".gif")
                If $Sounds Then SoundPlay($SoundsFileDeal, $SoundsFast)
                ;_Percent($i) ; calls with value of $i the value of the card
                ;_Points($i)
            Next
            
            
            For $i = 1 To $TotalPlayers * 2 - 1 Step 2
                $iCard[$i] = _NewCard()
                ConsoleWrite($i & ' ' & $iCard[$i] & @CRLF)
                GUICtrlSetImage($aPic[$i], "Cards\blank.jpg")
                Sleep($DealDelay)
                ;
                GUICtrlSetImage($aPic[$i], "Cards\" & $iCard[$i] & ".gif")
                If $Sounds Then SoundPlay($SoundsFileDeal, $SoundsFast)
                ;_Percent($i) ; calls with value of $i the value of the card
                ;_Points($i)
            Next
            
            For $i = 0 To $TotalPlayers * 2 - 1
                _Points($i)
            Next

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."

 

WindowsError.gif

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

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0