Hilfe beim $variable [2] Syntax

  • ORIGINAL:

    Spoiler anzeigen
    [autoit]

    #include-once
    ; #FUNCTION# ====================================================================================================================
    ; Name...........: _ProgressGui
    ; Description ...: A small splash screen type GUI with a progress bar and a configurable label
    ; Syntax.........: _ProgressGUI($s_MsgText = "Text Message", $s_MarqueeType = 0, $i_Fontsize = 14, $s_Font = "Arial", $i_XSize = 290, $i_YSize = 100, $b_GUIColor = -1, $b_FontColor = -1)
    ; Parameters ....: $s_MsgText - Text to display on the GUI
    ; $s_MarqueeType - [optional] Style of Progress Bar you want to use
    ; 0 = Marquee style [default]
    ; 1 = Normal Progress Bar style
    ; $i_Fontsize - [optional] The font size that you want to display the $s_MsgText at [default = 14]
    ; $s_Font - [optional] The font you want the message to use [default = "Arial"]
    ; $i_XSize - [optional] Width of the GUI [Default = 290] - Minimum size is 80
    ; $i_YSize - [optional] Height of the GUI [Default = 100] - Minimum size is 100
    ; $b_GUIColor - [optional] Background color of the GUI [default = 0x00080FF = Blue]
    ; $s_FontColor - [optional] Color of the text message [default = 0x0FFFC19 = Yellow]
    ; Return values .: Success - An array containing the following information
    ; $Array[0] - ControlID of the GUI created
    ; $Array[1] - ControlID of the ProgressBar control
    ; $Array[2] - ControlID of the label
    ; Failure - 0 and @error to 1 if the GUI couldn't be created
    ;
    ; Author ........: Bob Marotte (BrewManNH)
    ; Remarks .......: This will create a customizable GUI with a progress bar. The default style of the progress bar using this function is the
    ; Marquee style of progress bar. If you call this function with any positive, non-zero number in the $s_MarqueeType
    ; parameter it will use the normal progress bar style. All optional parameters will accept the "Default" keyword, an empty
    ; string "", or -1 if passed to the function. Use the return value to delete the GUI when you're done using it
    ; (ex. GUIDelete($Returnvalue[0]))
    ; Related .......: None
    ; Link ..........:
    ; Example .......: No
    ; ===============================================================================================================================
    Func _ProgressGUI($s_MsgText = "Text Message", $s_MarqueeType = 0, $i_Fontsize = 14, $s_Font = "Arial", $i_XSize = 290, $i_YSize = 100, $b_GUIColor = -1, $b_FontColor = -1)
    Local $PBMarquee[3]
    ;~ UDF Constants so no includes are needed
    Local Const $PG_WS_POPUP = 0x80000000 ; same as the $WS_POPUP constant in WindowsConstants.au3
    Local Const $PG_WS_DLGFRAME = 0x00400000 ; same as the $WS_DLGFRAME constant in WindowsConstants.au3
    Local Const $PG_PBS_MARQSMTH = 9 ; BitOr of $PBS_SMOOTH and $PBS_MARQUEE
    Local Const $PG_PBS_SMTH = 1 ; same as the $PBS_SMOOTH constant in ProgressConstants.au3
    Local Const $PG_PBM_SETMARQUEE = 1034 ; same as the $PBM_SETMARQUEE constant in ProgressConstants.au3
    ; bounds checking/correcting
    If $i_Fontsize = "" Or $i_Fontsize = Default Or $i_Fontsize = "-1" Then $i_Fontsize = 14 ; use the default setting of 14 for font size
    If $i_Fontsize < 1 Then $i_Fontsize = 1 ; minimum font size is 1
    If $i_XSize = "" Or $i_XSize = "-1" Or $i_XSize = Default Then $i_XSize = 290 ; use the default setting for X dimension of the GUI
    If $i_XSize < 80 Then $i_XSize = 80 ; minimum X dimension is 80
    If $i_XSize > @DesktopWidth - 50 Then $i_XSize = @DesktopWidth - 50 ; maximum X dimension is Desktop Width - 50
    If $i_YSize = "" Or $i_YSize = "-1" Or $i_YSize = Default Then $i_YSize = 100 ; use the default setting for Y dimension of the GUI
    If $i_YSize > @DesktopHeight - 50 Then $i_YSize = @DesktopHeight - 50 ; maximum y dimension is Desktop Height - 50
    If $i_YSize < 100 Then $i_YSize = 100 ; minimum Y dimension is 100
    If $s_Font = "" Or $s_Font = "-1" Or $s_Font = "Default" Then $s_Font = "Arial" ; use the default font type
    ;create the GUI
    $PBMarquee[0] = GUICreate("", $i_XSize, $i_YSize, -1, -1, BitOR($PG_WS_DLGFRAME, $PG_WS_POPUP))
    If @error Then Return SetError(@error, 0, 0) ; if there's any error with creating the GUI, return the error code
    Switch $b_GUIColor ; background color of the GUI
    Case "-1", Default; Used to set the default color
    GUISetBkColor(0x00080FF, $PBMarquee[0])
    Case ""
    ; don't set a default color, use the theme's coloring
    Case Else ; set the BG color of the GUI to the user provided color
    GUISetBkColor($b_GUIColor, $PBMarquee[0])
    EndSwitch
    ; Create the progressbar
    If $s_MarqueeType < 1 Then ; if $s_MarqueeType < 1 then use the Marquee style progress bar
    $PBMarquee[1] = GUICtrlCreateProgress(20, $i_YSize - 20, $i_XSize - 40, 15, $PG_PBS_MARQSMTH) ; uses the $PBS_SMOOTH and $PBS_MARQUEE style
    GUICtrlSendMsg($PBMarquee[1], $PG_PBM_SETMARQUEE, True, 20) ; change last parameter to change update speed of marquee style PB
    Else ; If $s_MarqueeType > 0 then use the normal style progress bar
    $PBMarquee[1] = GUICtrlCreateProgress(20, $i_YSize - 20, $i_XSize - 40, 15, $PG_PBS_SMTH) ; Use the $PBS_SMOOTH style
    EndIf
    ; Create the label
    $PBMarquee[2] = GUICtrlCreateLabel($s_MsgText, 20, 20, $i_XSize - 40, $i_YSize - 45) ; create the label for the GUI
    GUICtrlSetFont($PBMarquee[2], $i_Fontsize, 400, Default, $s_Font)
    Switch $b_FontColor
    Case "-1", Default; Used to set the default color of the label
    GUICtrlSetColor($PBMarquee[2], 0x0FFFC19)
    Case ""
    ; don't set a default color, use the theme's coloring
    Case Else
    GUICtrlSetColor($PBMarquee[2], $b_FontColor)
    EndSwitch
    GUISetState()
    Return SetError(0, 0, $PBMarquee) ;Return an array containing the ControlIDs of the GUI, Progress bar, and the Label (in that order)
    EndFunc ;==>_ProgressGUI

    [/autoit]


    Meine Variante (Was ich brauche) den Progressbar hab ich ausgelassen....

    Spoiler anzeigen
    [autoit]

    Func _ProgressGUI($s_MsgText = "Text Message", $s_MarqueeType = 0, $i_Fontsize = 14, $s_Font = "Arial", $i_XSize = 290, $i_YSize = 100, $b_GUIColor = -1, $b_FontColor = -1)
    Local $PBMarquee[3]
    ;~ UDF Constants so no includes are needed
    Local Const $PG_WS_POPUP = 0x80000000 ; same as the $WS_POPUP constant in WindowsConstants.au3
    Local Const $PG_WS_DLGFRAME = 0x00400000 ; same as the $WS_DLGFRAME constant in WindowsConstants.au3
    Local Const $PG_PBS_MARQSMTH = 9 ; BitOr of $PBS_SMOOTH and $PBS_MARQUEE
    Local Const $PG_PBS_SMTH = 1 ; same as the $PBS_SMOOTH constant in ProgressConstants.au3
    Local Const $PG_PBM_SETMARQUEE = 1034 ; same as the $PBM_SETMARQUEE constant in ProgressConstants.au3
    ; bounds checking/correcting
    If $i_Fontsize = "" Or $i_Fontsize = Default Or $i_Fontsize = "-1" Then $i_Fontsize = 14 ; use the default setting of 14 for font size
    If $i_Fontsize < 1 Then $i_Fontsize = 1 ; minimum font size is 1
    If $i_XSize = "" Or $i_XSize = "-1" Or $i_XSize = Default Then $i_XSize = 290 ; use the default setting for X dimension of the GUI
    If $i_XSize < 80 Then $i_XSize = 80 ; minimum X dimension is 80
    If $i_XSize > @DesktopWidth - 50 Then $i_XSize = @DesktopWidth - 50 ; maximum X dimension is Desktop Width - 50
    If $i_YSize = "" Or $i_YSize = "-1" Or $i_YSize = Default Then $i_YSize = 100 ; use the default setting for Y dimension of the GUI
    If $i_YSize > @DesktopHeight - 50 Then $i_YSize = @DesktopHeight - 50 ; maximum y dimension is Desktop Height - 50
    If $s_Font = "" Or $s_Font = "-1" Or $s_Font = "Default" Then $s_Font = "Arial" ; use the default font type
    ;create the GUI
    $PBMarquee[0] = GUICreate("SplashWindow", $i_XSize, $i_YSize, -1, -1, BitOR($PG_WS_DLGFRAME, $PG_WS_POPUP))
    If @error Then Return SetError(@error, 0, 0) ; if there's any error with creating the GUI, return the error code
    Switch $b_GUIColor ; background color of the GUI
    Case "-1", Default; Used to set the default color
    GUISetBkColor(0x00080FF, $PBMarquee[0])
    Case ""
    ; don't set a default color, use the theme's coloring
    Case Else ; set the BG color of the GUI to the user provided color
    GUISetBkColor($b_GUIColor, $PBMarquee[0])
    EndSwitch
    ; Create the progressbar
    ;~ If $s_MarqueeType < 1 Then ; if $s_MarqueeType < 1 then use the Marquee style progress bar
    ;~ $PBMarquee[1] = GUICtrlCreateProgress(20, $i_YSize - 20, $i_XSize - 40, 15, $PG_PBS_MARQSMTH) ; uses the $PBS_SMOOTH and $PBS_MARQUEE style
    ;~ GUICtrlSendMsg($PBMarquee[1], $PG_PBM_SETMARQUEE, True, 20) ; change last parameter to change update speed of marquee style PB
    ;~ Else ; If $s_MarqueeType > 0 then use the normal style progress bar
    ;~ $PBMarquee[1] = GUICtrlCreateProgress(20, $i_YSize - 20, $i_XSize - 40, 15, $PG_PBS_SMTH) ; Use the $PBS_SMOOTH style
    ;~ EndIf
    ; Create the label
    $PBMarquee[2] = GUICtrlCreateLabel($s_MsgText, 1, 1, $i_XSize, $i_YSize) ; create the label for the GUI
    GUICtrlSetFont($PBMarquee[2], $i_Fontsize, 400, Default, $s_Font)
    Switch $b_FontColor
    Case "-1", Default; Used to set the default color of the label
    GUICtrlSetColor($PBMarquee[2], 0x0FFFC19)
    Case ""
    ; don't set a default color, use the theme's coloring
    Case Else
    GUICtrlSetColor($PBMarquee[2], $b_FontColor)
    EndSwitch
    GUISetState()
    Return SetError(0, 0, $PBMarquee) ;Return an array containing the ControlIDs of the GUI, Progress bar, and the Label (in that order)
    EndFunc ;==>_ProgressGUI

    [/autoit]

    TACH,
    kleines problem wie eh und jeh....
    ich will diese kleine UDF _ProgressGUI.au3 benutzen, was auf dieser seite zu finden ist:
    [url='' [url']http://www.autoitscript.com/forum/topic/12…h-progress-bar/[/url]']Customizable-Splash-Screen-GUI-with-Progress-bar[/url]

    Jedoch mache ich da entweder was falsch, oder ich muss was anderes probieren... und zwar
    ich will das bei einer Tasten druck dieses kleine Splash Screen angezeigt wird was ein GUI ist. Jedoch wenn es dies tut soll es beim nexten tasten druck den Label Aktualisieren ohne das sich der GUI Komplett schliest und wieder auftaucht.
    Was ich aus dieser UDF brauche ist halt das man den Background color, Font Color, etc ändern kann und das er mit der Maus Moveable ist also bewegbar...

    Hab eigentlich mehr oder weniger alles geschaft jedocht wenn ich es schaffe es zu bewegen aktualisiert der Label nicht... ?( ?( ?(
    und wenn ich es schaffe es zu aktualisieren ist er nicht mehr bewegbar.... :cursing: :cursing: :cursing:

    Ich brauche die Variable in der UDF

    [autoit]

    $PBMarquee[2]
    $PBMarquee[2] = GUICtrlCreateLabel($s_MsgText, 1, 1, $i_XSize, $i_YSize) ; create the label for the GUI

    [/autoit]


    jedoch wegen der [2] tut der Nichts -.-

    [autoit]

    GUICtrlSetData ($PBMarquee[2], $ReadLine)

    [/autoit]

    Hättet ihr da eine idee was man an der UDF ändern kann ohne die Funktionen zu verlieren???
    Meine Kleine Funktion : Soll als SplashBox dienen da man mit SplashTextOn nicht sehr viel machen kann...

    Spoiler anzeigen
    [autoit]

    ;============================================================================================================
    ; F2 KEY
    ;============================================================================================================
    Func _F2Key()

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

    $Xpos = IniRead(@ScriptDir & "\config.ini", "Coordinates_X", "X", "")
    $Ypos = IniRead(@ScriptDir & "\config.ini", "Coordinates_Y", "Y", "")
    $time = IniRead(@ScriptDir & "\config.ini", "Time", "milliseconds", "")

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

    If WinExists ("SplashWindow","") Then
    GUICtrlSetData ($SplashInLabel, $ReadLine)

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

    ElseIf not WinExists ("SplashWindow","") Then
    ;~ _ProgressGUI($readline,"",Fontsize, $s_Font, $i_XSize, $i_YSize, $b_GUIColor, $b_FontColor)
    $CustomSplash = _ProgressGUI($ReadLine, 1, 20, "", 330, 50, 1, 0xE35522)
    GUICtrlSetStyle($CustomSplash, -1, 0x00100000) ;<<<<<<<<<<<<<<< This makes the first GUI movable with the mouse
    WinSetOnTop("SplashWindow", "", 1)
    EndIf
    Sleep($time)
    SplashOff()

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

    If $time = 0 Then
    $time = IniRead(@ScriptDir & "\config.ini", "Time", "milliseconds", "")
    SplashTextOn("", $ReadLine, 250, 45, $Xpos, $Ypos, 1, "", 12, 800)
    EndIf
    EndFunc ;==>_F2Key
    ;~ **********************************************************************************************************

    [/autoit]

    und hier ein kleines Example was der Autor gebastelt hat... Müsst ihr net selber raussuchen :D

    Spoiler anzeigen
    [autoit]

    #include "_ProgressGUI.au3"
    $Return = _ProgressGUI("This is a test message xxxxxxxxxxxxxxx xxxxxxxxxxxxx", 1, 30, "", 400, 300);, 4, 6)
    GUICtrlSetStyle($Return[2], -1, 0x00100000) ;<<<<<<<<<<<<<<< This makes the first GUI movable with the mouse
    For $I = 1 To 100
    GUICtrlSetData($Return[1], $I)

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

    Sleep(200)
    If Mod($I, 2) Then GUISetBkColor(Random(0, 32767, 1), $Return[0])
    Next
    Sleep(2000)
    GUIDelete($Return[0])
    $Return = _ProgressGUI()
    Sleep(4000)

    [/autoit]

    p.s. kann vorkommen das paar Variablen nicht einstimmen, da ich viel probiert habe :whistling: :whistling: :whistling:

    Einmal editiert, zuletzt von SSlayer93 (13. September 2014 um 00:32)

  • Interessant wäre dein Script gewesen in dem man den Fehler sieht^^
    Aber ich verstehe das richtig dass du mehrere GUI's verwendest oder?
    Eventuell wird ein GUISwitch() benötigt

  • das script ist für ein anderes programm geschreiben, ohne dies hilft es auch net weiter deswegen nur der eine Teil :)

    hmm ja schon, Halt statt ein SplashTextOn ("","","","") soll das ein Gui fenster das nur aussieht wie ein SplashBox sein., es soll natürlich nicht bei jedem erneutem jeweiligem tastendruck in dem fall halt "F2" ein neues GUI erstellen, sondern nur den geöffneten aktualisieren.

    Leider nicht wenn ich das richtig verstanden habe mit dem GUiSwitch, ich brauche im end efekt den Variable von der GuiCtrlCreateLabel im UDF, da sie jedoch den Variable

    [autoit]

    $PBMarquee[2]

    [/autoit]

    Hatt kann ich es nicht im GuiCtrlSetData nicht einsetzen wegen der Array [2] (kriege da ein ERROR) jedoch braucht der UDF den array da es nur damit geht das man die GUI bewegen kann...

    [autoit]

    $PBMarquee[2] = GUICtrlCreateLabel($s_MsgText, 1, 1, $i_XSize, $i_YSize) ; create the label for the GUI

    [/autoit]
  • ja wenn der GuiCtrlSetState ($variable[2], $variable1) funktionieren würde währe die sache schon gegessen :D
    es will halt den [2] nicht mit anerkennen, also keine ahnung wie ich das sonst noch anders ausdrücken soll.

    So ein Error kriege ich

    (270) : ==> Subscript used on non-accessible variable.:
    GUICtrlSetData ($SplashInLabel[2], $ReadLine)
    GUICtrlSetData ($SplashInLabel^ ERROR

    Benutze ISN AutoIT Studio

  • D.h. zu dem Zeitpunkt an dem du $SplashInLabel[2] verwendest existiert es noch nicht als Array.
    Wahrscheinlich hast du die Variable schon Deklariert aber sie ist kein Array wenn du sie verwendest.
    Am besten prüfst du vor der verwendung mit IsArray() ob die Variable ein Array ist. Falls ja kannst du sie verwenden, falls nein musst du etwas anderes machen.
    Ich tippe mal darauf dass du $SplashInLabel[2] verwendest bevor du überhaupt die _ProgressGui Funktion aufgerufen hast.
    Mit einer "normalen" Variable fällt das natürlich nicht auf weil dann das GUICtrlSetData einfach immer fehlschlägt bis das Control existiert...

  • Spoiler anzeigen
    [autoit]

    Func _ProgressGUI($s_MsgText = "Text Message", $s_MarqueeType = 0, $i_Fontsize = 14, $s_Font = "Arial", $i_XSize = 290, $i_YSize = 100, $b_GUIColor = -1, $b_FontColor = -1)
    Local $PBMarquee[3]
    ;~ UDF Constants so no includes are needed
    Local Const $PG_WS_POPUP = 0x80000000 ; same as the $WS_POPUP constant in WindowsConstants.au3
    Local Const $PG_WS_DLGFRAME = 0x00400000 ; same as the $WS_DLGFRAME constant in WindowsConstants.au3
    Local Const $PG_PBS_MARQSMTH = 9 ; BitOr of $PBS_SMOOTH and $PBS_MARQUEE
    Local Const $PG_PBS_SMTH = 1 ; same as the $PBS_SMOOTH constant in ProgressConstants.au3
    Local Const $PG_PBM_SETMARQUEE = 1034 ; same as the $PBM_SETMARQUEE constant in ProgressConstants.au3
    ; bounds checking/correcting
    If $i_Fontsize = "" Or $i_Fontsize = Default Or $i_Fontsize = "-1" Then $i_Fontsize = 14 ; use the default setting of 14 for font size
    If $i_Fontsize < 1 Then $i_Fontsize = 1 ; minimum font size is 1
    If $i_XSize = "" Or $i_XSize = "-1" Or $i_XSize = Default Then $i_XSize = 290 ; use the default setting for X dimension of the GUI
    If $i_XSize < 80 Then $i_XSize = 80 ; minimum X dimension is 80
    If $i_XSize > @DesktopWidth - 50 Then $i_XSize = @DesktopWidth - 50 ; maximum X dimension is Desktop Width - 50
    If $i_YSize = "" Or $i_YSize = "-1" Or $i_YSize = Default Then $i_YSize = 100 ; use the default setting for Y dimension of the GUI
    If $i_YSize > @DesktopHeight - 50 Then $i_YSize = @DesktopHeight - 50 ; maximum y dimension is Desktop Height - 50
    If $s_Font = "" Or $s_Font = "-1" Or $s_Font = "Default" Then $s_Font = "Arial" ; use the default font type
    ;create the GUI
    $PBMarquee[0] = GUICreate("SplashWindow", $i_XSize, $i_YSize, -1, -1, BitOR($PG_WS_DLGFRAME, $PG_WS_POPUP))
    If @error Then Return SetError(@error, 0, 0) ; if there's any error with creating the GUI, return the error code
    Switch $b_GUIColor ; background color of the GUI
    Case "-1", Default; Used to set the default color
    GUISetBkColor(0x00080FF, $PBMarquee[0])
    Case ""
    ; don't set a default color, use the theme's coloring
    Case Else ; set the BG color of the GUI to the user provided color
    GUISetBkColor($b_GUIColor, $PBMarquee[0])
    EndSwitch
    ; Create the progressbar
    ;~ If $s_MarqueeType < 1 Then ; if $s_MarqueeType < 1 then use the Marquee style progress bar
    ;~ $PBMarquee[1] = GUICtrlCreateProgress(20, $i_YSize - 20, $i_XSize - 40, 15, $PG_PBS_MARQSMTH) ; uses the $PBS_SMOOTH and $PBS_MARQUEE style
    ;~ GUICtrlSendMsg($PBMarquee[1], $PG_PBM_SETMARQUEE, True, 20) ; change last parameter to change update speed of marquee style PB
    ;~ Else ; If $s_MarqueeType > 0 then use the normal style progress bar
    ;~ $PBMarquee[1] = GUICtrlCreateProgress(20, $i_YSize - 20, $i_XSize - 40, 15, $PG_PBS_SMTH) ; Use the $PBS_SMOOTH style
    ;~ EndIf
    ; Create the label
    $PBMarquee[2] = GUICtrlCreateLabel($s_MsgText, 1, 1, $i_XSize, $i_YSize) ; create the label for the GUI
    GUICtrlSetFont($PBMarquee[2], $i_Fontsize, 400, Default, $s_Font)
    Switch $b_FontColor
    Case "-1", Default; Used to set the default color of the label
    GUICtrlSetColor($PBMarquee[2], 0x0FFFC19)
    Case ""
    ; don't set a default color, use the theme's coloring
    Case Else
    GUICtrlSetColor($PBMarquee[2], $b_FontColor)
    EndSwitch
    GUISetState()
    Return SetError(0, 0, $PBMarquee) ;Return an array containing the ControlIDs of the GUI, Progress bar, and the Label (in that order)
    EndFunc ;==>_ProgressGUI

    [/autoit]

    hab im UDF isArray überprüft und in meinem script

    Meins: (26) : ==> Array variable has incorrect number of subscripts or subscript dimension range exceeded.:
    IsArray ($PBMarquee[2])
    IsArray (^ ERROR

    UDF: (49) : ==> Duplicate function name.:
    Func _ProgressGUI($s_MsgText = "Text Message", $s_MarqueeType = 0, $i_Fontsize = 14, $s_Font = "Arial", $i_XSize = 290, $i_YSize = 100, $b_GUIColor = -1, $b_FontColor = -1)

    ein deklarietes Array würde doch so aussehen wenn ich recht habe: Local $Array2D[0][1]
    wenn ja dann hatt es der UDF nicht....

  • Verwende mal statt der Zeile:

    [autoit]

    GUICtrlSetData ($SplashInLabel[2], $ReadLine)

    [/autoit]


    Diese hier:

    [autoit]

    If IsArray($SplashInLabel) Then GUICtrlSetData($SplashInLabel[2], $ReadLine)

    [/autoit]
  • [autoit]

    If WinExists ("SplashWindow","") Then
    IsArray($PBMarquee[2])
    GUICtrlSetData($PBMarquee[2], $ReadLine)

    [/autoit]


    $PBMarquee[2] ist der GuiCtrlCreateLabel Variable im UDF...

    ERROR:

    [autoit]

    (273) : ==> Array variable has incorrect number of subscripts or subscript dimension range exceeded.:
    GUICtrlSetData($PBMarquee[2], $ReadLine)
    GUICtrlSetData(^ ERROR

    [/autoit]


    NO ERROR:

    [autoit]

    If WinExists ("SplashWindow","") Then
    IsArray($PBMarquee)
    GUICtrlSetData($PBMarquee, $ReadLine)

    [/autoit]

    jedoch aktualisiert es sich natürlich net X( :huh: ....

  • man man man....
    Hat IRGENDEINER in diesem Thread JEMALS ein Script debugged?
    Arrays und deren Inhalte fragt man ab mittels

    [autoit]

    _Arraydisplay()

    [/autoit]


    Keine Anzeige => kein Array, wenn Anzeige, dann sieht man den Arrayinhalt.
    Dimension eines Arrays?

    [autoit]

    Ubound()

    [/autoit]

    ist dein Freund...

    Hier wird wieder mal vortrefflich gezeigt, wie man, OHNE ein Script zu posten 2 Stunden lang Leute beschäftzigen kann, ohne auch nur ansatzweise einem Ergebnis näher zu kommen.

    SSlayer93, wenn du nicht in der Lage bist, komplette Scripte zu posten, lass die Programmiererei sein! Wenn deine Scripte so geheim sind, dass man sie niemandem zeigen darf, dann frag dich mal, was du hier willst!
    Jede Wette, ein komplettes Script wird gepostet und in den nächsten 2 Posts stehen 3 Lösungsansätze.....aber so? :thumbdown:

  • SSlayer93, wenn du nicht in der Lage bist, komplette Scripte zu posten, lass die Programmiererei sein! Wenn deine Scripte so geheim sind, dass man sie niemandem zeigen darf, dann frag dich mal, was du hier willst!
    Jede Wette, ein komplettes Script wird gepostet und in den nächsten 2 Posts stehen 3 Lösungsansätze.....aber so? :thumbdown:

    Willste beleidigen oder Helfen?, geheimerei? hat rein gar nichts damit zu tun der Rest der Script sind nur andere Funktionenen die Rein gar nichts mit dem problem zu tun haben
    und 150% unabhängig von dem ganzen hier, deswegen habe ich mir die arbeit gespart damit ich und die Jenigen die helfen mögen das problem nicht aus den augen verlieren.

    Hab leider bis jetzt nie Array gebraucht bzw damit gearbeitet deswegen bisschen langsam heute :whistling: :whistling: :whistling:


    Wie rufst Du die Funktion aus der UDF auf?
    $PBMarquee ist eine lokale Variable. Die kannst Du nicht vom Hauptprogramm aus benutzen.
    Du musst das Array verwenden, dass Du von der Funktion zurück bekommst.

    Steht eigentlich alles oben :D
    Wie genau würde das gehen?, ich verstehe schon was du meinst weis leider net genau wie ich das umsetzen kann...
    hab mir paar beispiele im Hilfe angesehen und diese hier versucht :

    [autoit]

    Global $SplashInLabel = UBound ($PBMarquee,2)

    [/autoit]

    und dann in meinem Script :

    [autoit]

    If WinExists ("SplashWindow","") Then
    GUICtrlSetData($SplashInLabel , $ReadLine)

    [/autoit]


    Spoiler anzeigen
    [autoit]

    ; #FUNCTION# ====================================================================================================================
    ; Name...........: _ProgressGui
    ; Description ...: A small splash screen type GUI with a progress bar and a configurable label
    ; Syntax.........: _ProgressGUI($s_MsgText = "Text Message", $s_MarqueeType = 0, $i_Fontsize = 14, $s_Font = "Arial", $i_XSize = 290, $i_YSize = 100, $b_GUIColor = -1, $b_FontColor = -1)
    ; Parameters ....: $s_MsgText - Text to display on the GUI
    ; $s_MarqueeType - [optional] Style of Progress Bar you want to use
    ; 0 = Marquee style [default]
    ; 1 = Normal Progress Bar style
    ; $i_Fontsize - [optional] The font size that you want to display the $s_MsgText at [default = 14]
    ; $s_Font - [optional] The font you want the message to use [default = "Arial"]
    ; $i_XSize - [optional] Width of the GUI [Default = 290] - Minimum size is 80
    ; $i_YSize - [optional] Height of the GUI [Default = 100] - Minimum size is 100
    ; $b_GUIColor - [optional] Background color of the GUI [default = 0x00080FF = Blue]
    ; $s_FontColor - [optional] Color of the text message [default = 0x0FFFC19 = Yellow]
    ; Return values .: Success - An array containing the following information
    ; $Array[0] - ControlID of the GUI created
    ; $Array[1] - ControlID of the ProgressBar control
    ; $Array[2] - ControlID of the label
    ; Failure - 0 and @error to 1 if the GUI couldn't be created
    ;
    ; Author ........: Bob Marotte (BrewManNH)
    ; Remarks .......: This will create a customizable GUI with a progress bar. The default style of the progress bar using this function is the
    ; Marquee style of progress bar. If you call this function with any positive, non-zero number in the $s_MarqueeType
    ; parameter it will use the normal progress bar style. All optional parameters will accept the "Default" keyword, an empty
    ; string "", or -1 if passed to the function. Use the return value to delete the GUI when you're done using it
    ; (ex. GUIDelete($Returnvalue[0]))
    ; Related .......: None
    ; Link ..........:
    ; Example .......: No
    ; ===============================================================================================================================

    [/autoit]

    Einmal editiert, zuletzt von SSlayer93 (10. September 2014 um 20:32)

  • Willste beleidigen oder Helfen?, geheimerei? hat rein gar nichts damit zu tun der Rest der Script sind nur andere Funktionenen die Rein gar nichts mit dem problem zu tun haben
    und 150% unabhängig von dem ganzen hier, deswegen habe ich mir die arbeit gespart damit ich und die Jenigen die helfen mögen das problem nicht aus den augen verlieren.


    Ich muss Andy zustimmen. Das was in deinen ersten Post steht hat eigentlich garnichts mit dem Problem zu tun bzw. dadurch wird es nicht ersichtlich.
    Konkret wurde es erst ab den Error. Und wenn man schon nen error bekommt dann ist debugging das A und O
    "Steht eigentlich alles oben" ist auch wieder am Problem vorbei, weil das oben nicht zu gebrauchen ist.
    Du deklarierst irgendwo eine Variable und bevor sie zum Array wird verwendest du sie schon als Array.

    Das du das Problem mit einer "normalen" Variable nicht hattest liegt nicht daran dass das Problem dort nicht auch auftrat. Es hatte nur nicht die Folgen dass das Script beendet wird.
    Schlampig geschrieben war es mit der "normalen" Variable genauso...

    Edit1:
    Wirf mal nen Blick in meine Signatur. Da ist unter Tutorials für den Einstieg in Autoit ein nützlicher Link um Fehler selbst zu finden.
    Der Ersteller des Threads weiß wovon er spricht und sollte ruhig respektiert werden

  • oke,entschuldigt den aufwand :D hier dann der Script... dachte würde reichen solange man das in der Funktion den fehler behebt deswegen gekürzt :rolleyes:

    Spoiler anzeigen
    [autoit]

    Global $ReadLine, $LogFile, $INI, $INI2, $exeFile, $Button1, $Button2, $Button3, $Button4, $Button5, $Button6, $Button7, $Button8
    Global $emuLog, $f2, $Label2, $hDLL, $hEdit, $string, $pos
    Global $Xpos, $Ypos, $time, $pressedOnButton, $pressedOffButton
    Global $Form1, $Form2, $Form3
    Global $hEdit1, $hEdit2, $hEdit3, $ReadOff, $ReadOn, $Readme, $CustomSplash,$PBMarquee, $SplashInLabel

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

    #NoTrayIcon
    #include <EditConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <GuiEdit.au3>
    #include <Misc.au3>
    #include <Restart.au3>
    #include <ScrollBarsConstants.au3>
    #include <StaticConstants.au3>
    #include <WindowsConstants.au3>
    #include <ButtonConstants.au3>
    #include <Timers.au3>
    #include <TastenAbfragen.au3>
    #include <_ProgressGUI_NoProgressbar.au3>

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

    ;============================================================================================================
    ; CHECK config.ini And Readme.txt
    ;============================================================================================================
    ;=> IF FILE NOT EXIST THEN SHOW SPLASH TEXT
    If FileExists (@ScriptDir &"\Readme.txt")Then
    $Readme = FileRead (@ScriptDir &"\Readme.txt")
    EndIf
    If Not FileExists(@ScriptDir & "\config.ini") Then
    SplashTextOn("1", "Please Chose Path First!!!", 500, 100, -1, -1, 1 + 32, "Algerian", 22)
    Sleep(1500)
    SplashOff()
    EndIf
    ;~ **********************************************************ua************************************************

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

    ;============================================================================================================
    ; MAIN INTERFACE [FORM:1]
    ;============================================================================================================
    While 1
    $INI = IniRead("config.ini", "Config", "Path", "")
    Sleep(10)
    $INI2 = IniRead("config.ini", "PCSX2", "exe", $exeFile)

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

    ;~ !!!! ~~~ !!!! ~~~
    $hDLL = DllOpen("user32.dll")
    $emuLog = FileOpen($INI & "\logs\emuLog.txt", 0)
    $LogFile = FileRead($emuLog)
    $ReadLine = FileReadLine($emuLog, -1)
    $ReadOff = IniRead(@ScriptDir & "\config.ini", "ON", "Preview", "")
    $ReadOn = IniRead(@ScriptDir & "\config.ini", "OFF", "Preview", "")

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

    ;~ !!!! ~~~ !!!! ~~~

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

    ;=> ~~~ CREATE GUI ~~~
    #Region
    $Form1 = GUICreate("PCSX2 SaveState Preview", 500, 500, -1, -1)
    GUISetBkColor(0x3378A5)
    $Menu1 = GUICtrlCreateMenu("Menu")
    $MenuItem = GUICtrlCreateMenuItem("About", $Menu1)
    $Restart = GUICtrlCreateMenuItem("Restart ", $Menu1, 5, 1)
    $MenuItem2 = GUICtrlCreateMenuItem("Reset Path", $Menu1)
    $MenuItem3 = GUICtrlCreateMenuItem("Download PCSX2", $Menu1)

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

    $CoordButton = GUICtrlCreateButton("Set Position", 0, 145, 100, 41)
    GUICtrlSetFont(-1, 12, 400, 2, "Bodoni MT", 5)

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

    $Button2 = GUICtrlCreateButton("Run PCSX2", 200, 125, 100, 41)
    GUICtrlSetFont(-1, 12, 400, 2, "Bodoni MT", 5)

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

    $Button3 = GUICtrlCreateButton("Chose Path", 400, 100, 100, 41)
    GUICtrlSetFont(-1, 12, 400, 2, "Bodoni MT", 5)

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

    $Button4 = GUICtrlCreateButton("Set Time", 400, 145, 100, 41)
    GUICtrlSetFont(-1, 12, 400, 2, "Bodoni MT", 5)

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

    $Button5 = GUICtrlCreateButton("Key Set", 0, 100, 100, 41)
    GUICtrlSetFont(-1, 12, 400, 2, "Bodoni MT", 5)

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

    $Label1 = GUICtrlCreateLabel(":CURRENT STATE:", 0, 0, 500, 40)
    GUICtrlSetStyle(-1, $SS_CENTER + $SS_SUNKEN + $BS_MULTILINE)
    GUICtrlSetFont(-1, 23, 800, 4, "Algerian")
    GUICtrlSetColor(-1, 0xFFFFFF)
    GUICtrlSetBkColor(-1, 0x3378A5)

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

    $Label2 = GUICtrlCreateLabel($ReadLine, 0, 40, 500, 35)
    GUICtrlSetBkColor(-1, 0x3378A5)
    GUICtrlSetStyle(-1, $SS_CENTER + $SS_SUNKEN)
    GUICtrlSetCursor(-1, "4")
    GUICtrlSetFont(-1, 20, 800, "", "Bodoni MT")
    GUICtrlSetColor(-1, 0x0EFE01)
    GUICtrlSetData($Label2, $ReadLine)

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

    $hEdit = GUICtrlCreateEdit($string, 0, 185, 500, 300, BitOR($ES_WANTRETURN, $WS_VSCROLL, $ES_READONLY))
    GUICtrlSetCursor(-1, "3")
    GUICtrlSetFont(-1, 10, 400, 0, "Tahoma")
    $string = _GUICtrlEdit_SetText($hEdit, $LogFile)
    $GetTextLen = _GUICtrlEdit_GetTextLen($hEdit)
    _GUICtrlEdit_SetSel($hEdit, $GetTextLen, $GetTextLen)
    _GUICtrlEdit_Scroll($hEdit, $SB_SCROLLCARET)
    GUISetState()
    #EndRegion
    ;=> ~~~ END GUI ~~~

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

    ;=> *** USER DEFINED FUNCTIONS (UDF´s) ***
    While 1

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

    Switch GUIGetMsg()

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

    Case $GUI_EVENT_CLOSE
    _CLOSE()
    Case $Button2
    _StartPCSX2()
    Case $Button3
    _SetPath()
    Case $Restart
    _Restarting()
    Case $MenuItem
    GUISetState(@SW_DISABLE, $Form1)
    _About()
    Case $MenuItem2
    _ResetPath()
    Case $MenuItem3
    _URLPCSX2()
    Case $CoordButton
    _SetCoordButton()
    Case $Button4
    _TimeSet()
    Case $Button5
    _KeySet()

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

    EndSwitch

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

    Switch Key()
    Case "F2"
    _F2Key()
    Case $ReadOff
    _DisablePreview()
    Case $ReadOn
    _EnablePreview()

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

    EndSwitch
    WEnd
    WEnd
    ;~ **********************************************************************************************************
    ;~ **********************************************************************************************************
    ;~ **********************************************************************************************************

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

    ;============================================================================================================
    ; CLOSE EVENTS
    ;============================================================================================================
    Func _CLOSE()
    Exit
    EndFunc ;==>_CLOSE
    ;~ **********************************************************************************************************

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

    ;============================================================================================================
    ; DISABLE PREVIEW [BUTTON] [$hEdit2]
    ;============================================================================================================
    Func _DisableP()
    While Not($pressedOffButton = "pause")
    $pressedOffButton = Key(Default, "1000", "1000")
    GUISetState()
    GUICtrlSetState($Button7, $GUI_DISABLE)
    $mPos = MouseGetPos()
    ToolTip("Detecting...." & $mPos)
    Sleep(0)
    If $pressedOffButton Then

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

    IniWrite(@ScriptDir & "\config.ini", "Preview", "OFF", $pressedOffButton)
    $sPB = _GUICtrlEdit_SetText($hEdit2, "OFF: " & $pressedOffButton)
    GUICtrlSetStyle($hEdit2, $SS_CENTER + $SS_SUNKEN + $BS_MULTILINE)
    $mPos = MouseGetPos()
    ToolTip("Detected!" & $mPos)
    Sleep(300)
    ToolTip("")
    ExitLoop
    EndIf
    WEnd
    EndFunc ;==>_DisableP

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

    ;~ **********************************************************************************************************

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

    ;============================================================================================================
    ; DISABLE PREVIEW
    ;============================================================================================================
    Func _DisablePreview()
    $Xpos = IniRead(@ScriptDir & "\config.ini", "Coordinates_X", "X", "")
    $Ypos = IniRead(@ScriptDir & "\config.ini", "Coordinates_Y", "Y", "")
    $ReadOn = IniRead(@ScriptDir & "\config.ini", "Preview", "ON", "")
    $ReadOff = IniRead(@ScriptDir & "\config.ini", "Preview", "OFF", "")
    WinSetOnTop("SplashWindow", "", 0)

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

    EndFunc ;==>_DisablePreview
    ;~ **********************************************************************************************************

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

    ;============================================================================================================
    ; ENABLE PREVIEW [$hEdit1]
    ;============================================================================================================
    Func _EnableP()

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

    While Not($pressedOnButton = "pause")

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

    $pressedOnButton = Key(Default, "500", "500")
    GUISetState()
    GUICtrlSetState($Button8, $GUI_DISABLE)
    $mPos = MouseGetPos()
    ToolTip("Detecting...." & $mPos)
    Sleep(0)
    If $pressedOnButton Then
    IniWrite(@ScriptDir & "\config.ini", "Preview", "ON", $pressedOnButton)
    $sPB = _GUICtrlEdit_SetText($hEdit1, "ON: " & $pressedOnButton)
    GUICtrlSetStyle($hEdit1, $SS_CENTER + $SS_SUNKEN + $BS_MULTILINE)

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

    $mPos = MouseGetPos()
    ToolTip("Detected!" & $mPos)
    Sleep(300)
    ToolTip("")
    ExitLoop

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

    EndIf
    WEnd

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

    EndFunc ;==>_EnableP
    ;~ **********************************************************************************************************

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

    ;============================================================================================================
    ; ENABLE PREVIEW
    ;============================================================================================================
    Func _EnablePreview()
    $Xpos = IniRead(@ScriptDir & "\config.ini", "Coordinates_X", "X", "")
    $Ypos = IniRead(@ScriptDir & "\config.ini", "Coordinates_Y", "Y", "")
    $ReadOn = IniRead(@ScriptDir & "\config.ini", "Preview", "ON", "")
    $ReadOff = IniRead(@ScriptDir & "\config.ini", "Preview", "OFF", "")

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

    ;~ _ProgressGUI($readline,"",Fontsize, $s_Font, $i_XSize, $i_YSize, $b_GUIColor, $b_FontColor)
    $CustomSplash = _ProgressGUI($ReadLine, 1, 20, "", 330, 50, 1, 0xE35522)
    GUICtrlSetStyle($PBMarquee[0], -1, 0x00100000) ;<<<<<<<<<<<<<<< This makes the first GUI movable with the mouse
    GUISetCoord ( $Xpos, $Ypos, $CustomSplash )
    WinSetOnTop("SplashWindow", "", 1)

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

    EndFunc ;==>_EnablePreview

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

    ;============================================================================================================
    ; F2 KEY
    ;============================================================================================================
    Func _F2Key()

    $emuLog = FileOpen($INI & "\logs\emuLog.txt", 0)
    $LogFile = FileRead($emuLog)
    $string = _GUICtrlEdit_SetText($hEdit, $LogFile)
    $GetTextLen = _GUICtrlEdit_GetTextLen($hEdit)
    _GUICtrlEdit_SetSel($hEdit, $GetTextLen, $GetTextLen)
    _GUICtrlEdit_Scroll($hEdit, $SB_SCROLLCARET)
    $emuLog = FileOpen($INI & "\logs\emuLog.txt", 0)
    $ReadLine = FileReadLine($emuLog, -1)
    GUICtrlSetData($Label2, $ReadLine)

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

    $Xpos = IniRead(@ScriptDir & "\config.ini", "Coordinates_X", "X", "")
    $Ypos = IniRead(@ScriptDir & "\config.ini", "Coordinates_Y", "Y", "")
    $time = IniRead(@ScriptDir & "\config.ini", "Time", "milliseconds", "")

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

    If WinExists ("SplashWindow","") Then
    GUICtrlSetData($SplashInLabel , $ReadLine)

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

    ElseIf not WinExists ("SplashWindow","") Then
    ;~ _ProgressGUI($readline,"",Fontsize, $s_Font, $i_XSize, $i_YSize, $b_GUIColor, $b_FontColor)
    $CustomSplash = _ProgressGUI($ReadLine, 1, 20, "", 330, 50, 1, 0xE35522)
    GUICtrlSetStyle($CustomSplash[2], -1, 0x00100000) ;<<<<<<<<<<<<<<< This makes the first GUI movable with the mouse
    WinSetOnTop("SplashWindow", "", 1)
    EndIf
    Sleep($time)
    SplashOff()

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

    If $time = 0 Then
    $time = IniRead(@ScriptDir & "\config.ini", "Time", "milliseconds", "")
    SplashTextOn("", $ReadLine, 250, 45, $Xpos, $Ypos, 1, "", 12, 800)
    EndIf
    EndFunc ;==>_F2Key
    ;~ **********************************************************************************************************

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

    ;============================================================================================================
    ; About
    ;============================================================================================================
    ;=> HELP SUB MENU (MENUITEM) CREATE GUI AND LABEL FOR INFO
    Func _About()
    $Form2 = GUICreate("About", 400, 200, -1, -1)
    GUISetBkColor(0x3378A5)
    $Label3 = GUICtrlCreateLabel(":ABOUT:", -0, -0, 400, 32, $SS_CENTER)
    GUICtrlSetFont(-1, 22, 800, 4, "Algerian")
    GUICtrlSetColor(-1, 0xFFFFFF)
    $Label4 = GUICtrlCreateLabel("~PCSX2 SaveState Preview~", 0, 80, 400, 40, $SS_CENTER)
    GUICtrlSetFont(-1, 15, 800, 4, "Algerian")
    GUICtrlSetColor(-1, 0x03E92C)
    $Label5 = GUICtrlCreateLabel("Version: 1.2", 0, 40, 400, 40, $SS_CENTER)
    GUICtrlSetFont(-1, 15, 800, 4, "Algerian")
    GUICtrlSetColor(-1, 0x03E92C)

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

    $Button4 = GUICtrlCreateButton(",~CLOSE~ ,", 92, 160, 201, 41)
    GUICtrlSetFont(-1, 12, 800, 4, "Algerian")
    GUICtrlSetColor(-1, 0x000000)
    GUICtrlSetBkColor(-1, 0xFFFFFF)
    GUISetState(@SW_SHOW)

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

    While 3
    Switch GUIGetMsg()
    Case $GUI_EVENT_CLOSE, $Button4
    GUIDelete($Form2)
    GUISetState(@SW_ENABLE, $Form1)
    GUISetState (@SW_RESTORE,$Form1)
    ExitLoop
    EndSwitch
    WEnd
    EndFunc ;==>_Help
    ;~ **********************************************************************************************************

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

    ;============================================================================================================
    ; KEY SET BUTTON ==> FORM 3
    ;============================================================================================================
    Func _KeySet()
    If WinExists("config.ini - Editor") Then WinClose("[CLASS:Notepad]")

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

    #Region ### START Koda GUI section ### Form=
    $Form3 = GUICreate("Set Your Key", 350, 300, -1, -1)
    GUICtrlSetState($Form3, @SW_SHOWNOACTIVATE)
    $Button7 = GUICtrlCreateButton("Disable Preview", 210, 260, 140, 40)
    GUICtrlSetFont(-1, 8.5, 800, 0)
    GUICtrlSetBkColor(-1, 0xE40C0C)
    $Button8 = GUICtrlCreateButton("Enable Preview", 0, 260, 140, 40)
    GUICtrlSetFont(-1, 8.5, 800, 0)
    GUICtrlSetBkColor(-1, 0x3CD556)
    $Button9 = GUICtrlCreateButton("Restore", 145, 270, 60, 30)

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

    $hEdit1 = GUICtrlCreateEdit("", 0, 0, 350, 50, BitOR($SS_CENTER, $ES_WANTRETURN, $WS_VSCROLL, $ES_READONLY))
    GUICtrlSetFont(-1, 10, 400, 0, "Tahoma", 5)
    GUICtrlSetCursor(-1, "3")
    GUICtrlSetStyle(-1, BitOR($ES_WANTRETURN, $WS_VSCROLL, $ES_READONLY))
    GUICtrlSetFont(-1, 23, 800, 4, "Algerian")
    GUICtrlSetColor(-1, 0x00FF00)
    GUICtrlSetBkColor(-1, 0x3378A5)
    $ReadOn = IniRead(@ScriptDir & "\config.ini", "Preview", "ON", "")
    _GUICtrlEdit_SetText($hEdit1, "ON: " & $ReadOn)
    GUICtrlSetStyle($hEdit1, $SS_CENTER + $SS_SUNKEN + $BS_MULTILINE)

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


    ;~ _GUICtrlEdit_Create($hWnd, $sText, $iX, $iY [, $iWidth = 150 [, $iHeight = 150 [, $iStyle, $iExStyle ])
    $hEdit2 = GUICtrlCreateEdit("", 0, 50, 350, 50)
    GUICtrlSetFont(-1, 10, 400, 0, "Tahoma", 5)
    GUICtrlSetCursor(-1, "3")
    GUICtrlSetStyle(-1, BitOR($ES_WANTRETURN, $WS_VSCROLL, $ES_READONLY))
    GUICtrlSetFont(-1, 23, 800, 4, "Algerian")
    GUICtrlSetColor(-1, 0xFF0000)
    GUICtrlSetBkColor(-1, 0x3378A5)
    $ReadOff = IniRead(@ScriptDir & "\config.ini", "Preview", "OFF", "")
    _GUICtrlEdit_SetText($hEdit2, "OFF: " & $ReadOff)
    GUICtrlSetStyle($hEdit2, $SS_CENTER + $SS_SUNKEN + $BS_MULTILINE)

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


    ;~ GUICtrlCreateEdit ( "text", left, top [, width [, height [, style [, exStyle]]]] )
    $hEdit4 = GUICtrlCreateEdit("", 0, 100, 350, 160, BitOR($ES_WANTRETURN, $WS_VSCROLL, $ES_READONLY))
    _GUICtrlEdit_SetText($hEdit4, $Readme)
    $GetTextLen = _GUICtrlEdit_GetTextLen($hEdit4)
    _GUICtrlEdit_SetSel($hEdit4, $GetTextLen, $GetTextLen)
    _GUICtrlEdit_Scroll($hEdit4, $SB_SCROLLCARET)

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

    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###


    While 1
    Switch GUIGetMsg()
    Case $GUI_EVENT_CLOSE
    _ScriptRestart()
    Case $Button7 ;==> Disable Preview
    _DisableP()
    Case $Button8 ;==> Enable Preview
    _EnableP()
    Case $Button9
    GUISetState()
    GUICtrlSetState($Button7, $GUI_ENABLE)
    GUICtrlSetState($Button8, $GUI_ENABLE)

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

    EndSwitch

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

    WEnd
    EndFunc ;==>_KeySet
    ;~ **********************************************************************************************************

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

    ;============================================================================================================
    ; RESET PATH
    ;============================================================================================================
    Func _ResetPath()
    If FileExists(@ScriptDir & "\config.ini") Then
    FileDelete(@ScriptDir & "\config.ini")
    If Not FileExists(@ScriptDir & "\config.ini") Then
    Sleep(100)
    _SetPath()
    EndIf
    EndIf
    EndFunc ;==>_ResetPath
    ;~ **********************************************************************************************************

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

    ;============================================================================================================
    ; RESTART COMPLETE SCRIPT with _ScriptRestart () [UDF]
    ;============================================================================================================
    ;=> RESTART COMPLETE SCRIPT
    Func _Restarting()
    If SplashTextOn("", "RESTARTING....", 200, 50, -1, -1, 1) Then
    Sleep(10)
    _ScriptRestart()
    EndIf
    EndFunc ;==>_Restarting
    ;~ **********************************************************************************************************

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

    ;============================================================================================================
    ; SET COORDINATES
    ;============================================================================================================
    Func _SetCoordButton()
    SplashTextOn("1", "Press Enter To set Coordinates", 500, 80, -1, -10, 1 + 32, "Algerian", 22)
    GUISetState(@SW_DISABLE, $Form1)
    While 1

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

    If _IsPressed("0D", $hDLL) Then
    IniWrite(@ScriptDir & "\config.ini", "Coordinates_X", "X", $pos[0])
    $Xpos = IniRead(@ScriptDir & "\config.ini", "Coordinates_X", "X", $pos[0])

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

    IniWrite(@ScriptDir & "\config.ini", "Coordinates_Y", "Y", $pos[1])
    $Ypos = IniRead(@ScriptDir & "\config.ini", "Coordinates_Y", "Y", $pos[1])

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

    ToolTip("")
    SplashTextOn("", $ReadLine, 250, 45, $Xpos, $Ypos, 1, "", 12, 800)

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

    GUISetState(@SW_ENABLE, $Form1)
    ExitLoop
    Else
    $pos = MouseGetPos()
    ToolTip($pos[0] & "x" & $pos[1])
    Sleep(0)
    EndIf

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

    WEnd

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

    EndFunc ;==>_SetCoordButton
    ;~ **********************************************************************************************************

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

    ;============================================================================================================
    ; SET PATH
    ;============================================================================================================
    ;~ ------------------WRITE FOLDER PATH TO INI AND READ FOLDER PATH FROM INI-----------------
    Func _SetPath()

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

    $FileExist = FileExists(@ScriptDir & "\config.ini")
    If $FileExist Then
    SplashTextOn("", "Path already exists!", 300, 50, -1, -10, 16, "Algerian", 15)
    Sleep(500)
    SplashTextOn("", "", "", "", "", 30000, 1, "", "", "")
    Else

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

    $INI = IniRead("config.ini", "Config", "Path", "")
    If($INI = "") Then
    SplashTextOn("1", "Chose Main Folder from PCSX2", 500, 70, -1, -10, 1 + 32, "Algerian", 22)
    $INI = FileSelectFolder("", "")
    IniWrite(@ScriptDir & "\config.ini", "Config", "Path", $INI)

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

    ;~ ------------------WRITE PATH TO INI AND READ FOLDER PATH FROM INI-----------------

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

    ;~ .............................................................................................

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

    ;~ ------------------WRITE EXE PATH TO INI AND READ EXE PATH FROM INI-----------------
    $INI2 = IniRead("config.ini", "PCSX2", "exe", $exeFile)
    If($INI2 = "") Then
    SplashTextOn("1", "Chose PCSX2.exe", 500, 70, -1, -10, 1 + 32, "Algerian", 22)
    $INI2 = FileOpenDialog("", "", "PCSX2.exe(*.exe*)")
    IniWrite(@ScriptDir & "\config.ini", "PCSX2", "exe", $INI2)
    $INI2 = IniRead("config.ini", "PCSX2", "exe", $exeFile)
    $INI = IniRead("config.ini", "Config", "Path", "")
    ;~ ------------------WRITE EXE PATH TO INI AND READ EXE PATH FROM INI-----------------

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

    ;=> AFTER PATH IS CHOSEN SCRIPT RESTARTS AND SPLASH WILL BE SHOWN
    If SplashTextOn("", "RESTARTING....", 200, 50, -1, -1, 1) Then
    Sleep(1000)
    _ScriptRestart()

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

    EndIf
    EndIf
    EndIf
    EndIf
    EndFunc ;==>_SetPath
    ;~ **********************************************************************************************************

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

    ;============================================================================================================
    ; START PCSX2
    ;============================================================================================================
    Func _StartPCSX2()
    Sleep(200)
    Run($INI2)
    EndFunc ;==>_StartPCSX2
    ;~ **********************************************************************************************************

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

    ;============================================================================================================
    ; TIME SET
    ;============================================================================================================
    Func _TimeSet()

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

    $time = InputBox("Enter Time ", "Infinity: = 0, 1 Second = 1000", "0", "")
    IniWrite(@ScriptDir & "\config.ini", "Time", "milliseconds", $time)
    $time = IniRead(@ScriptDir & "\config.ini", "Time", "milliseconds", "")
    ;==>_TimeSet

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

    EndFunc ;==>_TimeSet
    Func _URLPCSX2()
    ShellExecute("http://pcsx2.net/download.html")
    EndFunc ;==>_URLPCSX2

    [/autoit]
  • [autoit]

    Global $hEdit1, $hEdit2, $hEdit3, $ReadOff, $ReadOn, $Readme, $CustomSplash,$PBMarquee, $SplashInLabel

    [/autoit]


    Versuch mal so:

    [autoit]

    Global $hEdit1, $hEdit2, $hEdit3, $ReadOff, $ReadOn, $Readme, $CustomSplash, $SplashInLabel
    Global $PBMarquee[3]

    [/autoit]


    Du hast in deinem Script $PBMarquee eben nicht als Array deklariert, sondern nur als eine gewöhnliche Variable ...

  • ne leider der gleiche Error
    Der will gar kein [] haben -.-

    [autoit]

    ==> Array variable has incorrect number of subscripts or subscript dimension range exceeded.:
    GUICtrlSetData($PBMarquee[3], $ReadLine)

    [/autoit]
  • Warum Deklarierst du überhaupt alles als Global am Anfang deines Scripts?
    Bei sowas bekommt man ja Kopfweh -.-
    Versuch selbst mal zu debuggen.
    Wenn du so ne meldung bekommst wie: Array variable has incorrect number of subscripts or subscript dimension range exceeded.:
    dann prüf in der darüberliegenden Zeile ob die Variable die du verwendest ein array ist: isarray(), _arraydisplay,...
    Und wieviele Elemente dein array hat: ubound()
    Schau dir am besten dazu das Debug und das Array tutorial aus meiner Signatur an
    dass damit was nicht stimmt:

    [autoit]

    GUICtrlSetData($PBMarquee[3], $ReadLine)

    [/autoit]


    Sollte dir nach der zeile schon bewusst sein:

    [autoit]

    Global $PBMarquee[3]

    [/autoit]


    Steht sogar in der Bemerkung zu Ubound ...

    Der Thread hier ist fast schon etwas verarsche.
    Du hantierst immer wieder mit anderen Variablen rum und das ist nur ein rumgestochere ohne Ansatz von Eigeninitiative. Für das Script das du da zusammengebastelt hast fehlt dir einfach viel zu viel Hintergrundwissen...

  • Der Thread hier ist fast schon etwas verarsche.
    Du hantierst immer wieder mit anderen Variablen rum und das ist nur ein rumgestochere ohne Ansatz von Eigeninitiative. Für das Script das du da zusammengebastelt hast fehlt dir einfach viel zu viel Hintergrundwissen...


    Schnitzel; Ich verstehe leider nicht warum dieser Thread hier eine so genannte "fast" verarsche sein soll...
    ohne Eigeninitiative sagst du, find ich echt schade das du sowas sagst... da es einfach nicht stimmt...
    das mir der Hintergrundwissen dazu fehlt muss mir keiner Weiß machen, habe erst vor kurzem mit programmieren angefangen kein 1 monat her, wenn ihr von einem Neuling erwartet das er ohne fragen sondern durch sogenanntes Eigeninitiative weiter kommen soll, warum dann der Thread "Hilfe & Unterstützung" ???

    Wie auch immer danke für die Tollen meinungen und Kritiken, ein paar sachen habe ich gelernt, man lernt nie aus :D


    Ich sage dazu nur: Zeile 237 und Zeile 238.
    Dass ist genau das, was ich schon vermutet hatte.
    Du solltest wirklich erstmal die Grundlagen in AutoIt erlernen.

    Oscar ; so dumm kann keiner sein der Programmieren versucht und nicht feststellt das der Fehler auf der Zeile 237 und 238 ist...
    wie gesagt Grundlagen lernt man nicht von heute auf morgen, da ich der eher der Praktische typ bin lerne ich viel schneller wenn ich alles selber versuche auch wenn es zeit kostet, was es mir Wert ist... :thumbup:

    Und zum guten Nachricht, ALLES klappt :D:D , lag am: ISN AutoIt Studio selber :cursing::cursing::cursing: , als ich das ganze im SciTe versucht habe ging das ganze mit der Variable GUICtrlSetData($PBMarquee[2], $ReadLine), keine ahnung was das soll aber eins steht fest..., bleibe nun für immer auf SciTe!!!