Naja, jetzt funktionierts ja
Beiträge von Fast2
-
-
*Hust* Hab das Komplett-Script vergessen*hust*
Spoiler anzeigen
[autoit]#cs -----------------------------------------------------
[/autoit] [autoit][/autoit] [autoit]
AutoIt Version: 3.2.8.1
Von: Fast2Funktion:DragRacer3 Automatisierung
[/autoit]
#ce -----------------------------------------------------
;Anfang
#region Includes
#include <GUIConstants.au3>
#include <GUICombo.au3>
#endregion
#region Variablen
#region GUI1
Dim $G1;Das Winhandle der 1.GUI
Dim $W1;Die "Weiter" Button controlID
Dim $F1;Die "Fertig" Button controlID
#region GUI2
Dim $G2;Das Winhandle der 2.GUI
#endregion
Dim $R1;Die "Spiel-ist-in-einem-Fenster" Radiobutton control-ID
Dim $R2;Die "Spiel-ist-in-einem-Tab" Radiobutton conrol-ID
Dim $B1;Die "Bestätigen" Button control-ID
Dim $B2;Die "Schließen" Button control-ID
#region andere Variablen
Dim $FM = ""
Dim $c;Nur so
Dim $x
Dim $y
Dim $s;bis hier
$MA = "Rock|Classic Rock|Hard Rock|Pop|HipHop|Rap"
$HA = "Speed|Graffiti|Skyline|Cityscape|Muscle|Money|Cash|Base"
$OA = "Outskirts (0Cr)|Hi-Rev Tuners Section (100 Cr)|'Pump It UP!' Section (100 Cr)|Luxury Section (200 Cr)|Food Court (200 Cr)|Main Floor (500 Cr)|Front Entrance(1000 Cr)"
$KDO = @AppDataCommonDir&"\XT\KD"
$KDP = $KDO&"\KOI.ini"
$OD = DirCreate($KDO)
#endregion
#endregion
If not FileExists($KDP) Then FileInstall("C:\Dokumente und Einstellungen\Fabian\Desktop\AutoItDateien\Hilfsdateien\INIs\KOI.ini", $OD, 1)
;GUI1
$G1 = GUICreate("Drag Racer Trainer", 640, 250)
GUISetFont(14)
GUICtrlCreateLabel("Dieser Trainer Automatisiert den Show Off Modus von Drag Racer v3", 40, 20)
GUICtrlCreateLabel("Dieser Trainer wurde nur für die Auflösung 1280x1024 getestet", 30, 60)
GUICtrlCreateLabel("Bitte wählen sie im folgenden Fenster aus den Einstellungen", 60, 100)
$W1 = GUICtrlCreateButton("Fortfahren", 420, 215, 105)
$F1 = GUICtrlCreateButton("Abbrechen", 525, 215, 100)
GUISetBkColor(0x0000ED)
;GUI2
$G2 = GUICreate("Drag Racer Trainer Auswahl", 600, 150)
GUISetBkColor(0x0000ED)
$CBM = GUICtrlCreateCombo("Bitte wählen sie die Musik", 25, 20, -1 ,-1, BitOr($GUI_SS_DEFAULT_COMBO, $CBS_DROPDOWNLIST))
GUICtrlSetData($CBM, $MA)
$CBH = GUICtrlCreateCombo("Bitte wählen sie den Hintergrund", 25, 65, -1 ,-1, BitOr($GUI_SS_DEFAULT_COMBO, $CBS_DROPDOWNLIST))
GUICtrlSetData($CBH, $HA)
$CBA = GUICtrlCreateCombo("Bitte wählen sie den Ausstellungsort", 25, 110, -1 ,-1, BitOr($GUI_SS_DEFAULT_COMBO, $CBS_DROPDOWNLIST))
GUICtrlSetData($CBA, $OA)
$R1 = GUICtrlCreateRadio("Das Spiel ist in einem Fenster ", 280, 25, 300)
$R2 = GUICtrlCreateRadio("Das Spiel ist in einem Tab ", 280, 60, 300)
$B1 = GUICtrlCreateButton("Bestätigen", 425, 100, 110, 35)
$B2 = GUICtrlCreateButton("Schließen", 280, 100, 110, 35)
GUICtrlSetFont($R1, 14, 150)
GUICtrlSetFont($R2, 14, 150)
GUICtrlSetFont($B1, 14, 150)
GUICtrlSetFont($B2, 14, 150)
GUISetState(@SW_Show, $G1)
While 1
$msg = GUIGetMsg()
Select
Case $msg = $W1
GUISetState(@SW_Show, $G2)
GUISetState(@SW_Hide, $G1)
Case $msg = $B2 Or $msg = $F1 Or $msg = $GUI_Event_Close
Exit
Case $msg = $B1
$CB1 = GUICtrlRead($CBM)
$CB2 = GUICtrlRead($CBH)
$CB3 = GUICtrlRead($CBA)
$RB1 = GUICtrlRead($R1)
$RB2 = GUICtrlRead($R2)
Select
Case $RB1 = 1
$FoT = 0
Case $RB2 = 1
$FoT = 25
Case Else
MsgBox(0, "Bitte Wählen", "Sie haben dem Programm nicht mitgeteilt," & @CRLF & "ob das Programm in einem Task ist oder nicht!")
EndSelect
$MFI = _GUICtrlComboGetCurSel($CBM)
$HFI = _GUICtrlComboGetCurSel($CBH)
$AFI = _GUICtrlComboGetCurSel($CBA)
$MFIY = "M"&$MFI
$HFIY = "H"&$HFI
$AFIY = "A"&$AFI
$XC = IniRead($KDP, "ACK", "XC", "Der Wert XC in der INI wurde auf eine nicht gültige weise verändert!")
$MC = IniRead($KDP, "ACK", "MA", "Der Wert MA in der INI wurde auf eine nicht gültige weise verändert!")
$HC = IniRead($KDP, "ACK", "HA", "Der Wert HA in der INI wurde auf eine nicht gültige weise verändert!")
$AC = IniRead($KDP, "ACK", "AA", "Der Wert AA in der INI wurde auf eine nicht gültige weise verändert!")
$MK = IniRead($KDP, "MAK", $MFIY, "Der Wert "&$MFIY&" in der INI wurde auf eine nicht gültige weise verändert!")
$HK = IniRead($KDP, "HAK", $HFIY, "Der Wert "&$HFIY&" in der INI wurde auf eine nicht gültige weise verändert!")
$AK = IniRead($KDP, "AAK", $AFIY, "Der Wert "&$AFIY&" in der INI wurde auf eine nicht gültige weise verändert!")
$NU = $XC&$MC&$HC&$AC&$HK&$AK
If Not StringIsDigit($NU) Then
Select
Case StringIsDigit($XC) = 0
$FM &= $XC & @CRLF
ContinueCase
Case StringIsDigit($MC) = 0
$FM &= $MC & @CRLF
ContinueCase
Case StringIsDigit($HC) = 0
$FM &= $HC & @CRLF
ContinueCase
Case StringIsDigit($AC) = 0
$FM &= $AC & @CRLF
ContinueCase
Case StringIsDigit($MK) = 0
$FM &= $MK & @CRLF
ContinueCase
Case StringIsDigit($HK) = 0
$FM &= $HK & @CRLF
ContinueCase
Case StringIsDigit($AK) = 0
$FM &= $AK & @CRLF
EndSelect
MsgBox(16, "Fehler", $FM)
Else
EndIf
EndSelect
WEnd
Und falls das Script einigen im Forum bekannt vorkommt: Ich treib mich immer so lange im Forum rum, das ich nicht weiterkomm.
Aber ich hätte nicht gedacht dass ContinueLoop die Schleife fortsetzt(wie ich beim Name vermutet habe) sondern von vorne beginnt. Danke. -
Ich habe diesen Codeabschnitt:
Spoiler anzeigen
[autoit]$MFI = _GUICtrlComboGetCurSel($CBM)
[/autoit]
$HFI = _GUICtrlComboGetCurSel($CBH)
$AFI = _GUICtrlComboGetCurSel($CBA)
$MFIY = "M"&$MFI
$HFIY = "H"&$HFI
$AFIY = "A"&$AFI
Select
Case $MFI = 0
Falls die Variable $MFI gleich 0 ist, soll das Programm eine MsgBox anzeigen mit entsprechendem Hinweis und wieder zur Eingabemaske springen.(2.GUI)
Das Problem: Wie realisiere ich das? (Ein GoTo gibt es ja nicht(mehr)) -
[Unnötiges Kommentar] Ich würde sagen es funzt, weil es so richtig ist[/Unnötiges Kommentar]
PS: Ein bisschen was kann man noch wegmachen : Anstatt:$ende6 = '</span></div>' das: $ende6 = '</span>'. Falls zwischen dem </span> und dem </div> mal was kommen sollte. -
999991
__________________________________________________________________________________________________________________________________
Lalala... -
-
Ich seh auch keinen (hab aber gedacht, das es an mir liegt)
-
-
omg...
Aus der Hilfe kopiert:Spoiler anzeigen
C
Alles anzeigenFunction Reference _GUICtrlComboAddDir -------------------------------------------------------------------------------- Add names to the list displayed by the combo box #Include <GuiCombo.au3> _GUICtrlComboAddDir ( $h_combobox, $s_Attributes [, $s_file] ) Parameters $h_combobox control id/control hWnd $s_Attributes comma-delimited string $s_file Optional for "Drives" only: what Files/Folders to get eg *.* Return Value Success: Returns zero-based index of the last name added to the list. Failure: Returns $CB_ERR. Returns $CB_ERRSPACE if there is insufficient space to store the new strings. Remarks Requirement: $s_file for all but drives attribute $s_Attributes is an comma-delimited string valid values are any of the following: A,D,H,RO,RW,S,E,Drives,NB A = ARCHIVE Includes archived files. D = DIRECTORY Includes subdirectories. Subdirectory names are enclosed in square brackets ([ ]). H = HIDDEN Includes hidden files. RO = READONLY Includes read-only files. RW = READWRITE Includes read-write files with no additional attributes. This is the default setting. S = SYSTEM Includes system files. E = EXCLUSIVE Includes only files with the specified attributes. By default, read-write files are listed even if READWRITE is not specified. DRIVES All mapped drives are added to the list. Drives are listed in the form [-x-], where x is the drive letter. NB = No Brackets Drives are listed in the form x:, where x is the drive letter (used with Drives attribute) Related _GUICtrlComboInitStorage Example #include <GuiConstants.au3> #include <GuiCombo.au3> #Include <GuiStatusBar.au3> Opt('MustDeclareVars', 1) Dim $a_check[10], $msg, $ret, $s_attr, $allocated, $Status, $GUI Dim $input, $group, $a_attr, $Combo, $button, $btn_exit $GUI = GUICreate("ComboBox Add Dir", 400, 280) GUICtrlCreateLabel("Enter files to find", 25, 15) $input = GUICtrlCreateInput("", 125, 10, 180, 25) $group = GUICtrlCreateGroup("Atrributes", 10, 40, -1, 200) $a_attr = StringSplit("A,D,H,RO,RW,S,E,Drives,NB", ",") $a_check[0] = 9 $a_check[1] = GUICtrlCreateCheckbox("Archive", 15, 55, 170, 20) $a_check[2] = GUICtrlCreateCheckbox("Directory", 15, 75, 170, 20) $a_check[3] = GUICtrlCreateCheckbox("Hidden", 15, 95, 170, 20) $a_check[4] = GUICtrlCreateCheckbox("Read-Only", 15, 115, 170, 20) $a_check[5] = GUICtrlCreateCheckbox("Read-Write", 15, 135, 95, 20) $a_check[6] = GUICtrlCreateCheckbox("System", 15, 155, 170, 20) $a_check[7] = GUICtrlCreateCheckbox("Exclusive", 15, 175, 170, 20) $a_check[8] = GUICtrlCreateCheckbox("Drives", 15, 195, 170, 20) $a_check[9] = GUICtrlCreateCheckbox("No Brackets (Drives Only)", 15, 215, 170, 20) GUICtrlCreateGroup("", -99, -99, 1, 1) ;close group $Combo = GUICtrlCreateCombo("", 240, 40, 120, 120, $CBS_SIMPLE) $allocated = _GUICtrlComboInitStorage ($Combo, 26, 50) $button = GUICtrlCreateButton("Get Names", 240, 160, 120, 40) $btn_exit = GUICtrlCreateButton("Exit", 240, 205, 120, 40) $Status = _GUICtrlStatusBarCreate ($GUI, -1, "") _GUICtrlStatusBarSetSimple ($Status) _GUICtrlStatusBarSetText ($Status, "Pre-Allocated Memory For: " & $allocated & _ " Items Added To ComboBox: " & _GUICtrlComboGetCount ($Combo), 255) GUISetState() While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE Or $msg = $btn_exit ExitLoop Case $msg = $button $s_attr = "" For $i = 1 To $a_check[0] If (BitAND(GUICtrlRead($a_check[$i]), $GUI_CHECKED)) Then If (StringLen($s_attr) > 0) Then $s_attr &= "," & $a_attr[$i] Else $s_attr = $a_attr[$i] EndIf EndIf Next _GUICtrlComboResetContent ($Combo) $ret = _GUICtrlComboAddDir ($Combo, $s_attr, GUICtrlRead($input)) If ($ret < 0) Then If ($ret == $CB_ERRATTRIBUTE) Then MsgBox(16, "Error", "Invalid Attribute sent to _GUICtrlComboAddDir") ElseIf ($ret == $CB_ERRSPACE) Then MsgBox(16, "Error", "insufficient space to store the new strings from calling _GUICtrlComboAddDir") ElseIf ($ret == $CB_ERRREQUIRED) Then MsgBox(16, "Error", "Argument required for file search in call to _GUICtrlComboAddDir") ElseIf ($ret == $CB_ERR) Then MsgBox(16, "Error", "Unknown error from _GUICtrlComboAddDir" & @CRLF & "Possibly no files/folders found") EndIf EndIf _GUICtrlStatusBarSetText ($Status, "Pre-Allocated Memory For: " & $allocated & _ " Items Added To ComboBox: " & _GUICtrlComboGetCount ($Combo), 255) EndSelect WEnd Exit
@admins: Der Button für Code fehlt -
Ps: Autoit hat ne Hilfe, vllt. mal da suchen.
-
Vllt weil die Funktion _Close() nicht deklariert wurde ;)?
-
[Blockierte Grafik: http://bestsmileys.com/birthday2/6.gif][Blockierte Grafik: http://bestsmileys.com/birthday2/6.gif][Blockierte Grafik: http://bestsmileys.com/birthday2/6.gis_avatars/smile/smile_f][Blockierte Grafik: http://users.pandora.be/eborght/Emoticons/happy_birthday.gif]
-
Herzlichen Glückwunsch Huggy !!!
Und einen [Blockierte Grafik: http://www.pami.hit.bg/doors/13temi/01torta/torta1.gif] für dich!Und weil die Bilder so schön sind gleich nochmal:
[Blockierte Grafik: http://i37.photobucket.com/albums/e78/sueweb/happybday.gif] -
Oder Select mit ContinueCase.
-
Sehr übersichtlich Jetzt habs sogar ich verstanden
Weiter so!![Blockierte Grafik: http://img246.imageshack.us/img246/8399/thumbsup4kk.gif]
-
Wieso wertest du dann nicht einfach die Rückgabe aus?
[autoit]Do
[/autoit]
$ini=IniRead("C:\test.ini","test","id","Fehler")
Until NOT $ini = "Fehler" -
Das würde mit WinMove gehen.
Edit:Mist Oscar war schneller
-
Heißt Pid nicht "Process ID"? Aber für was das "w" steht weiß ich auch nicht.
-
Also ich würde in dem Fall mit StringSplit arbeiten.
-
Also erst mal [Blockierte Grafik: http://img125.echo.cx/img125/8038/01welcome7jb.gif]
[autoit]
Ach ja das steht alles in der Hilfe, aber da ich deswegen eigentlich gar nichts sagen dürfte( ich hatte am anfang auch kp) beschreibe ich es dir noch mal:;Für die MsgBox nimmst du folgendes (Syntax: MsgBox(flag, "title", "text"[, timeout])
[/autoit]
;Aso bei dir:
$M = MsgBox(1, "Dein Titel", "Der Text in Zeile1" & @CRLF & "und der in Zeile 2")
;Die Variable $M enthält jetzt das "Return Value" also den Rückgabewert. Diesen kannst du aus der Hilfe entnehmen. Dieser wird jetzt abgefragt (Bei OK ist er 1):
If $M = 1 Then
;Den Satz habe ich nicht verstanden, aber hier kommt das rein was du dann machen willst
EndIf
;Dann die 2.MsgBox, was du mit Grafiken meinst weiß ich nicht, wenn du dieses Warndreieck und so meinst, dann geht das mit der Flag --> Hilfe lesen
MsgBox(0, "Dein Titel", "Der Text in Zeile1" & @CRLF & "und der in Zeile 2")So das war's jetzt.
ps: Ich habe auch in Batch gescriptet bevor ich auf autoit umgestiegen bin, aber AutoIt hat bestimmt 1000x mehr möglichkeiten