John117 Posted July 12, 2007 Share Posted July 12, 2007 I have the following code. the last entry was to add the funtion section and a case to call it from while 1 I would like the edit box(Spam User Name) to contain a value when needed. When the value is not "" it should skip to the function and loop the value of the edit box. Currently it skips to the function even if "" and does not include exit info. Please help if you know how! CODE#include <GuiConstants.au3> #include <file.au3> Dim $aRecords If Not _FileReadToArray( @ScriptDir & "\Add New Contacts Here.txt",$aRecords) Then MsgBox(4096,"Error", " Error reading log to Array error:" & @error) Exit EndIf Dim $aButtons[uBound($aRecords)] $aHeight = (UBound($aRecords) * 25) + 60 ; START NET SEND RunWait("net start messenger", "", @SW_HIDE) ; GUI $window = GUICreate(@UserName & "'s Messenger", 250, $aHeight) GUISetIcon(@SystemDir & "\mspaint.exe", 0) ; MENU $filemenu = GuiCtrlCreateMenu ("File") $fileitem = GuiCtrlCreateMenuitem ("Add Contacts...",$filemenu) $separator1 = GuiCtrlCreateMenuitem ("",$filemenu) $exititem = GuiCtrlCreateMenuitem ("Exit",$filemenu) ;LABEL $CurrentUserName = GUICtrlCreateLabel("Type Message *Press Button to Send*", 10, 10, 200, 20);Left, Top, Right, Bottom ; INPUT $Edit1 = GUICtrlCreateEdit("Type Message Here", 10, 30, 230, 60, $ES_WANTRETURN) $SpamUserName = GUICtrlCreateEdit("", 200, 5, 30, 19, $ES_WANTRETURN);Left, Top, Right, Bottom ;BUILD BUTTONS $aTop = 100 $aLeft = 10 For $x = 1 to $aRecords[0] $aButtons[$x] = GUICtrlCreateButton( $aRecords[$x], $aLeft, $aTop, 100, 30) If $aLeft = 10 Then $aLeft = 140 ContinueLoop Else $aLeft = 10 $aTop = $aTop + 40 EndIf Next ;SET BUTTON FUNCTIONS GUISetState() While 1 $cursorinfo = GUIGetCursorInfo($window) If $cursorinfo[4] = $Edit1 Then If $cursorinfo[2] = 1 Then GUICtrlSetData($Edit1, "") EndIf EndIf $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then Exit If $msg = $exititem Then Exit Select Case $SpamUserName <> "" Call("SPAM_USER") Case $msg = $fileitem ShellExecute("Add New Contacts Here.txt", "", @ScriptDir, "edit") EndSelect For $x = 1 to $aRecords[0] If $msg = $aButtons[$x] Then Run("net send " & $aRecords[$x] & " Mesage From " & @UserName & ": " & StringReplace(GUICtrlRead($Edit1), @CRLF, " "), "", @SW_HIDE) MsgBox(0, "Message Sent", "message to "&$aRecords[$x]&": "& StringReplace(GUICtrlRead($Edit1), @CRLF, " ")) EndIf Next WEnd ;Function Section Func SPAM_USER() While 1 $msg = GUIGetMsg() For $x = 1 to $aRecords[0] If $msg = $aButtons[$x] Then For $count = 1 To $SpamUserName Run("net send " & $aRecords[$x] & " Mesage From " & @UserName & ": " & StringReplace(GUICtrlRead($Edit1), @CRLF, " "), "", @SW_HIDE) Next EndIf Next WEnd EndFunc Link to comment Share on other sites More sharing options...
Valuater Posted July 12, 2007 Share Posted July 12, 2007 this just cant be rightFor $count = 1 To $SpamUserName8) Link to comment Share on other sites More sharing options...
Valuater Posted July 12, 2007 Share Posted July 12, 2007 (edited) Gotta love these guys who ask then leaveLast Seen: 30 minutes ago8)EDITLast Seen: Today, 12:46 PM Edited July 12, 2007 by Valuater Link to comment Share on other sites More sharing options...
John117 Posted July 12, 2007 Author Share Posted July 12, 2007 (edited) Well, when your working at work! Works in VBA . . . not autoit? edit: fxd Edited July 13, 2007 by Hatcheda 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