Hier wie kann ich machen, dass ich ohne auf Berechnenbutton klicke die sachen schon berechnen?
Also das soll währen dich tippe die Zahlen schon verändern und ins Label reinschreiben.
Ich denk mal das hat was mit while zu tun aber weiter habe ich keine idee.
Code:
Spoiler anzeigen
#include <GUIConstants.au3>
#Region ### START Koda GUI section ### Form=J:\koda_1.7.0.1\Forms\Form1.kxf
$Form1 = GUICreate("Form1", 451, 268, 203, 124)
GUISetBkColor(0x9DB9EB)
$np = GUICtrlCreateInput("45000", 20, 22, 73, 21)
$pnoblue = GUICtrlCreateInput("145", 20, 65, 73, 21)
$pplus = GUICtrlCreateInput("160", 20, 112, 73, 21)
$pblue = GUICtrlCreateInput("160", 20, 154, 73, 21)
$pblueplus = GUICtrlCreateInput("180", 20, 200, 73, 21)
$Label3 = GUICtrlCreateLabel("% with blue", 18, 141, 73, 15)
GUICtrlSetFont(-1, 10, 400, 0, "Flubber")
$Label1 = GUICtrlCreateLabel("NPC Price", 18, 8, 63, 12)
GUICtrlSetFont(-1, 10, 400, 0, "Flubber")
$Label2 = GUICtrlCreateLabel("% with +", 18, 98, 57, 12)
GUICtrlSetFont(-1, 10, 400, 0, "Flubber")
$Label13 = GUICtrlCreateLabel("All Blue Items", 265, 10, 200, 17)
GUICtrlSetFont(-1, 10, 400, 0, "Flubber")
$Label8 = GUICtrlCreateLabel("+2", 264, 60, 16, 17)
$Label9 = GUICtrlCreateLabel("+3", 264, 96, 16, 17)
$Label10 = GUICtrlCreateLabel("+4", 264, 132, 16, 17)
$Label11 = GUICtrlCreateLabel("+5", 264, 168, 16, 17)
$enp = GUICtrlCreateLabel("0", 162, 24, 101, 20)
GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
$eplus = GUICtrlCreateLabel("0", 162, 113, 101, 20)
GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
$eblue = GUICtrlCreateLabel("0", 162, 158, 101, 20)
GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
$eblueplus = GUICtrlCreateLabel("0", 163, 201, 101, 20)
GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
$enoblue = GUICtrlCreateLabel("0", 163, 65, 101, 20)
GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
$e1 = GUICtrlCreateLabel("0", 282, 24, 100, 17)
$e2 = GUICtrlCreateLabel("0", 282, 60, 100, 17)
$e3 = GUICtrlCreateLabel("0", 282, 96, 100, 17)
$e4 = GUICtrlCreateLabel("0", 282, 132, 100, 17)
$e5 = GUICtrlCreateLabel("0", 282, 168, 100, 17)
$Label5 = GUICtrlCreateLabel("+1", 264, 24, 16, 17)
$Label6 = GUICtrlCreateLabel("% with blue and +", 20, 186, 110, 12)
GUICtrlSetFont(-1, 10, 400, 0, "Flubber")
$Label12 = GUICtrlCreateLabel("% non blue or +", 20, 50, 98, 15)
GUICtrlSetFont(-1, 10, 400, 0, "Flubber")
$Berechnen = GUICtrlCreateButton("Berechnen", 16, 228, 77, 29, 0)
GUICtrlSetBkColor(-1, 0xA6CAF0)
$Reset = GUICtrlCreateButton("Reset", 115, 229, 77, 29, 0)
GUICtrlSetBkColor(-1, 0xA6CAF0)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
func berechnen()
$np2 = GUICtrlRead($np)
$pnoblue2 = GUICtrlRead($pnoblue)
$pplus2 = GUICtrlRead($pplus)
$pblue2 = GUICtrlRead($pblue)
$pblueplus2 = GUICtrlRead($pblueplus)
GUICtrlSetData($enp, $np2)
$pnoblue2 = $np2 * $pnoblue2 / 100
GUICtrlSetData($enoblue, $pnoblue2)
$pplus2 = $np2 * $pplus2 / 100
GUICtrlSetData($eplus, $pplus2)
$pblue2 = $np2 * $pblue2 / 100
GUICtrlSetData($eblue, $pblue2)
$pblueplus2 = $np2 * $pblueplus2 / 100
GUICtrlSetData($eblueplus, $pblueplus2)
$pblueplus3 = GUICtrlRead($pblueplus)
$e12 = $np2 * $pblueplus3 / 100
GUICtrlSetData($e1, $e12)
$e22 = $np2 * $pblueplus3 / 100 * $pblueplus3 / 100
GUICtrlSetData($e2, $e22)
$e32 = $np2 * $pblueplus3 / 100 * $pblueplus3 / 100 * $pblueplus3 / 100
GUICtrlSetData($e3, $e32)
$e42 = $np2 * $pblueplus3 / 100 * $pblueplus3 / 100 * $pblueplus3 / 100 * $pblueplus3 / 100
GUICtrlSetData($e4, $e42)
$e52 = $np2 * $pblueplus3 / 100 * $pblueplus3 / 100 * $pblueplus3 / 100 * $pblueplus3 / 100 * $pblueplus3 / 100
GUICtrlSetData($e5, $e52)
EndFunc
Func reset()
GUICtrlSetData($enp, "0")
GUICtrlSetData($enoblue, "0")
GUICtrlSetData($eplus, "0")
GUICtrlSetData($eblue, "0")
GUICtrlSetData($eblueplus, "0")
GUICtrlSetData($e1, "0")
GUICtrlSetData($e2, "0")
GUICtrlSetData($e3, "0")
GUICtrlSetData($e4, "0")
GUICtrlSetData($e5, "0")
EndFunc
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Berechnen
berechnen()
Case $Reset
reset()
EndSwitch
WEnd
EDIT: Topic passend verändert