Hallo AutoIt Comm,
wiedermal stehe ich vor einem Rätsel, es geht darum ein InputFeld zu berechnen.
Ich schick am besten mal den Code, ist ein wenig bescheiden zu erklären.
[autoit]#include <GUIConstantsEx.au3>
#include <GUIConstants.au3>
;---------------------------------;
#Region ### START Koda GUI section ### Form=
$calculator = GUICreate("Boss Calculator", 311, 201, 193, 125)
$bosse = GUICtrlCreateCombo("Boss Wählen", 8, 8, 153, 25)
GUICtrlSetData(-1, "Aden Fregatte|Ghoetheborg|Bartolomew|Hawkins|General Charlie Will|General Cruz")
$nextrespawn = GUICtrlCreateLabel("Nächster Spawn:", 168, 56, 101, 17)
GUICtrlSetFont(-1, 8, 800, 4, "MS Sans Serif")
$respawntime = GUICtrlCreateLabel("Respawn Zeit:", 168, 8, 86, 17)
GUICtrlSetFont(-1, 8, 800, 4, "MS Sans Serif")
$time = GUICtrlCreateLabel("Zeit:", 8, 40, 30, 17)
GUICtrlSetFont(-1, 8, 800, 4, "MS Sans Serif")
$date = GUICtrlCreateLabel("Datum:", 8, 72, 44, 17)
GUICtrlSetFont(-1, 8, 800, 4, "MS Sans Serif")
$calc = GUICtrlCreateButton("Berechnen", 8, 168, 107, 25, 0)
$time1 = GUICtrlCreateInput("00:00:00", 64, 40, 57, 21)
GUICtrlSetData(-1, @HOUR&":"&@MIN&":"&@SEC)
$date1 = GUICtrlCreateInput("TT.MM", 64, 72, 57, 21)
GUICtrlSetData(-1, @MDAY&"."&@MON)
; -------^---Dort wird die Aktuelle PC Zeit&Datum ausgelesen---^------- ;
$respawntime1 = GUICtrlCreateInput("00:00:00", 168, 32, 73, 21)
GUICtrlSetState(-1, $GUI_DISABLE)
$spawnnext = GUICtrlCreateInput("00:00:00", 168, 80, 57, 21)
GUICtrlSetState(-1, $GUI_DISABLE)
$spawnnext1 = GUICtrlCreateInput("00:00:00", 168, 104, 57, 21)
GUICtrlSetState(-1, $GUI_DISABLE)
$spawnnext2 = GUICtrlCreateInput("00:00:00", 168, 128, 57, 21)
GUICtrlSetState(-1, $GUI_DISABLE)
$spawnnext3 = GUICtrlCreateInput("00:00:00", 168, 152, 57, 21)
GUICtrlSetState(-1, $GUI_DISABLE)
$spawnnext4 = GUICtrlCreateInput("00:00:00", 168, 176, 57, 21)
GUICtrlSetState(-1, $GUI_DISABLE)
$ttmm = GUICtrlCreateInput("TT.MM", 232, 80, 57, 21)
GUICtrlSetState(-1, $GUI_DISABLE)
$ttmm1 = GUICtrlCreateInput("TT.MM", 232, 104, 57, 21)
GUICtrlSetState(-1, $GUI_DISABLE)
$ttmm2 = GUICtrlCreateInput("TT.MM", 232, 128, 57, 21)
GUICtrlSetState(-1, $GUI_DISABLE)
$ttmm3 = GUICtrlCreateInput("TT.MM", 232, 152, 57, 21)
GUICtrlSetState(-1, $GUI_DISABLE)
$ttmm4 = GUICtrlCreateInput("TT.MM", 232, 176, 57, 21)
GUICtrlSetState(-1, $GUI_DISABLE)
; ------^--Dort sollen die neuen daten eingetragen werden --^------ ;
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$msg = GUIGetMsg(1)
Select
Case $msg[0] = $bosse ; <---- Hier wird der gewünschte Boss mit der jeweiligen ReSpawn Zeit rausgesucht
If GUICtrlRead($bosse) = "Aden Fregatte" Then
GUICtrlSetData($respawntime1, "6:50:00")
ElseIf GUICtrlRead($bosse) = "Ghoetheborg" Then
GUICtrlSetData($respawntime1, "6:50:00")
ElseIf GUICtrlRead($bosse) = "Bartolomew" Then
GUICtrlSetData($respawntime1, "10:04:00")
ElseIf GUICtrlRead($bosse) = "Hawkins" Then
GUICtrlSetData($respawntime1, "09:04:00")
ElseIf GUICtrlRead($bosse) = "General Cruz" Then
GUICtrlSetData($respawntime1, "19:20:00")
ElseIf GUICtrlRead($bosse) = "General Charlie Will" Then
GUICtrlSetData($respawntime1, "13:45:00")
Else
GUICtrlSetData($respawntime1, "00:00:00")
EndIf
Case $msg[0] = $calc
GUICtrlSetData($spawnnext, (GUICtrlRead($respawntime1))) ; <--- dort soll er die neue Zeit berechnen
Case $msg[0] = $GUI_EVENT_CLOSE
If $msg[1] = $calculator Then Exit
EndSelect
WEnd
Also er soll das neue Datum+Zeit in die Input felder eintragen. Aber wenn er $respawntime1 mit $time1 addieren soll, spuckt er mir entweder eine Fehlermeldung raus, oder da steht ne Dicke "0".
Hoffe Ihr könnt mir helfen.
mfg.