ChazFire's REVENGE Posted March 17, 2005 Share Posted March 17, 2005 I am making a communication program for school, all i need to know 4 now is how do I make this whenever i click SEND, to open cmd.exe and type: Net send lake# "message" : when # is the radio button number and message is text from message field? Sorry, I'm not completly aware of how to do stuff, but here is code so far. (my spelling might suck ) expandcollapse popup#include <GUIConstants.au3> GUICreate("GUI menu",300,200) GUICtrlCreateLabel("What do you want to say?", 10, 110, 150) $TITLE = GUICtrlCreateInput("", 5, 125, 290, 20) GUICtrlSetState ( -1, $GUI_FOCUS) GUICtrlSetTip(-1, "The title of the message box.") $filemenu = GuiCtrlCreateMenu ("File") $fileitem = GuiCtrlCreateMenuitem ("Open...",$filemenu) $recentfilesmenu = GuiCtrlCreateMenu ("Recent Files",$filemenu) $separator1 = GuiCtrlCreateMenuitem ("",$filemenu) $exititem = GuiCtrlCreateMenuitem ("Exit",$filemenu) $helpmenu = GuiCtrlCreateMenu ("?") $aboutitem = GuiCtrlCreateMenuitem ("About",$helpmenu) ;$helpmenu2 = GuiCtrlCreateMenuitem ("help",$helpmenu) $aboutitemhelp = GuiCtrlCreateMenuitem ("OMFG HELP",$helpmenu) $optInfo01 = GUICtrlCreateRadio("(01)", 10, 10, 50, 15) $optInfo02 = GUICtrlCreateRadio("(02)", 10, 30, 50, 15) $optInfo03 = GUICtrlCreateRadio("(03)", 10, 50, 50, 15) $optInfo04 = GUICtrlCreateRadio("(04)", 10, 70, 50, 15) $optInfo05 = GUICtrlCreateRadio("(05)", 10, 90, 50, 15) $optInfo06 = GUICtrlCreateRadio("(06)", 60, 10, 50, 15) $optInfo07 = GUICtrlCreateRadio("(07)", 60, 30, 50, 15) $optInfo08 = GUICtrlCreateRadio("(08)", 60, 50, 50, 15) $optInfo09 = GUICtrlCreateRadio("(09)", 60, 70, 50, 15) $optInfo10 = GUICtrlCreateRadio("(10)", 60, 90, 50, 15) $optInfo11 = GUICtrlCreateRadio("(11)", 110, 10, 50, 15) $optInfo12 = GUICtrlCreateRadio("(12)", 110, 30, 50, 15) $optInfo13 = GUICtrlCreateRadio("(13)", 110, 50, 50, 15) $optInfo14 = GUICtrlCreateRadio("(14)", 110, 70, 50, 15) $optInfo15 = GUICtrlCreateRadio("(15)", 110, 90, 50, 15) $optInfo16 = GUICtrlCreateRadio("(16)", 160, 10, 50, 15) $optInfo17 = GUICtrlCreateRadio("(17)", 160, 30, 50, 15) $optInfo18 = GUICtrlCreateRadio("(18)", 160, 50, 50, 15) $optInfo19 = GUICtrlCreateRadio("(19)", 160, 70, 50, 15) $optInfo20 = GUICtrlCreateRadio("(20)", 160, 90, 50, 15) $spambutton = GuiCtrlCreateButton ("SEND",210,30,70,20) $cancelbutton = GuiCtrlCreateButton ("Close",210,70,70,20) GuiSetState() While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE Or $msg = $cancelbutton ExitLoop Case $msg = $fileitem $file = FileOpenDialog("Choose file...",@TempDir,"All (*.*)") If @error <> 1 Then GuiCtrlCreateMenuItem ($file,$recentfilesmenu) Case $msg = $exititem ExitLoop Case $msg = $spambutton Dim $iMsgBoxAnswer $iMsgBoxAnswer = MsgBox(36,"","You'r about to send MESSAGE to USER, are you sure u want to continue?") Select Case $iMsgBoxAnswer = 6;Yes Run("cmd.exe") Case $iMsgBoxAnswer = 7;No EndSelect Case $msg = $aboutitemhelp MsgBox(0, "OMFG HELP","This will be help file.") ; work damnit Case $msg = $aboutitem Msgbox(0,"About","Thanks to all who supported this d/l! Email me @ michaell428wak@hotmail.com v1.0") EndSelect WEnd GUIDelete() Exit I've been using AuotIt v3 for about 4 mounths and just got new one 3 days ago. [font="Arial"]--------When you go to jail a friend will bve thier to bail you out, but a best friend will be sitting right next to you saying, "D*** we F**ked up!"--------A friend helps you move, but a best friend helps you move dead bodies?Which brings me to my question, what kind of friend are you?[/font] Link to comment Share on other sites More sharing options...
ChazFire's REVENGE Posted March 17, 2005 Author Share Posted March 17, 2005 Ok i think i got most of what i need, the easy part lol. Dim $iMsgBoxAnswer $iMsgBoxAnswer = MsgBox(36,"","You'r about to send MESSAGE to USER, are you sure u want to continue?") Select Case $iMsgBoxAnswer = 6;Yes Run("cmd.exe") WinWaitActive("C:\WINDOWS\system32\cmd.exe") Send("LakeNUM message{ENTER}") Case $iMsgBoxAnswer = 7;No EndSelect Now i just need help on how to do the variables on the # in LakeNUM , where NUM needs to to take the number of the radio button clicked, and how to import the text message for MESSAGE! [font="Arial"]--------When you go to jail a friend will bve thier to bail you out, but a best friend will be sitting right next to you saying, "D*** we F**ked up!"--------A friend helps you move, but a best friend helps you move dead bodies?Which brings me to my question, what kind of friend are you?[/font] Link to comment Share on other sites More sharing options...
ChazFire's REVENGE Posted March 17, 2005 Author Share Posted March 17, 2005 Can no-one @ all help me? [font="Arial"]--------When you go to jail a friend will bve thier to bail you out, but a best friend will be sitting right next to you saying, "D*** we F**ked up!"--------A friend helps you move, but a best friend helps you move dead bodies?Which brings me to my question, what kind of friend are you?[/font] Link to comment Share on other sites More sharing options...
ChazFire's REVENGE Posted March 17, 2005 Author Share Posted March 17, 2005 Today, 07:13 PM Today, 07:35 PM Today, 08:10 PM ....you're funny<{POST_SNAPBACK}>Why is this? I seriously need help! [font="Arial"]--------When you go to jail a friend will bve thier to bail you out, but a best friend will be sitting right next to you saying, "D*** we F**ked up!"--------A friend helps you move, but a best friend helps you move dead bodies?Which brings me to my question, what kind of friend are you?[/font] Link to comment Share on other sites More sharing options...
CyberSlug Posted March 17, 2005 Share Posted March 17, 2005 You really should replace that GUICtrlCreateRadio block with ARRAYS. Search the forums for info Against my better judgment:expandcollapse popup#include <GUIConstants.au3> GUICreate("GUI menu",300,200) GUICtrlCreateLabel("What do you want to say?", 10, 110, 150) $TITLE = GUICtrlCreateInput("", 5, 125, 290, 20) GUICtrlSetState ( -1, $GUI_FOCUS) GUICtrlSetTip(-1, "The title of the message box.") $filemenu = GuiCtrlCreateMenu ("File") $fileitem = GuiCtrlCreateMenuitem ("Open...",$filemenu) $recentfilesmenu = GuiCtrlCreateMenu ("Recent Files",$filemenu) $separator1 = GuiCtrlCreateMenuitem ("",$filemenu) $exititem = GuiCtrlCreateMenuitem ("Exit",$filemenu) $helpmenu = GuiCtrlCreateMenu ("?") $aboutitem = GuiCtrlCreateMenuitem ("About",$helpmenu) ;$helpmenu2 = GuiCtrlCreateMenuitem ("help",$helpmenu) $aboutitemhelp = GuiCtrlCreateMenuitem ("OMFG HELP",$helpmenu) $optInfo01 = GUICtrlCreateRadio("(01)", 10, 10, 50, 15) $optInfo02 = GUICtrlCreateRadio("(02)", 10, 30, 50, 15) $optInfo03 = GUICtrlCreateRadio("(03)", 10, 50, 50, 15) $optInfo04 = GUICtrlCreateRadio("(04)", 10, 70, 50, 15) $optInfo05 = GUICtrlCreateRadio("(05)", 10, 90, 50, 15) $optInfo06 = GUICtrlCreateRadio("(06)", 60, 10, 50, 15) $optInfo07 = GUICtrlCreateRadio("(07)", 60, 30, 50, 15) $optInfo08 = GUICtrlCreateRadio("(08)", 60, 50, 50, 15) $optInfo09 = GUICtrlCreateRadio("(09)", 60, 70, 50, 15) $optInfo10 = GUICtrlCreateRadio("(10)", 60, 90, 50, 15) $optInfo11 = GUICtrlCreateRadio("(11)", 110, 10, 50, 15) $optInfo12 = GUICtrlCreateRadio("(12)", 110, 30, 50, 15) $optInfo13 = GUICtrlCreateRadio("(13)", 110, 50, 50, 15) $optInfo14 = GUICtrlCreateRadio("(14)", 110, 70, 50, 15) $optInfo15 = GUICtrlCreateRadio("(15)", 110, 90, 50, 15) $optInfo16 = GUICtrlCreateRadio("(16)", 160, 10, 50, 15) $optInfo17 = GUICtrlCreateRadio("(17)", 160, 30, 50, 15) $optInfo18 = GUICtrlCreateRadio("(18)", 160, 50, 50, 15) $optInfo19 = GUICtrlCreateRadio("(19)", 160, 70, 50, 15) $optInfo20 = GUICtrlCreateRadio("(20)", 160, 90, 50, 15) $spambutton = GuiCtrlCreateButton ("SEND",210,30,70,20) $cancelbutton = GuiCtrlCreateButton ("Close",210,70,70,20) GuiSetState() Global $selectedNumber = 0 While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE Or $msg = $cancelbutton ExitLoop Case $msg = $fileitem $file = FileOpenDialog("Choose file...",@TempDir,"All (*.*)") If @error <> 1 Then GuiCtrlCreateMenuItem ($file,$recentfilesmenu) Case $msg = $exititem ExitLoop Case $msg >= Eval("optInfo01") And $msg <= Eval("optInfo20") $selectedNumber = $msg - 12 ;subtract 12 to convert ctrlID# into number you want Case $msg = $spambutton Dim $iMsgBoxAnswer $iMsgBoxAnswer = MsgBox(36,"","You'r about to send MESSAGE to USER, are you sure u want to continue?") Select Case $iMsgBoxAnswer = 6;Yes MsgBox(4096,"debug", $selectedNumber) $recipient = "lake" & $selectedNumber $message = """" & GuiCtrlRead($TITLE) & """" Run("net send " & $recipient & " " & $message, "", @SW_HIDE) GuiCtrlSetData($title, "") GuiCtrlSetState($title, $GUI_FOCUS) Case $iMsgBoxAnswer = 7;No EndSelect Case $msg = $aboutitemhelp MsgBox(0, "OMFG HELP","This will be help file."); work damnit Case $msg = $aboutitem Msgbox(0,"About","Thanks to all who supported this d/l! Email me @ michaell428wak@hotmail.com v1.0") EndSelect WEnd GUIDelete() Exit Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig! Link to comment Share on other sites More sharing options...
ChazFire's REVENGE Posted March 17, 2005 Author Share Posted March 17, 2005 Wow, nice! That helps me out alot! I'll be sure to check out the array thing. BTW would it be a'ight to add you to thanks list in the script/readme ? [font="Arial"]--------When you go to jail a friend will bve thier to bail you out, but a best friend will be sitting right next to you saying, "D*** we F**ked up!"--------A friend helps you move, but a best friend helps you move dead bodies?Which brings me to my question, what kind of friend are you?[/font] 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