Spiel in der Art von Travian funzt nicht

  • hi ich hab mich seid längerem nicht mehr mit autoit beschäftigt aber jetzt hab ich lust auf ein kleines Spiel zu programmieren.
    Es ist so ähnlich wie die Stämme oder Travian. Die Grafiken sind erstmal egal die brauicht man nicht unbedingt.
    Ich möchte, dass wenn z.b. zu wenig steine vorhanden sind um die bauzentrale zu erweitern das label wo die steinkosten für die bauzentrale stehen rot gefärbt wird(die schrift)und der button "disabled" wird jedoch klappt es nicht immer einwandfrei hier der code:

    Spoiler anzeigen
    [autoit]

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

    [/autoit] [autoit][/autoit] [autoit]

    $gui = GUICreate("Stratego", 1012, 538, 213, 125)
    GUISetBkColor(0xb29774,$gui)
    $logo = GUICtrlCreateLabel("Stratego by Nathan", 280, 0, 500, 80, $SS_CENTER)
    GUICtrlSetFont(-1, 43, 400, 0, "Arial")
    GUICtrlSetColor(-1, 0x800000)
    $ritterpic1 = GUICtrlCreatePic("bogenschutze1.jpg", 0, 0, 110, 180)
    GUICtrlSetCursor(-1,0)
    $ritterpic2 = GUICtrlCreatePic("bogenschutze2.jpg", 900, 0, 110, 200)
    GUICtrlSetCursor(-1,0)
    $baukostenlabel = GUICtrlCreateLabel("Baukosten", 39, 210, 92, 28)
    GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
    GUICtrlSetColor(-1, 0x800000)
    $bauzentralepic = GUICtrlCreatePic("bauzentrale.jpg", 168, 90, 105, 97)
    GUICtrlSetCursor(-1,4)
    $bauzentralelabel = GUICtrlCreateLabel("Bauzentrale(0)", 159, 210, 125, 28)
    GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
    GUICtrlSetColor(-1, 0x800000)
    $bauernhauspic = GUICtrlCreatePic("bauernhaus.jpg", 295, 85, 120, 120)
    GUICtrlSetCursor(-1,4)
    $bauernhauslabel = GUICtrlCreateLabel("Bauernhaus(0)", 290, 210, 128, 28)
    GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
    GUICtrlSetColor(-1, 0x800000)
    $speicherpic = GUICtrlCreatePic("speicher.jpg", 425, 90, 105, 97)
    GUICtrlSetCursor(-1,4)
    $speicherlabel = GUICtrlCreateLabel("Speicher(0)", 437, 210, 102, 28)
    GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
    GUICtrlSetColor(-1, 0x800000)
    $eisenminepic = GUICtrlCreatePic("eisenmine.jpg", 545, 90, 105, 97)
    GUICtrlSetCursor(-1,4)
    $eisenminelabel = GUICtrlCreateLabel("Eisenmine(0)", 545, 210, 116, 28)
    GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
    GUICtrlSetColor(-1, 0x800000)
    $steinbruchpic = GUICtrlCreatePic("steinbruch.jpg", 668, 90, 105, 97)
    GUICtrlSetCursor(-1,4)
    $steinbruchlabel = GUICtrlCreateLabel("Steinbruch(0)", 663, 210, 117, 28)
    GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
    GUICtrlSetColor(-1, 0x800000)
    $sagewerkpic = GUICtrlCreatePic("sägewerk.jpg", 790, 90, 105, 97)
    GUICtrlSetCursor(-1,4)
    $sagewerklabel = GUICtrlCreateLabel("Sägewerk(0)", 792, 210, 110, 28)
    GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
    GUICtrlSetColor(-1, 0x800000)
    $ausbaulabel = GUICtrlCreateLabel("Ausbau", 908, 210, 69, 28)
    GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
    GUICtrlSetColor(-1, 0x800000)
    $ausbaubutton1 = GUICtrlCreateButton("Ausbau", 168, 430, 80, 33)
    $ausbaubutton2 = GUICtrlCreateButton("Ausbau", 297, 430, 80, 33)
    $ausbaubutton3 = GUICtrlCreateButton("Ausbau", 430, 430, 80, 33)
    $ausbaubutton4 = GUICtrlCreateButton("Ausbau", 545, 430, 80, 33)
    $ausbaubutton5 = GUICtrlCreateButton("Ausbau", 670, 430, 80, 33)
    $ausbaubutton6 = GUICtrlCreateButton("Ausbau", 792, 430, 80, 33)
    $eisenpic = GUICtrlCreatePic("eisen.jpg", 184, 483, 33, 33)
    $eisenlabel = GUICtrlCreateLabel("500", 238, 484, 200, 41)
    GUICtrlSetFont(-1, 20, 400, 0, "MS Sans Serif")
    GUICtrlSetColor(-1, 0x008000)
    $steinpic = GUICtrlCreatePic("stein.jpg", 366, 483, 33, 33)
    $steinlabel = GUICtrlCreateLabel("500", 422, 484, 200, 41)
    GUICtrlSetFont(-1, 20, 400, 0, "MS Sans Serif")
    GUICtrlSetColor(-1, 0x008000)
    $holzpic = GUICtrlCreatePic("holz.jpg", 547, 483, 33, 33)
    $holzlabel = GUICtrlCreateLabel("500", 608, 484, 200, 41)
    GUICtrlSetFont(-1, 20, 400, 0, "MS Sans Serif")
    GUICtrlSetColor(-1, 0x008000)
    $ehrepic = GUICtrlCreatePic("ehre.jpg", 732, 480, 44, 44)
    $ehrelabel = GUICtrlCreateLabel("0", 790, 484, 200, 41)
    GUICtrlSetFont(-1, 20, 400, 0, "MS Sans Serif")
    GUICtrlSetColor(-1, 0x008000)
    $bauzentraleanzeige = GUICtrlCreateLabel("-0s", 160, 235, 100, 24, $SS_CENTER)
    GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
    GUICtrlSetColor(-1, 0x800000)
    $bauernanzahllabel = GUICtrlCreateLabel("0", 290, 235, 100, 24, $SS_CENTER)
    GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
    GUICtrlSetColor(-1, 0x800000)
    $speicheranzahl = GUICtrlCreateLabel("1500 / 2000", 434, 235, 88, 24, $SS_CENTER)
    GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
    GUICtrlSetColor(-1, 0x800000)
    $eisenmineanzahl = GUICtrlCreateLabel("30 / 10s", 540, 235, 100, 24, $SS_CENTER)
    GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
    GUICtrlSetColor(-1, 0x800000)
    $steinbruchanzahl = GUICtrlCreateLabel("30 / 10s", 692, 235, 100, 24)
    GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
    GUICtrlSetColor(-1, 0x800000)
    $sagewerkanzahl = GUICtrlCreateLabel("30 / 10s", 815, 235, 100, 24)
    GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
    GUICtrlSetColor(-1, 0x800000)
    $eisenpickosten = GUICtrlCreatePic("eisen.jpg", 65, 265, 30, 30)
    $eisenkostenbauzentrale = GUICtrlCreateLabel("180", 188, 268, 34, 28, $SS_CENTER)
    GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
    GUICtrlSetColor(-1, 0x800000)
    $eisenkostenbauernhaus = GUICtrlCreateLabel("170", 320, 268, 34, 28, $SS_CENTER)
    GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
    GUICtrlSetColor(-1, 0x800000)
    $eisenkostenspeicher = GUICtrlCreateLabel("140", 463, 268, 34, 28, $SS_CENTER)
    GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
    GUICtrlSetColor(-1, 0x800000)
    $eisenkosteneisenmine = GUICtrlCreateLabel("150", 576, 268, 34, 28, $SS_CENTER)
    GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
    GUICtrlSetColor(-1, 0x800000)
    $eisenkostensteinbruch = GUICtrlCreateLabel("150", 695, 268, 34, 28, $SS_CENTER)
    GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
    GUICtrlSetColor(-1, 0x800000)
    $eisenkostensagewerk = GUICtrlCreateLabel("150", 821, 268, 34, 28, $SS_CENTER)
    GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
    GUICtrlSetColor(-1, 0x800000)
    $steinpickosten = GUICtrlCreatePic("stein.jpg", 65, 302, 30, 30)
    $steinkostenbauzentrale = GUICtrlCreateLabel("170", 188, 305, 34, 28, $SS_CENTER)
    GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
    GUICtrlSetColor(-1, 0x800000)
    $steinkostenbauernhaus = GUICtrlCreateLabel("180", 320, 305, 34, 28, $SS_CENTER)
    GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
    GUICtrlSetColor(-1, 0x800000)
    $steinkostenspeicher = GUICtrlCreateLabel("170", 463, 305, 34, 28, $SS_CENTER)
    GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
    GUICtrlSetColor(-1, 0x800000)
    $steinkosteneisenmine = GUICtrlCreateLabel("150", 576, 305, 34, 28, $SS_CENTER)
    GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
    GUICtrlSetColor(-1, 0x800000)
    $steinkostensteinbruch = GUICtrlCreateLabel("150", 695, 305, 34, 28, $SS_CENTER)
    GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
    GUICtrlSetColor(-1, 0x800000)
    $steinkostensagewerk = GUICtrlCreateLabel("150", 821, 305, 34, 28, $SS_CENTER)
    GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
    GUICtrlSetColor(-1, 0x800000)
    $holzpickosten = GUICtrlCreatePic("holz.jpg", 65, 339, 30, 30)
    $holzkostenbauzentrale = GUICtrlCreateLabel("140", 188, 345, 34, 28, $SS_CENTER)
    GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
    GUICtrlSetColor(-1, 0x800000)
    $holzkostenbauernhaus = GUICtrlCreateLabel("190", 320, 345, 34, 28, $SS_CENTER)
    GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
    GUICtrlSetColor(-1, 0x800000)
    $holzkostenspeicher = GUICtrlCreateLabel("120", 463, 345, 34, 28, $SS_CENTER)
    GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
    GUICtrlSetColor(-1, 0x800000)
    $holzkosteneisenmine = GUICtrlCreateLabel("150", 576, 345, 34, 28, $SS_CENTER)
    GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
    GUICtrlSetColor(-1, 0x800000)
    $holzkostensteinbruch = GUICtrlCreateLabel("150", 695, 345, 34, 28, $SS_CENTER)
    GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
    GUICtrlSetColor(-1, 0x800000)
    $holzkostensagewerk = GUICtrlCreateLabel("150", 821, 345, 34, 28, $SS_CENTER)
    GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
    GUICtrlSetColor(-1, 0x800000)
    $uhrpic = GUICtrlCreateIcon("clock.ico", 1, 67, 380, 29, 29)
    $ausbauzeitbauzentrale = GUICtrlCreateLabel("5s", 188, 385, 33, 28, $SS_CENTER)
    GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
    GUICtrlSetColor(-1, 0x800000)
    $ausbauzeitbauernhaus = GUICtrlCreateLabel("3s", 320, 385, 33, 28, $SS_CENTER)
    GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
    GUICtrlSetColor(-1, 0x800000)
    $ausbauzeitspeicher = GUICtrlCreateLabel("6s", 463, 385, 33, 28, $SS_CENTER)
    GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
    GUICtrlSetColor(-1, 0x800000)
    $ausbauzeiteisenmine = GUICtrlCreateLabel("4s", 576, 385, 23, 28, $SS_CENTER)
    GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
    GUICtrlSetColor(-1, 0x800000)
    $ausbauzeitsteinbruch = GUICtrlCreateLabel("4s", 695, 385, 23, 28, $SS_CENTER)
    GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
    GUICtrlSetColor(-1, 0x800000)
    $ausbauzeitsagewerk = GUICtrlCreateLabel("4s", 821, 385, 23, 28, $SS_CENTER)
    GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
    GUICtrlSetColor(-1, 0x800000)
    $ausbauzeit = GUICtrlCreateLabel("", 890, 385, 50, 28, $SS_CENTER)
    GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
    GUICtrlSetColor(-1, 0x800000)
    $slabel = GUICtrlCreateLabel("", 935, 385, 7, 28, $SS_CENTER)
    GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
    GUICtrlSetColor(-1, 0x800000)
    GUISetState(@SW_SHOW)

    [/autoit] [autoit][/autoit] [autoit]

    $timerstart = TimerInit()
    $zabzug = 0
    $ep10s = 30
    $sp10s = 30
    $hp10s = 30
    $ehp10s = 0.5
    $ekos1 = 180
    $skos1 = 170
    $hkos1 = 140
    $ekos2 = 170
    $skos2 = 180
    $hkos2 = 190
    $ekos3 = 140
    $skos3 = 170
    $hkos3 = 120
    $ekos4 = 150
    $skos4 = 150
    $hkos4 = 150
    $ekos5 = 150
    $skos5 = 150
    $hkos5 = 150
    $ekos6 = 150
    $skos6 = 150
    $hkos6 = 150
    $speichermax = 1500
    $z1 = 1
    $z2 = 1
    $z3 = 1
    $z4 = 1
    $z5 = 1
    $z6 = 1
    $bauzentrale = 0
    $bauernhaus = 0
    $speicher = 0
    $eisenmine = 0
    $steinbruch = 0
    $sagewerk = 0
    $b1state1 = 1
    $b2state1 = 1
    $b3state1 = 1
    $b4state1 = 1
    $b5state1 = 1
    $b6state1 = 1
    $b1state2 = 1
    $b2state2 = 1
    $b3state2 = 1
    $b4state2 = 1
    $b5state2 = 1
    $b6state2 = 1
    $b1state3 = 1
    $b2state3 = 1
    $b3state3 = 1
    $b4state3 = 1
    $b5state3 = 1
    $b6state3 = 1
    $ausbaubutton1getstate = 0
    $ausbaubutton2getstate = 0
    $ausbaubutton3getstate = 0
    $ausbaubutton4getstate = 0
    $ausbaubutton5getstate = 0
    $ausbaubutton6getstate = 0
    $buttonsperre = 0

    [/autoit] [autoit][/autoit] [autoit]

    AdlibRegister("check",300)
    AdlibRegister("rohstoffcheck",300)

    [/autoit] [autoit][/autoit] [autoit]

    While 1
    $msg = GUIGetMsg()
    Select
    Case $msg = $ausbaubutton1
    $buttonsperre = 1
    GUICtrlSetData($eisenlabel, GUICtrlRead($eisenlabel) - $ekos1)
    GUICtrlSetData($steinlabel, GUICtrlRead($steinlabel) - $skos1)
    GUICtrlSetData($holzlabel, GUICtrlRead($holzlabel) - $hkos1)
    GUICtrlSetData($speicheranzahl, StringLeft(GUICtrlRead($speicheranzahl),4) - $ekos1 - $skos1- $hkos1&" / "&$speichermax)
    GUICtrlSetState($ausbaubutton1,$GUI_DISABLE)
    GUICtrlSetState($ausbaubutton2,$GUI_DISABLE)
    GUICtrlSetState($ausbaubutton3,$GUI_DISABLE)
    GUICtrlSetState($ausbaubutton4,$GUI_DISABLE)
    GUICtrlSetState($ausbaubutton5,$GUI_DISABLE)
    GUICtrlSetState($ausbaubutton6,$GUI_DISABLE)
    $zeit = $bauzentrale * 13 - $zabzug
    If $z1 = 1 Then
    $zeit = 5
    $z1 = 0
    EndIf
    GUICtrlSetData($ausbauzeit, $zeit)
    GUICtrlSetData($slabel, "s")
    For $a = 0 to $zeit Step 1
    Sleep(1000)
    GUICtrlSetData($ausbauzeit, GUICtrlRead($ausbauzeit) - 1)
    Next
    GUICtrlSetState($ausbaubutton1,$GUI_ENABLE)
    GUICtrlSetState($ausbaubutton2,$GUI_ENABLE)
    GUICtrlSetState($ausbaubutton3,$GUI_ENABLE)
    GUICtrlSetState($ausbaubutton4,$GUI_ENABLE)
    GUICtrlSetState($ausbaubutton5,$GUI_ENABLE)
    GUICtrlSetState($ausbaubutton6,$GUI_ENABLE)
    GUICtrlSetData($ausbauzeit, "")
    GUICtrlSetData($slabel, "")
    GUICtrlSetData($ehrelabel, GUICtrlRead($ehrelabel) + 50)
    GUICtrlSetData($eisenkostenbauzentrale, GUICtrlRead($eisenkostenbauzentrale) + 150)
    GUICtrlSetData($steinkostenbauzentrale, GUICtrlRead($steinkostenbauzentrale) + 170)
    GUICtrlSetData($holzkostenbauzentrale, GUICtrlRead($holzkostenbauzentrale) + 190)
    GUICtrlSetData($bauzentralelabel, "Bauzentrale("&$bauzentrale + 1&")")
    GUICtrlSetData($ausbauzeitbauzentrale, ($bauzentrale + 1) * 13&"s")
    $bauzentrale += 1
    $buttonsperre = 0
    rohstoffcheck()
    check()
    Case $msg = $ausbaubutton2
    $buttonsperre = 1
    GUICtrlSetData($eisenlabel, GUICtrlRead($eisenlabel) - $ekos2)
    GUICtrlSetData($steinlabel, GUICtrlRead($steinlabel) - $skos2)
    GUICtrlSetData($holzlabel, GUICtrlRead($holzlabel) - $hkos2)
    GUICtrlSetData($speicheranzahl, StringLeft(GUICtrlRead($speicheranzahl),4) - $ekos2 - $skos2- $hkos2&" / "&$speichermax)
    GUICtrlSetState($ausbaubutton1,$GUI_DISABLE)
    GUICtrlSetState($ausbaubutton2,$GUI_DISABLE)
    GUICtrlSetState($ausbaubutton3,$GUI_DISABLE)
    GUICtrlSetState($ausbaubutton4,$GUI_DISABLE)
    GUICtrlSetState($ausbaubutton5,$GUI_DISABLE)
    GUICtrlSetState($ausbaubutton6,$GUI_DISABLE)
    $zeit = $bauernhaus * 12 - $zabzug
    If $z2 = 1 Then
    $zeit = 3
    $z2 = 0
    EndIf
    GUICtrlSetData($ausbauzeit, $zeit)
    GUICtrlSetData($slabel, "s")
    For $a = 0 to $zeit Step 1
    Sleep(1000)
    GUICtrlSetData($ausbauzeit, GUICtrlRead($ausbauzeit) - 1)
    Next
    GUICtrlSetState($ausbaubutton1,$GUI_ENABLE)
    GUICtrlSetState($ausbaubutton2,$GUI_ENABLE)
    GUICtrlSetState($ausbaubutton3,$GUI_ENABLE)
    GUICtrlSetState($ausbaubutton4,$GUI_ENABLE)
    GUICtrlSetState($ausbaubutton5,$GUI_ENABLE)
    GUICtrlSetState($ausbaubutton6,$GUI_ENABLE)
    GUICtrlSetData($ausbauzeit, "")
    GUICtrlSetData($slabel, "")
    GUICtrlSetData($ehrelabel, GUICtrlRead($ehrelabel) + 50)
    GUICtrlSetData($eisenkostenbauernhaus, GUICtrlRead($eisenkostenbauernhaus) + 150)
    GUICtrlSetData($steinkostenbauernhaus, GUICtrlRead($steinkostenbauernhaus) + 170)
    GUICtrlSetData($holzkostenbauernhaus, GUICtrlRead($holzkostenbauernhaus) + 190)
    GUICtrlSetData($bauernhauslabel, "Bauernhaus("&$bauernhaus + 1&")")
    GUICtrlSetData($ausbauzeitbauernhaus, ($bauernhaus + 1) * 12&"s")
    $bauernhaus += 1
    $buttonsperre = 0
    rohstoffcheck()
    check()
    Case $msg = $ausbaubutton3
    $buttonsperre = 1
    GUICtrlSetData($eisenlabel, GUICtrlRead($eisenlabel) - $ekos3)
    GUICtrlSetData($steinlabel, GUICtrlRead($steinlabel) - $skos3)
    GUICtrlSetData($holzlabel, GUICtrlRead($holzlabel) - $hkos3)
    GUICtrlSetData($speicheranzahl, StringLeft(GUICtrlRead($speicheranzahl),4) - $ekos3 - $skos3- $hkos3&" / "&$speichermax)
    GUICtrlSetState($ausbaubutton1,$GUI_DISABLE)
    GUICtrlSetState($ausbaubutton2,$GUI_DISABLE)
    GUICtrlSetState($ausbaubutton3,$GUI_DISABLE)
    GUICtrlSetState($ausbaubutton4,$GUI_DISABLE)
    GUICtrlSetState($ausbaubutton5,$GUI_DISABLE)
    GUICtrlSetState($ausbaubutton6,$GUI_DISABLE)
    $zeit = $speicher * 10 - $zabzug
    If $z3 = 1 Then
    $zeit = 6
    $z3 = 0
    EndIf
    GUICtrlSetData($ausbauzeit, $zeit)
    GUICtrlSetData($slabel, "s")
    For $a = 0 to $zeit Step 1
    Sleep(1000)
    GUICtrlSetData($ausbauzeit, GUICtrlRead($ausbauzeit) - 1)
    Next
    GUICtrlSetState($ausbaubutton1,$GUI_ENABLE)
    GUICtrlSetState($ausbaubutton2,$GUI_ENABLE)
    GUICtrlSetState($ausbaubutton3,$GUI_ENABLE)
    GUICtrlSetState($ausbaubutton4,$GUI_ENABLE)
    GUICtrlSetState($ausbaubutton5,$GUI_ENABLE)
    GUICtrlSetState($ausbaubutton6,$GUI_ENABLE)
    GUICtrlSetData($ausbauzeit, "")
    GUICtrlSetData($slabel, "")
    GUICtrlSetData($ehrelabel, GUICtrlRead($ehrelabel) + 50)
    GUICtrlSetData($eisenkostenspeicher, GUICtrlRead($eisenkostenspeicher) + 150)
    GUICtrlSetData($steinkostenspeicher, GUICtrlRead($steinkostenspeicher) + 170)
    GUICtrlSetData($holzkostenspeicher, GUICtrlRead($holzkostenspeicher) + 190)
    GUICtrlSetData($speicherlabel, "Speicher("&$speicher + 1&")")
    GUICtrlSetData($ausbauzeitspeicher, ($speicher + 1) * 10&"s")
    $speicher += 1
    $buttonsperre = 0
    rohstoffcheck()
    check()
    Case $msg = $ausbaubutton4
    $buttonsperre = 1
    GUICtrlSetData($eisenlabel, GUICtrlRead($eisenlabel) - $ekos4)
    GUICtrlSetData($steinlabel, GUICtrlRead($steinlabel) - $skos4)
    GUICtrlSetData($holzlabel, GUICtrlRead($holzlabel) - $hkos4)
    GUICtrlSetData($speicheranzahl, StringLeft(GUICtrlRead($speicheranzahl),4) - $ekos4 - $skos4- $hkos4&" / "&$speichermax)
    GUICtrlSetState($ausbaubutton1,$GUI_DISABLE)
    GUICtrlSetState($ausbaubutton2,$GUI_DISABLE)
    GUICtrlSetState($ausbaubutton3,$GUI_DISABLE)
    GUICtrlSetState($ausbaubutton4,$GUI_DISABLE)
    GUICtrlSetState($ausbaubutton5,$GUI_DISABLE)
    GUICtrlSetState($ausbaubutton6,$GUI_DISABLE)
    $zeit = $eisenmine * 14 - $zabzug
    If $z4 = 1 Then
    $zeit = 4
    $z4 = 0
    EndIf
    GUICtrlSetData($ausbauzeit, $zeit)
    GUICtrlSetData($slabel, "s")
    For $a = 0 to $zeit Step 1
    Sleep(1000)
    GUICtrlSetData($ausbauzeit, GUICtrlRead($ausbauzeit) - 1)
    Next
    GUICtrlSetState($ausbaubutton1,$GUI_ENABLE)
    GUICtrlSetState($ausbaubutton2,$GUI_ENABLE)
    GUICtrlSetState($ausbaubutton3,$GUI_ENABLE)
    GUICtrlSetState($ausbaubutton4,$GUI_ENABLE)
    GUICtrlSetState($ausbaubutton5,$GUI_ENABLE)
    GUICtrlSetState($ausbaubutton6,$GUI_ENABLE)
    GUICtrlSetData($ausbauzeit, "")
    GUICtrlSetData($slabel, "")
    GUICtrlSetData($ehrelabel, GUICtrlRead($ehrelabel) + 50)
    GUICtrlSetData($eisenkosteneisenmine, GUICtrlRead($eisenkosteneisenmine) + 150)
    GUICtrlSetData($steinkosteneisenmine, GUICtrlRead($steinkosteneisenmine) + 170)
    GUICtrlSetData($holzkosteneisenmine, GUICtrlRead($holzkosteneisenmine) + 190)
    GUICtrlSetData($eisenminelabel, "Eisenmine("&$eisenmine + 1&")")
    GUICtrlSetData($ausbauzeiteisenmine, ($eisenmine + 1) * 14&"s")
    $eisenmine += 1
    $buttonsperre = 0
    rohstoffcheck()
    check()
    Case $msg = $ausbaubutton5
    $buttonsperre = 1
    GUICtrlSetData($eisenlabel, GUICtrlRead($eisenlabel) - $ekos5)
    GUICtrlSetData($steinlabel, GUICtrlRead($steinlabel) - $skos5)
    GUICtrlSetData($holzlabel, GUICtrlRead($holzlabel) - $hkos5)
    GUICtrlSetData($speicheranzahl, StringLeft(GUICtrlRead($speicheranzahl),4) - $ekos5 - $skos5- $hkos5&" / "&$speichermax)
    GUICtrlSetState($ausbaubutton1,$GUI_DISABLE)
    GUICtrlSetState($ausbaubutton2,$GUI_DISABLE)
    GUICtrlSetState($ausbaubutton3,$GUI_DISABLE)
    GUICtrlSetState($ausbaubutton4,$GUI_DISABLE)
    GUICtrlSetState($ausbaubutton5,$GUI_DISABLE)
    GUICtrlSetState($ausbaubutton6,$GUI_DISABLE)
    $zeit = $steinbruch * 14 - $zabzug
    If $z5 = 1 Then
    $zeit = 4
    $z5 = 0
    EndIf
    GUICtrlSetData($ausbauzeit, $zeit)
    GUICtrlSetData($slabel, "s")
    For $a = 0 to $zeit Step 1
    Sleep(1000)
    GUICtrlSetData($ausbauzeit, GUICtrlRead($ausbauzeit) - 1)
    Next
    GUICtrlSetState($ausbaubutton1,$GUI_ENABLE)
    GUICtrlSetState($ausbaubutton2,$GUI_ENABLE)
    GUICtrlSetState($ausbaubutton3,$GUI_ENABLE)
    GUICtrlSetState($ausbaubutton4,$GUI_ENABLE)
    GUICtrlSetState($ausbaubutton5,$GUI_ENABLE)
    GUICtrlSetState($ausbaubutton6,$GUI_ENABLE)
    GUICtrlSetData($ausbauzeit, "")
    GUICtrlSetData($slabel, "")
    GUICtrlSetData($ehrelabel, GUICtrlRead($ehrelabel) + 50)
    GUICtrlSetData($eisenkostensteinbruch, GUICtrlRead($eisenkostensteinbruch) + 150)
    GUICtrlSetData($steinkostensteinbruch, GUICtrlRead($steinkostensteinbruch) + 170)
    GUICtrlSetData($holzkostensteinbruch, GUICtrlRead($holzkostensteinbruch) + 190)
    GUICtrlSetData($steinbruchlabel, "Steinbruch("&$steinbruch + 1&")")
    GUICtrlSetData($ausbauzeitsteinbruch, ($steinbruch + 1) * 14&"s")
    $steinbruch += 1
    $buttonsperre = 0
    rohstoffcheck()
    check()
    Case $msg = $ausbaubutton6
    $buttonsperre = 1
    GUICtrlSetData($eisenlabel, GUICtrlRead($eisenlabel) - $ekos6)
    GUICtrlSetData($steinlabel, GUICtrlRead($steinlabel) - $skos6)
    GUICtrlSetData($holzlabel, GUICtrlRead($holzlabel) - $hkos6)
    GUICtrlSetData($speicheranzahl, StringLeft(GUICtrlRead($speicheranzahl),4) - $ekos6 - $skos6 - $hkos6&" / "&$speichermax)
    GUICtrlSetState($ausbaubutton1,$GUI_DISABLE)
    GUICtrlSetState($ausbaubutton2,$GUI_DISABLE)
    GUICtrlSetState($ausbaubutton3,$GUI_DISABLE)
    GUICtrlSetState($ausbaubutton4,$GUI_DISABLE)
    GUICtrlSetState($ausbaubutton5,$GUI_DISABLE)
    GUICtrlSetState($ausbaubutton6,$GUI_DISABLE)
    $zeit = $sagewerk * 14 - $zabzug
    If $z6 = 1 Then
    $zeit = 4
    $z6 = 0
    EndIf
    GUICtrlSetData($ausbauzeit, $zeit)
    GUICtrlSetData($slabel, "s")
    For $a = 0 to $zeit Step 1
    Sleep(1000)
    GUICtrlSetData($ausbauzeit, GUICtrlRead($ausbauzeit) - 1)
    Next
    GUICtrlSetState($ausbaubutton1,$GUI_ENABLE)
    GUICtrlSetState($ausbaubutton2,$GUI_ENABLE)
    GUICtrlSetState($ausbaubutton3,$GUI_ENABLE)
    GUICtrlSetState($ausbaubutton4,$GUI_ENABLE)
    GUICtrlSetState($ausbaubutton5,$GUI_ENABLE)
    GUICtrlSetState($ausbaubutton6,$GUI_ENABLE)
    GUICtrlSetData($ausbauzeit, "")
    GUICtrlSetData($slabel, "")
    GUICtrlSetData($ehrelabel, GUICtrlRead($ehrelabel) + 50)
    GUICtrlSetData($eisenkostensagewerk, GUICtrlRead($eisenkostensagewerk) + 150)
    GUICtrlSetData($steinkostensagewerk, GUICtrlRead($steinkostensagewerk) + 170)
    GUICtrlSetData($holzkostensagewerk, GUICtrlRead($holzkostensagewerk) + 190)
    GUICtrlSetData($sagewerklabel, "Sagewerk("&$sagewerk + 1&")")
    GUICtrlSetData($ausbauzeitsagewerk, ($sagewerk + 1) * 14&"s")
    $sagewerk += 1
    $buttonsperre = 0
    rohstoffcheck()
    check()
    Case $msg = $ritterpic1
    kampf()
    Case $msg = $ritterpic2
    kampf()
    Case $msg = $bauzentralepic
    MsgBox(64,"Info","Das ist die Bauzentrale. Sie ist das Zentrum deines Dorfes. Sie regelt die gesamten Einnahmen. Je höher ihre Stufe ist, desto schneller werden alle Einrichtungen im gesamten Dorf gebaut. Wieviel Bauzeit dabei immer abgezogen wird steht unten.")
    Case $msg = $bauernhauspic
    MsgBox(64,"Info","Das ist das Bauernhaus. Hier leben Bauern und werden für den Kampf trainiert. Wieviele Krieger schon erfolgreich rekrutiert worden sind bzw. wieviele du im moment besitzt siehst du unten. Je höher die Stufe, desto mehr Krieger werden ausgebildet")
    Case $msg = $speicherpic
    MsgBox(64,"Info","Das hier ist der Speicher deines Dorfes. In ihm werden alle Rohstoffe gelagert. Er hat jedoch ein Maximum an Speicherkapazität. Ist dieses erreicht kannst du keine Rohstoffe mehr lagern. Je höher die Stufe, desto größer wird das Speichervolumen, welches unten angezeigt wird.")
    Case $msg = $eisenminepic
    MsgBox(64,"Info","Das ist die Eisenmine. Hier arbeiten einige Bauern, um Eisen zu gewinnen. Es wird im Speicher gelagert. Wieviel du erhälst hängt von der Stufe ab und steht unten.")
    Case $msg = $steinbruchpic
    MsgBox(64,"Info","Das ist der Steinbruch. Hier arbeiten Steinmetzte, um Stein zu gewinnen. Es wird im Speicher gelagert. Wieviel du erhälst hängt von der Stufe ab und steht unten.")
    Case $msg = $sagewerkpic
    MsgBox(64,"Info","Das ist das Sägewerk. Hier arbeiten Holzfäller, um Holz zu gewinnen. Es wird im Speicher gelagert. Wieviel du erhälst hängt von der Stufe ab und steht unten.")
    Case $msg = $GUI_EVENT_CLOSE
    Exit
    EndSelect
    WEnd

    [/autoit] [autoit][/autoit] [autoit]

    Func rohstoffcheck()
    If GUICtrlRead($speicherlabel) = "Speicher(0)" Then
    $speichermax = 2000
    ElseIf GUICtrlRead($speicherlabel) = "Speicher(1)" Then
    $speichermax = 3000
    ElseIf GUICtrlRead($speicherlabel) = "Speicher(2)" Then
    $speichermax = 5000
    ElseIf GUICtrlRead($speicherlabel) = "Speicher(3)" Then
    $speichermax = 7000
    ElseIf GUICtrlRead($speicherlabel) = "Speicher(4)" Then
    $speichermax = 9000
    ElseIf GUICtrlRead($speicherlabel) = "Speicher(5)" Then
    $speichermax = 11000
    ElseIf GUICtrlRead($speicherlabel) = "Speicher(6)" Then
    $speichermax = 12000
    ElseIf GUICtrlRead($speicherlabel) = "Speicher(7)" Then
    $speichermax = 13000
    ElseIf GUICtrlRead($speicherlabel) = "Speicher(8)" Then
    $speichermax = 14000
    ElseIf GUICtrlRead($speicherlabel) = "Speicher(9)" Then
    $speichermax = 15000
    ElseIf GUICtrlRead($speicherlabel) = "Speicher(10)" Then
    $speichermax = 20000
    EndIf

    [/autoit] [autoit][/autoit] [autoit]

    If Guictrlread($speicheranzahl) > $speichermax Then
    GUICtrlSetData($speicheranzahl,$speichermax&" / "&$speichermax)
    EndIf

    [/autoit] [autoit][/autoit] [autoit]

    If GUICtrlRead($eisenminelabel) = "Eisenmine(0)" Then
    $ep10s = 30
    ElseIf GUICtrlRead($eisenminelabel) = "Eisenmine(1)" Then
    $ep10s = 50
    ElseIf GUICtrlRead($eisenminelabel) = "Eisenmine(2)" Then
    $ep10s = 80
    ElseIf GUICtrlRead($eisenminelabel) = "Eisenmine(3)" Then
    $ep10s = 100
    ElseIf GUICtrlRead($eisenminelabel) = "Eisenmine(4)" Then
    $ep10s = 120
    ElseIf GUICtrlRead($eisenminelabel) = "Eisenmine(5)" Then
    $ep10s = 130
    ElseIf GUICtrlRead($eisenminelabel) = "Eisenmine(6)" Then
    $ep10s = 150
    ElseIf GUICtrlRead($eisenminelabel) = "Eisenmine(7)" Then
    $ep10s = 190
    ElseIf GUICtrlRead($eisenminelabel) = "Eisenmine(8)" Then
    $ep10s = 220
    ElseIf GUICtrlRead($eisenminelabel) = "Eisenmine(9)" Then
    $ep10s = 250
    ElseIf GUICtrlRead($eisenminelabel) = "Eisenmine(10)" Then
    $ep10s = 300
    EndIf
    If GUICtrlRead($steinbruchlabel) = "Steinbruch(0)" Then
    $sp10s = 30
    ElseIf GUICtrlRead($steinbruchlabel) = "Steinbruch(1)" Then
    $sp10s = 50
    ElseIf GUICtrlRead($steinbruchlabel) = "Steinbruch(2)" Then
    $sp10s = 80
    ElseIf GUICtrlRead($steinbruchlabel) = "Steinbruch(3)" Then
    $sp10s = 100
    ElseIf GUICtrlRead($steinbruchlabel) = "Steinbruch(4)" Then
    $sp10s = 120
    ElseIf GUICtrlRead($steinbruchlabel) = "Steinbruch(5)" Then
    $sp10s = 130
    ElseIf GUICtrlRead($steinbruchlabel) = "Steinbruch(6)" Then
    $sp10s = 150
    ElseIf GUICtrlRead($steinbruchlabel) = "Steinbruch(7)" Then
    $sp10s = 190
    ElseIf GUICtrlRead($steinbruchlabel) = "Steinbruch(8)" Then
    $sp10s = 220
    ElseIf GUICtrlRead($steinbruchlabel) = "Steinbruch(9)" Then
    $sp10s = 250
    ElseIf GUICtrlRead($steinbruchlabel) = "Steinbruch(10)" Then
    $sp10s = 300
    EndIf
    If GUICtrlRead($sagewerklabel) = "Sägewerk(0)" Then
    $hp10s = 30
    ElseIf GUICtrlRead($sagewerklabel) = "Sägewerk(1)" Then
    $hp10s = 50
    ElseIf GUICtrlRead($sagewerklabel) = "Sägewerk(2)" Then
    $hp10s = 80
    ElseIf GUICtrlRead($sagewerklabel) = "Sägewerk(3)" Then
    $hp10s = 100
    ElseIf GUICtrlRead($sagewerklabel) = "Sägewerk(4)" Then
    $hp10s = 120
    ElseIf GUICtrlRead($sagewerklabel) = "Sägewerk(5)" Then
    $hp10s = 130
    ElseIf GUICtrlRead($sagewerklabel) = "Sägewerk(6)" Then
    $hp10s = 150
    ElseIf GUICtrlRead($sagewerklabel) = "Sägewerk(7)" Then
    $hp10s = 190
    ElseIf GUICtrlRead($sagewerklabel) = "Sägewerk(8)" Then
    $hp10s = 220
    ElseIf GUICtrlRead($sagewerklabel) = "Sägewerk(9)" Then
    $hp10s = 250
    ElseIf GUICtrlRead($sagewerklabel) = "Sägewerk(10)" Then
    $hp10s = 300
    EndIf
    If GUICtrlRead($bauzentralelabel) = "Bauzentrale(0)" Then
    $zabzug = 0
    ElseIf GUICtrlRead($bauzentralelabel) = "Bauzentrale(1)" Then
    $zabzug = 5
    ElseIf GUICtrlRead($bauzentralelabel) = "Bauzentrale(2)" Then
    $zabzug = 7
    ElseIf GUICtrlRead($bauzentralelabel) = "Bauzentrale(3)" Then
    $zabzug = 9
    ElseIf GUICtrlRead($bauzentralelabel) = "Bauzentrale(4)" Then
    $zabzug = 11
    ElseIf GUICtrlRead($bauzentralelabel) = "Bauzentrale(5)" Then
    $zabzug = 13
    ElseIf GUICtrlRead($bauzentralelabel) = "Bauzentrale(6)" Then
    $zabzug = 15
    ElseIf GUICtrlRead($bauzentralelabel) = "Bauzentrale(7)" Then
    $zabzug = 17
    ElseIf GUICtrlRead($bauzentralelabel) = "Bauzentrale(8)" Then
    $zabzug = 19
    ElseIf GUICtrlRead($bauzentralelabel) = "Bauzentrale(9)" Then
    $zabzug = 21
    ElseIf GUICtrlRead($bauzentralelabel) = "Bauzentrale(10)" Then
    $zabzug = 23
    EndIf
    If TimerDiff($timerstart) >= 10000 and GUICtrlRead($eisenlabel)+GUICtrlRead($steinlabel)+GUICtrlRead($holzlabel) <= $speichermax Then
    GUICtrlSetData($eisenlabel,GUICtrlRead($eisenlabel)+$ep10s)
    GUICtrlSetData($steinlabel,GUICtrlRead($steinlabel)+$sp10s)
    GUICtrlSetData($holzlabel,GUICtrlRead($holzlabel)+$hp10s)
    GUICtrlSetData($ehrelabel,GUICtrlRead($ehrelabel)+$ehp10s)
    GUICtrlSetData($speicheranzahl,GUICtrlRead($eisenlabel)+GUICtrlRead($steinlabel)+GUICtrlRead($holzlabel)&" / "&$speichermax)
    GUICtrlSetData($eisenmineanzahl,$ep10s&" / 10s")
    GUICtrlSetData($steinbruchanzahl,$sp10s&" / 10s")
    GUICtrlSetData($sagewerkanzahl,$hp10s&" / 10s")
    GUICtrlSetData($bauzentraleanzeige,"-"&$zabzug&"s")
    $timerstart = TimerInit()
    check()
    EndIf
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    Func check()
    If $buttonsperre = 0 Then
    If Guictrlread($eisenlabel) >= GUICtrlRead($eisenkostenbauzentrale) then
    GUICtrlSetColor($eisenkostenbauzentrale, 0x800000)
    $b1state1 = 1
    else
    GUICtrlSetColor($eisenkostenbauzentrale, 0xff0000)
    $b1state1 = 0
    Endif
    If Guictrlread($eisenlabel) >= GUICtrlRead($eisenkostenbauernhaus) then
    GUICtrlSetColor($eisenkostenbauernhaus, 0x800000)
    $b2state1 = 1
    else
    GUICtrlSetColor($eisenkostenbauernhaus, 0xff0000)
    $b2state1 = 0
    Endif
    If Guictrlread($eisenlabel) >= GUICtrlRead($eisenkostenspeicher) then
    GUICtrlSetColor($eisenkostenspeicher, 0x800000)
    $b3state1 = 1
    else
    GUICtrlSetColor($eisenkostenspeicher, 0xff0000)
    $b3state1 = 0
    Endif
    If Guictrlread($eisenlabel) >= GUICtrlRead($eisenkosteneisenmine) then
    GUICtrlSetColor($eisenkosteneisenmine, 0x800000)
    $b4state1 = 1
    else
    GUICtrlSetColor($eisenkosteneisenmine, 0xff0000)
    $b4state1 = 0
    Endif
    If Guictrlread($eisenlabel) >= GUICtrlRead($eisenkostensteinbruch) then
    GUICtrlSetColor($eisenkostensteinbruch, 0x800000)
    $b5state1 = 1
    else
    GUICtrlSetColor($eisenkostensteinbruch, 0xff0000)
    $b5state1 = 0
    Endif
    If Guictrlread($eisenlabel) >= GUICtrlRead($eisenkostensagewerk) then
    GUICtrlSetColor($eisenkostensagewerk, 0x800000)
    $b6state1 = 1
    else
    GUICtrlSetColor($eisenkostensagewerk, 0xff0000)
    $b6state1 = 0
    Endif

    [/autoit] [autoit][/autoit] [autoit]

    If Guictrlread($steinlabel) >= GUICtrlRead($steinkostenbauzentrale) then
    GUICtrlSetColor($steinkostenbauzentrale, 0x800000)
    $b1state2 = 1
    else
    GUICtrlSetColor($steinkostenbauzentrale, 0xff0000)
    $b1state2 = 0
    Endif
    If Guictrlread($steinlabel) >= GUICtrlRead($steinkostenbauernhaus) then
    GUICtrlSetColor($steinkostenbauernhaus, 0x800000)
    $b2state2 = 1
    else
    GUICtrlSetColor($steinkostenbauernhaus, 0xff0000)
    $b2state2 = 0
    Endif
    If Guictrlread($steinlabel) >= GUICtrlRead($steinkostenspeicher) then
    GUICtrlSetColor($steinkostenspeicher, 0x800000)
    $b3state2 = 1
    else
    GUICtrlSetColor($steinkostenspeicher, 0xff0000)
    $b3state2 = 0
    Endif
    If Guictrlread($steinlabel) >= GUICtrlRead($steinkosteneisenmine) then
    GUICtrlSetColor($steinkosteneisenmine, 0x800000)
    $b4state2 = 1
    else
    GUICtrlSetColor($steinkosteneisenmine, 0xff0000)
    $b4state2 = 0
    Endif
    If Guictrlread($steinlabel) >= GUICtrlRead($steinkostensteinbruch) then
    GUICtrlSetColor($steinkostensteinbruch, 0x800000)
    $b5state2 = 1
    else
    GUICtrlSetColor($steinkostensteinbruch, 0xff0000)
    $b5state2 = 0
    Endif
    If Guictrlread($steinlabel) >= GUICtrlRead($steinkostensagewerk) then
    GUICtrlSetColor($steinkostensagewerk, 0x800000)
    $b6state2 = 1
    else
    GUICtrlSetColor($steinkostensagewerk, 0xff0000)
    $b6state2 = 0
    Endif

    [/autoit] [autoit][/autoit] [autoit]

    If Guictrlread($holzlabel) >= GUICtrlRead($holzkostenbauzentrale) then
    GUICtrlSetColor($holzkostenbauzentrale, 0x800000)
    $b1state3 = 1
    else
    GUICtrlSetColor($holzkostenbauzentrale, 0xff0000)
    $b1state3 = 0
    Endif
    If Guictrlread($holzlabel) >= GUICtrlRead($holzkostenbauernhaus) then
    GUICtrlSetColor($holzkostenbauernhaus, 0x800000)
    $b2state3 = 1
    else
    GUICtrlSetColor($holzkostenbauernhaus, 0xff0000)
    $b2state3 = 0
    Endif
    If Guictrlread($holzlabel) >= GUICtrlRead($holzkostenspeicher) then
    GUICtrlSetColor($holzkostenspeicher, 0x800000)
    $b3state3 = 1
    else
    GUICtrlSetColor($holzkostenspeicher, 0xff0000)
    $b3state3 = 0
    Endif
    If Guictrlread($holzlabel) >= GUICtrlRead($holzkosteneisenmine) then
    GUICtrlSetColor($holzkosteneisenmine, 0x800000)
    $b4state3 = 1
    else
    GUICtrlSetColor($holzkosteneisenmine, 0xff0000)
    $b4state3 = 0
    Endif
    If Guictrlread($holzlabel) >= GUICtrlRead($holzkostensteinbruch) then
    GUICtrlSetColor($holzkostensteinbruch, 0x800000)
    $b5state3 = 1
    else
    GUICtrlSetColor($holzkostensteinbruch, 0xff0000)
    $b5state3 = 0
    Endif
    If Guictrlread($holzlabel) >= GUICtrlRead($holzkostensagewerk) then
    GUICtrlSetColor($holzkostensagewerk, 0x800000)
    $b6state3 = 1
    else
    GUICtrlSetColor($holzkostensagewerk, 0xff0000)
    $b6state3 = 0
    Endif

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    If $b1state1 = 1 and $b1state2 = 1 and $b1state3 = 1 and $ausbaubutton1getstate = 1 Then
    GUICtrlSetState($ausbaubutton1,$GUI_ENABLE)
    $ausbaubutton1getstate = 0
    $b1state1 = 0
    $b1state2 = 0
    $b1state3 = 0
    ElseIf $ausbaubutton1getstate = 0 and $b1state1 = 0 or $b1state2 = 0 or $b1state3 = 0 Then
    GUICtrlSetState($ausbaubutton1,$GUI_DISABLE)
    $ausbaubutton1getstate = 1
    $b1state1 = 0
    $b1state2 = 0
    $b1state3 = 0
    EndIf
    If $b2state1 = 1 and $b2state2 = 1 and $b2state3 = 1 and $ausbaubutton2getstate = 1 Then
    GUICtrlSetState($ausbaubutton2,$GUI_ENABLE)
    $ausbaubutton2getstate = 0
    $b2state1 = 0
    $b2state2 = 0
    $b2state3 = 0
    ElseIf $ausbaubutton2getstate = 0 and $b2state1 = 0 or $b2state2 = 0 or $b2state3 = 0 Then
    GUICtrlSetState($ausbaubutton2,$GUI_DISABLE)
    $ausbaubutton2getstate = 1
    $b2state1 = 0
    $b2state2 = 0
    $b2state3 = 0
    EndIf
    If $b3state1 = 1 and $b3state2 = 1 and $b3state3 = 1 and $ausbaubutton3getstate = 1 Then
    GUICtrlSetState($ausbaubutton3,$GUI_ENABLE)
    $ausbaubutton3getstate = 0
    $b3state1 = 0
    $b3state2 = 0
    $b3state3 = 0
    ElseIf $ausbaubutton3getstate = 0 and $b3state1 = 0 or $b3state2 = 0 or $b3state3 = 0 Then
    GUICtrlSetState($ausbaubutton3,$GUI_DISABLE)
    $ausbaubutton3getstate = 1
    $b3state1 = 0
    $b3state2 = 0
    $b3state3 = 0
    EndIf
    If $b4state1 = 1 and $b4state2 = 1 and $b4state3 = 1 and $ausbaubutton4getstate = 1 Then
    GUICtrlSetState($ausbaubutton4,$GUI_ENABLE)
    $ausbaubutton4getstate = 0
    $b4state1 = 0
    $b4state2 = 0
    $b4state3 = 0
    ElseIf $ausbaubutton4getstate = 0 and $b4state1 = 0 or $b4state2 = 0 or $b4state3 = 0 Then
    GUICtrlSetState($ausbaubutton4,$GUI_DISABLE)
    $ausbaubutton4getstate = 1
    $b4state1 = 0
    $b4state2 = 0
    $b4state3 = 0
    EndIf
    If $b5state1 = 1 and $b5state2 = 1 and $b5state3 = 1 and $ausbaubutton5getstate = 1 Then
    GUICtrlSetState($ausbaubutton5,$GUI_ENABLE)
    $ausbaubutton5getstate = 0
    $b5state1 = 0
    $b5state2 = 0
    $b5state3 = 0
    ElseIf $ausbaubutton5getstate = 0 and $b5state1 = 0 or $b5state2 = 0 or $b5state3 = 0 Then
    GUICtrlSetState($ausbaubutton5,$GUI_DISABLE)
    $ausbaubutton5getstate = 1
    $b5state1 = 0
    $b5state2 = 0
    $b5state3 = 0
    EndIf
    If $b6state1 = 1 and $b6state2 = 1 and $b6state3 = 1 and $ausbaubutton6getstate = 1 Then
    GUICtrlSetState($ausbaubutton6,$GUI_ENABLE)
    $ausbaubutton6getstate = 0
    $b6state1 = 0
    $b6state2 = 0
    $b6state3 = 0
    ElseIf $ausbaubutton6getstate = 0 and $b6state1 = 0 or $b6state2 = 0 or $b6state3 = 0 Then
    GUICtrlSetState($ausbaubutton6,$GUI_DISABLE)
    $ausbaubutton6getstate = 1
    $b6state1 = 0
    $b6state2 = 0
    $b6state3 = 0
    EndIf
    EndIf
    Endfunc

    [/autoit] [autoit][/autoit] [autoit]

    Func kampf()
    Endfunc

    [/autoit]

    das schema ist dabei

    Name
    Eisenkosten

    Steinkosten

    Hozkosten

    Zeit

    Dein Eisen | Dein Stein | Dein Holz | Deine Ehre

    [autoit]


    Func Ulam($n)
    Return 1
    EndFunc

    [/autoit]


    Rekursion FTW :D

  • mach ich doch ich hab doch in die while die fuktion check()
    gesetzt und wenn du ein bisschen nach unten scrollst kannst du sehen dass dort die labels ausgelesen werden.
    und es müssen ja nicht nur die buttons gesperrt werden sondern auch angezeigt werden was fehlt also welchen rohstoff man zu wenig hat um ein bestimmtes gebäude zu bauen
    hat noch wer anders ne idee??

    [autoit]


    Func Ulam($n)
    Return 1
    EndFunc

    [/autoit]


    Rekursion FTW :D

  • wird jedoch klappt es nicht immer einwandfrei

    wir sind egtl nicht da um bugs in programmen zu suchen. natürlich helfen wir dir gerne bei problemen aber du kannst nicht erwarten dass man sich 800 zeilen code durchliest und vor allem durchdenkt.
    dein code is nämlich nicht unbedingt übersichtlich...
    beschreib doch besser was dir an dem script nicht passt.

  • das hab ich auch schon versucht aber da flackern die ganzen controls und der effekt ist der selbe

    [autoit]


    Func Ulam($n)
    Return 1
    EndFunc

    [/autoit]


    Rekursion FTW :D

  • ja ok wie oben genannt
    es ist einprogramm wo man alle 10 sek rohstoffe bekommt die anzahl die man pro 10 s bekommt hängt dabei von der stufe der gebäude ab um die stufen zu erhöhen braucht man rohstoffe. Nun möchte ich dass wenn man sich ein gebäude nicht leisten kann der button disabled wird und der rohstoff der fehlt rot dargestellt wird. das klappt auch zum größten teil jedoch nicht immer . es scheint mir so als wenn die rohstoffanzahl unter 100 liegt und ich abrage ob sie größer ist als 100 true gesendet wird. kann das sein??

    [autoit]


    Func Ulam($n)
    Return 1
    EndFunc

    [/autoit]


    Rekursion FTW :D

    Einmal editiert, zuletzt von retrokid (5. Mai 2010 um 21:10)