Bounda Posted March 22, 2006 Share Posted March 22, 2006 im new to this programming stuff and i was trying to make a gui to help me with tasks like system restore and defrag. theres probly one alrdy made but i want to try to learn by making this. i need to know how to run a file like defrag after a radio has been clicked. this is wat i have so far. ; ---------------------------------------------------------------------------- ; ; Windows XP Help Script by BlueSmoke_ScR AkA Bounda, Bounder, LILELWOOD423 ; Script Function: ; To teach XP and Optimize performance. ; ; ---------------------------------------------------------------------------- #include <GUIConstants.au3> GuiCreate("Windows XP Help", 500, 100) $Frag = GuiCtrlCreateRadio("Defragment", 10, 10) $Help = GuiCtrlCreateRadio("Teach", 10, 30) $Res = GuiCtrlCreateRadio("System Restore", 10, 50) $Set = GuiCtrlCreateRadio("Display Computer Information", 10, 70) GuiSetState() While GuiGetMsg() <> $GUI_EVENT_CLOSE WEnd If $frag = $GUI_CHECKED Then Run Cmd Endif CS:S Aimbot - List From INI Funcs Link to comment Share on other sites More sharing options...
greenmachine Posted March 22, 2006 Share Posted March 22, 2006 Be sure to read the helpfile. I see you have Run, which is the right idea, but you need to know the syntax for it: Run ("filepath", "workingdir", $ShowFlag, $StdOutFlag) The helpfile goes over all this and more. Link to comment Share on other sites More sharing options...
Bounda Posted March 22, 2006 Author Share Posted March 22, 2006 srry i was reading but couldnt find it. ty for ur help. CS:S Aimbot - List From INI Funcs Link to comment Share on other sites More sharing options...
Bounda Posted March 22, 2006 Author Share Posted March 22, 2006 aight i did the syntax in my script which now looks like this ; ---------------------------------------------------------------------------- ; ; Windows XP Help Script by BlueSmoke_ScR AkA Bounda, Bounder, LILELWOOD423 ; Script Function: ; To teach XP and Optimize performance. ; ; ---------------------------------------------------------------------------- #include <GUIConstants.au3> GuiCreate("Windows XP Help", 500, 100) $Frag = GuiCtrlCreateRadio("Defragment", 10, 10) $Help = GuiCtrlCreateRadio("Teach", 10, 30) $Res = GuiCtrlCreateRadio("System Restore", 10, 50) $Set = GuiCtrlCreateRadio("Display Computer Information", 10, 70) GuiSetState() While GuiGetMsg() <> $GUI_EVENT_CLOSE WEnd If $frag = $GUI_CHECKED Then Run("Disk Defragmenter.exe", "", @SW_MAXIMIZE) Endif same as last time. when i click radio button nothing happens. is there something i have to add? CS:S Aimbot - List From INI Funcs Link to comment Share on other sites More sharing options...
greenmachine Posted March 22, 2006 Share Posted March 22, 2006 aight i did the syntax in my script which now looks like this ; ---------------------------------------------------------------------------- ; ; Windows XP Help Script by BlueSmoke_ScR AkA Bounda, Bounder, LILELWOOD423 ; Script Function: ; To teach XP and Optimize performance. ; ; ---------------------------------------------------------------------------- #include <GUIConstants.au3> GuiCreate("Windows XP Help", 500, 100) $Frag = GuiCtrlCreateRadio("Defragment", 10, 10) $Help = GuiCtrlCreateRadio("Teach", 10, 30) $Res = GuiCtrlCreateRadio("System Restore", 10, 50) $Set = GuiCtrlCreateRadio("Display Computer Information", 10, 70) GuiSetState() While GuiGetMsg() <> $GUI_EVENT_CLOSE WEnd If $frag = $GUI_CHECKED Then Run("Disk Defragmenter.exe", "", @SW_MAXIMIZE) Endif same as last time. when i click radio button nothing happens. is there something i have to add? Your While loop is lacking sustenance. $Button = GuiCtrlCreateButton ([buttonstuff]); need a "go" button While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE Exit Case $msg = $Button; which you should add ButtonPressed() EndSelect WEnd Func ButtonPressed() If GuiCtrlRead ($Frag) = $GUI_CHECKED Then ; Do fraggy stuff ElseIf GuiCtrlRead ($Help) = $GUI_CHECKED Then ; Helpful stuff ElseIf GuiCtrlRead ($Res) = $GUI_CHECKED Then ; Res stuff ElseIf GuiCtrlRead ($Set) = $GUI_CHECKED Then ; Whatever needs to go here Else MsgBox (0, "Err", "Please check an option first.") EndIf EndFunc Might be some errors in there, I wrote it in the box and didn't check anything. Link to comment Share on other sites More sharing options...
Bounda Posted March 22, 2006 Author Share Posted March 22, 2006 ty ill test CS:S Aimbot - List From INI Funcs Link to comment Share on other sites More sharing options...
Bounda Posted March 22, 2006 Author Share Posted March 22, 2006 doesnt work. im so confused with this im just gonna say screw this whole thing. CS:S Aimbot - List From INI Funcs Link to comment Share on other sites More sharing options...
Bounda Posted March 22, 2006 Author Share Posted March 22, 2006 expandcollapse popup; ---------------------------------------------------------------------------- ; ; Windows XP Help Script by BlueSmoke_ScR AkA Bounda, Bounder, LILELWOOD423 ; Script Function: ; To teach XP and Optimize performance. ; ; ---------------------------------------------------------------------------- #include <GUIConstants.au3> GuiCreate("Windows XP Help", 500, 100) $Frag = GuiCtrlCreateRadio("Defragment", 10, 10) $Help = GuiCtrlCreateRadio("Teach", 10, 30) $Res = GuiCtrlCreateRadio("System Restore", 10, 50) $Set = GuiCtrlCreateRadio("Display Computer Information", 10, 70) $Button = GuiCtrlCreateButton ("Go", 100, 10); need a "go" button GuiSetState() While GuiGetMsg() <> $GUI_EVENT_CLOSE WEnd While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE Exit Case $msg = $Button; which you should add ButtonPressed() EndSelect WEnd Func ButtonPressed() If GuiCtrlRead ($Frag) = $GUI_CHECKED Then Run("Disk Defragmenter.exe") ElseIf GuiCtrlRead ($Help) = $GUI_CHECKED Then ; Helpful stuff ElseIf GuiCtrlRead ($Res) = $GUI_CHECKED Then ; Res stuff ElseIf GuiCtrlRead ($Set) = $GUI_CHECKED Then ; Whatever needs to go here Else MsgBox (0, "Err", "Please check an option first.") EndIf EndFunc CS:S Aimbot - List From INI Funcs Link to comment Share on other sites More sharing options...
greenmachine Posted March 22, 2006 Share Posted March 22, 2006 Your other while loop was in the way. This works: expandcollapse popup; ---------------------------------------------------------------------------- ; ; Windows XP Help Script by BlueSmoke_ScR AkA Bounda, Bounder, LILELWOOD423 ; Script Function: ; To teach XP and Optimize performance. ; ; ---------------------------------------------------------------------------- #include <GUIConstants.au3> GuiCreate("Windows XP Help", 500, 100) $Frag = GuiCtrlCreateRadio("Defragment", 10, 10) $Help = GuiCtrlCreateRadio("Teach", 10, 30) $Res = GuiCtrlCreateRadio("System Restore", 10, 50) $Set = GuiCtrlCreateRadio("Display Computer Information", 10, 70) $Button = GuiCtrlCreateButton ("Go", 100, 10); need a "go" button GuiSetState() While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE Exit Case $msg = $Button; which you should add ButtonPressed() EndSelect WEnd Func ButtonPressed() If GuiCtrlRead ($Frag) = $GUI_CHECKED Then Run("Disk Defragmenter.exe") ElseIf GuiCtrlRead ($Help) = $GUI_CHECKED Then MsgBox (0, "help", "help checked") ElseIf GuiCtrlRead ($Res) = $GUI_CHECKED Then MsgBox (0, "res", "Res checked") ElseIf GuiCtrlRead ($Set) = $GUI_CHECKED Then MsgBox (0, "Set", "Set checked") Else MsgBox (0, "Err", "Please check an option first.") EndIf EndFunc Also, you're going to want the full path to the exe that you're trying to run, otherwise it probably won't find it. Link to comment Share on other sites More sharing options...
Bounda Posted March 22, 2006 Author Share Posted March 22, 2006 ty so much it finally works!! CS:S Aimbot - List From INI Funcs Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now