#include #Include #include #include #include #include #include #include #include #include #include #include #include #include Opt("GUIOnEventMode", 1) AutoItSetOption ( "TrayIconDebug", 1 ) Opt('MustDeclareVars', 1) Global $sFilePath = @ScriptDir & "\AddEmail_GUI_Working.au3" Global $AddEmail_GUI, $aTaskbar, $aWin,$Input1, $Input1_Pass, $iLine ;------------------------------------------- Accounts will go here ---------------------------------------------------------------------------- ;------------------------------------------ Accounts go here END ------------------------------------------------------------------------------------------ AccType() Func AccType() $AddEmail_GUI = GUICreate("Auto Add Email", 509, 452, @DesktopWidth, @DesktopHeight) $aTaskbar = WinGetPos("[CLASS:Shell_TrayWnd]", "") $aWin = WinGetPos($AddEmail_GUI) WinMove($AddEmail_GUI, "", @DesktopWidth - $aWin[2] - 4, @DesktopHeight - $aWin[3] - $aTaskbar[3] - 180) Global $AddAccount_Button = GUICtrlCreateButton("Add Account", 368, 182, 105, 41) GUICtrlSetTip(-1, "Click To Add Your Account") GUICtrlSetFont(-1, 10, 800, 0, "Arial") $Input1 = GUICtrlCreateInput("", 24, 56, 457, 21) $Input1_Pass = GUICtrlCreateInput("", 24, 120, 457, 21) Global $cCombo_AccType[10] $cCombo_AccType[1] = GUICtrlCreateCombo("", 320, 192, 33, 25) GUICtrlSetData($cCombo_AccType[1], "1|2|3|4|5|6|7|8|9|10", "") GUISetState() ; Run the GUI until the dialog is closed GUICtrlSetFont(-1, 8, 400, 0, "Arial") Global $Label_AccType = GUICtrlCreateLabel("Must Select a Type of Account Before you Submit", 40, 186, 272, 17) GUICtrlSetTip(-1, "You can add up to 10 Accounts for each type ") GUICtrlSetFont(-1, 9, 400, 0, "Arial") ;Global $RemoveAll_Button = GUICtrlCreateButton("Remove All", 296, 368, 105, 41) ;GUICtrlSetTip(-1, "Click To Remove All Emails") ;GUICtrlSetFont(-1, 9, 800, 0, "Arial") Global $Label_Input1 = GUICtrlCreateLabel("Enter a Gmail or Hotmail or Live Account", 24, 32, 275, 17) GUICtrlSetFont(-1, 10, 800, 0, "Arial") Global $Label_Input1Pass = GUICtrlCreateLabel("Enter the Password for that Account", 24, 96, 249, 17) GUICtrlSetFont(-1, 10, 800, 0, "Arial") Global $Label_Primary = GUICtrlCreateLabel("1 = Primary", 136, 208, 72, 17) GUICtrlSetTip(-1, "Primary is the selected account in Drop Down List") GUICtrlSetFont(-1, 9, 400, 0, "Arial") Global $Label_Secondary = GUICtrlCreateLabel("2 = Secondary", 224, 208, 79, 17) GUICtrlSetTip(-1, "Secondary Accounts become Primary if no Primary are added") GUICtrlSetFont(-1, 9, 400, 0, "Arial") ;Global $Label_RemoveAll = GUICtrlCreateLabel("Remove All Accounts From Script", 267, 416, 162, 17) ;GUICtrlSetFont(-1, 8, 400, 0, "Arial") ;Global $Reset_Button = GUICtrlCreateButton("Reset", 104, 365, 105, 41) ;GUICtrlSetTip(-1, "Click To Reset Script to Defualt") ;GUICtrlSetFont(-1, 9, 800, 0, "Arial") ;Global $Label_ResettoDefualt = GUICtrlCreateLabel("Resets Script To Defualts", 93, 416, 127, 18) ;GUICtrlSetFont(-1, 8, 400, 0, "Arial") GUISetOnEvent($GUI_EVENT_CLOSE, "On_Close") GUICtrlSetOnEvent(-1, "On_Button") GUICtrlSetOnEvent(14, "On_Button") GUICtrlSetOnEvent(8, "On_Button") GUICtrlSetOnEvent(3, "On_Button") GUISetState() EndFunc Func On_Button() Switch @GUI_CTRLID Case $AddAccount_Button Add_MultiEmail() EndSwitch EndFunc Global $AutoEmail_GUI Global $AddYourEmail_Button Func On_Close() Switch @GUI_WINHANDLE Case $AddEmail_GUI Exit Case $AddEmail_GUI GUIDelete($AddEmail_GUI) GUICtrlSetState($AddYourEmail_Button, $GUI_ENABLE) EndSwitch EndFunc Func Add_MultiEmail() Global $Account = GUICtrlRead($Input1) Global $Password = GUICtrlRead($Input1_Pass) Global $n = GUICtrlRead($cCombo_AccType[1]) If $Account = "" Then MsgBox($MB_SYSTEMMODAL, "Account Error", "You Must Enter a Gmail or Hotmail or Live Account ") Else If $Password = "" Then MsgBox($MB_SYSTEMMODAL, "Account Error", "You Must Enter a Password") Else If $Account <> "" Then If $Password <> "" Then If $n = 0 Then MsgBox($MB_SYSTEMMODAL, "Account Error", "You Must Select Account Type") Else If $Account <> "" Then If $Password <> "" Then $Account = GUICtrlRead($Input1) $Password = GUICtrlRead($Input1_Pass) $n = GUICtrlRead($cCombo_AccType[1]) If $Password <> "" Then If StringRegExp($Account, "..*@gmail.com") Then If $n = 1 Then GUICtrlSetData($cCombo_AccType[1], 2) Add_MoreGmail() Else If $n <> 1 Then $Account = GUICtrlRead($Input1) $Password = GUICtrlRead($Input1_Pass) $n = GUICtrlRead($cCombo_AccType[1]) _GUICtrlComboBox_DeleteString($cCombo_AccType[1], 0) MsgBox($MB_SYSTEMMODAL, "", "Combo item 1 Deleted") Add_MoreGmail() Else EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf Endfunc Func Add_MoreGmail() If $n = 1 Then Local $iLine = "34" If $n = 2 Then Local $iLine = "36" If $n = 3 Then Local $iLine = "38" If $n = 4 Then Local $iLine = "40" If $n = 5 Then Local $iLine = "42" If $n = 6 Then Local $iLine = "44" If $n = 7 Then Local $iLine = "46" If $n = 8 Then Local $iLine = "48" If $n = 9 Then Local $iLine = "50" If $n = 10 Then Local $iLine = "52" $Account= GUICtrlRead($Input1) $Password= GUICtrlRead($Input1_Pass) Global $USER_INPUT = "Global $GmailAccount"&($n)& " = " & '"' & ($Account) & '"' Global $USER_PASS = "Global $GmailPassword"&($n)& " = " & '"' & ($Password) & '"' _FileWriteToLine($sFilePath, $iLine, $USER_PASS) _FileWriteToLine($sFilePath, $iLine, $USER_INPUT) GUICtrlSetData($Input1,"") ;This Clears the input1 box GUICtrlSetData($Input1_Pass,"") ;This Clears the input1 pass box MsgBox($MB_SYSTEMMODAL, "Gmail", "You added "&$Account& " at Line "&$iLine) EndFunc While 1 $cCombo_AccType[2] = GUIGetMsg() Select Case $cCombo_AccType[2] = $GUI_EVENT_CLOSE Exit Case $cCombo_AccType[2] = $cCombo_AccType[1] MsgBox(64,"test",GUICtrlRead($cCombo_AccType[1])) EndSelect WEnd