#RequireAdmin #include #include #include #include #include #include #include #include #include #include #include #include #include ;---------------------------------------------------- My Latest work in progress ------------------------------------------------------ ;AutoItSetOption ( "GUIDataSeparatorChar", "" ) Opt("GUIOnEventMode", 1) AutoItSetOption ( "TrayIconDebug", 1 ) Global $AutoEmail, $AutoReplace_GUI = 9999, $Gmail_Button, $Hotmail_Button, $AutoReplace_Button = 9999 ; Predeclare the variables with dummy values to prevent firing the Case statements Global $Gmail1_Button, $Gmail2_Button, $Hotmail1_Button, $Hotmail2_Button, $Input1, $Input2, $Input3, $Input4 Global $Gmail, $Hotmail, $cCombo, $cCombo2 Global $sFilePath = @ScriptDir & "\AutoEmail_Variables_TESTING.au3" Global $iLine Global $GDataCom Global $Input_g1pass Global $Reset_Script_Button Global $Add_MoreEmails_Button Global $MsgBoxReset Global $Data1 Global $Data2 Global $n Global $iText Global $cCombo_AddNum Global $USER_INPUT Global $USER_PASS Global $GmailAccount1, $GmailAccount2, $GmailAccount3, $GmailAccount4, $GmailAccount5, $GmailAccount6, $GmailAccount7, $GmailAccount8, $GmailAccount9, $GmailAccount10 Global $GmailPassword1, $GmailPassword2, $GmailPassword3, $GmailPassword4, $GmailPassword5, $GmailPassword6, $GmailPassword7, $GmailPassword8, $GmailPassword9, $GmailPassword10 Global $HotmailAccount1, $HotmailAccount2, $HotmailAccount3, $HotmailAccount4, $HotmailAccount5, $HotmailAccount6, $HotmailAccount7, $HotmailAccount8, $HotmailAccount9, $HotmailAccount10 Global $HotmailPassword1, $HotmailPassword2, $HotmailPassword3, $HotmailPassword4, $HotmailPassword5, $HotmailPassword6, $HotmailPassword7, $HotmailPassword8, $HotmailPassword9, $HotmailPassword10 ;--------------------- Your Email Accounts Will Go Here --------------------- Global $GmailAccount1 = "test1@gmail.com" Global $GmailPassword1 = "test1" Global $GmailPassword2 = "test2" Global $GmailAccount3 = "test3@gmail.com" Global $GmailPassword3 = "test3" Global $HotmailAccount1 = "test1@hotmail.com" Global $HotmailPassword1 = "test1" Global $HotmailAccount2 = "test2@hotmail.com" Global $HotmailPassword2 = "test2" ;----------------------------- This is where I Need Help ----------------------------------------------------- Func Remove_All() Local $iLine[3] = ["54", "55", "56"] _FileWriteToLine ( $sFilePath, $iLine, "", 1 ) EndFunc ;----------------------------------------------------------------------------------------------------------------- GUI_AutoEmail() Func GUI_AutoEmail() $AutoEmail = GUICreate("Auto Email", 386, 132, @DesktopWidth, @DesktopHeight) $aTaskbar = WinGetPos("[CLASS:Shell_TrayWnd]", "") $aWin = WinGetPos($AutoEmail) WinMove($AutoEmail, "", @DesktopWidth - $aWin[2] - 4, @DesktopHeight - $aWin[3] - $aTaskbar[3] - 4) GUISetOnEvent($GUI_EVENT_CLOSE, "On_Close") $Gmail_Button = GUICtrlCreateButton("Gmail", 72, 16, 49, 41, $BS_ICON) GUICtrlSetImage(-1, "C:\Program Files\AutoEmail\gmail_icon.ico", 1) $Hotmail_Button = GUICtrlCreateButton("Hotmail", 263, 16, 49, 41, $BS_ICON) GUICtrlSetImage(-1, "C:\Program Files\AutoEmail\MSMail_icon.ico", 1) $iText = GUICtrlRead($cCombo) $cCombo = GUICtrlCreateCombo("", 16, 72, 161, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL)) If $GmailAccount10 Then GUICtrlSetData(-1, $GmailAccount10,$GmailAccount10) If $GmailAccount9 Then GUICtrlSetData(-1, $GmailAccount9,$GmailAccount9) If $GmailAccount8 Then GUICtrlSetData(-1, $GmailAccount8,$GmailAccount8) If $GmailAccount7 Then GUICtrlSetData(-1, $GmailAccount7,$GmailAccount7) If $GmailAccount6 Then GUICtrlSetData(-1, $GmailAccount6,$GmailAccount6) If $GmailAccount5 Then GUICtrlSetData(-1, $GmailAccount5,$GmailAccount5) If $GmailAccount4 Then GUICtrlSetData(-1, $GmailAccount4,$GmailAccount4) If $GmailAccount3 Then GUICtrlSetData(-1, $GmailAccount3,$GmailAccount3) If $GmailAccount2 Then GUICtrlSetData(-1, $GmailAccount2,$GmailAccount2) If $GmailAccount1 Then GUICtrlSetData(-1, $GmailAccount1,$GmailAccount1) $cCombo2 = GUICtrlCreateCombo("", 207, 72, 161, 25) If $HotmailAccount10 Then GUICtrlSetData(-1, $HotmailAccount10,$HotmailAccount10) If $HotmailAccount9 Then GUICtrlSetData(-1, $HotmailAccount9,$HotmailAccount9) If $HotmailAccount8 Then GUICtrlSetData(-1, $HotmailAccount8,$HotmailAccount8) If $HotmailAccount7 Then GUICtrlSetData(-1, $HotmailAccount7,$HotmailAccount7) If $HotmailAccount6 Then GUICtrlSetData(-1, $HotmailAccount6,$HotmailAccount6) If $HotmailAccount5 Then GUICtrlSetData(-1, $HotmailAccount5,$HotmailAccount5) If $HotmailAccount4 Then GUICtrlSetData(-1, $HotmailAccount4,$HotmailAccount4) If $HotmailAccount3 Then GUICtrlSetData(-1, $HotmailAccount3,$HotmailAccount3) If $HotmailAccount2 Then GUICtrlSetData(-1, $HotmailAccount2,$HotmailAccount2) If $HotmailAccount1 Then GUICtrlSetData(-1, $HotmailAccount1,$HotmailAccount1) GUICtrlSetOnEvent(3, "On_Button") GUICtrlSetOnEvent(4, "On_Button") GUICtrlSetOnEvent(-1, "On_Button") $AutoReplace_Button = GUICtrlCreateButton("Add Your Email", 18, 100, 80, 30) GUICtrlSetOnEvent(-1, "On_Button") GUISetState() EndFunc Func On_Button() Switch @GUI_CTRLID Case $Gmail_Button gmail() Case $Hotmail_Button hotmail() Case $AutoReplace_Button GUICtrlSetState($AutoReplace_Button, $GUI_DISABLE) GUI_AddEmail() Case $Gmail1_Button Case $Reset_Script_Button ;Reset_Script() Remove_All() Case $Add_MoreEmails_Button Add_MultiEmail() EndSwitch EndFunc Func gmail() Sleep(20) GUICtrlRead($cCombo) $GDataCom = GUICtrlRead($cCombo) If $GDataCom = $GmailAccount1 Then gmail1() Else GUICtrlRead($cCombo) $GDataCom = GUICtrlRead($cCombo) If $GDataCom = $GmailAccount2 Then gmail2() Else GUICtrlRead($cCombo) $GDataCom = GUICtrlRead($cCombo) If $GDataCom = $GmailAccount3 Then gmail3() EndIf EndIf EndIf EndFunc Func hotmail() Sleep(20) GUICtrlRead($cCombo2) $GDataCom2 = GUICtrlRead($cCombo2) If $GDataCom2 = $HotmailAccount1 Then ;MsgBox (0, "hbox1", "hotmail1") hotmail1() Else Sleep(20) GUICtrlRead($cCombo2) $GDataCom2 = GUICtrlRead($cCombo2) If $GDataCom2 = $HotmailAccount2 Then ;MsgBox (0, "hbox2", "hotmail2") hotmail2() EndIf EndIf EndFunc Func gmail1() Sleep(25) ProcessClose("iexplore.exe") ProcessWaitClose ( "iexplore.exe") Local $oIE = _IECreate ("https://accounts.google.com/ServiceLogin?service=mail&continue=https://mail.google.com/mail/") Sleep(25) Local $removeAccounts = _IEGetObjById ($oIE, "edit-account-list") _IEAction ($removeAccounts, "click") Local $removeAccounts = _IEGetObjById ($oIE, "account-email-0") _IEAction ($removeAccounts, "click") Local $removeAccounts = _IEGetObjById ($oIE, "account-email-1") _IEAction ($removeAccounts, "click") Sleep(100) Local $removeAccounts = _IEGetObjById ($oIE, "edit-account-list") _IEAction ($removeAccounts, "click") ;Local $staySignin = _IEGetObjById ($oIE, "PersistentCookie") ;_IEAction ($staySignin, "click") Sleep(1000) local $username = _IEGetObjByName ($oIE, "Email") Local $password = _IEGetObjByName ($oIE, "Passwd") Local $Email_button = _IEGetObjByName ($oIE, "Email") Local $Signin_button = _IEGetObjByName ($oIE,"signIn") _IEFormElementSetValue ($username, $GmailAccount1) _IEFormElementSetValue ($password, $GmailPassword1) _IEAction ($Email_button, "click") _IEAction ($Signin_button, "click") EndFunc Func gmail2() Sleep(25) ProcessClose("iexplore.exe") ProcessWaitClose ( "iexplore.exe") Local $oIE = _IECreate ("https://accounts.google.com/ServiceLogin?service=mail&continue=https://mail.google.com/mail/") Local $removeAccounts = _IEGetObjById ($oIE, "edit-account-list") _IEAction ($removeAccounts, "click") Local $removeAccounts = _IEGetObjById ($oIE, "account-email-0") _IEAction ($removeAccounts, "click") Local $removeAccounts = _IEGetObjById ($oIE, "account-email-1") _IEAction ($removeAccounts, "click") Sleep(100) Local $removeAccounts = _IEGetObjById ($oIE, "edit-account-list") _IEAction ($removeAccounts, "click") Sleep(1000) local $username = _IEGetObjByName ($oIE, "Email") Local $password = _IEGetObjByName ($oIE, "Passwd") Local $Email_button = _IEGetObjByName ($oIE, "account-email") Local $Signin_button = _IEGetObjByName ($oIE,"signIn") _IEFormElementSetValue ($username, $GmailAccount2) _IEFormElementSetValue ($password, $GmailPassword2) _IEAction ($Email_button, "click") _IEAction ($Signin_button, "click") EndFunc Func gmail3() Sleep(25) ProcessClose("iexplore.exe") ProcessWaitClose ( "iexplore.exe") Local $oIE = _IECreate ("https://accounts.google.com/ServiceLogin?service=mail&continue=https://mail.google.com/mail/") Local $removeAccounts = _IEGetObjById ($oIE, "edit-account-list") _IEAction ($removeAccounts, "click") Local $removeAccounts = _IEGetObjById ($oIE, "account-email-0") _IEAction ($removeAccounts, "click") Local $removeAccounts = _IEGetObjById ($oIE, "account-email-1") _IEAction ($removeAccounts, "click") Sleep(100) Local $removeAccounts = _IEGetObjById ($oIE, "edit-account-list") _IEAction ($removeAccounts, "click") Sleep(1000) local $username = _IEGetObjByName ($oIE, "Email") Local $password = _IEGetObjByName ($oIE, "Passwd") Local $Email_button = _IEGetObjByName ($oIE, "account-email") Local $Signin_button = _IEGetObjByName ($oIE,"signIn") _IEFormElementSetValue ($username, $GmailAccount3) _IEFormElementSetValue ($password, $GmailPassword3) _IEAction ($Email_button, "click") _IEAction ($Signin_button, "click") EndFunc Func hotmail1() Sleep(25) ProcessClose("iexplore.exe") ProcessWaitClose ( "iexplore.exe") Local $oIE = _IECreate ("https://login.live.com/login.srf?wa=wsignin1.0&rpsnv=12&ct=1428617583&rver=6.4.6456.0&wp=MBI_SSL_SHARED&wreply=https:%2F%2Fmail.live.com%2Fdefault.aspx%3Frru%3Dinbox&lc=1033&id=64855&mkt=en-us&cbcxt=mai") Local $username = _IEGetObjByName ($oIE, "login") Local $password = _IEGetObjByName ($oIE, "passwd") Local $Signin_button = _IEGetObjByName ($oIE,"SI") _IEFormElementSetValue ($username, $HotmailAccount1) _IEFormElementSetValue ($password, $HotmailPassword1) _IEAction ($Signin_button, "click") EndFunc Func hotmail2() Sleep(25) ProcessClose("iexplore.exe") ProcessWaitClose ( "iexplore.exe") Local $oIE = _IECreate ("http://www.live.com") Local $username = _IEGetObjByName ($oIE, "login") Local $password = _IEGetObjByName ($oIE, "passwd") Local $Signin_button = _IEGetObjByName ($oIE,"SI") _IEFormElementSetValue ($username, $HotmailAccount2) _IEFormElementSetValue ($password, $HotmailPassword2) _IEAction ($Signin_button, "click") EndFunc Func hotmail3() Sleep(25) ProcessClose("iexplore.exe") ProcessWaitClose ( "iexplore.exe") Local $oIE = _IECreate ("http://www.live.com") Local $username = _IEGetObjByName ($oIE, "login") Local $password = _IEGetObjByName ($oIE, "passwd") Local $Signin_button = _IEGetObjByName ($oIE,"SI") _IEFormElementSetValue ($username, $HotmailAccount3) _IEFormElementSetValue ($password, $HotmailPassword3) _IEAction ($Signin_button, "click") EndFunc Func On_Close() Switch @GUI_WINHANDLE Case $AutoEmail Exit Case $AutoReplace_GUI GUIDelete($AutoReplace_GUI) GUICtrlSetState($AutoReplace_Button, $GUI_ENABLE) EndSwitch EndFunc Func MsgReset_Close() Switch @GUI_WinHandle Case $MsgBoxReset Exit EndSwitch EndFunc Func GUI_AddEmail() $AutoReplace_GUI = GUICreate("Auto Add Email", 508, 334, -1, -1) $Input1 = GUICtrlCreateInput("", 24, 56, 457, 21) $Input_g1pass = GUICtrlCreateInput("", 24, 120, 457, 21) GUICtrlSetTip(-1, "Click To Remove All Emails") $cCombo_AddNum = GUICtrlCreateCombo("", 304, 144, 33, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL)) GUICtrlSetData(-1, "1") GUICtrlSetData(-1, "2") GUICtrlSetData(-1, "3") GUICtrlSetData(-1, "4") GUICtrlSetData(-1, "5") GUICtrlSetData(-1, "6") GUICtrlSetData(-1, "7") GUICtrlSetData(-1, "8") GUICtrlSetData(-1, "9") GUICtrlSetData(-1, "10") $Label_Num = GUICtrlCreateLabel("You Must Select a Type of Account Before you Submit", 24, 146, 272, 17) $Add_MoreEmails_Button = GUICtrlCreateButton("Add More Emails", 376, 150, 105, 41) $Reset_Script_Button = GUICtrlCreateButton("Remove All", 376, 272, 105, 41) $Label_AddGmail1 = GUICtrlCreateLabel("Enter a Gmail or Hotmail Account", 24, 32, 243, 17) $Label_AddPass1 = GUICtrlCreateLabel("Enter the Password for that Account", 24, 96, 249, 17) $Label1 = GUICtrlCreateLabel("1 = Primary", 168, 176, 56, 17) $Label2 = GUICtrlCreateLabel("2 = Secoundary", 256, 176, 79, 17) $Label3 = GUICtrlCreateLabel("This will remove All Accounts from the script", 144, 288, 210, 17) GUISetOnEvent($GUI_EVENT_CLOSE, "On_Close") GUICtrlSetOnEvent(-1, "On_Button") GUICtrlSetOnEvent(9, "On_Button") GUICtrlSetOnEvent(12, "On_Button") GUICtrlSetOnEvent(13, "On_Button") GUISetState() EndFunc ;Local $iText = StringRegExp($iText, "..*@gmail.com") ; Global $aReg[4][2] = [["386"],["3g2"],["acl"],["aac"]] Func Reset_Script() $MsgBoxReset = MsgBox(4, "Reset Script", "Do You want to Reset the Script") If $MsgBoxReset == 7 Then MsgReset_Close() If $MsgBoxReset == 6 Then FileCopy ("AutoEmail_Reset.au3", @ScriptFullPath, $FC_OVERWRITE ) EndIf EndFunc ;If StringRegExp($sText, ".*\..*@gmail.com") Then Func Add_MultiEmail() $iText = GUICtrlRead($Input1) $n = GUICtrlRead($cCombo_AddNum) If StringRegExp($iText, "..*@gmail.com") Then If $n = 1 Then MsgBox($MB_SYSTEMMODAL, "Gmail1", "You Added "& $iText) If $n = 2 Then MsgBox($MB_SYSTEMMODAL, "Gmail2", "You Added "& $iText) If $n = 3 Then MsgBox($MB_SYSTEMMODAL, "Gmail3", "You Added "& $iText) If $n = 4 Then MsgBox($MB_SYSTEMMODAL, "Gmail4", "You Added "& $iText) Add_MoreGmail() ;MsgBox($MB_SYSTEMMODAL, "Gmail End", "Gmail End"& $iText) EndIf If StringRegExp($iText, "..*@hotmail.com") Then If $n = 1 Then MsgBox($MB_SYSTEMMODAL, "Hotmail1", "You Added "& $iText) If $n = 2 Then MsgBox($MB_SYSTEMMODAL, "Hotmail2", "You Added "& $iText) If $n = 3 Then MsgBox($MB_SYSTEMMODAL, "Hotmail3", "You Added "& $iText) If $n = 4 Then MsgBox($MB_SYSTEMMODAL, "Hotmail4", "You Added "& $iText) Add_MoreHotmail() ;MsgBox($MB_SYSTEMMODAL, "Hotmail End", "Hotmail End"& $iText) EndIf EndFunc Func Add_MoreGmail() Local $n = GUICtrlRead($cCombo_AddNum) ;Local Const $sFilePath = @ScriptDir & "\AutoEmail_Variables_TESTING.au3" If $n = 1 Then Local $iLine = "61" If $n = 2 Then Local $iLine = "63" If $n = 3 Then Local $iLine = "65" If $n = 4 Then Local $iLine = "67" If $n = 5 Then Local $iLine = "69" If $n = 6 Then Local $iLine = "71" If $n = 7 Then Local $iLine = "73" If $n = 8 Then Local $iLine = "75" If $n = 9 Then Local $iLine = "77" If $n = 10 Then Local $iLine = "79" $Data1 = GUICtrlRead($Input1) $Data2 = GUICtrlRead($Input_g1pass) $USER_INPUT = "Global $GmailAccount"&($n)& " = " & '"' & ($Data1) & '"' $USER_PASS = "Global $GmailPassword"&($n)& " = " & '"' & ($Data2) & '"' _FileWriteToLine($sFilePath, $iLine, $USER_PASS) _FileWriteToLine($sFilePath, $iLine, $USER_INPUT) GUICtrlSetData($input1,"") ;This Clears the input1 box GUICtrlSetData($Input_g1pass,"") ;This Clears the input1 pass box EndFunc Func Add_MoreHotmail() $n = GUICtrlRead($cCombo_AddNum) ;Local Const $sFilePath = @ScriptDir & "\AutoEmail_Variables_TESTING.au3" If $n = 1 Then Local $iLine = "82" If $n = 2 Then Local $iLine = "84" If $n = 3 Then Local $iLine = "86" If $n = 4 Then Local $iLine = "88" If $n = 5 Then Local $iLine = "90" If $n = 6 Then Local $iLine = "92" If $n = 7 Then Local $iLine = "94" If $n = 8 Then Local $iLine = "96" If $n = 9 Then Local $iLine = "98" If $n = 10 Then Local $iLine = "100" $Data1 = GUICtrlRead($Input1) $Data2 = GUICtrlRead($Input_g1pass) $USER_INPUT = "Global $HotmailAccount"&($n)& " = " & '"' & ($Data1) & '"' $USER_PASS = "Global $HotmailPassword"&($n)& " = " & '"' & ($Data2) & '"' _FileWriteToLine($sFilePath, $iLine, $USER_PASS) _FileWriteToLine($sFilePath, $iLine, $USER_INPUT) GUICtrlSetData($input1,"") ;This Clears the input1 box GUICtrlSetData($Input_g1pass,"") ;This Clears the input1 pass box EndFunc ;------------------------------- This Auto Saves the Script Every 3 sec --------------------------- While 1 Sleep(3000) If WinActive ("[CLASS:SciTEWindow]") Then WinMenuSelectItem("[CLASS:SciTEWindow]", "", "&File", "&Save") EndIf WEnd ;---------------------------------------------------------------------------------------------------