While 1 and Sleep
Mouse stopped for no apparent reason
My script was running beautifully for two weeks. Then the mouse stopped working in the pop-up windows. It gets to a certain point and then stops. The script just sits there. I have rebuilt from scratch, etc... not sure what is happening.
Below is are the code and then the system information.
Windows 7 professional 64 bit.
#region --- Au3Recorder generated code Start (v3.3.9.5 KeyboardLayout=00000409) ---
#region --- Internal functions Au3Recorder Start ---
Func _Au3RecordSetup()
Opt('WinWaitDelay',100)
Opt('WinDetectHiddenText',1)
Opt('MouseCoordMode',0)
Local $aResult = DllCall('User32.dll', 'int', 'GetKeyboardLayoutNameW', 'wstr', '')
If $aResult[1] <> '00000409' Then
MsgBox(64, 'Warning', 'Recording has been done under a different Keyboard layout' & @CRLF & '(00000409->' & $aResult[1] & ')')
EndIf
EndFunc
Func _WinWaitActivate($title,$text,$timeout=0)
WinWait($title,$text,$timeout)
If Not WinActive($title,$text) Then WinActivate($title,$text)
WinWaitActive($title,$text,$timeout)
EndFunc
_AU3RecordSetup()
#endregion --- Internal functions Au3Recorder End ---
$DashCounter = 0
$LoginCounter = 0
While $LoginCounter < 2
$LoginCounter = $LoginCounter +1
$DashCounter = 0
_WinWaitActivate("Start","")
MouseClick("left",34,16,1)
_WinWaitActivate("Start menu","All Programs")
MouseClick("left",89,22,1)
_WinWaitActivate("Web Based CMMS Software | PM Software | Facility Maintenance | Login - Windows Internet Explorer","Address Combo Contro")
sleep(6000)
Send("xxxxxxxxxxx{ENTER}")
Sleep(20000)
MouseClick("left",425,77,1,20)
Sleep(3000)
_WinWaitActivate("http://www.maintenanceconnection.com/?s=34B3B746866800134E561993B07F2993D6BCF855B695316F6DA1FCA - Windows Internet Explorer","Address Combo Contro")
sleep(12000)
MouseClick("left",410,75,1)
sleep(8000)
_WinWaitActivate("My Dashboard -- Webpage Dialog","")
While $DashCounter < 42
$DashCounter = $DashCounter + 1
sleep(3000)
MouseClick("left",82,531,1)
Sleep(10000)
MouseClick("left",65,544,1)
Sleep(20000)
MouseClick("left",92,530,1)
Sleep(20000)
MouseClick("left",116,531,1)
Sleep(20000)
MouseClick("left",119,545,1)
Sleep(20000)
MouseClick("left",109,561,1)
Sleep(20000)
MouseClick("left",90,587,1)
Sleep(20000)
MouseClick("left",80,602,1)
Sleep(20000)
MouseClick("left",75,614,1)
Sleep(20000)
MouseClick("left",75,628,1)
Sleep(20000)
MouseClick("left",73,642,1)
Sleep(20000)
MouseClick("left",63,657,1)
Sleep(20000)
MouseClick("left",61,672,1)
Sleep(20000)
MouseClick("left",66,689,1)
Sleep(20000)
MouseClick("left",64,702,1)
Sleep(20000)
MouseClick("left",64,716,1)
Sleep(20000)
MouseClick("left",58,730,1)
Sleep(20000)
MouseClick("left",58,738,1)
Sleep(20000)
MouseClick("left",58,740,1)
Sleep(20000)
MouseClick("left",58,755,1)
Sleep(20000)
MouseClick("left",57,768,1)
Sleep(20000)
MouseClick("left",57,785,1)
Sleep(20000)
MouseClick("left",61,797,1)
Sleep(20000)
MouseClick("left",61,808,1)
Sleep(20000)
MouseClick("left",66,810,1)
Sleep(20000)
MouseClick("left",63,824,1)
Sleep(20000)
MouseClick("left",61,840,1)
Sleep(20000)
WEnd
ProcessClose("iexplore.exe")
sleep(1000)
ProcessClose("iexplore.exe")
sleep(1000)
ProcessClose("iexplore.exe")
sleep(1000)
ProcessClose("iexplore.exe")
WEnd
#endregion --- Au3Recorder generated code End ---
System Information
--------------------------------------------------------------------------------------------
OS Windows 7 Professional x64 Edition 6.1 (build: 7601) Service Pack 1
BIOS Version Dell Inc. A16
Last booted 10/23/2014 7:34 AM
Computer Name CROTHALL-PC
Computer Description Crothall-PC
Interactive User Crothall-PC\Crothall
Default Browser Internet Explorer
Default Browser Path C:\Program Files\Internet Explorer\iexplore.exe
Default Browser Version 10.00.9200.17116
Device screen 1024 x 768 x 32
CPU Information
-----------------------------------------------------
CPU Name Intel® Core i5-3470 CPU
CPU Clock 3192 MHz
CPU Description Number 4 Level 6 Model 58 Stepping 9
CPU Usage 5%
Memory Information
-------------------------------
Physical Memory Size 3.95 GB
Physical Memory Used 1.32 GB
Physical Memory Used % 33%
Physical Memory Free 2.63 GB
Physical Memory Free % 66%
Commit Memory Size 7.90 GB
Commit Memory Used 1.62 GB
Commit Memory Used % 20%
Commit Memory Free 6.28 GB
Commit Memory Free % 79%
Disk Drives
Drive Size Free % in use
-------------------------------------
C:\ 452.10 GB 410.06 GB 10%
D:\ 574.43 MB 0 KB 100%
Processes (Top 5 per CPU)
Name CPU% Memory
------------------------------------
System Idle Process 95%
System 2%
LMI_Rescue_srv.exe 1% 48.54 MB
LMI_Rescue_srv.exe 1% 103.52 MB
dwm.exe 1% 140.38 MB
Events (Last 5 Errors)
Type Generated Source Event ID
---------------------------------------------------------------------------
10/23/2014 7:36 AM WinMgmt 10
10/23/2014 7:34 AM Microsoft-Windows-WLAN-AutoConfig 4001
10/23/2014 7:33 AM Microsoft-Windows-User Profiles Service 1530
10/23/2014 3:19 AM WinMgmt 10
10/23/2014 3:18 AM System Restore 8210
_FileWriteFromArray
Hi.
I Used _FileReadToArray Function for read a text contain. then I want write them to a text file with _FileWriteFromArray but don't write any thin in text file.
Please Guide Me.
#RequireAdmin #include <File.au3> ; Local Var Local $CreateList = @ScriptDir & "\List.txt" Local $ReadPath = @DesktopDir & "\Sample.txt" Local $Array = 0 Local $ReadList = _FileReadToArray ($ReadPath,$Array,0) _ArrayDisplay ($Array) _FileWriteFromArray ($CreateList,$ReadList,1)
Lost with functions
Hello,
First off I feel really stupid because I cannot grasp how to create the function that I want to make. Looking at the examples in the help file just confuse me more. I am trying to simply build a function that will either A: Encrypt a string and return the value or B: Decrypt a string and return the value. I have encryption and decryption working fine I just want to create a function to do the work because I will be doing a lot of encrypting and decrypting in my script. I am working on a TCP register/login/logoff script if anyone is wondering.
Thanks!
Find String in text File
Hi.
I wrote a script that can read a text file and write new text. now I want search in text content and find custom string then add "// " at first find string.Please Guide Me.
Thanks
#RequireAdmin #include <File.au3> ; Local Var Local $CreateList = @ScriptDir & "\List.txt" Local $ReadPath = @DesktopDir & "\Sample.txt" Local $Array = 0 Local $ReadList = _FileReadToArray ($ReadPath,$Array,0) _FileWriteFromArray ($CreateList,$Array,1)
_ExcelReadSheetToArray not in latest build of Excel.AU3
I downloaded the latest version of AutoIT in order to get the enhanced performance _ExcelReadSheetToArray function. I'm reading in large excel sheets to an array to compare data & the earlier versions of this function takes a very long time. According to posts, the latest version 3.3.12 has the new Excel UDF that supposedly fixes this problem. With the latest install, I can't find this function in the file. Any suggestions of where I can download a version that has the fix
regress in Run-time errors on objects no longer fatal?
Autoit 3.3.9.0 has Changed: Run-time errors on objects no longer fatal (execution of the script is not halted).
And it work in 3.3.12.0
But in beta 3.3.13.19 script ended with error The requested action with this object has failed
Or maybe this is Script Breaking Changes?
$a = ObjCreate('scripting.dictionary') $a.add('x','a') ConsoleWrite(@error & @CRLF) $a.add('x','a') ConsoleWrite(@error & @CRLF)
>Running:(3.3.12.0):D:\Program Files\AutoIt3\autoit3.exe "D:\Users\user\Desktop\AutoIt v3 Script (2).au3" --> Press Ctrl+Alt+Break to Restart or Ctrl+Break to Stop 0 -2147352567 +>18:03:05 AutoIt3.exe ended.rc:0
>Running:(3.3.13.19):D:\Program Files\AutoIt3\Beta\autoit3.exe "D:\Users\user\Desktop\AutoIt v3 Script (2).au3" --> Press Ctrl+Alt+Break to Restart or Ctrl+Break to Stop 0 "D:\Users\user\Desktop\AutoIt v3 Script (2).au3" (45) : ==> The requested action with this object has failed.: $a.add('x','a') $a^ ERROR ->18:03:28 AutoIt3.exe ended.rc:1
UTF8 conversion problem
Hi,
I have a problem when I read my external IP from a simple external PHP script (with InetRead), result is provided as UTF8 from my web server.
When I convert it into decimal, few characters are added at the beginning, meaning it's not the right charset.
Into Hex, there is that header (UTF8) : 0xEFBBBF
So, I use BinaryToString($external_ip, 4) to convert from UTF8 into decimal.
With that, I am near of my goal : I obtain a full IP address, but it stays just a little "?" char before.
In Hex, I see that strange header : 0x3F
In theory, UTF8 header must disappear with the first BinaryToString conversion, no ?
For now, I can't use my script because conversion seems to be partial, or maybe there is another solution ?
Full example :
Binary resultat from the PHP script :
0xEFBBBF38372E3233312E32372E323335
If converted with BinaryToString($external_ip, 4) and converted again into Binary :
0x3F38372E3233312E32372E323335
Decimal obtained : ?87.231.27.235
Expected result :
0x38372E3233312E32372E323335
Decimal expected : 87.231.27.235
Thank you
DriveGetSerial report different hdd serial no.
hi all
$var = DriveGetSerial( "c:\" )
MsgBox(4096, "Serial Number: ", $var)
My hdd serial is 4MQ08LX3
the above script return 2004997699
how do i find serial is 4MQ08LX3 by using autoit ?
thx all !
Counting and sorting duplicate lines
Hey ya'll,
So im in a bit of a pickle here. I have a text file, file1.txt with a few hundred lines, some of these lines are exact duplicates.
What i'm trying to do is pick out the duplicate lines, and sort them out by number of occurrences and write the 10 most frequently seen duplicate lines to another file. So the "top 10" duplicate lines from file1.txt would be output to file2.txt
I've looked around at the _array functions but i only see a way to remove duplicates and make unique arrays, which isn't exactly what i need...
Any help?
_FileListToArray
Hi.
I wrote this code that make list from text contain with _FileListToArray Function. but when I use _ArrayDisplay for view array there is a 1 number at first list. please Guide Me.
Thanks
How build a loop like this (compound loop)
foo() Func foo() Local $try = 0 Local $aa = 0, $bb = 0 ConsoleWrite("start" & @LF) Do Switch $try Case 0, 2 $aa = function1() If @error Then $try = 1 Else $try = 0 $bb = function2() If @error Then $try = 2 Else $try = 0 EndIf EndIf ConsoleWrite("$TRY[" & $try & "]" & @LF) Case 1 $aa = function1() If @error Then $try = 1 Else $try = 0 EndIf ConsoleWrite("$TRY[" & $try & "]" & @LF) EndSwitch Until Not $try EndFunc ;==>wer Func function1() If Random(0, 1, 1) Then Return 1 Return SetError(1, 0, 0) EndFunc ;==>aa Func function2() If Random(0, 1, 1) Then Return 1 Return SetError(1, 0, 0) EndFunc ;==>bb
need a converter
i have a input of 5/3 that gives me 1,666666666666667 this is a very lager number
i want a output of 1,666 any possible way to convert that?
Seeking '@YDAY' calculation for dates other than today
@YDAY returns a 3-digit number for the current day of the year. Does anyone have a similar calculation that will return the 3-digit number for any date supplied?
Thanks!
Processclose not closing Excel when running macros
Is there any way autoit can close Excel while it is running macros? At the moment I'm closing Excel by Task Manager End Task.
Many thanks
How to Call Some AutoIt Functions That I Created in AutoIt, from C#?
Hi
Let's say I wrote an AutoIt codefile that contains 5 functions.
I now want to call those functions from a C# program.
How can I do it?
Is it possible to compile an AutoIt codefile to a .DLL, so I can then include that DLL in a C# program and call the functions in it?
If not, then other ways that can help?
Thank you
Zohar
Subscript used on non-accessible variable - Error message
So here is the error:
==> Subscript used on non-accessible variable.:
Here is the code:
The array seems to be there when I pass it to the _ArrayDisplay() function but in the prior line it gives me the error.
List COM port problem(Subscript used on non-accessible variable)
Hi everyone,
I am using martin's UDF to query my COM ports. Here is my code:
I've already put CommMG.au3 and commMG.dll in the same directory. When I use Tools => Go in Autoit SciTE-Lite everything is fine. The program print out all my COM ports. But when I compile this program to an EXE file and execute it. An error occurs as following:
This is so confusing. I try another experiment that removing commMG.au3, then Tools=> GO again. It shows the error like it is in EXE:
Is this indicating that something wrong in #include <CommMG.au3> ???
Thank you for your great support!
My code is packaged as an attachment.
Attached Files
Reproduce the ballon: Internet Explorer_Server
If not for 2 checks
$searchstring1 = "2394JF" $searchstring2 = "9345DC" $read_link = clipget() If Not StringInStr($read_link, $searchstring1) Or StringInStr($read_link, $searchstring2) Then
Here's my code, the problem is I want to do this on a single line, and it works fine if I use: "if not for the first : "If Not StringInStr($read_link, $searchstring1)"
But I also wanna use if not, for the next check, something like:
If Not StringInStr($read_link, $searchstring1) Or if not StringInStr($read_link, $searchstring2) Then
But that causes a syntex error, does someone got a suggestion ?