
Dgameman1
Active Members-
Posts
280 -
Joined
-
Last visited
Everything posted by Dgameman1
-
How to delete duplicates of in an Array?
Dgameman1 posted a topic in AutoIt General Help and Support
I know I can use _ArrayUnique to give back the Unique arrays, but I want to actually delete both of the duplicates if there's more than one at all. Local $Usernames[3] = ["Dan", "Bob", "Billy"] Local $blackListUsernames[2] = ["Dan", "Scott"] _ArrayAdd($Usernames, $blackListUsernames) ;combines the 2 arrays into 1. $Usernames = _ArrayUnique($Usernames) ;Uniques the array. This issue with this, is that $Usernames will contain Dan, Bob, Billy, Scott. I can't seem to find a way to make it so that if there are any duplicates, it'll just remove both of them, for example, I want $Usernames to have just Bob, Billy, Scott. There will only be either two or one of the same value. Never more than 2. -
This is what i was able to come up with so far $PowerShellCommand = "Start-Process -WindowStyle Hidden -FilePath 'C:\Program Files\Internet Explorer\iexplore.exe' 'google.com -noframemerging -private'" Run("powershell.exe -Command " & $PowerShellCommand) The issue with this is that the -WindowStyle Hidden doesn't work, but that's a powershell issue. And now powershell is visible lol. I don't want anything visible
-
Yes. I understand. I've said multiple times that I clearly understand what you're saying. I'm the one that even wrote about it first. I said... What I've been able to find, is that if you run this command through powershell, a hidden IE window will open and navigate to a certain page. $ie = new-object -com "InternetExplorer.Application" $ie.navigate("http://launchurl") No where did I say that, that was the answer to my problem. All I said was that's what I was able to figure out with PowerShell. Not that this is what I wanted to do. So, If you're clearly hell bent on telling me that _IECreate can do this, please, show me how I can use _IECreate to create a browser that starts off HIDDEN, (Not becomes hidden after it opens, like others have kept telling me to do), with the parameters -noframemerging -private Thanks!
-
Because I can't figure out how to do it correctly The following AutoiIt code opens up IE already hidden. Run("powershell.exe -Command New-Object -com internetexplorer.application") I don't know how to navigation and the -noframemerging -private parameters in that same line though. Making it navigate in the same line is Run("powershell.exe -Command Start-Process -FilePath 'C:\Program Files\Internet Explorer\iexplore.exe ' 'http://www.google.com'") But that doesn't start IE as hidden
-
What...? How would I go about doing that in IECREATE then? And I posted saying What I've been able to find, is that if you run this command through powershell, a hidden IE window will open and navigate to a certain page. $ie = new-object -com "InternetExplorer.Application" $ie.navigate("http://launchurl") Lmao, are you even reading my posts?
-
Is there a maximum amount of time for Timerdiff?
Dgameman1 replied to Dgameman1's topic in AutoIt General Help and Support
You make a very good point. Thanks again! -
Is there a maximum amount of time for Timerdiff?
Dgameman1 replied to Dgameman1's topic in AutoIt General Help and Support
Ooh, perfect. I just want it to go up to 12 hours. So I'm glad it does! Thanks -
Is there a maximum amount of time for Timerdiff?
Dgameman1 replied to Dgameman1's topic in AutoIt General Help and Support
Thank you thank you. So using a calculator, 1.79769e+308 milliseconds would be equal to 4.99358333333333321e+301 hours. I'm assuming the calculator fucked up because that only seems like 5 hours? -
Is there a maximum amount of time for Timerdiff?
Dgameman1 replied to Dgameman1's topic in AutoIt General Help and Support
Right. And just to clarify, I know that some programming languages can only go up to 2,147,483,647 as an integer. -
Is there a maximum amount of time for Timerdiff?
Dgameman1 replied to Dgameman1's topic in AutoIt General Help and Support
So, what's the highest number I can make TimerDiff go up to? -
$RunWebsite.visible = False Doesn't work What would I replace '$oIE' or '$RunWebsite' with EDIT I fixed it by If $invisible Then $o_IE.visible = False EndIf After I attach to the browser, but this way, the IE still flashes open for a sec. I want it to OPEN hidden, not turn hidden after being opened.
-
Several functions. A couple questions
Dgameman1 replied to element72's topic in AutoIt General Help and Support
While 1 While 1 Sleep(1000) WEnd ;;Anything here will never happen WEnd While 1 While 1 Sleep(1000) ExitLoop 1 WEnd ;;This will happen after the inside While loop reaches 'ExitLoop 1' WEnd -
This is the function I've written so far Func _IECreateNew($s_url = "about:blank", $invisible = 0) ; Create an IE browser in a new process, attach to it and navigate to specified URL ; Returns browser object on success ; Returns 0 on failure and sets @error to 1 (timeout waiting for browser) or 2 (attach failed) Local $h_IEhandle, $o_IE Local $Random1 = Random(100000, 999999, 1) Local $Random2 = Random(100000, 999999, 1) If $invisible Then ;;;; Else Local $RunWebsite = Run(@ProgramFilesDir & "\Internet Explorer\iexplore.exe about:blank" & $Random1 & "-" & $Random2 & " -noframemerging -private") EndIf If Not WinWait("Navigation Canceled - Internet Explorer - [InPrivate]", "", 60) Then ; Expected IE window did not appear Return SetError(1, 0, 0) EndIf ;$h_IEhandle = WinGetHandle("Navigation Canceled - Internet Explorer - [InPrivate]") Do $o_IE = _IEAttach("about:blank" & $Random1 & "-" & $Random2, "url") Sleep(250) Until IsObj($o_IE) _IENavigate($o_IE, $s_url) Return $o_IE EndFunc ;==>_IECreateNew What can I do to make it start off hidden??
-
Is there a maximum amount of time for Timerdiff?
Dgameman1 replied to Dgameman1's topic in AutoIt General Help and Support
Lol thanks but not at all what I was asking -
$RandomOne = "15" $RandomTwo = "30" $Site = _IECreateNew("http://SITE.com/OK.php?=" & $RandomOne & $RandomTwo) ;;;;;;;;;;;;;;;;;;;;Random Stuff, Then the AutoIt script clicks the submit button _IEAction($Submit, "click") ;;;;;;;;;;;;;;;;;;The Page now reloads and I want to reattach SecureSite = _IEAttach($RandomOne & $RandomTwo & "1 - Internet Explorer - [InPrivate]", "title") ;$SecureSite = _IEAttach("http://SITE.com/OKC.php?p=login", "url") ;;; The commented out line works, but I don't want to attach via 'url' I want to attach via the title. Func _IECreateNew($s_url = "about:blank", $invisible = 0) ; Create an IE browser in a new process, attach to it and navigate to specified URL ; Returns browser object on success ; Returns 0 on failure and sets @error to 1 (timeout waiting for browser) or 2 (attach failed) Local $h_IEhandle, $o_IE Local $Random1 = Random(100000, 999999, 1) Local $Random2 = Random(100000, 999999, 1) Local $RunWebsite = Run(@ProgramFilesDir & "\Internet Explorer\iexplore.exe about:blank" & $Random1 & "-" & $Random2 & " -noframemerging -private") If $invisible Then _IEAction($RunWebsite, "invisible") EndIf If Not WinWait("Navigation Canceled - Internet Explorer - [InPrivate]", "", 60) Then ; Expected IE window did not appear Return SetError(1, 0, 0) EndIf ;$h_IEhandle = WinGetHandle("Navigation Canceled - Internet Explorer - [InPrivate]") $o_IE = _IEAttach("about:blank" & $Random1 & "-" & $Random2, "url") If Not IsObj($o_IE) Then ; attach failed Return SetError(2, 0, 0) EndIf _IENavigate($o_IE, $s_url) Return $o_IE EndFunc ;==>_IECreateNew Why am I not able to attach via title? This is what AutoIt WIndow Info shows >>>> Window <<<< Title: 15301 - Internet Explorer - [InPrivate] Class: IEFrame Position: 564, 135 Size: 1191, 675 Style: 0x16CF0000 ExStyle: 0x00000100 Handle: 0x00290D12
-
Start IE hidden without using _IECreate
Dgameman1 replied to Dgameman1's topic in AutoIt General Help and Support
Any ideas? Using this code, how can I make it invisible right away? Func _IECreateNew($s_url = "about:blank", $invisible = 0) ; Create an IE browser in a new process, attach to it and navigate to specified URL ; Returns browser object on success ; Returns 0 on failure and sets @error to 1 (timeout waiting for browser) or 2 (attach failed) Local $h_IEhandle, $o_IE Global $RunWebsite = Run(@ProgramFilesDir & "\Internet Explorer\iexplore.exe about:blank1-2 -noframemerging -private") If $invisible Then _IEAction($RunWebsite, "invisible") EndIf If Not WinWait("Navigation Canceled - Internet Explorer - [InPrivate]", "", 60) Then ; Expected IE window did not appear Return SetError(1, 0, 0) EndIf ;$h_IEhandle = WinGetHandle("Navigation Canceled - Internet Explorer - [InPrivate]") $o_IE = _IEAttach("about:blank1-2", "url") If Not IsObj($o_IE) Then ; attach failed Return SetError(2, 0, 0) EndIf _IENavigate($o_IE, $s_url) Return $o_IE EndFunc ;==>_IECreateNew I also get the occasional error that it was not able to attach -
Oh, Everything works now And I know it's a required include file, but where is it? Is it a default AutoIt include? And why is it just named File? lol
-
Wait, what is this #Include<file.au3> ?
-
$IPPort = 587 $ssl = 0 10/10
-
I'm currently using the code from this thread https://www.autoitscript.com/forum/topic/23860-smtp-mailer-that-supports-html-and-attachments/?page=1 This is the code I have so far ; ;################################## ; Include ;################################## #Include<file.au3> ;################################## ; Variables ;################################## $SmtpServer = "mail.WEBSITE.com" ; address for the smtp-server to use - REQUIRED $FromName = "Dgameman1" ; name from who the email was sent $FromAddress = "Dgameman1@WEBSITE.com" ; address from where the mail should come $ToAddress = "Dgame1@gmail.com" ; destination address of the email - REQUIRED $Subject = "Userinfo" ; subject from the email - can be anything you want it to be $Body = "" ; the messagebody from the mail - can be left blank but then you get a blank mail $AttachFiles = "" ; the file(s) you want to attach seperated with a ; (Semicolon) - leave blank if not needed $CcAddress = "" ; address for cc - leave blank if not needed $BccAddress = "" ; address for bcc - leave blank if not needed $Importance = "Normal" ; Send message priority: "High", "Normal", "Low" $Username = "Dgameman1@WEBSITE.com" ; username for the account used from where the mail gets sent - REQUIRED $Password = "PASSWORD!" ; password for the account used from where the mail gets sent - REQUIRED $IPPort = 25 ; port used for sending the mail $ssl = 0 ; enables/disables secure socket layer sending - put to 1 if using httpS ;$IPPort=465 ; GMAIL port used for sending the mail ;$ssl=1 ; GMAILenables/disables secure socket layer sending - put to 1 if using httpS ;################################## ; Script ;################################## Global $oMyRet[2] Global $oMyError = ObjEvent("AutoIt.Error", "MyErrFunc") $rc = _INetSmtpMailCom($SmtpServer, $FromName, $FromAddress, $ToAddress, $Subject, $Body, $AttachFiles, $CcAddress, $BccAddress, $Importance, $Username, $Password, $IPPort, $ssl) If @error Then MsgBox(0, "Error sending message", "Error code:" & @error & " Description:" & $rc) EndIf ; ; The UDF Func _INetSmtpMailCom($s_SmtpServer, $s_FromName, $s_FromAddress, $s_ToAddress, $s_Subject = "", $as_Body = "", $s_AttachFiles = "", $s_CcAddress = "", $s_BccAddress = "", $s_Importance="Normal", $s_Username = "", $s_Password = "", $IPPort = 25, $ssl = 0) Local $objEmail = ObjCreate("CDO.Message") $objEmail.From = '"' & $s_FromName & '" <' & $s_FromAddress & '>' $objEmail.To = $s_ToAddress Local $i_Error = 0 Local $i_Error_desciption = "" If $s_CcAddress <> "" Then $objEmail.Cc = $s_CcAddress If $s_BccAddress <> "" Then $objEmail.Bcc = $s_BccAddress $objEmail.Subject = $s_Subject If StringInStr($as_Body, "<") And StringInStr($as_Body, ">") Then $objEmail.HTMLBody = $as_Body Else $objEmail.Textbody = $as_Body & @CRLF EndIf If $s_AttachFiles <> "" Then Local $S_Files2Attach = StringSplit($s_AttachFiles, ";") For $x = 1 To $S_Files2Attach[0] $S_Files2Attach[$x] = _PathFull($S_Files2Attach[$x]) ;~ ConsoleWrite('@@ Debug : $S_Files2Attach[$x] = ' & $S_Files2Attach[$x] & @LF & '>Error code: ' & @error & @LF) ;### Debug Console If FileExists($S_Files2Attach[$x]) Then ConsoleWrite('+> File attachment added: ' & $S_Files2Attach[$x] & @LF) $objEmail.AddAttachment($S_Files2Attach[$x]) Else ConsoleWrite('!> File not found to attach: ' & $S_Files2Attach[$x] & @LF) SetError(1) Return 0 EndIf Next EndIf $objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 $objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = $s_SmtpServer If Number($IPPort) = 0 then $IPPort = 25 $objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = $IPPort ;Authenticated SMTP If $s_Username <> "" Then $objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1 $objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusername") = $s_Username $objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendpassword") = $s_Password EndIf If $ssl Then $objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = True EndIf ;Update settings $objEmail.Configuration.Fields.Update ; Set Email Importance Switch $s_Importance Case "High" $objEmail.Fields.Item ("urn:schemas:mailheader:Importance") = "High" Case "Normal" $objEmail.Fields.Item ("urn:schemas:mailheader:Importance") = "Normal" Case "Low" $objEmail.Fields.Item ("urn:schemas:mailheader:Importance") = "Low" EndSwitch $objEmail.Fields.Update ; Sent the Message $objEmail.Send If @error Then SetError(2) Return $oMyRet[1] EndIf $objEmail="" EndFunc ;==>_INetSmtpMailCom ; ; ; Com Error Handler Func MyErrFunc() $HexNumber = Hex($oMyError.number, 8) $oMyRet[0] = $HexNumber $oMyRet[1] = StringStripWS($oMyError.description, 3) ConsoleWrite("### COM Error ! Number: " & $HexNumber & " ScriptLine: " & $oMyError.scriptline & " Description:" & $oMyRet[1] & @LF) SetError(1); something to check for when this function returns Return EndFunc ;==>MyErrFunc I changed some information in the Variables. The hosting provider I am using is Dreamhost and this is their Email Client Configuration page http://wiki.dreamhost.com/Email_Client_Configuration The error I get is Any ideas?
-
Add Variable inside String
Dgameman1 replied to Dgameman1's topic in AutoIt General Help and Support
$picklineText = StringReplace($picklineText, "#FirstName#", $CurrentMatchUsername)