Sign in to follow this  
Followers 0
Vicate

Help with a stat calculator please :]

6 posts in this topic

Hello :]

I'm trying to create a 'stat calculator' for Mario Kart Wii.

Basically, I have the stats of all karts/bikes and the stat-bonuses each character gives.

I'd just like to create a program that calculates the stats for each char+kart combination.

Inaccurate example: Let's say the 'Dolphin Chaser' Bike has 20 drift, and the Standard Kart has 10 drift.

Let's also say that when driving with Bowser you have a +6 drift bonus, while Toad only gives a +2 drift bonus.

I'm making the program with two drop-down (combo) boxes, one with karts+bikes and one with characters.

I'd like to get it working to where (using the example):

If you'd select the 'Dolphin Chaser' and 'Toad', it would display a 22(20+2) drift, whereas if you're driving with the same vehicle but with 'Bowser', it would display 26(20+6) drift, etc.

Here's what I have so far, I'm just having difficulties getting it to add the information (using GUICtrlSetData):

#include <GUIConstantsEx.au3>

#Region ====GUI AREA===
GUICreate("Mario Kart Wii Calculator", 283, 165, 337, 285) ; will create a dialog box that when displayed is centered
$Kart = GUICtrlCreateCombo("Select Kart/Bike", 10, 10)
GUICtrlSetData(-1, "Bit Bike|Dolphin Dasher", 'Select Kart/Bike')
$Char = GUICtrlCreateCombo("Select Character", 10, 40)
GUICtrlSetData(-1, "Toadette|Bowser", 'Select Character')
GUISetState()
#EndRegion ===GUI AREA===


#Region ===BUTTONS===
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
WEnd
#EndRegion ===BUTTONS===


#Region ===BULK===
Func Calculate()
$kRead = GUICtrlRead($Kart)
$cRead = GUICtrlRead($Char)
EndFunc
#EndRegion ===BULK===



#Region ===SCRAP===
;If $ Then
;GUICtrlSetData($DriftTotal, "Drift: " & $DriftK + $DriftC) <---Possibly the right way to go
#EndRegion ===SCRAP===

Any help is greatly appreciated. Thanks in advance.

-Chris

Share this post


Link to post
Share on other sites



Any help?

#include <GUIConstantsEx.au3>

#Region ====GUI AREA===
GUICreate("Mario Kart Wii Calculator", 283, 165, 337, 285) ; will create a dialog box that when displayed is centered
$Kart = GUICtrlCreateCombo("Select Kart/Bike", 10, 10)
GUICtrlSetData(-1, "Bit Bike|Dolphin Dasher", 'Select Kart/Bike')
$Char = GUICtrlCreateCombo("Select Character", 10, 40)
GUICtrlSetData(-1, "Toadette|Bowser", 'Select Character')
GUISetState()
#EndRegion ====GUI AREA===


#Region ===BUTTONS===
While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Kart, $Char
            Calculate ($Kart, $Char)
    EndSwitch
WEnd
#EndRegion ===BUTTONS===


#Region ===BULK===
Func Calculate($Kart, $Char)
    $kRead = GUICtrlRead($Kart)
    $cRead = GUICtrlRead($Char)
    $Total = 0
    Switch $kRead
        Case "Bit Bike"
            $Total += 10
        Case "Dolphin Dasher"
            $Total += 20
    EndSwitch
    Switch $cRead
        Case "Toadette"
            $Total += 2
        Case "Bowser"
            $Total += 6
    EndSwitch
    MsgBox (0, "Result", $Total)
EndFunc   ;==>Calculate
#EndRegion ===BULK===



#Region ===SCRAP===
;If $ Then
;GUICtrlSetData($DriftTotal, "Drift: " & $DriftK + $DriftC) <---Possibly the right way to go
#EndRegion ===SCRAP===

Mat

Share this post


Link to post
Share on other sites

Something like this? Merry Christmas!

#include <GUIConstantsEx.au3>

GUICreate("Mario Kart Wii Calculator", 283, 165, 337, 285) ; will create a dialog box that when displayed is centered
$Kart = GUICtrlCreateCombo("Select Kart/Bike", 10, 10)
GUICtrlSetData(-1, "Bit Bike|Dolphin Dasher", 'Select Kart/Bike')
$Char = GUICtrlCreateCombo("Select Character", 10, 40)
GUICtrlSetData(-1, "Toadette|Bowser", 'Select Character')

$Value_Label = GUICtrlCreateLabel("Value 0",10,140,130)

GUISetState()

Global $sSelection_Save
Global $Value = 0

While 1

    sleep(10)

    $nMsg = GUIGetMsg()
    if $nMsg = $GUI_EVENT_CLOSE then ExitLoop

    $sSelection = GUICtrlRead($Kart) & GUICtrlRead($Char)
    if $sSelection <> $sSelection_Save Then

        $Value = 0

        Switch GUICtrlRead($Kart)
            Case "Bit Bike"
                $Value += 20
            Case "Dolphin Dasher"
                $Value += 10
        EndSwitch

        Switch GUICtrlRead($Char)
            Case "Toadette"
                $Value += 2
            Case "Bowser"
                $Value += 6
        EndSwitch

        GUICtrlSetData($Value_Label,"Value: " & $Value)

        $sSelection_Save = $sSelection
        
    endif

WEnd

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

Thank you both for your replies :]

Mat, that's just what I wanted, thanks!

EDIT: Nevermind, guys. I got it. Thanks for your help ;)

Edited by Vicate

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