-
Posts
943 -
Joined
-
Last visited
About The Kandie Man
- Birthday December 5
Profile Information
-
Member Title
All Your Base Are Belong To Us
-
Location
The unknown part of the universe
-
Interests
Computers(programming, gaming, music, movies, overclocking, etc.)
Recent Profile Visitors
The Kandie Man's Achievements
Universalist (7/7)
5
Reputation
-
MadJunk reacted to a post in a topic: Auto-Delete Script immediately after work is done?
-
GeneNight reacted to a post in a topic: Process Suspend/Process Resume UDF
-
Xandy reacted to a post in a topic: Process Suspend/Process Resume UDF
-
LSang reacted to a post in a topic: Process Suspend/Process Resume UDF
-
PsiLink reacted to a post in a topic: Process Suspend/Process Resume UDF
-
Lock a Window / MsgBox
The Kandie Man replied to bambamfox's topic in AutoIt General Help and Support
You should use the handle parameter of Msgbox() to specify the parent window. If you do this, the OS will lock the parent GUI and when the parent GUI is clicked, it will make a bing noise and flash the Msgbox. MsgBox(262161, "Fatal Error: 0x81020014", "Call to undefined function: add_ctext()", 0, $h_GUI) - The Kandie Man ;-) -
Catching Array Out of Bounds Errors?
The Kandie Man replied to jmoskie's topic in AutoIt General Help and Support
Do a UBound() check on the array before you start trying to access it. If Ubound($lines) > $l+2 Then ;Do your accessing here Else ;Do your error handling here Endif Where $l+2 is the greatest value that will be accessed in the array in the If Then statement. - The Kandie Man ;-) EDIT: Fixed comparison operator -
I tried to run your script, which looks great btw, but it looks like the forum is butchering the code: C:\Downloads\Profiler\Profiler.au3(778,160) : ERROR: syntax error (illegal character) $aScriptSourceCode[$iCodeLine] = StringRegExpReplace($aScriptSourceCode[$iCodeLine], "(?i)^([ \t]*)(If .*? Then)[ \t]*(\bReturn\b.*?){:content:}quot;, " \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ C:\Downloads\Profiler\Profiler.au3(781,196) : ERROR: syntax error (illegal character) $aScriptSourceCode[$iCodeLine] = StringRegExpReplace($aScriptSourceCode[$iCodeLine], "(?i)^([ \t]*)(\bReturn\b.*?){:content:}quot;, $sProfileBlockStop & $sProfileFunctionstop & @CRLF & " \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ C:\Downloads\Profiler\Profiler.au3(803,158) : ERROR: syntax error (illegal character) $aScriptSourceCode[$iCodeLine] = StringRegExpReplace($aScriptSourceCode[$iCodeLine], "(?i)^([ \t]*)(If .*? Then)[ \t]*(\bExit\+.*?){:content:}quot;, " \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ C:\Downloads\Profiler\Profiler.au3(806,217) : ERROR: syntax error (illegal character) $aScriptSourceCode[$iCodeLine] = StringRegExpReplace($aScriptSourceCode[$iCodeLine], "(?i)^([ \t]*)(\bExit\b.*?){:content:}quot;, $sProfileBlockStop & $sProfileFunctionstop & @CRLF & $sProfReport & @CRLF & " \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ C:\Downloads\Profiler\Profiler.au3(883,162) : ERROR: syntax error (illegal character) $aScriptSourceCode[$iCodeLine] = StringRegExpReplace($aScriptSourceCode[$iCodeLine], "(?i)^([ \t]*)(If .*? Then)[ \t]*(\bReturn\b.*?){:content:}quot;, " \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ C:\Downloads\Profiler\Profiler.au3(886,177) : ERROR: syntax error (illegal character) $aScriptSourceCode[$iCodeLine] = StringRegExpReplace($aScriptSourceCode[$iCodeLine], "(?i)^([ \t]*)(\bReturn\b.*?){:content:}quot;, $sProfileFunctionstop & @CRLF & " \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ C:\Downloads\Profiler\Profiler.au3 - 6 error(s), 0 warning(s) I don't think that "{:content:}quot;" is supposed to be there. - The Kandie Man ;-)
-
This is great. I found only one nitpicking issue: _MailSlotGetMassageCount() Perhaps you meant: _MailSlotGetMessageCount() Just a typo, good work though. - The Kandie Man ;-)
-
You are using Run() incorrectly. The second parameter is not the path to the executable, it is what the executable's working directory will be set to when it is run. If the executable that you wish to run is not in the working directory of the script when the the Run() function is used it will not be able to locate "ccleaner.exe". You want to be able to run ccleaner.exe without extracting it from the script.exe? This is not possible. If you use FileInstall(), it will extract the files to the specified location. You would probably extract the required files to a temporary location, run the executable, and then delete the files when finished. Running an executable that is embedded in another executable in the manner you described is not realistically possible. This is not a limitation of AutoIt, this is a limitation in the way executable files are handle by the OS. - The Kandie Man ;-)
-
This is great. I particularly like how you spawned threads in the process by writing assembly hexadecimal executable machine code in the AutoIt source and then attaching it to the current process using CreateThread(). It would appear you have solved the AutoIt multithreading issue with this technique. 5 Stars - The Kandie Man ;-)
-
Script or tool to test a list of video files?
The Kandie Man replied to ken82m's topic in AutoIt General Help and Support
VLC Media Player. It is usually pretty good about opening things. In addition, if it detects that the file is corrupt, it will usually say so and will give you the option of attempting a repair on the file. Always backup files before repairing them, in case the repair does more damage than good. http://www.videolan.org/vlc/ - The Kandie Man ;-) -
controlsettext not setting text but successful
The Kandie Man replied to smcombs's topic in AutoIt General Help and Support
From your first script, it appears you are trying to modify a Pidgin client window or something similar. The chat program called Pidgin does not use standard win32 GUI controls. It uses the GTK+ toolkit to create its GUI. As a result, its GUI will not respond the same way as a standard win32 GUI object. - The Kandie Man ;-) -
How can I use WinTitleMathMode In C++
The Kandie Man replied to Hina's topic in AutoIt General Help and Support
You can't. There are no built-in C++ functions that do what Autoit does. The functions Autoit uses were custom written by the Autoit Team. You could write your own functions that do the same thing as Autoit; this of course assumes that you are at least moderately familiar with C++. - The Kandie Man ;-) -
Using Sin() with degrees
The Kandie Man replied to monoceres's topic in AutoIt General Help and Support
@Everyone, especially monoceres This is not so. Sin(x) does not return a number in any particular unit. It merely returns the value of the ratio of the length of the opposite side to the length of the hypotenuse of one of the non right angles in a right triangle whose angle measure is x. The angle measure is traditionally given in radians for Sine, Cosine, and Tangent functions because radians are the natural units of a circle. The only reason we use degrees is because the greeks had some fascination with using degrees instead of the more natural radians. In the world of the unit circle, Sin() is the value of the y coordinate on the unit circle while Cos() is the value of the x coordinate on the unit circle. Tan() is equal to the slope of the angle on the unit circle. I know you are frustrated about using radians instead of degrees, but please use the radians. They really are much more natural and much better than degrees. Anyway, to help you, i have made this: ConsoleWrite(Round(Cos(_DegreesToRadians(90)),2)&@LF) ConsoleWrite(_RadiansToDegrees(2*3.14159265358979)&@LF) Func _DegreesToRadians($nDegrees) Local $pi = 3.14159265358979 Return $nDegrees * $pi / 180 ; pi is equal to 180 degrees. So remove the 180 and multiply the remaining value by pi(I did this backwards, but it doesn't matter). EndFunc Func _RadiansToDegrees($nRadians) Local $pi = 3.14159265358979 Return $nRadians * 180 / $pi ; pi is equal to 180 degrees. So remove the pi and multiply the remaining value by 180(I did this backwards, but it doesn't matter). EndFuncoÝ÷ Ù¦zfÞ× ç¬jwkiØÆ«z)éºÛ(~Ø^~éܶ*'J)Þ "æ§u6§éíhºÚn¶Äáz¦ëlj·®((¶¸«b¢Çèªâm®&§W¨Ê(اj׬¢»%¢¬¢v®+·%{br¯z¼(®Wr¢æ«{ +)àqÞè¬Ê«{¦¦WèqêÞ±«¢+Ù5Í ½à À°ÅÕ½ÐìÅÕ½Ðì° ÄÀ½M¥¸¡}ÉÍQ½I¥¹Ì ÄÀ¤¤¤©M¥¸¡}ÉÍQ½I¥¹Ì ÄØÀ¤¤¤()Õ¹}ÉÍQ½I¥¹Ì ÀÌØí¹É̤(%1½°ÀÌØíÁ¤ô̸ÄÐÄÔäÈØÔÌÔàäÜä(%IÑÕɸÀÌØí¹Ę́ÀÌØíÁ¤¼ÄàÀ)¹Õ¹ It does give the answer as something around 19. I hope this answered your question. - The Kandie Man ;-) -
Detect when a window X is clicked
The Kandie Man replied to Swift's topic in AutoIt General Help and Support
Have you tried using the native AutoIt function WinKill() on the IE7 window that needs to be closed? Edit: If your only reason for detecting that the window has been closed is to close it faster, then WinKill() should work fine. If you are trying to do something else, then nevermind. - The Kandie Man ;-) -
Open file with associated program?
The Kandie Man replied to coolbambus's topic in AutoIt General Help and Support
Try using _RunDos this way: _RunDos('start "' & $myfile & '"') If you had spaces in the filename, it would fail the way you had it. I personally prefer ShellExecute(), a simple WinAPI call, to running a separate process to simply send a command to open something. - The Kandie Man ;-) -
_WinAPI_WriteProcessMemory()
The Kandie Man replied to Oldschool's topic in AutoIt General Help and Support
-
Overwriting StdOut in CUI compiled app
The Kandie Man replied to flyingboz's topic in AutoIt General Help and Support
Here is a modified version of a progress made by ResNullius: #AutoIt3Wrapper_Change2CUI=y Global Const $FOREGROUND_Black = 0x0000 Global Const $FOREGROUND_Blue = 0x0001 Global Const $FOREGROUND_Green = 0x0002 Global Const $FOREGROUND_Cyan = 0x0003 Global Const $FOREGROUND_Red = 0x0004 Global Const $FOREGROUND_Magenta = 0x0005 Global Const $FOREGROUND_Yellow = 0x0006 Global Const $FOREGROUND_Grey = 0x0007 Global Const $FOREGROUND_White = 0x0008 Global Const $BACKGROUND_Black = 0x0000 Global Const $BACKGROUND_Blue = 0x0010 Global Const $BACKGROUND_Green = 0x0020 Global Const $BACKGROUND_Cyan = 0x0030 Global Const $BACKGROUND_Red = 0x0040 Global Const $BACKGROUND_Magenta = 0x0050 Global Const $BACKGROUND_Yellow = 0x0060 Global Const $BACKGROUND_Grey = 0x0070 Global Const $BACKGROUND_White = 0x0080 $ClearProgress = 0 $processing = "Processing " $progress = "" Dim $spin[4]=['¦', '/', '-', '\' ] $elipses = "" $iCnt = 0 $iCnt2 = 16 For $i = 1 to 22 For $s = 1 to Ubound($spin)-1 _SetConsoleColor(BitOR($iCnt,8,$iCnt2,128)) $iCnt += 1 $iCnt2 += 16 ConsoleWrite(@CR & $processing & $elipses & "[" &$spin[$s] & "]") $elipses &= "." If $iCnt = 9 Then $iCnt = 0 If $iCnt2 = 112 Then $iCnt2 = 16 Sleep(50) Next Next _SetConsoleColor(12) ConsoleWrite(@CRLF & @CRLF & "DONE!"&@CRLF&@CRLF) $asSplit = StringSplit("Using console colors is fun. ;-)","") $iCnt2 = 1 For $iCnt = 1 to Ubound($asSplit)-1 _SetConsoleColor(BitOR($iCnt2,8)) $iCnt2 += 1 ConsoleWrite($asSplit[$iCnt]) If $iCnt2 = 9 Then $iCnt2 = 1 Next sleep(5000) Func _SetConsoleColor($iColor) Local $aRet, $aRet2 $aRet = DllCall($hdllKernel32,"hwnd","GetStdHandle","int",-11);$STD_INPUT_HANDLE = -10,$STD_OUTPUT_HANDLE = -11,$STD_ERROR_HANDLE = -12 If Not UBound($aRet) > 0 Then ConsoleWrite("!>Error. GetStdHandle failed."&@LF) Return 0 EndIf $aRet2 = DllCall($hdllKernel32,"int","SetConsoleTextAttribute","hwnd",$aRet[0],"ushort",$iColor) If Not UBound($aRet2) > 0 Then ConsoleWrite("!>Error. SetConsoleTextAttribute failed."&@LF) Return 0 EndIf ;Note: The StdHandle doesn't need to be closed because the handle wasn't opened. It was gotten. If $aRet2 <> 0 Then Return 1 Else Return 0 EndIf EndFunc Func OnAutoItStart() Global $hdllKernel32 = DllOpen("kernel32.dll") IF @error Then ConsoleWrite("!> Error. Couldn't open kernel32.dll"&@LF) Exit EndIf EndFunc Func OnAutoItExit() DllClose($hdllKernel32) EndFunc It uses color. Enjoy. - The Kandie Man ;-) -
UDPOpen() acting weird...
The Kandie Man replied to Xand3r's topic in AutoIt General Help and Support
The reason I don't like UDP is because it has no flow control. As a result, it can send frames through a network that are received by another machine in the wrong order. In addition to that, the frames can be corrupt. For a LAN, UDP would be an acceptable choice, but even then, I would be very careful if I were sending critical information. Sending database queries, like alexmadman is asking, could become risky if the queries retrieve data or add data to a database that is not in the correct order. For example, Computer 1(client) could send information to Computer 2(server). The data being sent from Computer 1 could look like this: Username:Jon,Occupation:Software Developer,Location:UK The frames could look something like this(brackets indicate a frame): [userName:Jon,][Occupation:Softwar][e Develop][er,Location:][uK] Even if the data is not corrupted, it could be received by Computer 2 out of order as: [Occupation:Softwar][userName:Jon,][e Develop][uK][er,Location:] As a result, the server would add the following to the database: Occupation:SoftwarUserName:Jon,e DevelopUKer,Location: Which is butchered beyond belief. This of course is still unlikely, but it is very possible if you have a network with many computers that are constantly querying a database server. The routers could routinely redirect frames through different paths to the server based on network traffic. The end result could be very similar to what I am describing above. Even with the fact that none of that data was corrupted and there was 0% "packet" loss, the data that was sent to the server was jumbled to a point where it is useless information. I personally would use UDP only for things that aren't critical. Examples include: streaming music and querying a site for information regarding a software update. Anything that needs reliability should use Transfer Control Protocol, because as long as a stable connection is possible, it guarantees the successful transfer of data. If a stable connection is lost, TCP will immediately(after the designated timeout) stop the transfer and notify the program that is transferring the data that the connection was lost. If data is sent that is corrupted, the receiving machine will re-request the corrupted frames from the sending machine and the sending machine will resend them. If the frames are received out of order, the receiving machine will re-order them so that they are in the correct order automatically and then send them to the application. This doesn't mean UDP is useless, it just is just completely unreliable in the sense of the definition of the word unreliable. I would say that UDP is extremely useful for those that don't need error correction, those that don't want overhead, those that want to write their own error correction and flow control, or those that simply don't care if the data is received correctly 100% of the time. For those types of situations, UDP is pure gold. That's just my two cents. @alexmadman You will need syntax regarding the formatting that the server uses when it receives information from its ports and the formatting that the server uses when it sends out information. As far as what port the server is listening, you can use TCPView. It shows what ports, both TCP and UDP, that certain processes are using. The MySQL server is likely to be listening at port 3306 with both TCP and UDP protocols. This is the official port used by MySQL databases according to Wikipedia. - The Kandie Man ;-)