- #include <GUIConstantsEx.au3>
- Global $tab, $msg, $setstate, $check, $track, $about, $name, $k, $d, $a, $role, $comment, $go, $nr, $kr, $dr, $ar, $rr, $cr, $sn, $sk, $sd, $sa, $sr, $sc, $sgo, $path = @MyDocumentsDir & "\PlayerTracker.ini", $nsn, $sds, $sks, $sas, $srs, $scs
- MainGUI()
- Func MainGUI()
- Call ("SGUI")
- EndFunc
- Func SGUI()
- GUICreate ("Spike's Player Tracker", 600, 300)
- $tab = GUICtrlCreateTab(1, 1, 598, 298)
- $track = GUICtrlCreateTabItem ("Track")
- GUICtrlCreateLabel ("Input Player Name:", 5, 30, 100, 20)
- $name = GUICtrlCreateInput ("", 5, 50, 100, 20)
- GUICtrlCreateLabel ("Input Player Score:", 120, 30, 100, 20)
- GUICtrlCreateLabel ("Kills:", 120, 50, 40, 20)
- $k = GUICtrlCreateInput ("", 170, 50, 40, 20)
- GUICtrlCreateLabel ("Deaths: ", 120, 70, 50, 20)
- $d = GUICtrlCreateInput ("", 170, 70, 40, 20)
- GUICtrlCreateLabel ("Assists:", 120, 90, 50, 20)
- $a = GUICtrlCreateInput ("", 170, 90, 40, 20)
- GUICtrlCreateLabel ("Role:", 5, 90, 100, 20)
- $role = GUICtrlCreateInput ("", 5, 110, 100, 20)
- GUICtrlCreateLabel ("Comments:", 300, 30, 100, 20)
- $comment = GUICtrlCreateInput ("", 300, 50, 295, 245)
- $go = GUICtrlCreateButton ("Save", 100, 200, 100, 70)
- $check = GUICtrlCreateTabItem ("Check")
- GUICtrlSetState(-1,$GUI_SHOW)
- GUICtrlCreateLabel ("Search Player Name:", 5, 30, 100, 20)
- $sn = GUICtrlCreateInput ($nsn, 5, 50, 100, 20)
- GUICtrlCreateLabel ("Player Score:", 120, 30, 100, 20)
- GUICtrlCreateLabel ("Kills:", 120, 50, 40, 20)
- GUICtrlCreateLabel ("Deaths: ", 120, 70, 50, 20)
- GUICtrlCreateLabel ("Assists:", 120, 90, 50, 20)
- GUICtrlCreateLabel ("Role:", 5, 90, 100, 20)
- GUICtrlCreateLabel ("Comments:", 300, 30, 100, 20)
- $sgo = GUICtrlCreateButton ("Save", 100, 200, 100, 70)
- GUICtrlCreateInput ($sks, 170, 50, 40, 20)
- GUICtrlCreateInput ($sds, 170, 70, 40, 20)
- GUICtrlCreateInput ($sas, 170, 90, 40, 20)
- GUICtrlCreateInput ($srs, 5, 110, 100, 20)
- GUICtrlCreateInput ($scs, 300, 50, 295, 245)
- $about = GUICtrlCreateTabItem ("About")
- GUICtrlCreateLabel ("I'm lazy, still have to do this", 5, 30, 500, 250)
- GUICtrlSetState($check,$GUI_SHOW)
- $setstate = GUISetState()
- Call ("Open")
- Endfunc
- Func Save()
- $nr = GUICtrlRead ($name)
- $kr = GUICtrlRead ($k)
- $dr = GUICtrlRead ($d)
- $ar = GUICtrlRead ($a)
- $rr = GUICtrlRead ($role)
- $cr = GUICtrlRead ($comment)
- IniWriteSection ($path, $nr, "")
- IniWrite (@MyDocumentsDir & "\PlayerTracker.ini", $nr, "Name", $nr)
- IniWrite (@MyDocumentsDir & "\PlayerTracker.ini", $nr, "Kills", $kr)
- IniWrite (@MyDocumentsDir & "\PlayerTracker.ini", $nr, "Deaths", $dr)
- IniWrite (@MyDocumentsDir & "\PlayerTracker.ini", $nr, "Assists", $ar)
- IniWrite (@MyDocumentsDir & "\PlayerTracker.ini", $nr, "Role", $rr)
- IniWrite (@MyDocumentsDir & "\PlayerTracker.ini", $nr, "Comments", $cr)
- EndFunc
- Func Search ()
- $nsn = GUICtrlRead ($sn)
- $sks = IniRead ($path, $nsn, "Kills", "XX")
- $sds = IniRead ($path, $nsn, "Deaths", "XX")
- $sas = IniRead ($path, $nsn, "Assists", "XX")
- $srs = IniRead ($path, $nsn, "Role", "XXXXXX")
- $scs = IniRead ($path, $nsn, "Comments", "XXXXXXXX")
- GUICtrlDelete ($check)
- GUICtrlDelete ($track)
- GUICtrlDelete ($about)
- if $sks = "XX" Then
- MSGBox (0, "Not Found", "No Player Found!")
- Else
- msgbox (0, "Complete", "Search Complete! Press OK to show the results.")
- Endif
- GUIDelete()
- Call ("SGUI")
- EndFunc
- Func Open()
- While $msg <> $GUI_EVENT_CLOSE
- $msg = GUIGetMsg()
- Select
- Case $msg = $go
- Call ("Save")
- Case $msg = $GUI_EVENT_CLOSE
- ExitLoop
- Case $msg = $sgo
- Call ("Search")
- EndSelect
- WEnd
- Endfunc