Jump to content

Slot Machine


 Share

Recommended Posts

Lucky 777

go ahead, press your luck

CODE

Version 1:

ok i put a very crappy pull lever on the side, instead of the spin button.

i didnt have time to make a pull lever in photoshop, its just MSPAINT. i know, i know... but i will later...

the program will download the BMP files for you.

Version 2:

Point system is better, fixed up the script. has table for what each is worth. and some other little details

Version 3:

Now spins all 3 reels, then stops one by one.

Now with Max bet at 10. and you vary it from 1-10.

Version 4:

Actual Reels. They Spin Too

1-5 dollar bets.

Harder chances of winning

better design

New Font

First Time Runners: The program will take a few seconds to load.

Version: 5

Brand New Look. You'll Like this one.

Request made that the reels spun to long, FIXED. Shorter time.

Still Extremely Hard.

First Run takes a while to get the updated images and other files.

Version: 5.1

Bug Fixed.

-Reels' were not showing. Now showing

Version: 5.2

No need to manually install font. Function inside script does it for you.

Version:6.0.0.1

Either play automatic spin, where you only need to press "spin." Or play manual spin, where after you press "spin," you need to press "stop" for each reel.

Also either play with max bet at 5 or 10.

You can also choose to start a new game.

You may also choose whether or not you want to automatically spin when you press Max Bet.

Thank you all for your downloads....

previous DLS: 335

The latest version: 7.0.1.8

Now with sound.

And other features

Lucky777.zip

Edited by billthecreator

[font=Microsoft Sans Serif]My Scripts: From Most recent to least.[/font]Countdown GUI | QLOCK TWO | FlipClock | Slot Machine My UDF:_GenerateRandomNoRepeat | _GuiSnap

Link to comment
Share on other sites

EDIT:

Just Missing EzSkin and Sound!!

8)

thanks, im leaving that up to you (if you want) to do that. and then get back to me...

Edited by billthecreator

[font=Microsoft Sans Serif]My Scripts: From Most recent to least.[/font]Countdown GUI | QLOCK TWO | FlipClock | Slot Machine My UDF:_GenerateRandomNoRepeat | _GuiSnap

Link to comment
Share on other sites

Where do I collect my winnings?


Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Link to comment
Share on other sites

Ok. i do agree its easy. im working on making the script more simple and the chances harder. and also the points lower.

thank you all for the feed back... should have the new script soon...

[font=Microsoft Sans Serif]My Scripts: From Most recent to least.[/font]Countdown GUI | QLOCK TWO | FlipClock | Slot Machine My UDF:_GenerateRandomNoRepeat | _GuiSnap

Link to comment
Share on other sites

I'm a little over 570k now. ^_^

It's annoying to have to wait for large numbers to scroll down, as it takes upwards of 10 seconds on a 1000 bet. Maybe set a time based countdown instead of an index? The appearance would probably be smoother.

Very cool, otherwise.

Link to comment
Share on other sites

I didn't get any money from a cherry on the 1st window???

I used to be able to keep hitting the 5 and it would keep adding the the bet window, but not anymore...I liked that

here it is without the header, but moveable

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

Global Const $WM_LBUTTONDOWN = 0x0201

Global $BAR = "="
Global $1BAR = $BAR, $2BAR = $BAR & " " & $BAR, $3BAR = $BAR & " " & $BAR& " " & $BAR
Global $Multi = Random(2,5,1)
Global $Belt[17][2] =     [["7", "R"], _ ;Red
                         [$1BAR, "1"], _ ;Single Bar
                         ["7", "W"], _ ;White
                         ["", "X"], _ ;Blank
                         ["7", "B"], _ ;Blue
                         ["", "X"], _ ;Blank
                         [$2BAR, "2"], _ ;Double Bar
                         ["", "X"], _ ;Blank
                         ["Cherry", "C"], _ ;Cherry
                         [$3BAR, "3"], _ ;Triple
                         [$2BAR, "2"], _ ;Double
                         ["7", "W"], _ ;White
                         ["", "X"], _ ;Blank
                         ["7", "B"], _ ;Blue
                         ["x"&$Multi, "J"], _ ;Multiple
                         ["", "X"]] ;Blank
Global $Reel[4]
Global $Pot = IniRead("SlotWinnings.ini", "Pot", "Pot", "1000")
Global $BackGround = 0x82562F
Global $WhiteColor = 0xFFFFFF
$Points = ""
$Bet = 0
;
If Not FileExists("slothandle.bmp") or Not FileExists("slothandle2.bmp") Then
    InetGet("http://serioushogan.com/slotmachine/slothandle.bmp", "slothandle.bmp")
    InetGet("http://serioushogan.com/slotmachine/slothandle2.bmp", "slothandle2.bmp")
EndIf
;
#Region ### START Koda GUI section ### Form=
$Form1             = GUICreate("Lucky 7's      Multiple = x"&$Multi, 405, 139, -1, -1, $WS_POPUP)
            GUISetBkColor($BackGround)
$Reel[1]         = GUICtrlCreateLabel("Slots", 8, 8, 113, 21, $SS_CENTER)
            GUICtrlSetFont(-1, 13, 400, 0, "Tahoma")
            GUICtrlSetBkColor(-1, 0xC89464)
            GUICtrlSetColor(-1, 0xFF0000)
$Reel[2]         = GUICtrlCreateLabel("Slots", 128, 8, 113, 21, $SS_CENTER)
            GUICtrlSetFont(-1, 13, 400, 0, "Tahoma")
            GUICtrlSetBkColor(-1, 0xC89464)
            GUICtrlSetColor(-1, $WhiteColor)
$Reel[3]         = GUICtrlCreateLabel("Slots", 248, 8, 113, 21, $SS_CENTER)
            GUICtrlSetFont(-1, 13, 400, 0, "Tahoma")
            GUICtrlSetBkColor(-1, 0xC89464)
            GUICtrlSetColor(-1, 0x000090)
            
$Spin            =GUICtrlCreatePic("slothandle.bmp", 370, 0, 35, 139)
            GUICtrlSetCursor(-1, 0)
            GUICtrlSetState(-1, $GUI_DISABLE)
            
$Bet_1             = GUICtrlCreateButton("Bet 1", 8, 104, 50, 25, 0)
$Bet_2             = GUICtrlCreateButton("Bet 2", 63, 104, 50, 25, 0)
$Bet_5             = GUICtrlCreateButton("Bet 5", 118, 104, 50, 25, 0)
$Bet_Clear        = GUICtrlCreateButton("Clear", 173, 104, 50, 25, 0)

$Winnings        = GUICtrlCreateButton("Winnings", 240, 104, 70, 25, 0)
            
$ButtonGroup    = StringSplit($Bet_1 & ":" & $Bet_2 & ":" & $Bet_5 & ":" & $Bet_Clear & ":" & $Spin, ":")

$Credits         = GUICtrlCreateLabel($Pot, 8, 40, 121, 34, $SS_RIGHT)
            GUICtrlSetFont(-1, 24, 400, 0, "MS Sans Serif")
            GUICtrlSetColor(-1, 0xFF2222)
            GUICtrlSetBkColor(-1, 0xCCCCCC)
            GUICtrlCreateLabel("Credits", 8, 80, 121, 17, $SS_CENTER)
$Your_Bet         = GUICtrlCreateLabel("0", 150, 40, 59, 34, $SS_RIGHT)
            GUICtrlSetFont(-1, 24, 400, 0, "MS Sans Serif")
            GUICtrlSetColor(-1, 0xFF2222)
            GUICtrlSetBkColor(-1, 0xCCCCCC)
            GUICtrlCreateLabel("Bet", 160, 80, 49, 17, $SS_CENTER)
$Winner_Paid    = GUICtrlCreateLabel("0", 240, 40, 121, 34, $SS_RIGHT)
            GUICtrlSetFont(-1, 24, 400, 0, "MS Sans Serif")
            GUICtrlSetColor(-1, 0xFF2222)
            GUICtrlSetBkColor(-1, 0xCCCCCC)
            GUICtrlCreateLabel("Winnings/Lossings", 240, 80, 121, 17, $SS_CENTER)

GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
;
#Region ### START Koda GUI section ### Form=
$Form2 = GUICreate("Winnings", 298, 445, 193, 155, BitOR($WS_CAPTION,$WS_POPUP,$WS_BORDER,$WS_CLIPSIBLINGS,$DS_MODALFRAME), BitOR($WS_EX_TOOLWINDOW,$WS_EX_WINDOWEDGE))
GUISetFont(14, 400, 0, "MS Sans Serif")
GUISetBkColor($BackGround - 0xFFFFFFF)
$Group1 = GUICtrlCreateGroup("1 Credit", 8, 16, 281, 385)
GUICtrlCreateLabel("7", 16, 40, 14, 28)
GUICtrlSetColor(-1, 0xFF0000)
GUICtrlCreateLabel("7", 30, 40, 14, 28)
GUICtrlSetColor(-1, $WhiteColor)
GUICtrlCreateLabel("7", 46, 40, 14, 28)
GUICtrlSetColor(-1, 0x000090)
GUICtrlCreateLabel("7 7 7", 16, 72, 44, 28)
GUICtrlSetColor(-1, 0xFF0000)
GUICtrlCreateLabel("7 7 7", 16, 104, 44, 28)
GUICtrlSetColor(-1, 0xE68C29)
GUICtrlCreateLabel("Any 7 7 7", 16, 168, 82, 28)
GUICtrlCreateLabel("7 7 7", 16, 136, 44, 28)
GUICtrlSetColor(-1, 0x000090)
GUICtrlCreateLabel("250", 216, 40, 34, 28)
GUICtrlSetColor(-1, 0xFF0000)
GUICtrlCreateLabel("150", 216, 72, 34, 28)
GUICtrlSetColor(-1, 0xFF0000)
GUICtrlCreateLabel("100", 216, 104, 34, 28)
GUICtrlSetColor(-1, 0xFF0000)
GUICtrlCreateLabel("80", 216, 136, 24, 28)
GUICtrlSetColor(-1, 0xFF0000)
GUICtrlCreateLabel("40", 216, 168, 24, 28)
GUICtrlSetColor(-1, 0xFF0000)
GUICtrlCreateLabel("3 Triple Bars", 16, 232, 109, 28)
GUICtrlCreateLabel("3 Double Bars", 16, 264, 122, 28)
GUICtrlCreateLabel("3 Single Bars", 16, 296, 114, 28)
GUICtrlCreateLabel("30", 216, 232, 24, 28)
GUICtrlSetColor(-1, 0xFF0000)
GUICtrlCreateLabel("20", 216, 264, 24, 28)
GUICtrlSetColor(-1, 0xFF0000)
GUICtrlCreateLabel("10", 216, 296, 24, 28)
GUICtrlSetColor(-1, 0xFF0000)
GUICtrlCreateLabel("Any With Two Cherrys", 16, 331)
GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
GUICtrlCreateLabel("10", 216, 328)
GUICtrlSetColor(-1, 0xFF0000)
GUICtrlCreateLabel("3 Multiples", 16, 360, 93, 28)
GUICtrlCreateLabel("500", 216, 360, 34, 28)
GUICtrlSetColor(-1, 0xFF0000)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Cancel = GUICtrlCreateButton("Cancel", 208, 408, 75, 25, 0)
GUICtrlSetFont(-1, 8.5, 400, 0, "MS Sans Serif")
GUISetState(@SW_HIDE)
#EndRegion ### END Koda GUI section ###

GUIRegisterMsg($WM_LBUTTONDOWN, "_WinMove")

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            IniWrite("SlotWinnings.ini", "Pot", "Pot", GUICtrlRead($Credits))
            Exit
        Case $Bet_1
            $Bet=1
            GUICtrlSetData($Your_Bet, $Bet)
            GUICtrlSetState($Spin, $GUI_ENABLE)
        Case $Bet_2
            $Bet=2
            GUICtrlSetData($Your_Bet, $Bet)
            GUICtrlSetState($Spin, $GUI_ENABLE)
        Case $Bet_5
            $Bet=5
            GUICtrlSetData($Your_Bet, $Bet)
            GUICtrlSetState($Spin, $GUI_ENABLE)
        Case $Bet_Clear
            $Bet=0
            GUICtrlSetData($Your_Bet, $Bet)
            GUICtrlSetState($Spin, $GUI_DISABLE)
        Case $Spin
            GUICtrlSetImage($Spin, "slothandle2.bmp")
            _Spin()
        Case $Winnings
            GUISetState(@SW_SHOW, $Form2)
        Case $Cancel
            GUISetState(@SW_HIDE, $Form2)
    EndSwitch
WEnd
;
Func _Spin()
    _GuiCtrlGroupSetState($ButtonGroup, $GUI_DISABLE)
    Sleep(500)
    
    GUICtrlSetImage($Spin, "slothandle.bmp")
        $Points = ""
    For $r = 1 to 3
        $Random = Random(0,UBound($Belt)-2,1)
        For $o = 1 To Random(2,4,1)
            For $s = 0 to UBound($Belt)-2
                _GUICtrlSetDataColor($Reel[$r],$Belt[$s][0], $Belt[$s][1])
                Sleep(30)
            Next
        Next
        _GUICtrlSetDataColor($Reel[$r],$Belt[$Random][0],$Belt[$Random][1])
        Sleep(750)
        $Points &= $Belt[$Random][1]
    Next
    GUICtrlSetData($Winner_Paid, _Get_Points($Points)*GUICtrlRead($Your_Bet))
    Sleep(500)
    If _Get_Points($Points)*GUICtrlRead($Your_Bet) < 0 Then
        _YouLose()
    Else
        _YouWin()
    EndIf
    _GuiCtrlGroupSetState($ButtonGroup, $GUI_ENABLE)
    _CheckCredits()
EndFunc
;
Func _GUICtrlSetDataColor($Control, $Data, $Other)
    GUICtrlSetData($Control,$Data)
    GUICtrlSetColor($Control, _GetColor($Other))
EndFunc
;
Func _GetColor($item)
    Switch $item
        Case "R"
            Return 0xFF0000
        Case "W"
            Return 0xFFFFFF
        Case "B"
            Return 0x000090
        Case "C"
            Return 0xB63905
        Case $1BAR
            Return 0x626360
        Case $2BAR
            Return 0x5D5E5C
        Case $3BAR
            Return 0x373734
        Case "J"
            Return 0x109618
    EndSwitch
EndFunc
;
Func _YouWin()
    $Step = 1
    For $k = 1 to 4
        GUISetBkColor(0xFF0000, $Form1)
        Sleep(100)
        GUISetBkColor($BackGround, $Form1)
        Sleep(100)
    Next
    If GUICtrlRead($Winner_Paid) >= 1000 Then 
        GUICtrlSetData($Credits, GUICtrlRead($Credits) + GUICtrlRead($Winner_Paid))
        GUICtrlSetData($Winner_Paid, "0")
    Else
    For $w = 1 To GUICtrlRead($Winner_Paid) Step $Step
        GUICtrlSetData($Credits, GUICtrlRead($Credits) + $Step)
        GUICtrlSetData($Winner_Paid, GUICtrlRead($Winner_Paid) - $Step)
        Sleep(10)
    Next
    EndIf
EndFunc
;
Func _YouLose()
    For $w = 1 To - GUICtrlRead($Winner_Paid)
        GUICtrlSetData($Credits, GUICtrlRead($Credits) - 1)
        GUICtrlSetData($Winner_Paid, GUICtrlRead($Winner_Paid) + 1)
        Sleep(10)
    Next
EndFunc
;
Func _Get_Points($data)
    Local $Pay = 0
    
    Switch $data
        Case "RRR" ; 3 Red 7s
            $Pay = 150
        Case "RRJ", "RJR", "JRR"
            $Pay = 150 * $Multi
        Case "RWB" ;Must be in RED WHITE BLUE order to receive points
            $Pay = 250
        Case "WWW" ; 3 White 7s
            Return 100
        Case "WWJ", "WJW", "JWW"
            Return 100 * $Multi
        Case "BBB", "XXX" ; 3 Blue 7s or 3 Blanks
            Return 80
        Case "BBJ", "BJB", "JBB"
            Return 80 * $Multi
        Case "RRW", "RRB", "RWR", "RWW", "RBR", "RBW", "RBB", "WRR", "WRW", "WRB", "WWR", "WWB", "WBR", "WBW", "WBB", "BRR", "BRW", "BRB", "BWR", "BWW", "BWB", "BBR", "BBW"
            Return 40
        Case "JJJ" ; 3 Multis
            Return 500
        Case "CCC"
            Return 100
        Case "111" ; 3 Single Bars
            Return 10
        Case "222" ; 3 Double Bars
            Return 15
        Case "333" ; 3 Triple Bars
            Return 20
        Case "112", "113", "211", "212", "213", "311", "312", "313", "121", "122", "221", "223", "321", "322", "323", "131", "132", "231", "232", "233", "331", "332" ; any other bar combo
            Return 8
        Case "123", "321" ; Single Double Triple, or Triple double Single Combo
            Return 20
    EndSwitch
    
    $symbol = StringSplit($data, "")
    
    If StringInStr($data, "C", 0 , 2) Then $Pay = 10
    
    If StringInStr($data, "J") Then $Pay *= $Multi
    If $Pay = 0 Then $Pay = -1
    
    Return $Pay
EndFunc
;
Func _CheckCredits()
    If GUICtrlRead($Credits) < 0 Then
        _GuiCtrlGroupSetState($ButtonGroup, $GUI_DISABLE)
        If MsgBox(4,"You Lose", "You lose, would you like to start over? If you press no, I'll give you 1000 credits for next time you play.") = 6 Then
            GUICtrlSetData($Credits, "1000")
            _GuiCtrlGroupSetState($ButtonGroup, $GUI_ENABLE)
            $Bet=0
            GUICtrlSetData($Your_Bet, $Bet)
            GUICtrlSetState($Spin, $GUI_DISABLE)
        Else
            IniWrite("SlotWinnings.ini", "Pot", "Pot", 1000)
            Exit
        EndIf
    EndIf
EndFunc
;
Func _GuiCtrlGroupSetState(ByRef $a_GroupArray, $i_State)
    For $i = 1 To $a_GroupArray[0]
        GUICtrlSetState($a_GroupArray[$i], $i_State)
    Next
EndFunc

Func _WinMove($HWnd, $Command, $wParam, $lParam)
    If BitAND(WinGetState($HWnd), 32) Then Return $GUI_RUNDEFMSG
    DllCall("user32.dll", "long", "SendMessage", "hwnd", $HWnd, "int", $WM_SYSCOMMAND, "int", 0xF009, "int", 0)
EndFunc   ;==>_WinMove

8)

NEWHeader1.png

Link to comment
Share on other sites

I didn't get any money from a cherry on the 1st window???

I used to be able to keep hitting the 5 and it would keep adding the the bet window, but not anymore...I liked that

here it is without the header, but moveable

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

Global Const $WM_LBUTTONDOWN = 0x0201

Global $BAR = "="
Global $1BAR = $BAR, $2BAR = $BAR & " " & $BAR, $3BAR = $BAR & " " & $BAR& " " & $BAR
Global $Multi = Random(2,5,1)
Global $Belt[17][2] =     [["7", "R"], _ ;Red
                         [$1BAR, "1"], _ ;Single Bar
                         ["7", "W"], _ ;White
                         ["", "X"], _ ;Blank
                         ["7", "B"], _ ;Blue
                         ["", "X"], _ ;Blank
                         [$2BAR, "2"], _ ;Double Bar
                         ["", "X"], _ ;Blank
                         ["Cherry", "C"], _ ;Cherry
                         [$3BAR, "3"], _ ;Triple
                         [$2BAR, "2"], _ ;Double
                         ["7", "W"], _ ;White
                         ["", "X"], _ ;Blank
                         ["7", "B"], _ ;Blue
                         ["x"&$Multi, "J"], _ ;Multiple
                         ["", "X"]] ;Blank
Global $Reel[4]
Global $Pot = IniRead("SlotWinnings.ini", "Pot", "Pot", "1000")
Global $BackGround = 0x82562F
Global $WhiteColor = 0xFFFFFF
$Points = ""
$Bet = 0
;
If Not FileExists("slothandle.bmp") or Not FileExists("slothandle2.bmp") Then
    InetGet("http://serioushogan.com/slotmachine/slothandle.bmp", "slothandle.bmp")
    InetGet("http://serioushogan.com/slotmachine/slothandle2.bmp", "slothandle2.bmp")
EndIf
;
#Region ### START Koda GUI section ### Form=
$Form1             = GUICreate("Lucky 7's      Multiple = x"&$Multi, 405, 139, -1, -1, $WS_POPUP)
            GUISetBkColor($BackGround)
$Reel[1]         = GUICtrlCreateLabel("Slots", 8, 8, 113, 21, $SS_CENTER)
            GUICtrlSetFont(-1, 13, 400, 0, "Tahoma")
            GUICtrlSetBkColor(-1, 0xC89464)
            GUICtrlSetColor(-1, 0xFF0000)
$Reel[2]         = GUICtrlCreateLabel("Slots", 128, 8, 113, 21, $SS_CENTER)
            GUICtrlSetFont(-1, 13, 400, 0, "Tahoma")
            GUICtrlSetBkColor(-1, 0xC89464)
            GUICtrlSetColor(-1, $WhiteColor)
$Reel[3]         = GUICtrlCreateLabel("Slots", 248, 8, 113, 21, $SS_CENTER)
            GUICtrlSetFont(-1, 13, 400, 0, "Tahoma")
            GUICtrlSetBkColor(-1, 0xC89464)
            GUICtrlSetColor(-1, 0x000090)
            
$Spin            =GUICtrlCreatePic("slothandle.bmp", 370, 0, 35, 139)
            GUICtrlSetCursor(-1, 0)
            GUICtrlSetState(-1, $GUI_DISABLE)
            
$Bet_1             = GUICtrlCreateButton("Bet 1", 8, 104, 50, 25, 0)
$Bet_2             = GUICtrlCreateButton("Bet 2", 63, 104, 50, 25, 0)
$Bet_5             = GUICtrlCreateButton("Bet 5", 118, 104, 50, 25, 0)
$Bet_Clear        = GUICtrlCreateButton("Clear", 173, 104, 50, 25, 0)

$Winnings        = GUICtrlCreateButton("Winnings", 240, 104, 70, 25, 0)
            
$ButtonGroup    = StringSplit($Bet_1 & ":" & $Bet_2 & ":" & $Bet_5 & ":" & $Bet_Clear & ":" & $Spin, ":")

$Credits         = GUICtrlCreateLabel($Pot, 8, 40, 121, 34, $SS_RIGHT)
            GUICtrlSetFont(-1, 24, 400, 0, "MS Sans Serif")
            GUICtrlSetColor(-1, 0xFF2222)
            GUICtrlSetBkColor(-1, 0xCCCCCC)
            GUICtrlCreateLabel("Credits", 8, 80, 121, 17, $SS_CENTER)
$Your_Bet         = GUICtrlCreateLabel("0", 150, 40, 59, 34, $SS_RIGHT)
            GUICtrlSetFont(-1, 24, 400, 0, "MS Sans Serif")
            GUICtrlSetColor(-1, 0xFF2222)
            GUICtrlSetBkColor(-1, 0xCCCCCC)
            GUICtrlCreateLabel("Bet", 160, 80, 49, 17, $SS_CENTER)
$Winner_Paid    = GUICtrlCreateLabel("0", 240, 40, 121, 34, $SS_RIGHT)
            GUICtrlSetFont(-1, 24, 400, 0, "MS Sans Serif")
            GUICtrlSetColor(-1, 0xFF2222)
            GUICtrlSetBkColor(-1, 0xCCCCCC)
            GUICtrlCreateLabel("Winnings/Lossings", 240, 80, 121, 17, $SS_CENTER)

GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
;
#Region ### START Koda GUI section ### Form=
$Form2 = GUICreate("Winnings", 298, 445, 193, 155, BitOR($WS_CAPTION,$WS_POPUP,$WS_BORDER,$WS_CLIPSIBLINGS,$DS_MODALFRAME), BitOR($WS_EX_TOOLWINDOW,$WS_EX_WINDOWEDGE))
GUISetFont(14, 400, 0, "MS Sans Serif")
GUISetBkColor($BackGround - 0xFFFFFFF)
$Group1 = GUICtrlCreateGroup("1 Credit", 8, 16, 281, 385)
GUICtrlCreateLabel("7", 16, 40, 14, 28)
GUICtrlSetColor(-1, 0xFF0000)
GUICtrlCreateLabel("7", 30, 40, 14, 28)
GUICtrlSetColor(-1, $WhiteColor)
GUICtrlCreateLabel("7", 46, 40, 14, 28)
GUICtrlSetColor(-1, 0x000090)
GUICtrlCreateLabel("7 7 7", 16, 72, 44, 28)
GUICtrlSetColor(-1, 0xFF0000)
GUICtrlCreateLabel("7 7 7", 16, 104, 44, 28)
GUICtrlSetColor(-1, 0xE68C29)
GUICtrlCreateLabel("Any 7 7 7", 16, 168, 82, 28)
GUICtrlCreateLabel("7 7 7", 16, 136, 44, 28)
GUICtrlSetColor(-1, 0x000090)
GUICtrlCreateLabel("250", 216, 40, 34, 28)
GUICtrlSetColor(-1, 0xFF0000)
GUICtrlCreateLabel("150", 216, 72, 34, 28)
GUICtrlSetColor(-1, 0xFF0000)
GUICtrlCreateLabel("100", 216, 104, 34, 28)
GUICtrlSetColor(-1, 0xFF0000)
GUICtrlCreateLabel("80", 216, 136, 24, 28)
GUICtrlSetColor(-1, 0xFF0000)
GUICtrlCreateLabel("40", 216, 168, 24, 28)
GUICtrlSetColor(-1, 0xFF0000)
GUICtrlCreateLabel("3 Triple Bars", 16, 232, 109, 28)
GUICtrlCreateLabel("3 Double Bars", 16, 264, 122, 28)
GUICtrlCreateLabel("3 Single Bars", 16, 296, 114, 28)
GUICtrlCreateLabel("30", 216, 232, 24, 28)
GUICtrlSetColor(-1, 0xFF0000)
GUICtrlCreateLabel("20", 216, 264, 24, 28)
GUICtrlSetColor(-1, 0xFF0000)
GUICtrlCreateLabel("10", 216, 296, 24, 28)
GUICtrlSetColor(-1, 0xFF0000)
GUICtrlCreateLabel("Any With Two Cherrys", 16, 331)
GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
GUICtrlCreateLabel("10", 216, 328)
GUICtrlSetColor(-1, 0xFF0000)
GUICtrlCreateLabel("3 Multiples", 16, 360, 93, 28)
GUICtrlCreateLabel("500", 216, 360, 34, 28)
GUICtrlSetColor(-1, 0xFF0000)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Cancel = GUICtrlCreateButton("Cancel", 208, 408, 75, 25, 0)
GUICtrlSetFont(-1, 8.5, 400, 0, "MS Sans Serif")
GUISetState(@SW_HIDE)
#EndRegion ### END Koda GUI section ###

GUIRegisterMsg($WM_LBUTTONDOWN, "_WinMove")

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            IniWrite("SlotWinnings.ini", "Pot", "Pot", GUICtrlRead($Credits))
            Exit
        Case $Bet_1
            $Bet=1
            GUICtrlSetData($Your_Bet, $Bet)
            GUICtrlSetState($Spin, $GUI_ENABLE)
        Case $Bet_2
            $Bet=2
            GUICtrlSetData($Your_Bet, $Bet)
            GUICtrlSetState($Spin, $GUI_ENABLE)
        Case $Bet_5
            $Bet=5
            GUICtrlSetData($Your_Bet, $Bet)
            GUICtrlSetState($Spin, $GUI_ENABLE)
        Case $Bet_Clear
            $Bet=0
            GUICtrlSetData($Your_Bet, $Bet)
            GUICtrlSetState($Spin, $GUI_DISABLE)
        Case $Spin
            GUICtrlSetImage($Spin, "slothandle2.bmp")
            _Spin()
        Case $Winnings
            GUISetState(@SW_SHOW, $Form2)
        Case $Cancel
            GUISetState(@SW_HIDE, $Form2)
    EndSwitch
WEnd
;
Func _Spin()
    _GuiCtrlGroupSetState($ButtonGroup, $GUI_DISABLE)
    Sleep(500)
    
    GUICtrlSetImage($Spin, "slothandle.bmp")
        $Points = ""
    For $r = 1 to 3
        $Random = Random(0,UBound($Belt)-2,1)
        For $o = 1 To Random(2,4,1)
            For $s = 0 to UBound($Belt)-2
                _GUICtrlSetDataColor($Reel[$r],$Belt[$s][0], $Belt[$s][1])
                Sleep(30)
            Next
        Next
        _GUICtrlSetDataColor($Reel[$r],$Belt[$Random][0],$Belt[$Random][1])
        Sleep(750)
        $Points &= $Belt[$Random][1]
    Next
    GUICtrlSetData($Winner_Paid, _Get_Points($Points)*GUICtrlRead($Your_Bet))
    Sleep(500)
    If _Get_Points($Points)*GUICtrlRead($Your_Bet) < 0 Then
        _YouLose()
    Else
        _YouWin()
    EndIf
    _GuiCtrlGroupSetState($ButtonGroup, $GUI_ENABLE)
    _CheckCredits()
EndFunc
;
Func _GUICtrlSetDataColor($Control, $Data, $Other)
    GUICtrlSetData($Control,$Data)
    GUICtrlSetColor($Control, _GetColor($Other))
EndFunc
;
Func _GetColor($item)
    Switch $item
        Case "R"
            Return 0xFF0000
        Case "W"
            Return 0xFFFFFF
        Case "B"
            Return 0x000090
        Case "C"
            Return 0xB63905
        Case $1BAR
            Return 0x626360
        Case $2BAR
            Return 0x5D5E5C
        Case $3BAR
            Return 0x373734
        Case "J"
            Return 0x109618
    EndSwitch
EndFunc
;
Func _YouWin()
    $Step = 1
    For $k = 1 to 4
        GUISetBkColor(0xFF0000, $Form1)
        Sleep(100)
        GUISetBkColor($BackGround, $Form1)
        Sleep(100)
    Next
    If GUICtrlRead($Winner_Paid) >= 1000 Then 
        GUICtrlSetData($Credits, GUICtrlRead($Credits) + GUICtrlRead($Winner_Paid))
        GUICtrlSetData($Winner_Paid, "0")
    Else
    For $w = 1 To GUICtrlRead($Winner_Paid) Step $Step
        GUICtrlSetData($Credits, GUICtrlRead($Credits) + $Step)
        GUICtrlSetData($Winner_Paid, GUICtrlRead($Winner_Paid) - $Step)
        Sleep(10)
    Next
    EndIf
EndFunc
;
Func _YouLose()
    For $w = 1 To - GUICtrlRead($Winner_Paid)
        GUICtrlSetData($Credits, GUICtrlRead($Credits) - 1)
        GUICtrlSetData($Winner_Paid, GUICtrlRead($Winner_Paid) + 1)
        Sleep(10)
    Next
EndFunc
;
Func _Get_Points($data)
    Local $Pay = 0
    
    Switch $data
        Case "RRR" ; 3 Red 7s
            $Pay = 150
        Case "RRJ", "RJR", "JRR"
            $Pay = 150 * $Multi
        Case "RWB" ;Must be in RED WHITE BLUE order to receive points
            $Pay = 250
        Case "WWW" ; 3 White 7s
            Return 100
        Case "WWJ", "WJW", "JWW"
            Return 100 * $Multi
        Case "BBB", "XXX" ; 3 Blue 7s or 3 Blanks
            Return 80
        Case "BBJ", "BJB", "JBB"
            Return 80 * $Multi
        Case "RRW", "RRB", "RWR", "RWW", "RBR", "RBW", "RBB", "WRR", "WRW", "WRB", "WWR", "WWB", "WBR", "WBW", "WBB", "BRR", "BRW", "BRB", "BWR", "BWW", "BWB", "BBR", "BBW"
            Return 40
        Case "JJJ" ; 3 Multis
            Return 500
        Case "CCC"
            Return 100
        Case "111" ; 3 Single Bars
            Return 10
        Case "222" ; 3 Double Bars
            Return 15
        Case "333" ; 3 Triple Bars
            Return 20
        Case "112", "113", "211", "212", "213", "311", "312", "313", "121", "122", "221", "223", "321", "322", "323", "131", "132", "231", "232", "233", "331", "332" ; any other bar combo
            Return 8
        Case "123", "321" ; Single Double Triple, or Triple double Single Combo
            Return 20
    EndSwitch
    
    $symbol = StringSplit($data, "")
    
    If StringInStr($data, "C", 0 , 2) Then $Pay = 10
    
    If StringInStr($data, "J") Then $Pay *= $Multi
    If $Pay = 0 Then $Pay = -1
    
    Return $Pay
EndFunc
;
Func _CheckCredits()
    If GUICtrlRead($Credits) < 0 Then
        _GuiCtrlGroupSetState($ButtonGroup, $GUI_DISABLE)
        If MsgBox(4,"You Lose", "You lose, would you like to start over? If you press no, I'll give you 1000 credits for next time you play.") = 6 Then
            GUICtrlSetData($Credits, "1000")
            _GuiCtrlGroupSetState($ButtonGroup, $GUI_ENABLE)
            $Bet=0
            GUICtrlSetData($Your_Bet, $Bet)
            GUICtrlSetState($Spin, $GUI_DISABLE)
        Else
            IniWrite("SlotWinnings.ini", "Pot", "Pot", 1000)
            Exit
        EndIf
    EndIf
EndFunc
;
Func _GuiCtrlGroupSetState(ByRef $a_GroupArray, $i_State)
    For $i = 1 To $a_GroupArray[0]
        GUICtrlSetState($a_GroupArray[$i], $i_State)
    Next
EndFunc

Func _WinMove($HWnd, $Command, $wParam, $lParam)
    If BitAND(WinGetState($HWnd), 32) Then Return $GUI_RUNDEFMSG
    DllCall("user32.dll", "long", "SendMessage", "hwnd", $HWnd, "int", $WM_SYSCOMMAND, "int", 0xF009, "int", 0)
EndFunc   ;==>_WinMove

8)

The new script makes it so that you need 2 cherries in order to get points. and i couldn't close the script of the one you posted.... Edited by billthecreator

[font=Microsoft Sans Serif]My Scripts: From Most recent to least.[/font]Countdown GUI | QLOCK TWO | FlipClock | Slot Machine My UDF:_GenerateRandomNoRepeat | _GuiSnap

Link to comment
Share on other sites

Haha I love it ^_^ it's great but like everyone said too easy to win :( and.. u can cheat too easily.. and even edit how much money/credits you have :D change Pot= in the Slotwinnings.ini but anyways it's awesome! and fun ;) and addicting. woo.

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...