Jump to content

IrrLicht 3d graphics help


Recommended Posts

I wasn't sure where to put this as the example scripts where this plugin came from is not a support forum and there is no real forum for 3d graphics help.

All of this code is working perfectly so far, except lines 189-196 and maybe 115

The code is probably wrong as I was adding and removing bits to try to get the .3ds file to show.

#include <GUIConstantsEx.au3>
#include <ButtonConstants.au3>
#include <ChangeResolutionEx.au3>
#Include <Misc.au3>
#include <IrrlichtPluginUtils.au3>
_Singleton("Terisi.exe")
Global $install=RegRead("HKEY_CURRENT_USER\SOFTWARE\Terisi","")
TraySetIcon(""&$install&"\Terisi.ico")
Global $name
Global $name1
Global $prof
Global $curdeskW=@DesktopWidth
Global $curdeskH=@DesktopHeight
_ChangeScreenResEx(1,1024,768,-1,-1)
Global $character
Global $character2
Global $character3
Global $centerW=@DesktopWidth/2
Global $centerH=@DesktopHeight/2
Global $toon
Global $node

start()

Func start()
    $character=IniRead(""&$install&"\data\cdat.ini","Characters",1,"")
    $character2=IniRead(""&$install&"\data\cdat.ini","Characters",2,"")
    $character3=IniRead(""&$install&"\data\cdat.ini","Characters",3,"")
    $start=GUICreate("Quest for Terisi",300,75,$centerW-150,$centerH-50)
    GUISetIcon(""&$install&"\Terisi.ico")
    If ($character="" And $character2="" And $character3="") Then
        $play=GUICtrlCreateButton("PLAY",10,25,50,25)
        $delete=GUICtrlCreateButton("Delete a Character",155,15,60,40,$BS_MULTILINE)
        GUICtrlSetState($play, $GUI_DISABLE)
        GUICtrlSetState($delete, $GUI_DISABLE)
        $CC=GUICtrlCreateButton("Create Character",80,15,60,40,$BS_MULTILINE)
        ElseIf ($character<>"" And $character2<>"" And $character3<>"") Then
            $play=GUICtrlCreateButton("PLAY",10,25,50,25)
            $delete=GUICtrlCreateButton("Delete a Character",155,15,60,40,$BS_MULTILINE)
            $CC=GUICtrlCreateButton("Create Character",80,15,60,40,$BS_MULTILINE)
            GUICtrlSetState($CC, $GUI_DISABLE)
    ElseIf ($character<>"" Or $character2<>"" Or $character3<>"") Then
            $play=GUICtrlCreateButton("PLAY",10,25,50,25)
            $delete=GUICtrlCreateButton("Delete a Character",155,15,60,40,$BS_MULTILINE)
            $CC=GUICtrlCreateButton("Create Character",80,15,60,40,$BS_MULTILINE)
    EndIf
    $exit=GUICtrlCreateButton("Exit",235,25,50,25)
    GUISetState(@SW_SHOW,$start)
    While 1
        $msg = GUIGetMsg($start)
            If $msg=$delete Then
            GUIDelete($start)
            delete()
        ElseIf $msg=$CC Then
            GUIDelete($start)
            Character()
        ElseIf $msg=$exit Then
            _ChangeScreenResEx(1,$curdeskW,$curdeskH,-1,-1)
            Exit(1)
        ElseIf $msg=$play Then
            GUIDelete($start)
            game()
        ElseIf $msg=$GUI_EVENT_CLOSE Then
            _ChangeScreenResEx(1,$curdeskW,$curdeskH,-1,-1)
            Exit(1)
        EndIf
    WEnd
EndFunc
Func delete()
    $top=10
    $del=GUICreate("Delete Which Character?",300,165,-1,-1)
    GUISetIcon(""&$install&"\Terisi.ico")
    $dchar=IniRead(""&$install&"\data\cdat.ini","Characters",1,"")
    $char1=GUICtrlCreateButton($dchar,75,$top,150,20)
    $top=$top+30
    $dchar2=IniRead(""&$install&"\data\cdat.ini","Characters",2,"")
    $char2=GUICtrlCreateButton($dchar2,75,$top,150,20)
    $top=$top+30
    $dchar3=IniRead(""&$install&"\data\cdat.ini","Characters",3,"")
    $char3=GUICtrlCreateButton($dchar3,75,$top,150,20)
    $top=$top+50
    $cancel=GUICtrlCreateButton("Cancel",125,$top,50,30)

    GUISetState(@SW_SHOW,$del)
    While 1
        $msg2=GUIGetMsg($del)
        If $msg2=$char1 Then
            IniDelete(""&$install&"\data\cstat.ini",$dchar)
            IniDelete(""&$install&"\data\cdat.ini","Characters",1)
            GUIDelete($del)
            start()
        ElseIf $msg2=$char2 Then
            IniDelete(""&$install&"\data\cstat.ini",$dchar2)
            IniDelete(""&$install&"\data\cdat.ini","Characters",2)
            GUIDelete($del)
            start()
        ElseIf $msg2=$char3 Then
            IniDelete(""&$install&"\data\cstat.ini",$dchar3)
            IniDelete(""&$install&"\data\cdat.ini","Characters",3)
            GUIDelete($del)
            start()
        ElseIf $msg2=$GUI_EVENT_CLOSE Then
            GUIDelete($del)
            start()
        ElseIf $msg2=$cancel Then
            GUIDelete($del)
            start()
        EndIf
    WEnd
EndFunc
Func Character()
$gui=GUICreate("Character Creation",@DesktopWidth,@DesktopHeight,0,0)
GUISetIcon(""&$install&"\Terisi.ico")

    CreateDeviceOnWindow( $gui,$EDT_OPENGL,100,100, 300, 500, 16, 1, 1 )

    $ws=1
    GUICtrlCreateLabel("Melee",650,100)
    $wslabel=GUICtrlCreateLabel($ws,750,100,12,12)
    $wsu=GUICtrlCreateButton("+",765,100,15,15)
    $wsd=GUICtrlCreateButton("-",785,100,15,15)
    GUICtrlSetState($wsd, $GUI_DISABLE)
    $bs=1
    GUICtrlCreateLabel("Ranged",650,150)
    $bslabel=GUICtrlCreateLabel($bs,750,150,12,12)
    $bsu=GUICtrlCreateButton("+",765,150,15,15)
    $bsd=GUICtrlCreateButton("-",785,150,15,15)
    GUICtrlSetState($bsd, $GUI_DISABLE)
    $s=1
    GUICtrlCreateLabel("Strength",650,200)
    $slabel=GUICtrlCreateLabel($s,750,200,12,12)
    $su=GUICtrlCreateButton("+",765,200,15,15)
    $sd=GUICtrlCreateButton("-",785,200,15,15)
    GUICtrlSetState($sd, $GUI_DISABLE)
    $agi=1
    GUICtrlCreateLabel("Agility",650,250)
    $agilabel=GUICtrlCreateLabel($agi,750,250,12,12)
    $agiu=GUICtrlCreateButton("+",765,250,15,15)
    $agid=GUICtrlCreateButton("-",785,250,15,15)
    GUICtrlSetState($agid, $GUI_DISABLE)
    $t=1
    GUICtrlCreateLabel("Toughness",650,300)
    $tlabel=GUICtrlCreateLabel($t,750,300,12,12)
    $tu=GUICtrlCreateButton("+",765,300,15,15)
    $td=GUICtrlCreateButton("-",785,300,15,15)
    GUICtrlSetState($td, $GUI_DISABLE)
    $w=1
    GUICtrlCreateLabel("Health",650,350)
    $wlabel=GUICtrlCreateLabel($w,750,350,12,12)
    $wu=GUICtrlCreateButton("+",765,350,15,15)
    $wd=GUICtrlCreateButton("-",785,350,15,15)
    GUICtrlSetState($wd, $GUI_DISABLE)
    $attrpnt=30-$ws-$bs-$s-$t-$w-$agi
    GUICtrlCreateLabel("Attribute Points Remaining",675,400)
    $attrpntlabel=GUICtrlCreateLabel($attrpnt,735,425,12,12)
    GUISetState()

    $name1=GUICtrlCreateInput("",$centerW-70,0.78*@desktopHeight,150,20)
    GUICtrlCreateLabel("Name",$centerW-10,0.81*@desktopheight)
    GUICtrlSetLimit ($name1,25,3)
    $gender1=GUICtrlCreateCombo("",0.40*@desktopwidth,0.70*@desktopHeight,75,20)
    GUICtrlSetData($gender1, "Male|Female", "Male")
    GUICtrlCreateLabel("Profession",0.50*@desktopwidth,0.67*@desktopheight)
    $prof1=GUICtrlCreateCombo("",0.50*@desktopwidth,0.70*@desktopHeight,120,20)
    $profeqal1=GUICtrlSetData($prof1, "Rune Crafter|Assassin|Weapon Crafter|Bodyguard|Hacker|Spell Weaver|Armor Crafter|Machinist|Demolitions Expert|Bounty Hunter", "Bodyguard")
    $prof=GUICtrlRead($prof1)
    GUICtrlCreateLabel("Starting Skills",0.70*@desktopwidth,0.65*@desktopheight,100,30)
    $1=IniRead(""&$install&"\data\Skls.ini",$prof,1,"")
    $1a=GUICtrlCreateButton($1,0.70*@desktopwidth,0.67*@desktopheight,100,30)
    $2=IniRead(""&$install&"\data\Skls.ini",$prof,2,"")
    $2a=GUICtrlCreateButton($2,0.70*@desktopwidth,0.72*@desktopheight,100,30)
    $3=IniRead(""&$install&"\data\Skls.ini",$prof,3,"")
    $3a=GUICtrlCreateButton($3,0.70*@desktopwidth,0.77*@desktopheight,100,30)
    $4=IniRead(""&$install&"\data\Skls.ini",$prof,4,"")
    $4a=GUICtrlCreateButton($4,0.70*@desktopwidth,0.82*@desktopheight,100,30)

GUICtrlCreateTabItem("")

$done=GUICtrlCreateButton("Done",$centerW-25,0.90*@DesktopHeight, 50, 20)

    While 1

        $msg = GUIGetMsg()
        If $msg<>0 Then
            $name=GUICtrlRead($name1)
            If StringRegExp($name, '[^a-z\-\:039:\ \v]') = 1 Then _
                GUICtrlSetData($name1, StringRegExpReplace($name, '([^a-z\-\:039:\ \v])', ''))
            $gender=GUICtrlRead($gender1)
            If $gender="Female" Then
                $toon = GetMesh(""&$install&"\data\Models\female.3DS" )
                ScaleMesh($toon,25,25,25)
                $node = AddMeshSceneNode( $toon )
                $Camera = AddCameraSceneNode( 0, 0, 20, -40, 0, 0, 0 )
                BeginScene( true, true, 255, 50, 50, 100 )
                SceneDraw( )
                EndIf
            $prof=GUICtrlRead($prof1)
            $1=IniRead(""&$install&"\data\Skls.ini",$prof,1,"")
            GUICtrlSetData($1a,$1)
            $2=IniRead(""&$install&"\data\Skls.ini",$prof,2,"")
            GUICtrlSetData($2a,$2)
            $3=IniRead(""&$install&"\data\Skls.ini",$prof,3,"")
            GUICtrlSetData($3a,$3)
            $4=IniRead(""&$install&"\data\Skls.ini",$prof,4,"")
            GUICtrlSetData($4a,$4)

            If $msg = $wsu Then
                $ws=$ws+1
                $attrpnt=30-$ws-$bs-$s-$t-$w-$agi
                GUICtrlSetData($wslabel,$ws)
                GUICtrlSetData($attrpntlabel,$attrpnt)
                If $attrpnt<>0 Then
                    GUICtrlSetState($su, $GUI_ENABLE)
                    GUICtrlSetState($bsu, $GUI_ENABLE)
                    GUICtrlSetState($wsu, $GUI_ENABLE)
                    GUICtrlSetState($tu, $GUI_ENABLE)
                    GUICtrlSetState($wu, $GUI_ENABLE)
                    GUICtrlSetState($agiu, $GUI_ENABLE)
                EndIf
                If $agi<2 Then
                    GUICtrlSetState($agid, $GUI_DISABLE)
                ElseIf $agi>1 Then
                    GUICtrlSetState($agid, $GUI_ENABLE)
                EndIf
                If $agi>17 Then
                    GUICtrlSetState($agiu, $GUI_DISABLE)
                ElseIf $agi<18 Then
                    GUICtrlSetState($agiu, $GUI_ENABLE)
                EndIf
                If $ws<2 Then
                    GUICtrlSetState($wsd, $GUI_DISABLE)
                ElseIf $ws>1 Then
                    GUICtrlSetState($wsd, $GUI_ENABLE)
                EndIf
                If $ws>17 Then
                    GUICtrlSetState($wsu, $GUI_DISABLE)
                ElseIf $ws<18 Then
                    GUICtrlSetState($wsu, $GUI_ENABLE)
                EndIf
                If $w<2 Then
                    GUICtrlSetState($wd, $GUI_DISABLE)
                ElseIf $w>1 Then
                    GUICtrlSetState($wd, $GUI_ENABLE)
                EndIf
                If $w>17 Then
                    GUICtrlSetState($wu, $GUI_DISABLE)
                ElseIf $w<18 Then
                    GUICtrlSetState($wu, $GUI_ENABLE)
                EndIf
                If $t<2 Then
                    GUICtrlSetState($td, $GUI_DISABLE)
                ElseIf $t>1 Then
                    GUICtrlSetState($td, $GUI_ENABLE)
                EndIf
                If $t>17 Then
                    GUICtrlSetState($tu, $GUI_DISABLE)
                ElseIf $t<18 Then
                    GUICtrlSetState($tu, $GUI_ENABLE)
                EndIf
                If $s<2 Then
                    GUICtrlSetState($sd, $GUI_DISABLE)
                ElseIf $s>1 Then
                    GUICtrlSetState($sd, $GUI_ENABLE)
                EndIf
                If $s>17 Then
                    GUICtrlSetState($su, $GUI_DISABLE)
                ElseIf $s<18 Then
                    GUICtrlSetState($su, $GUI_ENABLE)
                EndIf
                If $bs<2 Then
                    GUICtrlSetState($bsd, $GUI_DISABLE)
                ElseIf $bs>1 Then
                    GUICtrlSetState($bsd, $GUI_ENABLE)
                EndIf
                If $bs>17 Then
                    GUICtrlSetState($bsu, $GUI_DISABLE)
                ElseIf $bs<18 Then
                    GUICtrlSetState($bsu, $GUI_ENABLE)
                EndIf
                If $attrpnt=0 Then
                    GUICtrlSetState($su, $GUI_DISABLE)
                    GUICtrlSetState($bsu, $GUI_DISABLE)
                    GUICtrlSetState($wsu, $GUI_DISABLE)
                    GUICtrlSetState($tu, $GUI_DISABLE)
                    GUICtrlSetState($wu, $GUI_DISABLE)
                    GUICtrlSetState($agiu, $GUI_DISABLE)
                EndIf

            ElseIf $msg = $wsd Then
                $ws=$ws-1
                $attrpnt=30-$ws-$bs-$s-$t-$w-$agi
                GUICtrlSetData($wslabel,$ws)
                GUICtrlSetData($attrpntlabel,$attrpnt)
                If $attrpnt<>0 Then
                    GUICtrlSetState($su, $GUI_ENABLE)
                    GUICtrlSetState($bsu, $GUI_ENABLE)
                    GUICtrlSetState($wsu, $GUI_ENABLE)
                    GUICtrlSetState($tu, $GUI_ENABLE)
                    GUICtrlSetState($wu, $GUI_ENABLE)
                    GUICtrlSetState($agiu, $GUI_ENABLE)
                EndIf
                If $agi<2 Then
                    GUICtrlSetState($agid, $GUI_DISABLE)
                ElseIf $agi>1 Then
                    GUICtrlSetState($agid, $GUI_ENABLE)
                EndIf
                If $agi>17 Then
                    GUICtrlSetState($agiu, $GUI_DISABLE)
                ElseIf $agi<18 Then
                    GUICtrlSetState($agiu, $GUI_ENABLE)
                EndIf
                If $ws<2 Then
                    GUICtrlSetState($wsd, $GUI_DISABLE)
                ElseIf $ws>1 Then
                    GUICtrlSetState($wsd, $GUI_ENABLE)
                EndIf
                If $ws>17 Then
                    GUICtrlSetState($wsu, $GUI_DISABLE)
                ElseIf $ws<18 Then
                    GUICtrlSetState($wsu, $GUI_ENABLE)
                EndIf
                If $w<2 Then
                    GUICtrlSetState($wd, $GUI_DISABLE)
                ElseIf $w>1 Then
                    GUICtrlSetState($wd, $GUI_ENABLE)
                EndIf
                If $w>17 Then
                    GUICtrlSetState($wu, $GUI_DISABLE)
                ElseIf $w<18 Then
                    GUICtrlSetState($wu, $GUI_ENABLE)
                EndIf
                If $t<2 Then
                    GUICtrlSetState($td, $GUI_DISABLE)
                ElseIf $t>1 Then
                    GUICtrlSetState($td, $GUI_ENABLE)
                EndIf
                If $t>17 Then
                    GUICtrlSetState($tu, $GUI_DISABLE)
                ElseIf $t<18 Then
                    GUICtrlSetState($tu, $GUI_ENABLE)
                EndIf
                If $s<2 Then
                    GUICtrlSetState($sd, $GUI_DISABLE)
                ElseIf $s>1 Then
                    GUICtrlSetState($sd, $GUI_ENABLE)
                EndIf
                If $s>17 Then
                    GUICtrlSetState($su, $GUI_DISABLE)
                ElseIf $s<18 Then
                    GUICtrlSetState($su, $GUI_ENABLE)
                EndIf
                If $bs<2 Then
                    GUICtrlSetState($bsd, $GUI_DISABLE)
                ElseIf $bs>1 Then
                    GUICtrlSetState($bsd, $GUI_ENABLE)
                EndIf
                If $bs>17 Then
                    GUICtrlSetState($bsu, $GUI_DISABLE)
                ElseIf $bs<18 Then
                    GUICtrlSetState($bsu, $GUI_ENABLE)
                EndIf
                If $attrpnt=0 Then
                    GUICtrlSetState($su, $GUI_DISABLE)
                    GUICtrlSetState($bsu, $GUI_DISABLE)
                    GUICtrlSetState($wsu, $GUI_DISABLE)
                    GUICtrlSetState($tu, $GUI_DISABLE)
                    GUICtrlSetState($wu, $GUI_DISABLE)
                    GUICtrlSetState($agiu, $GUI_DISABLE)
                EndIf

            ElseIf $msg = $bsu Then
                $bs=$bs+1
                GUICtrlSetData($bslabel,$bs)
                $attrpnt=30-$ws-$bs-$s-$t-$w-$agi
                GUICtrlSetData($attrpntlabel,$attrpnt)
                If $attrpnt<>0 Then
                    GUICtrlSetState($su, $GUI_ENABLE)
                    GUICtrlSetState($bsu, $GUI_ENABLE)
                    GUICtrlSetState($wsu, $GUI_ENABLE)
                    GUICtrlSetState($tu, $GUI_ENABLE)
                    GUICtrlSetState($wu, $GUI_ENABLE)
                    GUICtrlSetState($agiu, $GUI_ENABLE)
                EndIf
                If $agi<2 Then
                    GUICtrlSetState($agid, $GUI_DISABLE)
                ElseIf $agi>1 Then
                    GUICtrlSetState($agid, $GUI_ENABLE)
                EndIf
                If $agi>17 Then
                    GUICtrlSetState($agiu, $GUI_DISABLE)
                ElseIf $agi<18 Then
                    GUICtrlSetState($agiu, $GUI_ENABLE)
                EndIf
                If $ws<2 Then
                    GUICtrlSetState($wsd, $GUI_DISABLE)
                ElseIf $ws>1 Then
                    GUICtrlSetState($wsd, $GUI_ENABLE)
                EndIf
                If $ws>17 Then
                    GUICtrlSetState($wsu, $GUI_DISABLE)
                ElseIf $ws<18 Then
                    GUICtrlSetState($wsu, $GUI_ENABLE)
                EndIf
                If $w<2 Then
                    GUICtrlSetState($wd, $GUI_DISABLE)
                ElseIf $w>1 Then
                    GUICtrlSetState($wd, $GUI_ENABLE)
                EndIf
                If $w>17 Then
                    GUICtrlSetState($wu, $GUI_DISABLE)
                ElseIf $w<18 Then
                    GUICtrlSetState($wu, $GUI_ENABLE)
                EndIf
                If $t<2 Then
                    GUICtrlSetState($td, $GUI_DISABLE)
                ElseIf $t>1 Then
                    GUICtrlSetState($td, $GUI_ENABLE)
                EndIf
                If $t>17 Then
                    GUICtrlSetState($tu, $GUI_DISABLE)
                ElseIf $t<18 Then
                    GUICtrlSetState($tu, $GUI_ENABLE)
                EndIf
                If $s<2 Then
                    GUICtrlSetState($sd, $GUI_DISABLE)
                ElseIf $s>1 Then
                    GUICtrlSetState($sd, $GUI_ENABLE)
                EndIf
                If $s>17 Then
                    GUICtrlSetState($su, $GUI_DISABLE)
                ElseIf $s<18 Then
                    GUICtrlSetState($su, $GUI_ENABLE)
                EndIf
                If $bs<2 Then
                    GUICtrlSetState($bsd, $GUI_DISABLE)
                ElseIf $bs>1 Then
                    GUICtrlSetState($bsd, $GUI_ENABLE)
                EndIf
                If $bs>17 Then
                    GUICtrlSetState($bsu, $GUI_DISABLE)
                ElseIf $bs<18 Then
                    GUICtrlSetState($bsu, $GUI_ENABLE)
                EndIf
                If $attrpnt=0 Then
                    GUICtrlSetState($su, $GUI_DISABLE)
                    GUICtrlSetState($bsu, $GUI_DISABLE)
                    GUICtrlSetState($wsu, $GUI_DISABLE)
                    GUICtrlSetState($tu, $GUI_DISABLE)
                    GUICtrlSetState($wu, $GUI_DISABLE)
                    GUICtrlSetState($agiu, $GUI_DISABLE)
                EndIf

            ElseIf $msg = $bsd Then
                $bs=$bs-1
                GUICtrlSetData($bslabel,$bs)
                $attrpnt=30-$ws-$bs-$s-$t-$w-$agi
                GUICtrlSetData($attrpntlabel,$attrpnt)
                If $attrpnt<>0 Then
                    GUICtrlSetState($su, $GUI_ENABLE)
                    GUICtrlSetState($bsu, $GUI_ENABLE)
                    GUICtrlSetState($wsu, $GUI_ENABLE)
                    GUICtrlSetState($tu, $GUI_ENABLE)
                    GUICtrlSetState($wu, $GUI_ENABLE)
                    GUICtrlSetState($agiu, $GUI_ENABLE)
                EndIf
                If $agi<2 Then
                    GUICtrlSetState($agid, $GUI_DISABLE)
                ElseIf $agi>1 Then
                    GUICtrlSetState($agid, $GUI_ENABLE)
                EndIf
                If $agi>17 Then
                    GUICtrlSetState($agiu, $GUI_DISABLE)
                ElseIf $agi<18 Then
                    GUICtrlSetState($agiu, $GUI_ENABLE)
                EndIf
                If $ws<2 Then
                    GUICtrlSetState($wsd, $GUI_DISABLE)
                ElseIf $ws>1 Then
                    GUICtrlSetState($wsd, $GUI_ENABLE)
                EndIf
                If $ws>17 Then
                    GUICtrlSetState($wsu, $GUI_DISABLE)
                ElseIf $ws<18 Then
                    GUICtrlSetState($wsu, $GUI_ENABLE)
                EndIf
                If $w<2 Then
                    GUICtrlSetState($wd, $GUI_DISABLE)
                ElseIf $w>1 Then
                    GUICtrlSetState($wd, $GUI_ENABLE)
                EndIf
                If $w>17 Then
                    GUICtrlSetState($wu, $GUI_DISABLE)
                ElseIf $w<18 Then
                    GUICtrlSetState($wu, $GUI_ENABLE)
                EndIf
                If $t<2 Then
                    GUICtrlSetState($td, $GUI_DISABLE)
                ElseIf $t>1 Then
                    GUICtrlSetState($td, $GUI_ENABLE)
                EndIf
                If $t>17 Then
                    GUICtrlSetState($tu, $GUI_DISABLE)
                ElseIf $t<18 Then
                    GUICtrlSetState($tu, $GUI_ENABLE)
                EndIf
                If $s<2 Then
                    GUICtrlSetState($sd, $GUI_DISABLE)
                ElseIf $s>1 Then
                    GUICtrlSetState($sd, $GUI_ENABLE)
                EndIf
                If $s>17 Then
                    GUICtrlSetState($su, $GUI_DISABLE)
                ElseIf $s<18 Then
                    GUICtrlSetState($su, $GUI_ENABLE)
                EndIf
                If $bs<2 Then
                    GUICtrlSetState($bsd, $GUI_DISABLE)
                ElseIf $bs>1 Then
                    GUICtrlSetState($bsd, $GUI_ENABLE)
                EndIf
                If $bs>17 Then
                    GUICtrlSetState($bsu, $GUI_DISABLE)
                ElseIf $bs<18 Then
                    GUICtrlSetState($bsu, $GUI_ENABLE)
                EndIf
                If $attrpnt=0 Then
                    GUICtrlSetState($su, $GUI_DISABLE)
                    GUICtrlSetState($bsu, $GUI_DISABLE)
                    GUICtrlSetState($wsu, $GUI_DISABLE)
                    GUICtrlSetState($tu, $GUI_DISABLE)
                    GUICtrlSetState($wu, $GUI_DISABLE)
                    GUICtrlSetState($agiu, $GUI_DISABLE)
                EndIf

            ElseIf $msg = $sd Then
                $s=$s-1
                GUICtrlSetData($slabel,$s)
                $attrpnt=30-$ws-$bs-$s-$t-$w-$agi
                GUICtrlSetData($attrpntlabel,$attrpnt)
                If $attrpnt<>0 Then
                    GUICtrlSetState($su, $GUI_ENABLE)
                    GUICtrlSetState($bsu, $GUI_ENABLE)
                    GUICtrlSetState($wsu, $GUI_ENABLE)
                    GUICtrlSetState($tu, $GUI_ENABLE)
                    GUICtrlSetState($wu, $GUI_ENABLE)
                    GUICtrlSetState($agiu, $GUI_ENABLE)
                EndIf
                If $agi<2 Then
                    GUICtrlSetState($agid, $GUI_DISABLE)
                ElseIf $agi>1 Then
                    GUICtrlSetState($agid, $GUI_ENABLE)
                EndIf
                If $agi>17 Then
                    GUICtrlSetState($agiu, $GUI_DISABLE)
                ElseIf $agi<18 Then
                    GUICtrlSetState($agiu, $GUI_ENABLE)
                EndIf
                If $ws<2 Then
                    GUICtrlSetState($wsd, $GUI_DISABLE)
                ElseIf $ws>1 Then
                    GUICtrlSetState($wsd, $GUI_ENABLE)
                EndIf
                If $ws>17 Then
                    GUICtrlSetState($wsu, $GUI_DISABLE)
                ElseIf $ws<18 Then
                    GUICtrlSetState($wsu, $GUI_ENABLE)
                EndIf
                If $w<2 Then
                    GUICtrlSetState($wd, $GUI_DISABLE)
                ElseIf $w>1 Then
                    GUICtrlSetState($wd, $GUI_ENABLE)
                EndIf
                If $w>17 Then
                    GUICtrlSetState($wu, $GUI_DISABLE)
                ElseIf $w<18 Then
                    GUICtrlSetState($wu, $GUI_ENABLE)
                EndIf
                If $t<2 Then
                    GUICtrlSetState($td, $GUI_DISABLE)
                ElseIf $t>1 Then
                    GUICtrlSetState($td, $GUI_ENABLE)
                EndIf
                If $t>17 Then
                    GUICtrlSetState($tu, $GUI_DISABLE)
                ElseIf $t<18 Then
                    GUICtrlSetState($tu, $GUI_ENABLE)
                EndIf
                If $s<2 Then
                    GUICtrlSetState($sd, $GUI_DISABLE)
                ElseIf $s>1 Then
                    GUICtrlSetState($sd, $GUI_ENABLE)
                EndIf
                If $s>17 Then
                    GUICtrlSetState($su, $GUI_DISABLE)
                ElseIf $s<18 Then
                    GUICtrlSetState($su, $GUI_ENABLE)
                EndIf
                If $bs<2 Then
                    GUICtrlSetState($bsd, $GUI_DISABLE)
                ElseIf $bs>1 Then
                    GUICtrlSetState($bsd, $GUI_ENABLE)
                EndIf
                If $bs>17 Then
                    GUICtrlSetState($bsu, $GUI_DISABLE)
                ElseIf $bs<18 Then
                    GUICtrlSetState($bsu, $GUI_ENABLE)
                EndIf
                If $attrpnt=0 Then
                    GUICtrlSetState($su, $GUI_DISABLE)
                    GUICtrlSetState($bsu, $GUI_DISABLE)
                    GUICtrlSetState($wsu, $GUI_DISABLE)
                    GUICtrlSetState($tu, $GUI_DISABLE)
                    GUICtrlSetState($wu, $GUI_DISABLE)
                    GUICtrlSetState($agiu, $GUI_DISABLE)
                EndIf

            ElseIf $msg = $su Then
                $s=$s+1
                GUICtrlSetData($slabel,$s)
                $attrpnt=30-$ws-$bs-$s-$t-$w-$agi
                GUICtrlSetData($attrpntlabel,$attrpnt)
                If $attrpnt<>0 Then
                    GUICtrlSetState($su, $GUI_ENABLE)
                    GUICtrlSetState($bsu, $GUI_ENABLE)
                    GUICtrlSetState($wsu, $GUI_ENABLE)
                    GUICtrlSetState($tu, $GUI_ENABLE)
                    GUICtrlSetState($wu, $GUI_ENABLE)
                    GUICtrlSetState($agiu, $GUI_ENABLE)
                EndIf
                If $agi<2 Then
                    GUICtrlSetState($agid, $GUI_DISABLE)
                ElseIf $agi>1 Then
                    GUICtrlSetState($agid, $GUI_ENABLE)
                EndIf
                If $agi>17 Then
                    GUICtrlSetState($agiu, $GUI_DISABLE)
                ElseIf $agi<18 Then
                    GUICtrlSetState($agiu, $GUI_ENABLE)
                EndIf
                If $ws<2 Then
                    GUICtrlSetState($wsd, $GUI_DISABLE)
                ElseIf $ws>1 Then
                    GUICtrlSetState($wsd, $GUI_ENABLE)
                EndIf
                If $ws>17 Then
                    GUICtrlSetState($wsu, $GUI_DISABLE)
                ElseIf $ws<18 Then
                    GUICtrlSetState($wsu, $GUI_ENABLE)
                EndIf
                If $w<2 Then
                    GUICtrlSetState($wd, $GUI_DISABLE)
                ElseIf $w>1 Then
                    GUICtrlSetState($wd, $GUI_ENABLE)
                EndIf
                If $w>17 Then
                    GUICtrlSetState($wu, $GUI_DISABLE)
                ElseIf $w<18 Then
                    GUICtrlSetState($wu, $GUI_ENABLE)
                EndIf
                If $t<2 Then
                    GUICtrlSetState($td, $GUI_DISABLE)
                ElseIf $t>1 Then
                    GUICtrlSetState($td, $GUI_ENABLE)
                EndIf
                If $t>17 Then
                    GUICtrlSetState($tu, $GUI_DISABLE)
                ElseIf $t<18 Then
                    GUICtrlSetState($tu, $GUI_ENABLE)
                EndIf
                If $s<2 Then
                    GUICtrlSetState($sd, $GUI_DISABLE)
                ElseIf $s>1 Then
                    GUICtrlSetState($sd, $GUI_ENABLE)
                EndIf
                If $s>17 Then
                    GUICtrlSetState($su, $GUI_DISABLE)
                ElseIf $s<18 Then
                    GUICtrlSetState($su, $GUI_ENABLE)
                EndIf
                If $bs<2 Then
                    GUICtrlSetState($bsd, $GUI_DISABLE)
                ElseIf $bs>1 Then
                    GUICtrlSetState($bsd, $GUI_ENABLE)
                EndIf
                If $bs>17 Then
                    GUICtrlSetState($bsu, $GUI_DISABLE)
                ElseIf $bs<18 Then
                    GUICtrlSetState($bsu, $GUI_ENABLE)
                EndIf
                If $attrpnt=0 Then
                    GUICtrlSetState($su, $GUI_DISABLE)
                    GUICtrlSetState($bsu, $GUI_DISABLE)
                    GUICtrlSetState($wsu, $GUI_DISABLE)
                    GUICtrlSetState($tu, $GUI_DISABLE)
                    GUICtrlSetState($wu, $GUI_DISABLE)
                    GUICtrlSetState($agiu, $GUI_DISABLE)
                EndIf

            ElseIf $msg = $tu Then
                $t=$t+1
                GUICtrlSetData($tlabel,$t)
                $attrpnt=30-$ws-$bs-$s-$t-$w-$agi
                GUICtrlSetData($attrpntlabel,$attrpnt)
                If $attrpnt<>0 Then
                    GUICtrlSetState($su, $GUI_ENABLE)
                    GUICtrlSetState($bsu, $GUI_ENABLE)
                    GUICtrlSetState($wsu, $GUI_ENABLE)
                    GUICtrlSetState($tu, $GUI_ENABLE)
                    GUICtrlSetState($wu, $GUI_ENABLE)
                    GUICtrlSetState($agiu, $GUI_ENABLE)
                EndIf
                If $agi<2 Then
                    GUICtrlSetState($agid, $GUI_DISABLE)
                ElseIf $agi>1 Then
                    GUICtrlSetState($agid, $GUI_ENABLE)
                EndIf
                If $agi>17 Then
                    GUICtrlSetState($agiu, $GUI_DISABLE)
                ElseIf $agi<18 Then
                    GUICtrlSetState($agiu, $GUI_ENABLE)
                EndIf
                If $ws<2 Then
                    GUICtrlSetState($wsd, $GUI_DISABLE)
                ElseIf $ws>1 Then
                    GUICtrlSetState($wsd, $GUI_ENABLE)
                EndIf
                If $ws>17 Then
                    GUICtrlSetState($wsu, $GUI_DISABLE)
                ElseIf $ws<18 Then
                    GUICtrlSetState($wsu, $GUI_ENABLE)
                EndIf
                If $w<2 Then
                    GUICtrlSetState($wd, $GUI_DISABLE)
                ElseIf $w>1 Then
                    GUICtrlSetState($wd, $GUI_ENABLE)
                EndIf
                If $w>17 Then
                    GUICtrlSetState($wu, $GUI_DISABLE)
                ElseIf $w<18 Then
                    GUICtrlSetState($wu, $GUI_ENABLE)
                EndIf
                If $t<2 Then
                    GUICtrlSetState($td, $GUI_DISABLE)
                ElseIf $t>1 Then
                    GUICtrlSetState($td, $GUI_ENABLE)
                EndIf
                If $t>17 Then
                    GUICtrlSetState($tu, $GUI_DISABLE)
                ElseIf $t<18 Then
                    GUICtrlSetState($tu, $GUI_ENABLE)
                EndIf
                If $s<2 Then
                    GUICtrlSetState($sd, $GUI_DISABLE)
                ElseIf $s>1 Then
                    GUICtrlSetState($sd, $GUI_ENABLE)
                EndIf
                If $s>17 Then
                    GUICtrlSetState($su, $GUI_DISABLE)
                ElseIf $s<18 Then
                    GUICtrlSetState($su, $GUI_ENABLE)
                EndIf
                If $bs<2 Then
                    GUICtrlSetState($bsd, $GUI_DISABLE)
                ElseIf $bs>1 Then
                    GUICtrlSetState($bsd, $GUI_ENABLE)
                EndIf
                If $bs>17 Then
                    GUICtrlSetState($bsu, $GUI_DISABLE)
                ElseIf $bs<18 Then
                    GUICtrlSetState($bsu, $GUI_ENABLE)
                EndIf
                If $attrpnt=0 Then
                    GUICtrlSetState($su, $GUI_DISABLE)
                    GUICtrlSetState($bsu, $GUI_DISABLE)
                    GUICtrlSetState($wsu, $GUI_DISABLE)
                    GUICtrlSetState($tu, $GUI_DISABLE)
                    GUICtrlSetState($wu, $GUI_DISABLE)
                    GUICtrlSetState($agiu, $GUI_DISABLE)
                EndIf

            ElseIf $msg = $td Then
                $t=$t-1
                GUICtrlSetData($tlabel,$t)
                $attrpnt=30-$ws-$bs-$s-$t-$w-$agi
                GUICtrlSetData($attrpntlabel,$attrpnt)
                If $attrpnt<>0 Then
                    GUICtrlSetState($su, $GUI_ENABLE)
                    GUICtrlSetState($bsu, $GUI_ENABLE)
                    GUICtrlSetState($wsu, $GUI_ENABLE)
                    GUICtrlSetState($tu, $GUI_ENABLE)
                    GUICtrlSetState($wu, $GUI_ENABLE)
                    GUICtrlSetState($agiu, $GUI_ENABLE)
                EndIf
                If $agi<2 Then
                    GUICtrlSetState($agid, $GUI_DISABLE)
                ElseIf $agi>1 Then
                    GUICtrlSetState($agid, $GUI_ENABLE)
                EndIf
                If $agi>17 Then
                    GUICtrlSetState($agiu, $GUI_DISABLE)
                ElseIf $agi<18 Then
                    GUICtrlSetState($agiu, $GUI_ENABLE)
                EndIf
                If $ws<2 Then
                    GUICtrlSetState($wsd, $GUI_DISABLE)
                ElseIf $ws>1 Then
                    GUICtrlSetState($wsd, $GUI_ENABLE)
                EndIf
                If $ws>17 Then
                    GUICtrlSetState($wsu, $GUI_DISABLE)
                ElseIf $ws<18 Then
                    GUICtrlSetState($wsu, $GUI_ENABLE)
                EndIf
                If $w<2 Then
                    GUICtrlSetState($wd, $GUI_DISABLE)
                ElseIf $w>1 Then
                    GUICtrlSetState($wd, $GUI_ENABLE)
                EndIf
                If $w>17 Then
                    GUICtrlSetState($wu, $GUI_DISABLE)
                ElseIf $w<18 Then
                    GUICtrlSetState($wu, $GUI_ENABLE)
                EndIf
                If $t<2 Then
                    GUICtrlSetState($td, $GUI_DISABLE)
                ElseIf $t>1 Then
                    GUICtrlSetState($td, $GUI_ENABLE)
                EndIf
                If $t>17 Then
                    GUICtrlSetState($tu, $GUI_DISABLE)
                ElseIf $t<18 Then
                    GUICtrlSetState($tu, $GUI_ENABLE)
                EndIf
                If $s<2 Then
                    GUICtrlSetState($sd, $GUI_DISABLE)
                ElseIf $s>1 Then
                    GUICtrlSetState($sd, $GUI_ENABLE)
                EndIf
                If $s>17 Then
                    GUICtrlSetState($su, $GUI_DISABLE)
                ElseIf $s<18 Then
                    GUICtrlSetState($su, $GUI_ENABLE)
                EndIf
                If $bs<2 Then
                    GUICtrlSetState($bsd, $GUI_DISABLE)
                ElseIf $bs>1 Then
                    GUICtrlSetState($bsd, $GUI_ENABLE)
                EndIf
                If $bs>17 Then
                    GUICtrlSetState($bsu, $GUI_DISABLE)
                ElseIf $bs<18 Then
                    GUICtrlSetState($bsu, $GUI_ENABLE)
                EndIf
                If $attrpnt=0 Then
                    GUICtrlSetState($su, $GUI_DISABLE)
                    GUICtrlSetState($bsu, $GUI_DISABLE)
                    GUICtrlSetState($wsu, $GUI_DISABLE)
                    GUICtrlSetState($tu, $GUI_DISABLE)
                    GUICtrlSetState($wu, $GUI_DISABLE)
                    GUICtrlSetState($agiu, $GUI_DISABLE)
                EndIf

            ElseIf $msg = $wd Then
                $w=$w-1
                GUICtrlSetData($wlabel,$w)
                $attrpnt=30-$ws-$bs-$s-$t-$w-$agi
                GUICtrlSetData($attrpntlabel,$attrpnt)
                If $attrpnt<>0 Then
                    GUICtrlSetState($su, $GUI_ENABLE)
                    GUICtrlSetState($bsu, $GUI_ENABLE)
                    GUICtrlSetState($wsu, $GUI_ENABLE)
                    GUICtrlSetState($tu, $GUI_ENABLE)
                    GUICtrlSetState($wu, $GUI_ENABLE)
                    GUICtrlSetState($agiu, $GUI_ENABLE)
                EndIf
                If $agi<2 Then
                    GUICtrlSetState($agid, $GUI_DISABLE)
                ElseIf $agi>1 Then
                    GUICtrlSetState($agid, $GUI_ENABLE)
                EndIf
                If $agi>17 Then
                    GUICtrlSetState($agiu, $GUI_DISABLE)
                ElseIf $agi<18 Then
                    GUICtrlSetState($agiu, $GUI_ENABLE)
                EndIf
                If $ws<2 Then
                    GUICtrlSetState($wsd, $GUI_DISABLE)
                ElseIf $ws>1 Then
                    GUICtrlSetState($wsd, $GUI_ENABLE)
                EndIf
                If $ws>17 Then
                    GUICtrlSetState($wsu, $GUI_DISABLE)
                ElseIf $ws<18 Then
                    GUICtrlSetState($wsu, $GUI_ENABLE)
                EndIf
                If $w<2 Then
                    GUICtrlSetState($wd, $GUI_DISABLE)
                ElseIf $w>1 Then
                    GUICtrlSetState($wd, $GUI_ENABLE)
                EndIf
                If $w>17 Then
                    GUICtrlSetState($wu, $GUI_DISABLE)
                ElseIf $w<18 Then
                    GUICtrlSetState($wu, $GUI_ENABLE)
                EndIf
                If $t<2 Then
                    GUICtrlSetState($td, $GUI_DISABLE)
                ElseIf $t>1 Then
                    GUICtrlSetState($td, $GUI_ENABLE)
                EndIf
                If $t>17 Then
                    GUICtrlSetState($tu, $GUI_DISABLE)
                ElseIf $t<18 Then
                    GUICtrlSetState($tu, $GUI_ENABLE)
                EndIf
                If $s<2 Then
                    GUICtrlSetState($sd, $GUI_DISABLE)
                ElseIf $s>1 Then
                    GUICtrlSetState($sd, $GUI_ENABLE)
                EndIf
                If $s>17 Then
                    GUICtrlSetState($su, $GUI_DISABLE)
                ElseIf $s<18 Then
                    GUICtrlSetState($su, $GUI_ENABLE)
                EndIf
                If $bs<2 Then
                    GUICtrlSetState($bsd, $GUI_DISABLE)
                ElseIf $bs>1 Then
                    GUICtrlSetState($bsd, $GUI_ENABLE)
                EndIf
                If $bs>17 Then
                    GUICtrlSetState($bsu, $GUI_DISABLE)
                ElseIf $bs<18 Then
                    GUICtrlSetState($bsu, $GUI_ENABLE)
                EndIf
                If $attrpnt=0 Then
                    GUICtrlSetState($su, $GUI_DISABLE)
                    GUICtrlSetState($bsu, $GUI_DISABLE)
                    GUICtrlSetState($wsu, $GUI_DISABLE)
                    GUICtrlSetState($tu, $GUI_DISABLE)
                    GUICtrlSetState($wu, $GUI_DISABLE)
                    GUICtrlSetState($agiu, $GUI_DISABLE)
                EndIf

            ElseIf $msg = $wu Then
                $w=$w+1
                GUICtrlSetData($wlabel,$w)
                $attrpnt=30-$ws-$bs-$s-$t-$w-$agi
                GUICtrlSetData($attrpntlabel,$attrpnt)
                If $attrpnt<>0 Then
                    GUICtrlSetState($su, $GUI_ENABLE)
                    GUICtrlSetState($bsu, $GUI_ENABLE)
                    GUICtrlSetState($wsu, $GUI_ENABLE)
                    GUICtrlSetState($tu, $GUI_ENABLE)
                    GUICtrlSetState($wu, $GUI_ENABLE)
                    GUICtrlSetState($agiu, $GUI_ENABLE)
                EndIf
                If $agi<2 Then
                    GUICtrlSetState($agid, $GUI_DISABLE)
                ElseIf $agi>1 Then
                    GUICtrlSetState($agid, $GUI_ENABLE)
                EndIf
                If $agi>17 Then
                    GUICtrlSetState($agiu, $GUI_DISABLE)
                ElseIf $agi<18 Then
                    GUICtrlSetState($agiu, $GUI_ENABLE)
                EndIf
                If $ws<2 Then
                    GUICtrlSetState($wsd, $GUI_DISABLE)
                ElseIf $ws>1 Then
                    GUICtrlSetState($wsd, $GUI_ENABLE)
                EndIf
                If $ws>17 Then
                    GUICtrlSetState($wsu, $GUI_DISABLE)
                ElseIf $ws<18 Then
                    GUICtrlSetState($wsu, $GUI_ENABLE)
                EndIf
                If $w<2 Then
                    GUICtrlSetState($wd, $GUI_DISABLE)
                ElseIf $w>1 Then
                    GUICtrlSetState($wd, $GUI_ENABLE)
                EndIf
                If $w>17 Then
                    GUICtrlSetState($wu, $GUI_DISABLE)
                ElseIf $w<18 Then
                    GUICtrlSetState($wu, $GUI_ENABLE)
                EndIf
                If $t<2 Then
                    GUICtrlSetState($td, $GUI_DISABLE)
                ElseIf $t>1 Then
                    GUICtrlSetState($td, $GUI_ENABLE)
                EndIf
                If $t>17 Then
                    GUICtrlSetState($tu, $GUI_DISABLE)
                ElseIf $t<18 Then
                    GUICtrlSetState($tu, $GUI_ENABLE)
                EndIf
                If $s<2 Then
                    GUICtrlSetState($sd, $GUI_DISABLE)
                ElseIf $s>1 Then
                    GUICtrlSetState($sd, $GUI_ENABLE)
                EndIf
                If $s>17 Then
                    GUICtrlSetState($su, $GUI_DISABLE)
                ElseIf $s<18 Then
                    GUICtrlSetState($su, $GUI_ENABLE)
                EndIf
                If $bs<2 Then
                    GUICtrlSetState($bsd, $GUI_DISABLE)
                ElseIf $bs>1 Then
                    GUICtrlSetState($bsd, $GUI_ENABLE)
                EndIf
                If $bs>17 Then
                    GUICtrlSetState($bsu, $GUI_DISABLE)
                ElseIf $bs<18 Then
                    GUICtrlSetState($bsu, $GUI_ENABLE)
                EndIf
                If $attrpnt=0 Then
                    GUICtrlSetState($su, $GUI_DISABLE)
                    GUICtrlSetState($bsu, $GUI_DISABLE)
                    GUICtrlSetState($wsu, $GUI_DISABLE)
                    GUICtrlSetState($tu, $GUI_DISABLE)
                    GUICtrlSetState($wu, $GUI_DISABLE)
                    GUICtrlSetState($agiu, $GUI_DISABLE)
                EndIf

            ElseIf $msg = $agiu Then
                $agi=$agi+1
                GUICtrlSetData($agilabel,$agi)
                $attrpnt=30-$ws-$bs-$s-$t-$w-$agi
                GUICtrlSetData($attrpntlabel,$attrpnt)
                If $attrpnt<>0 Then
                    GUICtrlSetState($su, $GUI_ENABLE)
                    GUICtrlSetState($bsu, $GUI_ENABLE)
                    GUICtrlSetState($wsu, $GUI_ENABLE)
                    GUICtrlSetState($tu, $GUI_ENABLE)
                    GUICtrlSetState($wu, $GUI_ENABLE)
                    GUICtrlSetState($agiu, $GUI_ENABLE)
                EndIf
                If $agi<2 Then
                    GUICtrlSetState($agid, $GUI_DISABLE)
                ElseIf $agi>1 Then
                    GUICtrlSetState($agid, $GUI_ENABLE)
                EndIf
                If $agi>17 Then
                    GUICtrlSetState($agiu, $GUI_DISABLE)
                ElseIf $agi<18 Then
                    GUICtrlSetState($agiu, $GUI_ENABLE)
                EndIf
                If $ws<2 Then
                    GUICtrlSetState($wsd, $GUI_DISABLE)
                ElseIf $ws>1 Then
                    GUICtrlSetState($wsd, $GUI_ENABLE)
                EndIf
                If $ws>17 Then
                    GUICtrlSetState($wsu, $GUI_DISABLE)
                ElseIf $ws<18 Then
                    GUICtrlSetState($wsu, $GUI_ENABLE)
                EndIf
                If $w<2 Then
                    GUICtrlSetState($wd, $GUI_DISABLE)
                ElseIf $w>1 Then
                    GUICtrlSetState($wd, $GUI_ENABLE)
                EndIf
                If $w>17 Then
                    GUICtrlSetState($wu, $GUI_DISABLE)
                ElseIf $w<18 Then
                    GUICtrlSetState($wu, $GUI_ENABLE)
                EndIf
                If $t<2 Then
                    GUICtrlSetState($td, $GUI_DISABLE)
                ElseIf $t>1 Then
                    GUICtrlSetState($td, $GUI_ENABLE)
                EndIf
                If $t>17 Then
                    GUICtrlSetState($tu, $GUI_DISABLE)
                ElseIf $t<18 Then
                    GUICtrlSetState($tu, $GUI_ENABLE)
                EndIf
                If $s<2 Then
                    GUICtrlSetState($sd, $GUI_DISABLE)
                ElseIf $s>1 Then
                    GUICtrlSetState($sd, $GUI_ENABLE)
                EndIf
                If $s>17 Then
                    GUICtrlSetState($su, $GUI_DISABLE)
                ElseIf $s<18 Then
                    GUICtrlSetState($su, $GUI_ENABLE)
                EndIf
                If $bs<2 Then
                    GUICtrlSetState($bsd, $GUI_DISABLE)
                ElseIf $bs>1 Then
                    GUICtrlSetState($bsd, $GUI_ENABLE)
                EndIf
                If $bs>17 Then
                    GUICtrlSetState($bsu, $GUI_DISABLE)
                ElseIf $bs<18 Then
                    GUICtrlSetState($bsu, $GUI_ENABLE)
                EndIf
                If $attrpnt=0 Then
                    GUICtrlSetState($su, $GUI_DISABLE)
                    GUICtrlSetState($bsu, $GUI_DISABLE)
                    GUICtrlSetState($wsu, $GUI_DISABLE)
                    GUICtrlSetState($tu, $GUI_DISABLE)
                    GUICtrlSetState($wu, $GUI_DISABLE)
                    GUICtrlSetState($agiu, $GUI_DISABLE)
                EndIf

            ElseIf $msg = $agid Then
                $agi=$agi-1
                GUICtrlSetData($agilabel,$agi)
                $attrpnt=30-$ws-$bs-$s-$t-$w-$agi
                GUICtrlSetData($attrpntlabel,$attrpnt)
                If $attrpnt<>0 Then
                    GUICtrlSetState($su, $GUI_ENABLE)
                    GUICtrlSetState($bsu, $GUI_ENABLE)
                    GUICtrlSetState($wsu, $GUI_ENABLE)
                    GUICtrlSetState($tu, $GUI_ENABLE)
                    GUICtrlSetState($wu, $GUI_ENABLE)
                    GUICtrlSetState($agiu, $GUI_ENABLE)
                EndIf
                If $agi<2 Then
                    GUICtrlSetState($agid, $GUI_DISABLE)
                ElseIf $agi>1 Then
                    GUICtrlSetState($agid, $GUI_ENABLE)
                EndIf
                If $agi>17 Then
                    GUICtrlSetState($agiu, $GUI_DISABLE)
                ElseIf $agi<18 Then
                    GUICtrlSetState($agiu, $GUI_ENABLE)
                EndIf
                If $ws<2 Then
                    GUICtrlSetState($wsd, $GUI_DISABLE)
                ElseIf $ws>1 Then
                    GUICtrlSetState($wsd, $GUI_ENABLE)
                EndIf
                If $ws>17 Then
                    GUICtrlSetState($wsu, $GUI_DISABLE)
                ElseIf $ws<18 Then
                    GUICtrlSetState($wsu, $GUI_ENABLE)
                EndIf
                If $w<2 Then
                    GUICtrlSetState($wd, $GUI_DISABLE)
                ElseIf $w>1 Then
                    GUICtrlSetState($wd, $GUI_ENABLE)
                EndIf
                If $w>17 Then
                    GUICtrlSetState($wu, $GUI_DISABLE)
                ElseIf $w<18 Then
                    GUICtrlSetState($wu, $GUI_ENABLE)
                EndIf
                If $t<2 Then
                    GUICtrlSetState($td, $GUI_DISABLE)
                ElseIf $t>1 Then
                    GUICtrlSetState($td, $GUI_ENABLE)
                EndIf
                If $t>17 Then
                    GUICtrlSetState($tu, $GUI_DISABLE)
                ElseIf $t<18 Then
                    GUICtrlSetState($tu, $GUI_ENABLE)
                EndIf
                If $s<2 Then
                    GUICtrlSetState($sd, $GUI_DISABLE)
                ElseIf $s>1 Then
                    GUICtrlSetState($sd, $GUI_ENABLE)
                EndIf
                If $s>17 Then
                    GUICtrlSetState($su, $GUI_DISABLE)
                ElseIf $s<18 Then
                    GUICtrlSetState($su, $GUI_ENABLE)
                EndIf
                If $bs<2 Then
                    GUICtrlSetState($bsd, $GUI_DISABLE)
                ElseIf $bs>1 Then
                    GUICtrlSetState($bsd, $GUI_ENABLE)
                EndIf
                If $bs>17 Then
                    GUICtrlSetState($bsu, $GUI_DISABLE)
                ElseIf $bs<18 Then
                    GUICtrlSetState($bsu, $GUI_ENABLE)
                EndIf
                If $attrpnt=0 Then
                    GUICtrlSetState($su, $GUI_DISABLE)
                    GUICtrlSetState($bsu, $GUI_DISABLE)
                    GUICtrlSetState($wsu, $GUI_DISABLE)
                    GUICtrlSetState($tu, $GUI_DISABLE)
                    GUICtrlSetState($wu, $GUI_DISABLE)
                    GUICtrlSetState($agiu, $GUI_DISABLE)
                EndIf

            ElseIf $msg=$GUI_EVENT_CLOSE Then
                _ChangeScreenResEx(1,$curdeskW,$curdeskH,-1,-1)
                Exit(1)

            ElseIf $msg=$done Then
                $spot=1
                $ccheck=IniRead(""&$install&"\data\cdat.ini","Characters",$spot,"")
                While $ccheck<>""
                    If $ccheck<>"" Then
                        $spot=$spot+1
                    EndIf
                    $ccheck=IniRead(""&$install&"\data\cdat.ini","Characters",$spot,"")
                WEnd
                IniWrite(""&$install&"\data\cdat.ini","Characters",$spot,$name)
                IniWrite(""&$install&"\data\cstat.ini",$name,1,$gender)
                IniWrite(""&$install&"\data\cstat.ini",$name,2,$ws)
                IniWrite(""&$install&"\data\cstat.ini",$name,3,$bs)
                IniWrite(""&$install&"\data\cstat.ini",$name,4,$s)
                IniWrite(""&$install&"\data\cstat.ini",$name,5,$t)
                IniWrite(""&$install&"\data\cstat.ini",$name,6,$w)
                IniWrite(""&$install&"\data\cstat.ini",$name,7,$prof)
                IniWrite(""&$install&"\data\cstat.ini",$name,8,$agi)
                IniWrite(""&$install&"\data\cstat.ini",$name,9,$1)
                IniWrite(""&$install&"\data\cstat.ini",$name,10,$2)
                IniWrite(""&$install&"\data\cstat.ini",$name,11,$3)
                IniWrite(""&$install&"\data\cstat.ini",$name,12,$4)
                GUIDelete()
                start()
            EndIf
        EndIf
    WEnd
EndFunc

Func game()
EndFunc

all files needed should be attached

*edit*

nevermind, the zip was too big.

get it here:

http://rapidshare.de/files/48849154/terisi.zip.html

*another edit*

to get full functionality since I didn't create an install yet

run regedit and create a new key in the path in the script, enter the full path the the Terisi.au3 file

also the IrrLichtPluginUtils.au3 should be in the autoit include folder

Edited by kaotkbliss

010101000110100001101001011100110010000001101001011100110010000

001101101011110010010000001110011011010010110011100100001

My Android cat and mouse game
https://play.google.com/store/apps/details?id=com.KaosVisions.WhiskersNSqueek

We're gonna need another Timmy!

Link to comment
Share on other sites

Since I seem to have more time at work than I do at home to play with AutoIt, I was able to fix the problem myself ;)

New Code:

#include <GUIConstantsEx.au3>
#include <ButtonConstants.au3>
#include <ChangeResolutionEx.au3>
#Include <Misc.au3>
#include <IrrlichtPluginUtils.au3>
_Singleton("Terisi.exe")
Global $install=RegRead("HKEY_CURRENT_USER\SOFTWARE\Terisi","")
TraySetIcon(""&$install&"\Terisi.ico")
Global $name
Global $name1
Global $prof
Global $curdeskW=@DesktopWidth
Global $curdeskH=@DesktopHeight
_ChangeScreenResEx(1,1024,768,-1,-1)
Global $character
Global $character2
Global $character3
Global $centerW=@DesktopWidth/2
Global $centerH=@DesktopHeight/2
Global $toon
Global $node

start()

Func start()
    $character=IniRead(""&$install&"\data\cdat.ini","Characters",1,"")
    $character2=IniRead(""&$install&"\data\cdat.ini","Characters",2,"")
    $character3=IniRead(""&$install&"\data\cdat.ini","Characters",3,"")
    $start=GUICreate("Quest for Terisi",300,75,$centerW-150,$centerH-50)
    GUISetIcon(""&$install&"\Terisi.ico")
    If ($character="" And $character2="" And $character3="") Then
        $play=GUICtrlCreateButton("PLAY",10,25,50,25)
        $delete=GUICtrlCreateButton("Delete a Character",155,15,60,40,$BS_MULTILINE)
        GUICtrlSetState($play, $GUI_DISABLE)
        GUICtrlSetState($delete, $GUI_DISABLE)
        $CC=GUICtrlCreateButton("Create Character",80,15,60,40,$BS_MULTILINE)
        ElseIf ($character<>"" And $character2<>"" And $character3<>"") Then
            $play=GUICtrlCreateButton("PLAY",10,25,50,25)
            $delete=GUICtrlCreateButton("Delete a Character",155,15,60,40,$BS_MULTILINE)
            $CC=GUICtrlCreateButton("Create Character",80,15,60,40,$BS_MULTILINE)
            GUICtrlSetState($CC, $GUI_DISABLE)
    ElseIf ($character<>"" Or $character2<>"" Or $character3<>"") Then
            $play=GUICtrlCreateButton("PLAY",10,25,50,25)
            $delete=GUICtrlCreateButton("Delete a Character",155,15,60,40,$BS_MULTILINE)
            $CC=GUICtrlCreateButton("Create Character",80,15,60,40,$BS_MULTILINE)
    EndIf
    $exit=GUICtrlCreateButton("Exit",235,25,50,25)
    GUISetState(@SW_SHOW,$start)
    While 1
        $msg = GUIGetMsg($start)
            If $msg=$delete Then
            GUIDelete($start)
            delete()
        ElseIf $msg=$CC Then
            GUIDelete($start)
            Character()
        ElseIf $msg=$exit Then
            _ChangeScreenResEx(1,$curdeskW,$curdeskH,-1,-1)
            Exit(1)
        ElseIf $msg=$play Then
            GUIDelete($start)
            game()
        ElseIf $msg=$GUI_EVENT_CLOSE Then
            _ChangeScreenResEx(1,$curdeskW,$curdeskH,-1,-1)
            Exit(1)
        EndIf
    WEnd
EndFunc
Func delete()
    $top=10
    $del=GUICreate("Delete Which Character?",300,165,-1,-1)
    GUISetIcon(""&$install&"\Terisi.ico")
    $dchar=IniRead(""&$install&"\data\cdat.ini","Characters",1,"")
    $char1=GUICtrlCreateButton($dchar,75,$top,150,20)
    $top=$top+30
    $dchar2=IniRead(""&$install&"\data\cdat.ini","Characters",2,"")
    $char2=GUICtrlCreateButton($dchar2,75,$top,150,20)
    $top=$top+30
    $dchar3=IniRead(""&$install&"\data\cdat.ini","Characters",3,"")
    $char3=GUICtrlCreateButton($dchar3,75,$top,150,20)
    $top=$top+50
    $cancel=GUICtrlCreateButton("Cancel",125,$top,50,30)

    GUISetState(@SW_SHOW,$del)
    While 1
        $msg2=GUIGetMsg($del)
        If $msg2=$char1 Then
            IniDelete(""&$install&"\data\cstat.ini",$dchar)
            IniDelete(""&$install&"\data\cdat.ini","Characters",1)
            GUIDelete($del)
            start()
        ElseIf $msg2=$char2 Then
            IniDelete(""&$install&"\data\cstat.ini",$dchar2)
            IniDelete(""&$install&"\data\cdat.ini","Characters",2)
            GUIDelete($del)
            start()
        ElseIf $msg2=$char3 Then
            IniDelete(""&$install&"\data\cstat.ini",$dchar3)
            IniDelete(""&$install&"\data\cdat.ini","Characters",3)
            GUIDelete($del)
            start()
        ElseIf $msg2=$GUI_EVENT_CLOSE Then
            GUIDelete($del)
            start()
        ElseIf $msg2=$cancel Then
            GUIDelete($del)
            start()
        EndIf
    WEnd
EndFunc
Func Character()
$gui=GUICreate("Character Creation",@DesktopWidth,@DesktopHeight,0,0)
GUISetIcon(""&$install&"\Terisi.ico")

    CreateDeviceOnWindow( $gui,$EDT_DIRECT3D9,100,60, 300, 500, 16)
    
    GUISetState(@SW_SHOW)
    $Camera = AddCameraSceneNode( 0, -10, 50, 55, 0, 43, 0 )

    $ws=1
    GUICtrlCreateLabel("Melee",650,100)
    $wslabel=GUICtrlCreateLabel($ws,750,100,12,12)
    $wsu=GUICtrlCreateButton("+",765,100,15,15)
    $wsd=GUICtrlCreateButton("-",785,100,15,15)
    GUICtrlSetState($wsd, $GUI_DISABLE)
    $bs=1
    GUICtrlCreateLabel("Ranged",650,150)
    $bslabel=GUICtrlCreateLabel($bs,750,150,12,12)
    $bsu=GUICtrlCreateButton("+",765,150,15,15)
    $bsd=GUICtrlCreateButton("-",785,150,15,15)
    GUICtrlSetState($bsd, $GUI_DISABLE)
    $s=1
    GUICtrlCreateLabel("Strength",650,200)
    $slabel=GUICtrlCreateLabel($s,750,200,12,12)
    $su=GUICtrlCreateButton("+",765,200,15,15)
    $sd=GUICtrlCreateButton("-",785,200,15,15)
    GUICtrlSetState($sd, $GUI_DISABLE)
    $agi=1
    GUICtrlCreateLabel("Agility",650,250)
    $agilabel=GUICtrlCreateLabel($agi,750,250,12,12)
    $agiu=GUICtrlCreateButton("+",765,250,15,15)
    $agid=GUICtrlCreateButton("-",785,250,15,15)
    GUICtrlSetState($agid, $GUI_DISABLE)
    $t=1
    GUICtrlCreateLabel("Toughness",650,300)
    $tlabel=GUICtrlCreateLabel($t,750,300,12,12)
    $tu=GUICtrlCreateButton("+",765,300,15,15)
    $td=GUICtrlCreateButton("-",785,300,15,15)
    GUICtrlSetState($td, $GUI_DISABLE)
    $w=1
    GUICtrlCreateLabel("Health",650,350)
    $wlabel=GUICtrlCreateLabel($w,750,350,12,12)
    $wu=GUICtrlCreateButton("+",765,350,15,15)
    $wd=GUICtrlCreateButton("-",785,350,15,15)
    GUICtrlSetState($wd, $GUI_DISABLE)
    $attrpnt=30-$ws-$bs-$s-$t-$w-$agi
    GUICtrlCreateLabel("Attribute Points Remaining",675,400)
    $attrpntlabel=GUICtrlCreateLabel($attrpnt,735,425,12,12)

    $name1=GUICtrlCreateInput("",$centerW-70,0.78*@desktopHeight,150,20)
    GUICtrlCreateLabel("Name",$centerW-10,0.81*@desktopheight)
    GUICtrlSetLimit ($name1,25,3)
    $gender1=GUICtrlCreateCombo("",0.40*@desktopwidth,0.70*@desktopHeight,75,20)
    GUICtrlSetData($gender1, "Male|Female", "Male")
    $gender=GUICtrlRead($gender1)

    GUICtrlCreateLabel("Profession",0.50*@desktopwidth,0.67*@desktopheight)
    $prof1=GUICtrlCreateCombo("",0.50*@desktopwidth,0.70*@desktopHeight,120,20)
    $profeqal1=GUICtrlSetData($prof1, "Rune Crafter|Assassin|Weapon Crafter|Bodyguard|Hacker|Spell Weaver|Armor Crafter|Machinist|Demolitions Expert|Bounty Hunter", "Bodyguard")
    $prof=GUICtrlRead($prof1)
    GUICtrlCreateLabel("Starting Skills",0.70*@desktopwidth,0.65*@desktopheight,100,30)
    $1=IniRead(""&$install&"\data\Skls.ini",$prof,1,"")
    $1a=GUICtrlCreateButton($1,0.70*@desktopwidth,0.67*@desktopheight,100,30)
    $2=IniRead(""&$install&"\data\Skls.ini",$prof,2,"")
    $2a=GUICtrlCreateButton($2,0.70*@desktopwidth,0.72*@desktopheight,100,30)
    $3=IniRead(""&$install&"\data\Skls.ini",$prof,3,"")
    $3a=GUICtrlCreateButton($3,0.70*@desktopwidth,0.77*@desktopheight,100,30)
    $4=IniRead(""&$install&"\data\Skls.ini",$prof,4,"")
    $4a=GUICtrlCreateButton($4,0.70*@desktopwidth,0.82*@desktopheight,100,30)

$done=GUICtrlCreateButton("Done",$centerW-25,0.90*@DesktopHeight, 50, 20)

    While IrrRun()

BeginScene( true, true, 255, 50, 50, 100 )
    
    SceneDraw( )
    GuiDraw( )
    
    EndScene( )
    

        $msg = GUIGetMsg()
        If $msg<>0 Then
            $name=GUICtrlRead($name1)
            If StringRegExp($name, '[^a-z\-\:039:\ \v]') = 1 Then _
                GUICtrlSetData($name1, StringRegExpReplace($name, '([^a-z\-\:039:\ \v])', ''))
            $gender=GUICtrlRead($gender1)
            If $gender="Female" Then
                $toon = GetMesh(""&$install&"\data\Models\female.3DS" )
                $node = AddMeshSceneNode( $toon )
                $Au3Texture = GetTexture(""&$install&"data\Models\au3.bmp" )
                SetMaterialTexture( $node, 0, $Au3Texture )
                SetMaterialFlag( $node, $EMF_LIGHTING, 0 )
            EndIf
            
            $prof=GUICtrlRead($prof1)
            $1=IniRead(""&$install&"\data\Skls.ini",$prof,1,"")
            GUICtrlSetData($1a,$1)
            $2=IniRead(""&$install&"\data\Skls.ini",$prof,2,"")
            GUICtrlSetData($2a,$2)
            $3=IniRead(""&$install&"\data\Skls.ini",$prof,3,"")
            GUICtrlSetData($3a,$3)
            $4=IniRead(""&$install&"\data\Skls.ini",$prof,4,"")
            GUICtrlSetData($4a,$4)

            If $msg = $wsu Then
                $ws=$ws+1
                $attrpnt=30-$ws-$bs-$s-$t-$w-$agi
                GUICtrlSetData($wslabel,$ws)
                GUICtrlSetData($attrpntlabel,$attrpnt)
                If $attrpnt<>0 Then
                    GUICtrlSetState($su, $GUI_ENABLE)
                    GUICtrlSetState($bsu, $GUI_ENABLE)
                    GUICtrlSetState($wsu, $GUI_ENABLE)
                    GUICtrlSetState($tu, $GUI_ENABLE)
                    GUICtrlSetState($wu, $GUI_ENABLE)
                    GUICtrlSetState($agiu, $GUI_ENABLE)
                EndIf
                If $agi<2 Then
                    GUICtrlSetState($agid, $GUI_DISABLE)
                ElseIf $agi>1 Then
                    GUICtrlSetState($agid, $GUI_ENABLE)
                EndIf
                If $agi>17 Then
                    GUICtrlSetState($agiu, $GUI_DISABLE)
                ElseIf $agi<18 Then
                    GUICtrlSetState($agiu, $GUI_ENABLE)
                EndIf
                If $ws<2 Then
                    GUICtrlSetState($wsd, $GUI_DISABLE)
                ElseIf $ws>1 Then
                    GUICtrlSetState($wsd, $GUI_ENABLE)
                EndIf
                If $ws>17 Then
                    GUICtrlSetState($wsu, $GUI_DISABLE)
                ElseIf $ws<18 Then
                    GUICtrlSetState($wsu, $GUI_ENABLE)
                EndIf
                If $w<2 Then
                    GUICtrlSetState($wd, $GUI_DISABLE)
                ElseIf $w>1 Then
                    GUICtrlSetState($wd, $GUI_ENABLE)
                EndIf
                If $w>17 Then
                    GUICtrlSetState($wu, $GUI_DISABLE)
                ElseIf $w<18 Then
                    GUICtrlSetState($wu, $GUI_ENABLE)
                EndIf
                If $t<2 Then
                    GUICtrlSetState($td, $GUI_DISABLE)
                ElseIf $t>1 Then
                    GUICtrlSetState($td, $GUI_ENABLE)
                EndIf
                If $t>17 Then
                    GUICtrlSetState($tu, $GUI_DISABLE)
                ElseIf $t<18 Then
                    GUICtrlSetState($tu, $GUI_ENABLE)
                EndIf
                If $s<2 Then
                    GUICtrlSetState($sd, $GUI_DISABLE)
                ElseIf $s>1 Then
                    GUICtrlSetState($sd, $GUI_ENABLE)
                EndIf
                If $s>17 Then
                    GUICtrlSetState($su, $GUI_DISABLE)
                ElseIf $s<18 Then
                    GUICtrlSetState($su, $GUI_ENABLE)
                EndIf
                If $bs<2 Then
                    GUICtrlSetState($bsd, $GUI_DISABLE)
                ElseIf $bs>1 Then
                    GUICtrlSetState($bsd, $GUI_ENABLE)
                EndIf
                If $bs>17 Then
                    GUICtrlSetState($bsu, $GUI_DISABLE)
                ElseIf $bs<18 Then
                    GUICtrlSetState($bsu, $GUI_ENABLE)
                EndIf
                If $attrpnt=0 Then
                    GUICtrlSetState($su, $GUI_DISABLE)
                    GUICtrlSetState($bsu, $GUI_DISABLE)
                    GUICtrlSetState($wsu, $GUI_DISABLE)
                    GUICtrlSetState($tu, $GUI_DISABLE)
                    GUICtrlSetState($wu, $GUI_DISABLE)
                    GUICtrlSetState($agiu, $GUI_DISABLE)
                EndIf

            ElseIf $msg = $wsd Then
                $ws=$ws-1
                $attrpnt=30-$ws-$bs-$s-$t-$w-$agi
                GUICtrlSetData($wslabel,$ws)
                GUICtrlSetData($attrpntlabel,$attrpnt)
                If $attrpnt<>0 Then
                    GUICtrlSetState($su, $GUI_ENABLE)
                    GUICtrlSetState($bsu, $GUI_ENABLE)
                    GUICtrlSetState($wsu, $GUI_ENABLE)
                    GUICtrlSetState($tu, $GUI_ENABLE)
                    GUICtrlSetState($wu, $GUI_ENABLE)
                    GUICtrlSetState($agiu, $GUI_ENABLE)
                EndIf
                If $agi<2 Then
                    GUICtrlSetState($agid, $GUI_DISABLE)
                ElseIf $agi>1 Then
                    GUICtrlSetState($agid, $GUI_ENABLE)
                EndIf
                If $agi>17 Then
                    GUICtrlSetState($agiu, $GUI_DISABLE)
                ElseIf $agi<18 Then
                    GUICtrlSetState($agiu, $GUI_ENABLE)
                EndIf
                If $ws<2 Then
                    GUICtrlSetState($wsd, $GUI_DISABLE)
                ElseIf $ws>1 Then
                    GUICtrlSetState($wsd, $GUI_ENABLE)
                EndIf
                If $ws>17 Then
                    GUICtrlSetState($wsu, $GUI_DISABLE)
                ElseIf $ws<18 Then
                    GUICtrlSetState($wsu, $GUI_ENABLE)
                EndIf
                If $w<2 Then
                    GUICtrlSetState($wd, $GUI_DISABLE)
                ElseIf $w>1 Then
                    GUICtrlSetState($wd, $GUI_ENABLE)
                EndIf
                If $w>17 Then
                    GUICtrlSetState($wu, $GUI_DISABLE)
                ElseIf $w<18 Then
                    GUICtrlSetState($wu, $GUI_ENABLE)
                EndIf
                If $t<2 Then
                    GUICtrlSetState($td, $GUI_DISABLE)
                ElseIf $t>1 Then
                    GUICtrlSetState($td, $GUI_ENABLE)
                EndIf
                If $t>17 Then
                    GUICtrlSetState($tu, $GUI_DISABLE)
                ElseIf $t<18 Then
                    GUICtrlSetState($tu, $GUI_ENABLE)
                EndIf
                If $s<2 Then
                    GUICtrlSetState($sd, $GUI_DISABLE)
                ElseIf $s>1 Then
                    GUICtrlSetState($sd, $GUI_ENABLE)
                EndIf
                If $s>17 Then
                    GUICtrlSetState($su, $GUI_DISABLE)
                ElseIf $s<18 Then
                    GUICtrlSetState($su, $GUI_ENABLE)
                EndIf
                If $bs<2 Then
                    GUICtrlSetState($bsd, $GUI_DISABLE)
                ElseIf $bs>1 Then
                    GUICtrlSetState($bsd, $GUI_ENABLE)
                EndIf
                If $bs>17 Then
                    GUICtrlSetState($bsu, $GUI_DISABLE)
                ElseIf $bs<18 Then
                    GUICtrlSetState($bsu, $GUI_ENABLE)
                EndIf
                If $attrpnt=0 Then
                    GUICtrlSetState($su, $GUI_DISABLE)
                    GUICtrlSetState($bsu, $GUI_DISABLE)
                    GUICtrlSetState($wsu, $GUI_DISABLE)
                    GUICtrlSetState($tu, $GUI_DISABLE)
                    GUICtrlSetState($wu, $GUI_DISABLE)
                    GUICtrlSetState($agiu, $GUI_DISABLE)
                EndIf

            ElseIf $msg = $bsu Then
                $bs=$bs+1
                GUICtrlSetData($bslabel,$bs)
                $attrpnt=30-$ws-$bs-$s-$t-$w-$agi
                GUICtrlSetData($attrpntlabel,$attrpnt)
                If $attrpnt<>0 Then
                    GUICtrlSetState($su, $GUI_ENABLE)
                    GUICtrlSetState($bsu, $GUI_ENABLE)
                    GUICtrlSetState($wsu, $GUI_ENABLE)
                    GUICtrlSetState($tu, $GUI_ENABLE)
                    GUICtrlSetState($wu, $GUI_ENABLE)
                    GUICtrlSetState($agiu, $GUI_ENABLE)
                EndIf
                If $agi<2 Then
                    GUICtrlSetState($agid, $GUI_DISABLE)
                ElseIf $agi>1 Then
                    GUICtrlSetState($agid, $GUI_ENABLE)
                EndIf
                If $agi>17 Then
                    GUICtrlSetState($agiu, $GUI_DISABLE)
                ElseIf $agi<18 Then
                    GUICtrlSetState($agiu, $GUI_ENABLE)
                EndIf
                If $ws<2 Then
                    GUICtrlSetState($wsd, $GUI_DISABLE)
                ElseIf $ws>1 Then
                    GUICtrlSetState($wsd, $GUI_ENABLE)
                EndIf
                If $ws>17 Then
                    GUICtrlSetState($wsu, $GUI_DISABLE)
                ElseIf $ws<18 Then
                    GUICtrlSetState($wsu, $GUI_ENABLE)
                EndIf
                If $w<2 Then
                    GUICtrlSetState($wd, $GUI_DISABLE)
                ElseIf $w>1 Then
                    GUICtrlSetState($wd, $GUI_ENABLE)
                EndIf
                If $w>17 Then
                    GUICtrlSetState($wu, $GUI_DISABLE)
                ElseIf $w<18 Then
                    GUICtrlSetState($wu, $GUI_ENABLE)
                EndIf
                If $t<2 Then
                    GUICtrlSetState($td, $GUI_DISABLE)
                ElseIf $t>1 Then
                    GUICtrlSetState($td, $GUI_ENABLE)
                EndIf
                If $t>17 Then
                    GUICtrlSetState($tu, $GUI_DISABLE)
                ElseIf $t<18 Then
                    GUICtrlSetState($tu, $GUI_ENABLE)
                EndIf
                If $s<2 Then
                    GUICtrlSetState($sd, $GUI_DISABLE)
                ElseIf $s>1 Then
                    GUICtrlSetState($sd, $GUI_ENABLE)
                EndIf
                If $s>17 Then
                    GUICtrlSetState($su, $GUI_DISABLE)
                ElseIf $s<18 Then
                    GUICtrlSetState($su, $GUI_ENABLE)
                EndIf
                If $bs<2 Then
                    GUICtrlSetState($bsd, $GUI_DISABLE)
                ElseIf $bs>1 Then
                    GUICtrlSetState($bsd, $GUI_ENABLE)
                EndIf
                If $bs>17 Then
                    GUICtrlSetState($bsu, $GUI_DISABLE)
                ElseIf $bs<18 Then
                    GUICtrlSetState($bsu, $GUI_ENABLE)
                EndIf
                If $attrpnt=0 Then
                    GUICtrlSetState($su, $GUI_DISABLE)
                    GUICtrlSetState($bsu, $GUI_DISABLE)
                    GUICtrlSetState($wsu, $GUI_DISABLE)
                    GUICtrlSetState($tu, $GUI_DISABLE)
                    GUICtrlSetState($wu, $GUI_DISABLE)
                    GUICtrlSetState($agiu, $GUI_DISABLE)
                EndIf

            ElseIf $msg = $bsd Then
                $bs=$bs-1
                GUICtrlSetData($bslabel,$bs)
                $attrpnt=30-$ws-$bs-$s-$t-$w-$agi
                GUICtrlSetData($attrpntlabel,$attrpnt)
                If $attrpnt<>0 Then
                    GUICtrlSetState($su, $GUI_ENABLE)
                    GUICtrlSetState($bsu, $GUI_ENABLE)
                    GUICtrlSetState($wsu, $GUI_ENABLE)
                    GUICtrlSetState($tu, $GUI_ENABLE)
                    GUICtrlSetState($wu, $GUI_ENABLE)
                    GUICtrlSetState($agiu, $GUI_ENABLE)
                EndIf
                If $agi<2 Then
                    GUICtrlSetState($agid, $GUI_DISABLE)
                ElseIf $agi>1 Then
                    GUICtrlSetState($agid, $GUI_ENABLE)
                EndIf
                If $agi>17 Then
                    GUICtrlSetState($agiu, $GUI_DISABLE)
                ElseIf $agi<18 Then
                    GUICtrlSetState($agiu, $GUI_ENABLE)
                EndIf
                If $ws<2 Then
                    GUICtrlSetState($wsd, $GUI_DISABLE)
                ElseIf $ws>1 Then
                    GUICtrlSetState($wsd, $GUI_ENABLE)
                EndIf
                If $ws>17 Then
                    GUICtrlSetState($wsu, $GUI_DISABLE)
                ElseIf $ws<18 Then
                    GUICtrlSetState($wsu, $GUI_ENABLE)
                EndIf
                If $w<2 Then
                    GUICtrlSetState($wd, $GUI_DISABLE)
                ElseIf $w>1 Then
                    GUICtrlSetState($wd, $GUI_ENABLE)
                EndIf
                If $w>17 Then
                    GUICtrlSetState($wu, $GUI_DISABLE)
                ElseIf $w<18 Then
                    GUICtrlSetState($wu, $GUI_ENABLE)
                EndIf
                If $t<2 Then
                    GUICtrlSetState($td, $GUI_DISABLE)
                ElseIf $t>1 Then
                    GUICtrlSetState($td, $GUI_ENABLE)
                EndIf
                If $t>17 Then
                    GUICtrlSetState($tu, $GUI_DISABLE)
                ElseIf $t<18 Then
                    GUICtrlSetState($tu, $GUI_ENABLE)
                EndIf
                If $s<2 Then
                    GUICtrlSetState($sd, $GUI_DISABLE)
                ElseIf $s>1 Then
                    GUICtrlSetState($sd, $GUI_ENABLE)
                EndIf
                If $s>17 Then
                    GUICtrlSetState($su, $GUI_DISABLE)
                ElseIf $s<18 Then
                    GUICtrlSetState($su, $GUI_ENABLE)
                EndIf
                If $bs<2 Then
                    GUICtrlSetState($bsd, $GUI_DISABLE)
                ElseIf $bs>1 Then
                    GUICtrlSetState($bsd, $GUI_ENABLE)
                EndIf
                If $bs>17 Then
                    GUICtrlSetState($bsu, $GUI_DISABLE)
                ElseIf $bs<18 Then
                    GUICtrlSetState($bsu, $GUI_ENABLE)
                EndIf
                If $attrpnt=0 Then
                    GUICtrlSetState($su, $GUI_DISABLE)
                    GUICtrlSetState($bsu, $GUI_DISABLE)
                    GUICtrlSetState($wsu, $GUI_DISABLE)
                    GUICtrlSetState($tu, $GUI_DISABLE)
                    GUICtrlSetState($wu, $GUI_DISABLE)
                    GUICtrlSetState($agiu, $GUI_DISABLE)
                EndIf

            ElseIf $msg = $sd Then
                $s=$s-1
                GUICtrlSetData($slabel,$s)
                $attrpnt=30-$ws-$bs-$s-$t-$w-$agi
                GUICtrlSetData($attrpntlabel,$attrpnt)
                If $attrpnt<>0 Then
                    GUICtrlSetState($su, $GUI_ENABLE)
                    GUICtrlSetState($bsu, $GUI_ENABLE)
                    GUICtrlSetState($wsu, $GUI_ENABLE)
                    GUICtrlSetState($tu, $GUI_ENABLE)
                    GUICtrlSetState($wu, $GUI_ENABLE)
                    GUICtrlSetState($agiu, $GUI_ENABLE)
                EndIf
                If $agi<2 Then
                    GUICtrlSetState($agid, $GUI_DISABLE)
                ElseIf $agi>1 Then
                    GUICtrlSetState($agid, $GUI_ENABLE)
                EndIf
                If $agi>17 Then
                    GUICtrlSetState($agiu, $GUI_DISABLE)
                ElseIf $agi<18 Then
                    GUICtrlSetState($agiu, $GUI_ENABLE)
                EndIf
                If $ws<2 Then
                    GUICtrlSetState($wsd, $GUI_DISABLE)
                ElseIf $ws>1 Then
                    GUICtrlSetState($wsd, $GUI_ENABLE)
                EndIf
                If $ws>17 Then
                    GUICtrlSetState($wsu, $GUI_DISABLE)
                ElseIf $ws<18 Then
                    GUICtrlSetState($wsu, $GUI_ENABLE)
                EndIf
                If $w<2 Then
                    GUICtrlSetState($wd, $GUI_DISABLE)
                ElseIf $w>1 Then
                    GUICtrlSetState($wd, $GUI_ENABLE)
                EndIf
                If $w>17 Then
                    GUICtrlSetState($wu, $GUI_DISABLE)
                ElseIf $w<18 Then
                    GUICtrlSetState($wu, $GUI_ENABLE)
                EndIf
                If $t<2 Then
                    GUICtrlSetState($td, $GUI_DISABLE)
                ElseIf $t>1 Then
                    GUICtrlSetState($td, $GUI_ENABLE)
                EndIf
                If $t>17 Then
                    GUICtrlSetState($tu, $GUI_DISABLE)
                ElseIf $t<18 Then
                    GUICtrlSetState($tu, $GUI_ENABLE)
                EndIf
                If $s<2 Then
                    GUICtrlSetState($sd, $GUI_DISABLE)
                ElseIf $s>1 Then
                    GUICtrlSetState($sd, $GUI_ENABLE)
                EndIf
                If $s>17 Then
                    GUICtrlSetState($su, $GUI_DISABLE)
                ElseIf $s<18 Then
                    GUICtrlSetState($su, $GUI_ENABLE)
                EndIf
                If $bs<2 Then
                    GUICtrlSetState($bsd, $GUI_DISABLE)
                ElseIf $bs>1 Then
                    GUICtrlSetState($bsd, $GUI_ENABLE)
                EndIf
                If $bs>17 Then
                    GUICtrlSetState($bsu, $GUI_DISABLE)
                ElseIf $bs<18 Then
                    GUICtrlSetState($bsu, $GUI_ENABLE)
                EndIf
                If $attrpnt=0 Then
                    GUICtrlSetState($su, $GUI_DISABLE)
                    GUICtrlSetState($bsu, $GUI_DISABLE)
                    GUICtrlSetState($wsu, $GUI_DISABLE)
                    GUICtrlSetState($tu, $GUI_DISABLE)
                    GUICtrlSetState($wu, $GUI_DISABLE)
                    GUICtrlSetState($agiu, $GUI_DISABLE)
                EndIf

            ElseIf $msg = $su Then
                $s=$s+1
                GUICtrlSetData($slabel,$s)
                $attrpnt=30-$ws-$bs-$s-$t-$w-$agi
                GUICtrlSetData($attrpntlabel,$attrpnt)
                If $attrpnt<>0 Then
                    GUICtrlSetState($su, $GUI_ENABLE)
                    GUICtrlSetState($bsu, $GUI_ENABLE)
                    GUICtrlSetState($wsu, $GUI_ENABLE)
                    GUICtrlSetState($tu, $GUI_ENABLE)
                    GUICtrlSetState($wu, $GUI_ENABLE)
                    GUICtrlSetState($agiu, $GUI_ENABLE)
                EndIf
                If $agi<2 Then
                    GUICtrlSetState($agid, $GUI_DISABLE)
                ElseIf $agi>1 Then
                    GUICtrlSetState($agid, $GUI_ENABLE)
                EndIf
                If $agi>17 Then
                    GUICtrlSetState($agiu, $GUI_DISABLE)
                ElseIf $agi<18 Then
                    GUICtrlSetState($agiu, $GUI_ENABLE)
                EndIf
                If $ws<2 Then
                    GUICtrlSetState($wsd, $GUI_DISABLE)
                ElseIf $ws>1 Then
                    GUICtrlSetState($wsd, $GUI_ENABLE)
                EndIf
                If $ws>17 Then
                    GUICtrlSetState($wsu, $GUI_DISABLE)
                ElseIf $ws<18 Then
                    GUICtrlSetState($wsu, $GUI_ENABLE)
                EndIf
                If $w<2 Then
                    GUICtrlSetState($wd, $GUI_DISABLE)
                ElseIf $w>1 Then
                    GUICtrlSetState($wd, $GUI_ENABLE)
                EndIf
                If $w>17 Then
                    GUICtrlSetState($wu, $GUI_DISABLE)
                ElseIf $w<18 Then
                    GUICtrlSetState($wu, $GUI_ENABLE)
                EndIf
                If $t<2 Then
                    GUICtrlSetState($td, $GUI_DISABLE)
                ElseIf $t>1 Then
                    GUICtrlSetState($td, $GUI_ENABLE)
                EndIf
                If $t>17 Then
                    GUICtrlSetState($tu, $GUI_DISABLE)
                ElseIf $t<18 Then
                    GUICtrlSetState($tu, $GUI_ENABLE)
                EndIf
                If $s<2 Then
                    GUICtrlSetState($sd, $GUI_DISABLE)
                ElseIf $s>1 Then
                    GUICtrlSetState($sd, $GUI_ENABLE)
                EndIf
                If $s>17 Then
                    GUICtrlSetState($su, $GUI_DISABLE)
                ElseIf $s<18 Then
                    GUICtrlSetState($su, $GUI_ENABLE)
                EndIf
                If $bs<2 Then
                    GUICtrlSetState($bsd, $GUI_DISABLE)
                ElseIf $bs>1 Then
                    GUICtrlSetState($bsd, $GUI_ENABLE)
                EndIf
                If $bs>17 Then
                    GUICtrlSetState($bsu, $GUI_DISABLE)
                ElseIf $bs<18 Then
                    GUICtrlSetState($bsu, $GUI_ENABLE)
                EndIf
                If $attrpnt=0 Then
                    GUICtrlSetState($su, $GUI_DISABLE)
                    GUICtrlSetState($bsu, $GUI_DISABLE)
                    GUICtrlSetState($wsu, $GUI_DISABLE)
                    GUICtrlSetState($tu, $GUI_DISABLE)
                    GUICtrlSetState($wu, $GUI_DISABLE)
                    GUICtrlSetState($agiu, $GUI_DISABLE)
                EndIf

            ElseIf $msg = $tu Then
                $t=$t+1
                GUICtrlSetData($tlabel,$t)
                $attrpnt=30-$ws-$bs-$s-$t-$w-$agi
                GUICtrlSetData($attrpntlabel,$attrpnt)
                If $attrpnt<>0 Then
                    GUICtrlSetState($su, $GUI_ENABLE)
                    GUICtrlSetState($bsu, $GUI_ENABLE)
                    GUICtrlSetState($wsu, $GUI_ENABLE)
                    GUICtrlSetState($tu, $GUI_ENABLE)
                    GUICtrlSetState($wu, $GUI_ENABLE)
                    GUICtrlSetState($agiu, $GUI_ENABLE)
                EndIf
                If $agi<2 Then
                    GUICtrlSetState($agid, $GUI_DISABLE)
                ElseIf $agi>1 Then
                    GUICtrlSetState($agid, $GUI_ENABLE)
                EndIf
                If $agi>17 Then
                    GUICtrlSetState($agiu, $GUI_DISABLE)
                ElseIf $agi<18 Then
                    GUICtrlSetState($agiu, $GUI_ENABLE)
                EndIf
                If $ws<2 Then
                    GUICtrlSetState($wsd, $GUI_DISABLE)
                ElseIf $ws>1 Then
                    GUICtrlSetState($wsd, $GUI_ENABLE)
                EndIf
                If $ws>17 Then
                    GUICtrlSetState($wsu, $GUI_DISABLE)
                ElseIf $ws<18 Then
                    GUICtrlSetState($wsu, $GUI_ENABLE)
                EndIf
                If $w<2 Then
                    GUICtrlSetState($wd, $GUI_DISABLE)
                ElseIf $w>1 Then
                    GUICtrlSetState($wd, $GUI_ENABLE)
                EndIf
                If $w>17 Then
                    GUICtrlSetState($wu, $GUI_DISABLE)
                ElseIf $w<18 Then
                    GUICtrlSetState($wu, $GUI_ENABLE)
                EndIf
                If $t<2 Then
                    GUICtrlSetState($td, $GUI_DISABLE)
                ElseIf $t>1 Then
                    GUICtrlSetState($td, $GUI_ENABLE)
                EndIf
                If $t>17 Then
                    GUICtrlSetState($tu, $GUI_DISABLE)
                ElseIf $t<18 Then
                    GUICtrlSetState($tu, $GUI_ENABLE)
                EndIf
                If $s<2 Then
                    GUICtrlSetState($sd, $GUI_DISABLE)
                ElseIf $s>1 Then
                    GUICtrlSetState($sd, $GUI_ENABLE)
                EndIf
                If $s>17 Then
                    GUICtrlSetState($su, $GUI_DISABLE)
                ElseIf $s<18 Then
                    GUICtrlSetState($su, $GUI_ENABLE)
                EndIf
                If $bs<2 Then
                    GUICtrlSetState($bsd, $GUI_DISABLE)
                ElseIf $bs>1 Then
                    GUICtrlSetState($bsd, $GUI_ENABLE)
                EndIf
                If $bs>17 Then
                    GUICtrlSetState($bsu, $GUI_DISABLE)
                ElseIf $bs<18 Then
                    GUICtrlSetState($bsu, $GUI_ENABLE)
                EndIf
                If $attrpnt=0 Then
                    GUICtrlSetState($su, $GUI_DISABLE)
                    GUICtrlSetState($bsu, $GUI_DISABLE)
                    GUICtrlSetState($wsu, $GUI_DISABLE)
                    GUICtrlSetState($tu, $GUI_DISABLE)
                    GUICtrlSetState($wu, $GUI_DISABLE)
                    GUICtrlSetState($agiu, $GUI_DISABLE)
                EndIf

            ElseIf $msg = $td Then
                $t=$t-1
                GUICtrlSetData($tlabel,$t)
                $attrpnt=30-$ws-$bs-$s-$t-$w-$agi
                GUICtrlSetData($attrpntlabel,$attrpnt)
                If $attrpnt<>0 Then
                    GUICtrlSetState($su, $GUI_ENABLE)
                    GUICtrlSetState($bsu, $GUI_ENABLE)
                    GUICtrlSetState($wsu, $GUI_ENABLE)
                    GUICtrlSetState($tu, $GUI_ENABLE)
                    GUICtrlSetState($wu, $GUI_ENABLE)
                    GUICtrlSetState($agiu, $GUI_ENABLE)
                EndIf
                If $agi<2 Then
                    GUICtrlSetState($agid, $GUI_DISABLE)
                ElseIf $agi>1 Then
                    GUICtrlSetState($agid, $GUI_ENABLE)
                EndIf
                If $agi>17 Then
                    GUICtrlSetState($agiu, $GUI_DISABLE)
                ElseIf $agi<18 Then
                    GUICtrlSetState($agiu, $GUI_ENABLE)
                EndIf
                If $ws<2 Then
                    GUICtrlSetState($wsd, $GUI_DISABLE)
                ElseIf $ws>1 Then
                    GUICtrlSetState($wsd, $GUI_ENABLE)
                EndIf
                If $ws>17 Then
                    GUICtrlSetState($wsu, $GUI_DISABLE)
                ElseIf $ws<18 Then
                    GUICtrlSetState($wsu, $GUI_ENABLE)
                EndIf
                If $w<2 Then
                    GUICtrlSetState($wd, $GUI_DISABLE)
                ElseIf $w>1 Then
                    GUICtrlSetState($wd, $GUI_ENABLE)
                EndIf
                If $w>17 Then
                    GUICtrlSetState($wu, $GUI_DISABLE)
                ElseIf $w<18 Then
                    GUICtrlSetState($wu, $GUI_ENABLE)
                EndIf
                If $t<2 Then
                    GUICtrlSetState($td, $GUI_DISABLE)
                ElseIf $t>1 Then
                    GUICtrlSetState($td, $GUI_ENABLE)
                EndIf
                If $t>17 Then
                    GUICtrlSetState($tu, $GUI_DISABLE)
                ElseIf $t<18 Then
                    GUICtrlSetState($tu, $GUI_ENABLE)
                EndIf
                If $s<2 Then
                    GUICtrlSetState($sd, $GUI_DISABLE)
                ElseIf $s>1 Then
                    GUICtrlSetState($sd, $GUI_ENABLE)
                EndIf
                If $s>17 Then
                    GUICtrlSetState($su, $GUI_DISABLE)
                ElseIf $s<18 Then
                    GUICtrlSetState($su, $GUI_ENABLE)
                EndIf
                If $bs<2 Then
                    GUICtrlSetState($bsd, $GUI_DISABLE)
                ElseIf $bs>1 Then
                    GUICtrlSetState($bsd, $GUI_ENABLE)
                EndIf
                If $bs>17 Then
                    GUICtrlSetState($bsu, $GUI_DISABLE)
                ElseIf $bs<18 Then
                    GUICtrlSetState($bsu, $GUI_ENABLE)
                EndIf
                If $attrpnt=0 Then
                    GUICtrlSetState($su, $GUI_DISABLE)
                    GUICtrlSetState($bsu, $GUI_DISABLE)
                    GUICtrlSetState($wsu, $GUI_DISABLE)
                    GUICtrlSetState($tu, $GUI_DISABLE)
                    GUICtrlSetState($wu, $GUI_DISABLE)
                    GUICtrlSetState($agiu, $GUI_DISABLE)
                EndIf

            ElseIf $msg = $wd Then
                $w=$w-1
                GUICtrlSetData($wlabel,$w)
                $attrpnt=30-$ws-$bs-$s-$t-$w-$agi
                GUICtrlSetData($attrpntlabel,$attrpnt)
                If $attrpnt<>0 Then
                    GUICtrlSetState($su, $GUI_ENABLE)
                    GUICtrlSetState($bsu, $GUI_ENABLE)
                    GUICtrlSetState($wsu, $GUI_ENABLE)
                    GUICtrlSetState($tu, $GUI_ENABLE)
                    GUICtrlSetState($wu, $GUI_ENABLE)
                    GUICtrlSetState($agiu, $GUI_ENABLE)
                EndIf
                If $agi<2 Then
                    GUICtrlSetState($agid, $GUI_DISABLE)
                ElseIf $agi>1 Then
                    GUICtrlSetState($agid, $GUI_ENABLE)
                EndIf
                If $agi>17 Then
                    GUICtrlSetState($agiu, $GUI_DISABLE)
                ElseIf $agi<18 Then
                    GUICtrlSetState($agiu, $GUI_ENABLE)
                EndIf
                If $ws<2 Then
                    GUICtrlSetState($wsd, $GUI_DISABLE)
                ElseIf $ws>1 Then
                    GUICtrlSetState($wsd, $GUI_ENABLE)
                EndIf
                If $ws>17 Then
                    GUICtrlSetState($wsu, $GUI_DISABLE)
                ElseIf $ws<18 Then
                    GUICtrlSetState($wsu, $GUI_ENABLE)
                EndIf
                If $w<2 Then
                    GUICtrlSetState($wd, $GUI_DISABLE)
                ElseIf $w>1 Then
                    GUICtrlSetState($wd, $GUI_ENABLE)
                EndIf
                If $w>17 Then
                    GUICtrlSetState($wu, $GUI_DISABLE)
                ElseIf $w<18 Then
                    GUICtrlSetState($wu, $GUI_ENABLE)
                EndIf
                If $t<2 Then
                    GUICtrlSetState($td, $GUI_DISABLE)
                ElseIf $t>1 Then
                    GUICtrlSetState($td, $GUI_ENABLE)
                EndIf
                If $t>17 Then
                    GUICtrlSetState($tu, $GUI_DISABLE)
                ElseIf $t<18 Then
                    GUICtrlSetState($tu, $GUI_ENABLE)
                EndIf
                If $s<2 Then
                    GUICtrlSetState($sd, $GUI_DISABLE)
                ElseIf $s>1 Then
                    GUICtrlSetState($sd, $GUI_ENABLE)
                EndIf
                If $s>17 Then
                    GUICtrlSetState($su, $GUI_DISABLE)
                ElseIf $s<18 Then
                    GUICtrlSetState($su, $GUI_ENABLE)
                EndIf
                If $bs<2 Then
                    GUICtrlSetState($bsd, $GUI_DISABLE)
                ElseIf $bs>1 Then
                    GUICtrlSetState($bsd, $GUI_ENABLE)
                EndIf
                If $bs>17 Then
                    GUICtrlSetState($bsu, $GUI_DISABLE)
                ElseIf $bs<18 Then
                    GUICtrlSetState($bsu, $GUI_ENABLE)
                EndIf
                If $attrpnt=0 Then
                    GUICtrlSetState($su, $GUI_DISABLE)
                    GUICtrlSetState($bsu, $GUI_DISABLE)
                    GUICtrlSetState($wsu, $GUI_DISABLE)
                    GUICtrlSetState($tu, $GUI_DISABLE)
                    GUICtrlSetState($wu, $GUI_DISABLE)
                    GUICtrlSetState($agiu, $GUI_DISABLE)
                EndIf

            ElseIf $msg = $wu Then
                $w=$w+1
                GUICtrlSetData($wlabel,$w)
                $attrpnt=30-$ws-$bs-$s-$t-$w-$agi
                GUICtrlSetData($attrpntlabel,$attrpnt)
                If $attrpnt<>0 Then
                    GUICtrlSetState($su, $GUI_ENABLE)
                    GUICtrlSetState($bsu, $GUI_ENABLE)
                    GUICtrlSetState($wsu, $GUI_ENABLE)
                    GUICtrlSetState($tu, $GUI_ENABLE)
                    GUICtrlSetState($wu, $GUI_ENABLE)
                    GUICtrlSetState($agiu, $GUI_ENABLE)
                EndIf
                If $agi<2 Then
                    GUICtrlSetState($agid, $GUI_DISABLE)
                ElseIf $agi>1 Then
                    GUICtrlSetState($agid, $GUI_ENABLE)
                EndIf
                If $agi>17 Then
                    GUICtrlSetState($agiu, $GUI_DISABLE)
                ElseIf $agi<18 Then
                    GUICtrlSetState($agiu, $GUI_ENABLE)
                EndIf
                If $ws<2 Then
                    GUICtrlSetState($wsd, $GUI_DISABLE)
                ElseIf $ws>1 Then
                    GUICtrlSetState($wsd, $GUI_ENABLE)
                EndIf
                If $ws>17 Then
                    GUICtrlSetState($wsu, $GUI_DISABLE)
                ElseIf $ws<18 Then
                    GUICtrlSetState($wsu, $GUI_ENABLE)
                EndIf
                If $w<2 Then
                    GUICtrlSetState($wd, $GUI_DISABLE)
                ElseIf $w>1 Then
                    GUICtrlSetState($wd, $GUI_ENABLE)
                EndIf
                If $w>17 Then
                    GUICtrlSetState($wu, $GUI_DISABLE)
                ElseIf $w<18 Then
                    GUICtrlSetState($wu, $GUI_ENABLE)
                EndIf
                If $t<2 Then
                    GUICtrlSetState($td, $GUI_DISABLE)
                ElseIf $t>1 Then
                    GUICtrlSetState($td, $GUI_ENABLE)
                EndIf
                If $t>17 Then
                    GUICtrlSetState($tu, $GUI_DISABLE)
                ElseIf $t<18 Then
                    GUICtrlSetState($tu, $GUI_ENABLE)
                EndIf
                If $s<2 Then
                    GUICtrlSetState($sd, $GUI_DISABLE)
                ElseIf $s>1 Then
                    GUICtrlSetState($sd, $GUI_ENABLE)
                EndIf
                If $s>17 Then
                    GUICtrlSetState($su, $GUI_DISABLE)
                ElseIf $s<18 Then
                    GUICtrlSetState($su, $GUI_ENABLE)
                EndIf
                If $bs<2 Then
                    GUICtrlSetState($bsd, $GUI_DISABLE)
                ElseIf $bs>1 Then
                    GUICtrlSetState($bsd, $GUI_ENABLE)
                EndIf
                If $bs>17 Then
                    GUICtrlSetState($bsu, $GUI_DISABLE)
                ElseIf $bs<18 Then
                    GUICtrlSetState($bsu, $GUI_ENABLE)
                EndIf
                If $attrpnt=0 Then
                    GUICtrlSetState($su, $GUI_DISABLE)
                    GUICtrlSetState($bsu, $GUI_DISABLE)
                    GUICtrlSetState($wsu, $GUI_DISABLE)
                    GUICtrlSetState($tu, $GUI_DISABLE)
                    GUICtrlSetState($wu, $GUI_DISABLE)
                    GUICtrlSetState($agiu, $GUI_DISABLE)
                EndIf

            ElseIf $msg = $agiu Then
                $agi=$agi+1
                GUICtrlSetData($agilabel,$agi)
                $attrpnt=30-$ws-$bs-$s-$t-$w-$agi
                GUICtrlSetData($attrpntlabel,$attrpnt)
                If $attrpnt<>0 Then
                    GUICtrlSetState($su, $GUI_ENABLE)
                    GUICtrlSetState($bsu, $GUI_ENABLE)
                    GUICtrlSetState($wsu, $GUI_ENABLE)
                    GUICtrlSetState($tu, $GUI_ENABLE)
                    GUICtrlSetState($wu, $GUI_ENABLE)
                    GUICtrlSetState($agiu, $GUI_ENABLE)
                EndIf
                If $agi<2 Then
                    GUICtrlSetState($agid, $GUI_DISABLE)
                ElseIf $agi>1 Then
                    GUICtrlSetState($agid, $GUI_ENABLE)
                EndIf
                If $agi>17 Then
                    GUICtrlSetState($agiu, $GUI_DISABLE)
                ElseIf $agi<18 Then
                    GUICtrlSetState($agiu, $GUI_ENABLE)
                EndIf
                If $ws<2 Then
                    GUICtrlSetState($wsd, $GUI_DISABLE)
                ElseIf $ws>1 Then
                    GUICtrlSetState($wsd, $GUI_ENABLE)
                EndIf
                If $ws>17 Then
                    GUICtrlSetState($wsu, $GUI_DISABLE)
                ElseIf $ws<18 Then
                    GUICtrlSetState($wsu, $GUI_ENABLE)
                EndIf
                If $w<2 Then
                    GUICtrlSetState($wd, $GUI_DISABLE)
                ElseIf $w>1 Then
                    GUICtrlSetState($wd, $GUI_ENABLE)
                EndIf
                If $w>17 Then
                    GUICtrlSetState($wu, $GUI_DISABLE)
                ElseIf $w<18 Then
                    GUICtrlSetState($wu, $GUI_ENABLE)
                EndIf
                If $t<2 Then
                    GUICtrlSetState($td, $GUI_DISABLE)
                ElseIf $t>1 Then
                    GUICtrlSetState($td, $GUI_ENABLE)
                EndIf
                If $t>17 Then
                    GUICtrlSetState($tu, $GUI_DISABLE)
                ElseIf $t<18 Then
                    GUICtrlSetState($tu, $GUI_ENABLE)
                EndIf
                If $s<2 Then
                    GUICtrlSetState($sd, $GUI_DISABLE)
                ElseIf $s>1 Then
                    GUICtrlSetState($sd, $GUI_ENABLE)
                EndIf
                If $s>17 Then
                    GUICtrlSetState($su, $GUI_DISABLE)
                ElseIf $s<18 Then
                    GUICtrlSetState($su, $GUI_ENABLE)
                EndIf
                If $bs<2 Then
                    GUICtrlSetState($bsd, $GUI_DISABLE)
                ElseIf $bs>1 Then
                    GUICtrlSetState($bsd, $GUI_ENABLE)
                EndIf
                If $bs>17 Then
                    GUICtrlSetState($bsu, $GUI_DISABLE)
                ElseIf $bs<18 Then
                    GUICtrlSetState($bsu, $GUI_ENABLE)
                EndIf
                If $attrpnt=0 Then
                    GUICtrlSetState($su, $GUI_DISABLE)
                    GUICtrlSetState($bsu, $GUI_DISABLE)
                    GUICtrlSetState($wsu, $GUI_DISABLE)
                    GUICtrlSetState($tu, $GUI_DISABLE)
                    GUICtrlSetState($wu, $GUI_DISABLE)
                    GUICtrlSetState($agiu, $GUI_DISABLE)
                EndIf

            ElseIf $msg = $agid Then
                $agi=$agi-1
                GUICtrlSetData($agilabel,$agi)
                $attrpnt=30-$ws-$bs-$s-$t-$w-$agi
                GUICtrlSetData($attrpntlabel,$attrpnt)
                If $attrpnt<>0 Then
                    GUICtrlSetState($su, $GUI_ENABLE)
                    GUICtrlSetState($bsu, $GUI_ENABLE)
                    GUICtrlSetState($wsu, $GUI_ENABLE)
                    GUICtrlSetState($tu, $GUI_ENABLE)
                    GUICtrlSetState($wu, $GUI_ENABLE)
                    GUICtrlSetState($agiu, $GUI_ENABLE)
                EndIf
                If $agi<2 Then
                    GUICtrlSetState($agid, $GUI_DISABLE)
                ElseIf $agi>1 Then
                    GUICtrlSetState($agid, $GUI_ENABLE)
                EndIf
                If $agi>17 Then
                    GUICtrlSetState($agiu, $GUI_DISABLE)
                ElseIf $agi<18 Then
                    GUICtrlSetState($agiu, $GUI_ENABLE)
                EndIf
                If $ws<2 Then
                    GUICtrlSetState($wsd, $GUI_DISABLE)
                ElseIf $ws>1 Then
                    GUICtrlSetState($wsd, $GUI_ENABLE)
                EndIf
                If $ws>17 Then
                    GUICtrlSetState($wsu, $GUI_DISABLE)
                ElseIf $ws<18 Then
                    GUICtrlSetState($wsu, $GUI_ENABLE)
                EndIf
                If $w<2 Then
                    GUICtrlSetState($wd, $GUI_DISABLE)
                ElseIf $w>1 Then
                    GUICtrlSetState($wd, $GUI_ENABLE)
                EndIf
                If $w>17 Then
                    GUICtrlSetState($wu, $GUI_DISABLE)
                ElseIf $w<18 Then
                    GUICtrlSetState($wu, $GUI_ENABLE)
                EndIf
                If $t<2 Then
                    GUICtrlSetState($td, $GUI_DISABLE)
                ElseIf $t>1 Then
                    GUICtrlSetState($td, $GUI_ENABLE)
                EndIf
                If $t>17 Then
                    GUICtrlSetState($tu, $GUI_DISABLE)
                ElseIf $t<18 Then
                    GUICtrlSetState($tu, $GUI_ENABLE)
                EndIf
                If $s<2 Then
                    GUICtrlSetState($sd, $GUI_DISABLE)
                ElseIf $s>1 Then
                    GUICtrlSetState($sd, $GUI_ENABLE)
                EndIf
                If $s>17 Then
                    GUICtrlSetState($su, $GUI_DISABLE)
                ElseIf $s<18 Then
                    GUICtrlSetState($su, $GUI_ENABLE)
                EndIf
                If $bs<2 Then
                    GUICtrlSetState($bsd, $GUI_DISABLE)
                ElseIf $bs>1 Then
                    GUICtrlSetState($bsd, $GUI_ENABLE)
                EndIf
                If $bs>17 Then
                    GUICtrlSetState($bsu, $GUI_DISABLE)
                ElseIf $bs<18 Then
                    GUICtrlSetState($bsu, $GUI_ENABLE)
                EndIf
                If $attrpnt=0 Then
                    GUICtrlSetState($su, $GUI_DISABLE)
                    GUICtrlSetState($bsu, $GUI_DISABLE)
                    GUICtrlSetState($wsu, $GUI_DISABLE)
                    GUICtrlSetState($tu, $GUI_DISABLE)
                    GUICtrlSetState($wu, $GUI_DISABLE)
                    GUICtrlSetState($agiu, $GUI_DISABLE)
                EndIf

            ElseIf $msg=$GUI_EVENT_CLOSE Then
                _ChangeScreenResEx(1,$curdeskW,$curdeskH,-1,-1)
                Exit(1)

            ElseIf $msg=$done Then
                $spot=1
                $ccheck=IniRead(""&$install&"\data\cdat.ini","Characters",$spot,"")
                While $ccheck<>""
                    If $ccheck<>"" Then
                        $spot=$spot+1
                    EndIf
                    $ccheck=IniRead(""&$install&"\data\cdat.ini","Characters",$spot,"")
                WEnd
                IniWrite(""&$install&"\data\cdat.ini","Characters",$spot,$name)
                IniWrite(""&$install&"\data\cstat.ini",$name,1,$gender)
                IniWrite(""&$install&"\data\cstat.ini",$name,2,$ws)
                IniWrite(""&$install&"\data\cstat.ini",$name,3,$bs)
                IniWrite(""&$install&"\data\cstat.ini",$name,4,$s)
                IniWrite(""&$install&"\data\cstat.ini",$name,5,$t)
                IniWrite(""&$install&"\data\cstat.ini",$name,6,$w)
                IniWrite(""&$install&"\data\cstat.ini",$name,7,$prof)
                IniWrite(""&$install&"\data\cstat.ini",$name,8,$agi)
                IniWrite(""&$install&"\data\cstat.ini",$name,9,$1)
                IniWrite(""&$install&"\data\cstat.ini",$name,10,$2)
                IniWrite(""&$install&"\data\cstat.ini",$name,11,$3)
                IniWrite(""&$install&"\data\cstat.ini",$name,12,$4)
                GUIDelete()
                start()
            EndIf
        EndIf
    WEnd
EndFunc

Func game()
EndFunc

Also add the attached to data\Models\

it's not the real mesh skin, but I needed something for the model until I get the skin completed.

*edit*

I forgot to mention the dll files need to be in the windows/system32 folder

Edited by kaotkbliss

010101000110100001101001011100110010000001101001011100110010000

001101101011110010010000001110011011010010110011100100001

My Android cat and mouse game
https://play.google.com/store/apps/details?id=com.KaosVisions.WhiskersNSqueek

We're gonna need another Timmy!

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