Hey Leute,
ich kann in meinem Programm einfach den Fehler nicht finden. Ich weiß, dass es etwas unübersichtlich ist Ich hoffe es ist erlaubt. Wenn nicht tuts mir leid.
[autoitgelöst![/autoit]
Ini Fehler
-
- [ gelöst ]
-
crazylumi -
17. April 2013 um 20:53 -
Geschlossen -
Erledigt
-
-
poste dein Skript doch bitte nochmal im Quellcode-Reiter , wenn du im Editor bist.
Edit : Die Ini anzuhängen wär auch ne gute Idee, um Fehler zu finden. -
Hab mal das Script entknotet, ansonsten unverändert:
Spoiler anzeigen
[autoit]#include <ButtonConstants.au3>
[/autoit] [autoit][/autoit] [autoit]
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#RequireAdmin
#NoTrayIcon$ini = "cfg.ini"
[/autoit] [autoit][/autoit] [autoit]
If FileExists($ini) Then
$rx = IniRead($ini, "active", "x", "ERROR")
$ry = IniRead($ini, "active", "y", "ERROR")
$rt = IniRead($ini, "active", "t", "ERROR")
$rd = IniRead($ini, "active", "d", "ERROR")
$rk = IniRead($ini, "active", "k", "ERROR")
$fd = IniRead($ini, "flick", "d", "ERROR")
$raged = IniRead($ini, "rage", "d", "ERROR")
$ld = IniRead($ini, "legit", "d", "ERROR")
$od = IniRead($ini, "own", "d", "ERROR")
$fk = IniRead($ini, "flick", "k", "ERROR")
$ragek = IniRead($ini, "rage", "k", "ERROR")
$lk = IniRead($ini, "legit", "k", "ERROR")
$ok = IniRead($ini, "own", "k", "ERROR")
Else
IniWrite($ini, "active", "x", "-")
IniWrite($ini, "active", "y", "-")
IniWrite($ini, "active", "t", "-")
IniWrite($ini, "active", "d", "-")
IniWrite($ini, "active", "k", "-")
IniWrite($ini, "flick", "d", "0")
IniWrite($ini, "flick", "k", "0")
IniWrite($ini, "rage", "d", "25")
IniWrite($ini, "rage", "k", "0")
IniWrite($ini, "legit", "d", "85")
IniWrite($ini, "legit", "k", "?")
IniWrite($ini, "own", "d", "?")
IniWrite($ini, "own", "k", "?")
$rx = IniRead($ini, "active", "x", "ERROR")
$ry = IniRead($ini, "active", "y", "ERROR")
$rt = IniRead($ini, "active", "t", "ERROR")
$rd = IniRead($ini, "active", "d", "ERROR")
$rk = IniRead($ini, "active", "k", "ERROR")
$fd = IniRead($ini, "flick", "d", "ERROR")
$raged = IniRead($ini, "rage", "d", "ERROR")
$ld = IniRead($ini, "legit", "d", "ERROR")
$od = IniRead($ini, "own", "d", "ERROR")
$fk = IniRead($ini, "flick", "k", "ERROR")
$ragek = IniRead($ini, "rage", "k", "ERROR")
$lk = IniRead($ini, "legit", "k", "ERROR")
$ok = IniRead($ini, "own", "k", "ERROR")
Sleep(1000)
EndIf#region ### START Koda GUI section ### Form=C:\Users\Tim\Documents\Form1_1.kxf
[/autoit] [autoit][/autoit] [autoit]
$Form1_1 = GUICreate("Settings", 273, 133, 509, 485, $WS_POPUP)
GUISetBkColor(0x000000)
$resolution = GUICtrlCreateLabel("Screenresolution:", 8, 8, 145, 24)
GUICtrlSetFont(-1, 12, 800, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0xFFFFFF)
$exit = GUICtrlCreateLabel("x", 200, 0, 20, 41)
GUICtrlSetFont(-1, 24, 800, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0xFFFFFF)
$tolerance = GUICtrlCreateLabel("Tolerance:", 64, 40, 88, 24)
GUICtrlSetFont(-1, 12, 800, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0xFFFFFF)
$delay = GUICtrlCreateLabel("Delay:", 96, 72, 54, 24)
GUICtrlSetFont(-1, 12, 800, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0xFFFFFF)
$key = GUICtrlCreateLabel("Triggerkey:", 56, 104, 92, 24)
GUICtrlSetFont(-1, 12, 800, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0xFFFFFF)
$ix = GUICtrlCreateInput($rx * 2, 152, 8, 41, 21)
$iy = GUICtrlCreateInput($ry * 2, 224, 8, 41, 21)
$it = GUICtrlCreateInput($rt, 152, 40, 41, 21)
$id = GUICtrlCreateInput($rd, 152, 72, 41, 21)
$ik = GUICtrlCreateInput($rk, 152, 104, 41, 21)
$save = GUICtrlCreateButton("Save!", 200, 40, 67, 57)
GUICtrlSetBkColor(-1, 0xFFFFFF)
$settings = GUICtrlCreateButton("Settings", 200, 104, 67, 25)
GUICtrlSetBkColor(-1, 0xFFFFFF)
GUISetState(@SW_SHOW)
#endregion ### END Koda GUI section ####region ### START Koda GUI section ### Form=
[/autoit] [autoit][/autoit] [autoit]
$settingsform = GUICreate("Settings", 178, 75, 192, 114, $WS_POPUP)
GUISetBkColor(0x000000)
$flick = GUICtrlCreateButton("Flick", 8, 8, 75, 25)
GUICtrlSetBkColor(-1, 0xFFFFFF)
$rage = GUICtrlCreateButton("RAGE", 96, 8, 75, 25)
GUICtrlSetBkColor(-1, 0xFFFFFF)
$legit = GUICtrlCreateButton("legit", 8, 40, 75, 25)
GUICtrlSetBkColor(-1, 0xFFFFFF)
$own = GUICtrlCreateButton("Your Settings", 96, 40, 75, 25)
GUICtrlSetBkColor(-1, 0xFFFFFF)
#endregion ### END Koda GUI section ####region ### START Koda GUI section ### Form=
[/autoit] [autoit][/autoit] [autoit]
$Form3 = GUICreate("Settings", 211, 66, 433, 388, $WS_POPUP)
GUISetBkColor(0x000000)
$delay = GUICtrlCreateLabel("Delay:", 48, 8, 54, 24)
GUICtrlSetFont(-1, 12, 800, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0xFFFFFF)
$key = GUICtrlCreateLabel("Triggerkey:", 8, 32, 92, 24)
GUICtrlSetFont(-1, 12, 800, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0xFFFFFF)
$id3 = GUICtrlCreateInput($fd, 104, 8, 41, 21)
$ik3 = GUICtrlCreateInput($fk, 104, 32, 41, 21)
$save3 = GUICtrlCreateButton("Save!", 152, 8, 49, 49)
GUICtrlSetBkColor(-1, 0xFFFFFF)
#endregion ### END Koda GUI section ####region ### START Koda GUI section ### Form=
[/autoit] [autoit][/autoit] [autoit]
$Form4 = GUICreate("Settings", 211, 66, 433, 388, $WS_POPUP)
GUISetBkColor(0x000000)
$delay = GUICtrlCreateLabel("Delay:", 48, 8, 54, 24)
GUICtrlSetFont(-1, 12, 800, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0xFFFFFF)
$key = GUICtrlCreateLabel("Triggerkey:", 8, 32, 92, 24)
GUICtrlSetFont(-1, 12, 800, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0xFFFFFF)
$id4 = GUICtrlCreateInput($raged, 104, 8, 41, 21)
$ik4 = GUICtrlCreateInput($ragek, 104, 32, 41, 21)
$save4 = GUICtrlCreateButton("Save!", 152, 8, 49, 49)
GUICtrlSetBkColor(-1, 0xFFFFFF)
#endregion ### END Koda GUI section ####region ### START Koda GUI section ### Form=
[/autoit] [autoit][/autoit] [autoit]
$Form5 = GUICreate("Settings", 211, 66, 433, 388, $WS_POPUP)
GUISetBkColor(0x000000)
$delay = GUICtrlCreateLabel("Delay:", 48, 8, 54, 24)
GUICtrlSetFont(-1, 12, 800, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0xFFFFFF)
$key = GUICtrlCreateLabel("Triggerkey:", 8, 32, 92, 24)
GUICtrlSetFont(-1, 12, 800, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0xFFFFFF)
$id5 = GUICtrlCreateInput($ld, 104, 8, 41, 21)
$ik5 = GUICtrlCreateInput($lk, 104, 32, 41, 21)
$save5 = GUICtrlCreateButton("Save!", 152, 8, 49, 49)
GUICtrlSetBkColor(-1, 0xFFFFFF)
#endregion ### END Koda GUI section ####region ### START Koda GUI section ### Form=
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]
$Form6 = GUICreate("Settings", 211, 66, 433, 388, $WS_POPUP)
GUISetBkColor(0x000000)
$delay = GUICtrlCreateLabel("Delay:", 48, 8, 54, 24)
GUICtrlSetFont(-1, 12, 800, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0xFFFFFF)
$key = GUICtrlCreateLabel("Triggerkey:", 8, 32, 92, 24)
GUICtrlSetFont(-1, 12, 800, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0xFFFFFF)
$id6 = GUICtrlCreateInput($od, 104, 8, 41, 21)
$ik6 = GUICtrlCreateInput($ok, 104, 32, 41, 21)
$save6 = GUICtrlCreateButton("Save!", 152, 8, 49, 49)
GUICtrlSetBkColor(-1, 0xFFFFFF)
#endregion ### END Koda GUI section ###While 1
[/autoit]
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $save
$x = GUICtrlRead($ix)
$y = GUICtrlRead($iy)
$t = GUICtrlRead($it)
$d = GUICtrlRead($id)
$k = GUICtrlRead($ik)
IniWrite($ini, "active", "x", $x / 2)
IniWrite($ini, "active", "y", $y / 2)
IniWrite($ini, "active", "t", $t)
IniWrite($ini, "active", "d", $d)
IniWrite($ini, "active", "k", $k)
If FileExists("cfg.ini") Then
MsgBox(4096, "Settings", "Config was sucessfully created!")
Exit
Else
MsgBox(4096, "Settings", "FAILED! Please read the README!")
EndIf
Case $exit
Exit
Case $resolution
MsgBox(64, "Settings", "Just write your screenresolution in the input")
Case $tolerance
MsgBox(64, "Settings", "Write the tolerance in pixels (I use 5 for FullHD)")
Case $delay
MsgBox(64, "Settings", "Write a delay in ms")
Case $key
MsgBox(64, "Settings", "The key numbers can you see in the key.txt. It will be automaticaly open!")
ShellExecute("key.txt")
Case $settings
GUISetState(@SW_SHOW, $settingsform)
Case $flick
GUISetState(@SW_SHOW, $Form3)
Case $rage
GUISetState(@SW_SHOW, $Form4)
Case $legit
GUISetState(@SW_SHOW, $Form4)
Case $own
GUISetState(@SW_SHOW, $Form4)
Case $save3
$fd2 = GUICtrlRead($id3)
$fk2 = GUICtrlRead($ik3)
IniWrite($ini, "flick", "d", $fd2)
IniWrite($ini, "flick", "k", $fk2)
GUISetState(@SW_HIDE, $Form3)
GUISetState(@SW_HIDE, $settingsform)
Case $save4
$raged2 = GUICtrlRead($id4)
$ragek2 = GUICtrlRead($ik4)
IniWrite($ini, "rage", "d", $raged2)
IniWrite($ini, "rage", "k", $ragek2)
GUISetState(@SW_HIDE, $Form4)
GUISetState(@SW_HIDE, $settingsform)
Case $save5
$ld2 = GUICtrlRead($id5)
$lk2 = GUICtrlRead($ik5)
IniWrite($ini, "legit", "d", $ld2)
IniWrite($ini, "legit", "k", $lk2)
GUISetState(@SW_HIDE, $Form5)
GUISetState(@SW_HIDE, $settingsform)
Case $save6
$od2 = GUICtrlRead($id6)
$ok2 = GUICtrlRead($ik6)
IniWrite($ini, "own", "d", $od2)
IniWrite($ini, "own", "k", $ok2)
GUISetState(@SW_HIDE, $Form6)
GUISetState(@SW_HIDE, $settingsform)
EndSwitch
WEndEdit: Alcros: wenn die .ini nicht existiert wird sie neu erstellt
-
@Shadow : jop, hab ich jetzt auch gesehen.
War zu faul, dieses Wirrwarr mir näher anzugucken.Und was ist denn der Fehler ?
Vllt solltest du uns sagen, was nicht funktioniert, dann kann man hier bestimmt helfen -
Hat sich schon gelöst. Hatte bei @SW_SHOW immer die gleiche Form drin