Sign in to follow this  
Followers 0
GeekS

General Array Problem

4 posts in this topic

Ok this is very likely a small typo problem or something, but i cant seem to find or fix it.

#include <GUIConstants.au3>
#Include <Constants.au3>
#include <EzSkin.au3>

Opt("GUICloseOnESC", 1)
Opt("TrayIconHide", 1)

#include <GUIConstants.au3>

#Region ### START Koda GUI section ### Form=
$FormGold = GUICreate("Max gold", 633, 447, @DesktopWidth/2-633/2,  @DesktopHeight/2-447/2.5-@DesktopHeight/4)
$Regen = EzSkinButton("", 522, 104, 591-522, 220-104, $BS_BITMAP)
$LVLINPUT = GUICtrlCreateInput("Max Gold", 80, 192, 177, 21)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Select
        Case $nMsg = $GUI_EVENT_CLOSE
            Exit
        Case $nMsg = $Regen
            
$LVL = GuiCtrlRead($LVLINPUT)

Dim $K[41] = ["", 50000, 50000*2, 50000*3, 50000*4, 50000*5, 50000*6, 50000*7, 50000*8, 50000*9, 50000*10, 50000*11, 50000*12, 50000*13, 50000*14, 50000*15, 50000*16, 50000*17, 50000*18, 50000*19, 50000*20, 50000*21, 50000*22, 50000*23, 50000*23, 50000*24, 50000*25, 50000*26, 50000*27, 50000*28, 50000*29, 50000*30]
Dim $L[41] = ["", 1, 10, 20, 30, 31, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 80, 82, 84, 86, 88, 90, 92, 94, 96, 98, 99]
$MaxGold = 2500000

For $i = 1 to 39;there's 40
    If $LVL >= $L[$i] And $LVL < $L[$i] Then $MaxGold = $K[$i]
    Next
MsgBox(-1, "Max gold possible", $MaxGold)


    EndSelect
WEnd

I wanted to have different outputs (MsgBox) depending on what's inserted into the GuiCtrlCreateInput. Like

Insert/output: 1 / 50.000

Insert/output: 2 / 50.000

Insert/output: 8 / 50.000

Insert/output: 20 / 150.000

If you dont understand what i'm trying to get from this, feel free to ask.

Thanks in advance, Gnu / GeekS.

Share this post


Link to post
Share on other sites



If $LVL >= $L[$i] And $LVL < $L[$i]

That's impossible!


SNMP_UDF ... for SNMPv1 and v2c so far, GetBulk and a new example script

wannabe "Unbeatable" Tic-Tac-Toe

Paper-Scissor-Rock ... try to beat it anyway :)

Share this post


Link to post
Share on other sites

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
;#include <EzSkin.au3>

Opt("GUICloseOnESC", 1)
Opt("TrayIconHide", 1)


Dim $K[41] = ["", 50000, 50000 * 2, 50000 * 3, 50000 * 4, 50000 * 5, 50000 * 6, 50000 * 7, 50000 * 8, 50000 * 9, 50000 * 10, 50000 * 11, 50000 * 12, 50000 * 13, 50000 * 14, 50000 * 15, 50000 * 16, 50000 * 17, 50000 * 18, 50000 * 19, 50000 * 20, 50000 * 21, 50000 * 22, 50000 * 23, 50000 * 23, 50000 * 24, 50000 * 25, 50000 * 26, 50000 * 27, 50000 * 28, 50000 * 29, 50000 * 30]
Dim $L[41] = ["", 1, 10, 20, 30, 31, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 80, 82, 84, 86, 88, 90, 92, 94, 96, 98, 99]
$MaxGold = 2500000

$FormGold = GUICreate("Max gold", 633, 447, @DesktopWidth / 2 - 633 / 2, @DesktopHeight / 2 - 447 / 2.5 - @DesktopHeight / 4)
$Regen = GUICtrlCreateButton("", 522, 104, 591 - 522, 220 - 104);, $BS_BITMAP)
$LVLINPUT = GUICtrlCreateInput("Max Gold", 80, 192, 177, 21)
GUISetState(@SW_SHOW)

While 1
    $nMsg = GUIGetMsg()
    Select
        Case $nMsg = $GUI_EVENT_CLOSE
            Exit
        Case $nMsg = $Regen

            $LVL = GUICtrlRead($LVLINPUT)

            For $i = 1 To 39 ;there's 40
                If $LVL >= $L[$i] And $LVL < $L[$i + 1] Then
                    $MaxGold = $K[$i]
                    MsgBox(-1, "Max gold possible", $MaxGold)
                    ExitLoop
                EndIf
            Next

    EndSelect
WEnd

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
;#include <EzSkin.au3>

Opt("GUICloseOnESC", 1)
Opt("TrayIconHide", 1)


Dim $K[41] = ["", 50000, 50000 * 2, 50000 * 3, 50000 * 4, 50000 * 5, 50000 * 6, 50000 * 7, 50000 * 8, 50000 * 9, 50000 * 10, 50000 * 11, 50000 * 12, 50000 * 13, 50000 * 14, 50000 * 15, 50000 * 16, 50000 * 17, 50000 * 18, 50000 * 19, 50000 * 20, 50000 * 21, 50000 * 22, 50000 * 23, 50000 * 23, 50000 * 24, 50000 * 25, 50000 * 26, 50000 * 27, 50000 * 28, 50000 * 29, 50000 * 30]
Dim $L[41] = ["", 1, 10, 20, 30, 31, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 80, 82, 84, 86, 88, 90, 92, 94, 96, 98, 99]
$MaxGold = 2500000

$FormGold = GUICreate("Max gold", 633, 447, @DesktopWidth / 2 - 633 / 2, @DesktopHeight / 2 - 447 / 2.5 - @DesktopHeight / 4)
$Regen = GUICtrlCreateButton("", 522, 104, 591 - 522, 220 - 104);, $BS_BITMAP)
$LVLINPUT = GUICtrlCreateInput("Max Gold", 80, 192, 177, 21)
GUISetState(@SW_SHOW)

While 1
    $nMsg = GUIGetMsg()
    Select
        Case $nMsg = $GUI_EVENT_CLOSE
            Exit
        Case $nMsg = $Regen

            $LVL = GUICtrlRead($LVLINPUT)

            For $i = 1 To 39 ;there's 40
                If $LVL >= $L[$i] And $LVL < $L[$i + 1] Then
                    $MaxGold = $K[$i]
                    MsgBox(-1, "Max gold possible", $MaxGold)
                    ExitLoop
                EndIf
            Next

    EndSelect
WEnd

8)

Thanks yet again, your a great help :P

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0