
maqleod
Active Members-
Posts
309 -
Joined
-
Last visited
About maqleod
- Birthday 08/10/1980
Profile Information
-
Member Title
Weary Scripter
-
Location
North Bend, Wa
-
WWW
https://superuser.com/users/46328/maqleod
-
Interests
AutoIt, Python
maqleod's Achievements

Universalist (7/7)
1
Reputation
-
jvds reacted to a post in a topic: GUI Child Window
-
What I want to do is detect a stream of letters and replace with a different string of letters. Something like this, but this detects the f and starts going, also pulling the f from the sent key and continually repeating forever: #include <Process.au3> HotKeySet("forumsX", "LinkForums") ;listens for forumsX to be typed While 1 ;loop indefinitely Sleep(100) ;keeps from maxing out processor WEnd Func LinkForums() Dim $pid If WinExists("Gmail", "") Then ;check if a window relating to Gmail is open $pid = WinGetProcess("Gmail", "") ;check that window is actually open in a browser (therefore negating notepad, wordpad, etc) If _ProcessGetName($pid) = "firefox.exe" Then ;verify browser is firefox Send("<a href='www.myforums.com'>My Forums</a>") ;replacement text goes here EndIf EndIf EndFunc Is the only way to do this to have a sequence of _IsPressed() functions in a large set of nested If statements? or is there a cleaner way using Hotkey set or IsPressed, or even something else?
-
Local $asWords[2] = ["Boat", "Car"] MsgBox(0, "Here's a word for you", $asWords[Random(0, UBound($asWords) -1, 1)])
-
It errors because he has a 2 value array and 0-ubound($aswords) is 3 values to random.
-
There is no way you can get something to list words without some sort of list to verify they are actually words, otherwise you'll just get jumbles of letters returned.
-
Stdout read from cmd.exe being cut short
maqleod replied to Rishodi's topic in AutoIt General Help and Support
That is from the help file, it gives a sample like so: #include <Constants.au3> Local $foo = Run(@ComSpec & " /c dir foo.bar", @SystemDir, @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD) Local $line While 1 $line = StdoutRead($foo) If @error Then ExitLoop MsgBox(0, "STDOUT read:", $line) Wend -
Whats wrong { Solved } - Pixel Search
maqleod replied to LibertyMan's topic in AutoIt General Help and Support
Have you verified with a MsgBox that the Hex command is returning what you think it is returning? And why do you need both the If structure and the select structure? -
Whats wrong { Solved } - Pixel Search
maqleod replied to LibertyMan's topic in AutoIt General Help and Support
It might work a bit better if you complete those for loops. -
I need a function that just validates that the target mailbox exists, but doesn't actually send anything. Since _InetSmtpMail() already does the work of finding and connecting to the mail server on the other end, I figured it would be a good place to start with this. If $s_SmtpServer = "" Or $s_FromAddress = "" Or $s_ToAddress = "" Or $s_FromName = "" Or StringLen($s_FromName) > 256 Then Return SetError(1, 0 ,0) If $s_helo = "" Then $s_helo = @ComputerName If TCPStartup() = 0 Then Return SetError(2, 0 ,0) Local $s_IPAddress, $i_Count StringRegExp($s_SmtpServer, "(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)") If @extended Then $s_IPAddress = $s_SmtpServer Else $s_IPAddress = TCPNameToIP($s_SmtpServer) EndIf If $s_IPAddress = "" Then TCPShutdown() Return SetError(3, 0 ,0) EndIf Local $v_Socket = TCPConnect($s_IPAddress, 25) If $v_Socket = -1 Then TCPShutdown() Return SetError(4, 0 ,0) EndIf Local $s_Send[6], $s_ReplyCode[6] ; Return code from SMTP server indicating success $s_Send[0] = "HELO " & $s_helo & @CRLF If StringLeft($s_helo,5) = "EHLO " Then $s_Send[0] = $s_helo & @CRLF $s_ReplyCode[0] = "250" $s_Send[1] = "MAIL FROM: <" & $s_FromAddress & ">" & @CRLF $s_ReplyCode[1] = "250" $s_Send[2] = "RCPT TO: <" & $s_ToAddress & ">" & @CRLF $s_ReplyCode[2] = "250" $s_Send[3] = "DATA" & @CRLF $s_ReplyCode[3] = "354" Local $aResult = _Date_Time_GetTimeZoneInformation() Local $bias = -$aResult[1]/60 Local $biasH = Int($bias) Local $biasM = 0 If $biasH <> $bias Then $biasM = Abs($bias - $biasH) * 60 $bias = StringFormat(" (%+.2d%.2d)", $biasH, $biasM) $s_Send[4] = "From:" & $s_FromName & "<" & $s_FromAddress & ">" & @CRLF & _ "To:" & "<" & $s_ToAddress & ">" & @CRLF & _ "Subject:" & $s_Subject & @CRLF & _ "Mime-Version: 1.0" & @CRLF & _ "Date: " & _DateDayOfWeek(@WDAY, 1) & ", " & @MDAY & " " & _DateToMonth(@MON, 1) & " " & @YEAR & " " & @HOUR & ":" & @MIN & ":" & @SEC & $bias & @CRLF & _ "Content-Type: text/plain; charset=US-ASCII" & @CRLF & _ @CRLF $s_ReplyCode[4] = "" $s_Send[5] = @CRLF & "." & @CRLF $s_ReplyCode[5] = "250" Looking at the above section of code from that function, this is the initial part that just ensures that it can just attempt the connection to the mail server at all. ; open stmp session If __SmtpSend($v_Socket, $s_Send[0], $s_ReplyCode[0], $b_trace, "220", $s_first) Then Return SetError(50, 0, 0) ; send header For $i_Count = 1 To UBound($s_Send) - 2 If __SmtpSend($v_Socket, $s_Send[$i_Count], $s_ReplyCode[$i_Count], $b_trace) Then Return SetError(50 + $i_Count, 0 ,0) Next This part opens the smtp session and sends the header. Is this all I need to verify the mailbox exists? If the server receives the header and nothing more, does it still put mail in the receiving mailbox?
-
Well, PixelSearch() might help, you can do the mouse click when the button you need to press actually appears, that way you won't need to sleep.
-
Is this by chance a game bot? It is starting to sound like one.
-
Why do you need to sleep after every line? There are functions like WinWait(), WinWaitActive() and WinWaitClose() that might be better suited, as they'll work for any speed computer You can also look at the WinWaitDelay setting too. Edit: You might also find the ControlClick() function more useful, as it would be better suited for different resolutions (i mention this because you bring up using this script on different computers).
-
How to get text from Yahoo! Messenger Window ?
maqleod replied to Nevercom's topic in AutoIt General Help and Support
maybe try IE functions? that is the same type of class information you get from an IE window. -
adding numbers from _arraytostring
maqleod replied to iamtheky's topic in AutoIt General Help and Support
you can also do this to make the code a bit shorter Local $Array[10] = [0,1,2,3,4,5,6,7,8,9] -
How to get text from Yahoo! Messenger Window ?
maqleod replied to Nevercom's topic in AutoIt General Help and Support
Have you tried the AU3Info tool? any sample code to see what you're trying? -
First off, welcome to the forums! Initially, you should learn how to make a proper gui and controls from the help file. The help file is your best friend, it will give you most of the answers you need for all of the basics of autoit, and some of the more advanced topics as well. As soon as you can create a basic gui and execute any action by means of pressing a button, you're ready to add the functionality that you want. In order to send an email using autoit, look at the _INetSmtpMail in the iNet UDF in the help file. Give some things a shot, post what you've got and we'll help you out where you need it.