Jump to content

Shortcutter


uPod
 Share

Recommended Posts

This is my first, uhh, useful script. It's not that great, and there is a bunch of stuff that I have to fix. I wanted to post it here so that you guys could give me a bit of advice if you didn't mind. I need all the help I can get.

Its basically just a mass short cut program that can save and load presets, though I'd like to use a Ini instead of a txt file, so I'll have to change that.

#cs ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

 Shortcutter Beta
 By Zeitgeist

#ce ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

#RequireAdmin
#Include <GUIConstants.au3>
#Include <Misc.au3>
$i = 1
;Create
$first = GUICreate ("Shortcutter by :Zeitgeist:", 425, 325)

;TopMenus
$gfilemenu = GUICtrlCreateMenu ("Files")
$gexititem = GUICtrlCreateMenuItem ("Exit", $gfilemenu)

$geditmenu = GUICtrlCreateMenu ("Edit")
$gslots = GUICtrlCreateMenu ("Slots", $geditmenu, 1)
$gslot3 = GUICtrlCreateMenuItem ("3", $gslots, 1)
GUICtrlSetState (-1, $GUI_CHECKED)
$gslot4 = GUICtrlCreateMenuItem ("4", $gslots, 2)
$gslot5 = GUICtrlCreateMenuItem ("5", $gslots, 3)


$gaboutmenu = GUICtrlCreateMenu ("About")
$ghelpitem = GUICtrlCreateMenuItem ("Help", $gaboutmenu)
$gaboutitem = GUICtrlCreateMenuItem ("About", $gaboutmenu)

;RightSide Menu
$gButtonsave = GUICtrlCreateButton ("Save", 317, 225, 100)
$grunbutton = GUICtrlCreateButton ("Run", 317, 175, 100)
$gloadbutton = GUICtrlCreateButton ("Load", 317, 200, 100)
$gexitbutton = GUICtrlCreateButton ("Exit", 317, 275, 100)

;Tabs
$gtab = GUICtrlCreateTab(10, 10, 300, 291)

;TabItems
$gedittab = GUICtrlCreateTabItem ("Edit")
$ginput1 = GUICtrlCreateInput ("", 25, 50, 250, 20)
$glabel1 = GUICtrlCreateLabel ("First Exe", 25, 35)
$ginput2 = GUICtrlCreateInput ("", 25, 100, 250, 20)
$glabel2 = GUICtrlCreateLabel ("Second Exe", 25, 85)
$ginput3 = GUICtrlCreateInput ("", 25, 150, 250, 20)
$glabel3 = GUICtrlCreateLabel ("Third Exe", 25, 135)
$ginput4 = GUICtrlCreateInput ("", 25, 200, 250, 20)
GUICtrlSetState (-1, $GUI_HIDE)
$glabel4 = GUICtrlCreateLabel ("Fourth Exe", 25, 185)
GUICtrlSetState (-1, $GUI_HIDE)
$ginput5 = GUICtrlCreateInput ("", 25, 250, 250, 20)
GUICtrlSetState (-1, $GUI_HIDE)
$glabel5 = GUICtrlCreateLabel ("Fith Exe", 25, 235)
GUICtrlSetState (-1, $GUI_HIDE)



GUISetState ()

;Code
While 1
    $msg = GUIGetMsg ()
    
    Select
        Case $msg = $gexitbutton
            Exit
;Load
        Case $msg = $gloadbutton
            If BitAND(GUICtrlRead($gslot4), $GUI_CHECKED) Then
                $second = GUICreate ("Load", 125, 125, "", "", "", "", $first)
                $gloadinput = GUICtrlCreateInput ("Load", 22, 25, 75)
                $gokbutton = GUICtrlCreateButton ("OK", 10, 50, 100)
                
                GUISetState()
                
                While $i = 1
                    $gmsg = GUIGetMsg ()
                    Select
                        Case $gmsg = $gokbutton
                            $lr = GUICtrlRead ($gloadinput)
                            FileOpen ($lr, 0)
                            $frl1 = FileReadLine ($lr, 1)
                            $frl2 = FileReadLine ($lr, 2)
                            $frl3 = FileReadLine ($lr, 3)
                            $frl4 = FileReadLine ($lr, 4)
                            $frl5 = FileReadLine ($lr, 5)
                            GUICtrlSetData ($ginput1, $frl1)
                            GUICtrlSetData ($ginput2, $frl2)
                            GUICtrlSetData ($ginput3, $frl3)
                            GUICtrlSetData ($ginput4, $frl4)
                            GUICtrlSetData ($ginput5, $frl5)
                            GUISetState (@SW_HIDE)
                            $i = $i + 1
                    EndSelect
                WEnd
                    $i = 1
            EndIf
            If BitAND(GUICtrlRead($gslot5), $GUI_CHECKED) Then
                $second = GUICreate ("Load", 125, 125, "", "", "", "", $first)
                $gloadinput = GUICtrlCreateInput ("Load", 22, 25, 75)
                $gokbutton = GUICtrlCreateButton ("OK", 10, 50, 100)
                
                GUISetState()
                
                While $i = 1
                    $gmsg = GUIGetMsg ()
                    Select
                        Case $gmsg = $gokbutton
                            $lr = GUICtrlRead ($gloadinput)
                            FileOpen ($lr, 0)
                            $frl1 = FileReadLine ($lr, 1)
                            $frl2 = FileReadLine ($lr, 2)
                            $frl3 = FileReadLine ($lr, 3)
                            $frl4 = FileReadLine ($lr, 4)
                            $frl5 = FileReadLine ($lr, 5)
                            GUICtrlSetData ($ginput1, $frl1)
                            GUICtrlSetData ($ginput2, $frl2)
                            GUICtrlSetData ($ginput3, $frl3)
                            GUICtrlSetData ($ginput4, $frl4)
                            GUICtrlSetData ($ginput5, $frl5)
                            GUISetState (@SW_HIDE)
                            $i = $i + 1
                    EndSelect
                WEnd
                    $i = 1
            EndIf
            If BitAND(GUICtrlRead($gslot3), $GUI_CHECKED) Then
                $second = GUICreate ("Load", 125, 125, "", "", "", "", $first)
                $gloadinput = GUICtrlCreateInput ("Load", 22, 25, 75)
                $gokbutton = GUICtrlCreateButton ("OK", 10, 50, 100)
                
                GUISetState()
                
                While $i = 1
                    $gmsg = GUIGetMsg ()
                    Select
                        Case $gmsg = $gokbutton
                            $lr = GUICtrlRead ($gloadinput)
                            FileOpen ($lr, 0)
                            $frl1 = FileReadLine ($lr, 1)
                            $frl2 = FileReadLine ($lr, 2)
                            $frl3 = FileReadLine ($lr, 3)
                            $frl4 = FileReadLine ($lr, 4)
                            $frl5 = FileReadLine ($lr, 5)
                            GUICtrlSetData ($ginput1, $frl1)
                            GUICtrlSetData ($ginput2, $frl2)
                            GUICtrlSetData ($ginput3, $frl3)
                            GUICtrlSetData ($ginput4, $frl4)
                            GUICtrlSetData ($ginput5, $frl5)
                            GUISetState (@SW_HIDE)
                            $i = $i + 1
                    EndSelect
                WEnd
                $i = 1
            EndIf
;Run                
        Case $msg = $grunbutton
            If BitAND(GUICtrlRead($gslot4), $GUI_CHECKED) Then
                
                $rr1 = GUICtrlRead ($ginput1)
                $rr2 = GUICtrlRead ($ginput2)
                $rr3 = GUICtrlRead ($ginput3)
                $rr4 = GUICtrlRead ($ginput4)
                
                Run ($rr1)
                Run ($rr2)
                Run ($rr3)
                Run ($rr4)
            EndIf
            If BitAND(GUICtrlRead($gslot5), $GUI_CHECKED) Then
                
                $rr1 = GUICtrlRead ($ginput1)
                $rr2 = GUICtrlRead ($ginput2)
                $rr3 = GUICtrlRead ($ginput3)
                $rr4 = GUICtrlRead ($ginput4)
                $rr5 = GUICtrlRead ($ginput5)
                
                Run ($rr1)
                Run ($rr2)
                Run ($rr3)
                Run ($rr4)
                Run ($rr5)
            EndIf   
            If BitAND(GUICtrlRead($gslot3), $GUI_CHECKED) Then
                
                $rr1 = GUICtrlRead ($ginput1)
                $rr2 = GUICtrlRead ($ginput2)
                $rr3 = GUICtrlRead ($ginput3)
                
                Run ($rr1)
                Run ($rr2)
                Run ($rr3)
            EndIf
;Save           
        Case $msg = $gButtonsave
            If BitAND(GUICtrlRead($gslot4), $GUI_CHECKED) Then
                
                $second = GUICreate ("Save", 125, 125, "", "", "", "", $first)
                $gsaveinput = GUICtrlCreateInput ("Save", 22, 25, 75)
                $gokbutton = GUICtrlCreateButton ("OK", 10, 50, 100)
                GUISetState ()
                
                While $i = 1
                    $gmsg = GUIGetMsg ()
                    Select
                        Case $gmsg = $gokbutton
                $st = GUICtrlRead ($gsaveinput)
                $sr1 = GUICtrlRead ($ginput1)
                $sr2 = GUICtrlRead ($ginput2)
                $sr3 = GUICtrlRead ($ginput3)
                $sr4 = GUICtrlRead ($ginput4)
                
                FileOpen ($st, 2)
                FileWrite ($st, $sr1 & @CRLF & $sr2 & @CRLF & $sr3 & @CRLF & $sr4)
                FileClose ($st)
                GUISetState (@SW_HIDE)
                $i = $i + 1
                    EndSelect
                WEnd
                $i = 1
            EndIf
            If BitAND(GUICtrlRead($gslot5), $GUI_CHECKED) Then
                
                $second = GUICreate ("Save", 125, 125, "", "", "", "", $first)
                $gsaveinput = GUICtrlCreateInput ("Save", 22, 25, 75)
                $gokbutton = GUICtrlCreateButton ("OK", 10, 50, 100)
                GUISetState ()
                
                While $i = 1
                    $gmsg = GUIGetMsg ()
                    Select
                        Case $gmsg = $gokbutton
                $st = GUICtrlRead ($gsaveinput)
                $sr1 = GUICtrlRead ($ginput1)
                $sr2 = GUICtrlRead ($ginput2)
                $sr3 = GUICtrlRead ($ginput3)
                $sr4 = GUICtrlRead ($ginput4)
                $sr5 = GUICtrlRead ($ginput5)
                
                FileOpen ($st, 2)
                FileWrite ($st, $sr1 & @CRLF & $sr2 & @CRLF & $sr3 & @CRLF & $sr4 & @CRLF & $sr5)
                FileClose ($st)
                GUISetState (@SW_HIDE)
                $i = $i + 1
                    EndSelect
                WEnd
                $i = 1              
            EndIf   
            If BitAND(GUICtrlRead($gslot3), $GUI_CHECKED) Then
                $second = GUICreate ("Save", 125, 125, "", "", "", "", $first)
                $gsaveinput = GUICtrlCreateInput ("Save", 22, 25, 75)
                $gokbutton = GUICtrlCreateButton ("OK", 10, 50, 100)
                GUISetState ()
                
                While $i = 1
                    $gmsg = GUIGetMsg ()
                    Select
                        Case $gmsg = $gokbutton
                $st = GUICtrlRead ($gsaveinput)
                $sr1 = GUICtrlRead ($ginput1)
                $sr2 = GUICtrlRead ($ginput2)
                $sr3 = GUICtrlRead ($ginput3)
                $sr4 = GUICtrlRead ($ginput4)
                
                FileOpen ($st, 2)
                FileWrite ($st, $sr1 & @CRLF & $sr2 & @CRLF & $sr3 & @CRLF & $sr4)
                FileClose ($st)
                GUISetState (@SW_HIDE)
                $i = $i + 1
                    EndSelect
                WEnd
                $i = 1
            EndIf
;HelpMenuItem   
        Case $msg = $ghelpitem
            MsgBox (0, "Help", "A ReadMe Will Be Included Soon." & @CRLF & "READ IT!")
;AboutMenuItem  
        Case $msg = $gaboutitem
            MsgBox (0, "About", "MaDe bY Zeitgeist")
;ExitMenuItem   
        Case $msg = $gexititem
            ExitLoop
;X=CLOSE    
        Case $msg = $GUI_EVENT_CLOSE
            ExitLoop
;Slot4MenuItem  
        Case $msg = $gslot4
            If BitAND(GUICtrlRead($gslot4), $GUI_UNCHECKED) Then
                GUICtrlSetState ($gslot4, $GUI_CHECKED)
                GUICtrlSetState ($gslot3, $GUI_UNCHECKED)
                GUICtrlSetState ($gslot5, $GUI_UNCHECKED)
                GUICtrlSetState ($ginput4, $GUI_SHOW)
                GUICtrlSetState ($ginput5, $GUI_HIDE)
                GUICtrlSetState ($glabel4, $GUI_SHOW)
                GUICtrlSetState ($glabel5, $GUI_HIDE)
            EndIf
;Slot5MenuItem  
        Case $msg = $gslot5
            If BitAND(GUICtrlRead($gslot5), $GUI_UNCHECKED) Then
                GUICtrlSetState ($gslot5, $GUI_CHECKED)
                GUICtrlSetState ($gslot3, $GUI_UNCHECKED)
                GUICtrlSetState ($gslot4, $GUI_UNCHECKED)
                GUICtrlSetState ($ginput4, $GUI_SHOW)
                GUICtrlSetState ($ginput5, $GUI_SHOW)
                GUICtrlSetState ($glabel4, $GUI_SHOW)
                GUICtrlSetState ($glabel5, $GUI_SHOW)
            EndIf
;Slot3MenuItem  
        Case $msg = $gslot3
            If BitAND(GUICtrlRead($gslot3), $GUI_UNCHECKED) Then
                GUICtrlSetState ($gslot3, $GUI_CHECKED)
                GUICtrlSetState ($gslot4, $GUI_UNCHECKED)
                GUICtrlSetState ($gslot5, $GUI_UNCHECKED)
                GUICtrlSetState ($ginput4, $GUI_HIDE)
                GUICtrlSetState ($ginput5, $GUI_HIDE)
                GUICtrlSetState ($glabel4, $GUI_HIDE)
                GUICtrlSetState ($glabel5, $GUI_HIDE)
            EndIf
    EndSelect
WEnd
Edited by uPod
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...