Leaderboard
Popular Content
Showing content with the highest reputation on 06/21/2013 in all areas
-
super easy noob question *pls* help
PJThys and one other reacted to JohnQSmith for a topic
Whenever someone says "pls" because it's shorter than "please", I say "no" because it's shorter than "yes".2 points -
Don't forget to convert property returns that should be strings to a string using String() or check that it is a string with IsString(). Otherwise you can end up with an inadvertent match.1 point
-
Change this section: For $x = 2 To $aFile[0] ; <<<<<<<<<<<<<<<<<<<<<<< Change 1 to 2 MemoWrite($aFile[1] & "\" & $aFile[$x]) ; <<<<<<<<<<<<<<<<<<<<<<<<<<<< Append $aFile[1], which holds the folder name, to the file names Next1 point
-
How can i learn fast?
Wombat reacted to JLogan3o13 for a topic
bots is often a red flag, but it is a broad term. As long as you are not doing something that violates the rules on this forum (which could not be more clear), you're fine.1 point -
preben1337, Reading the Help file (at least the first few sections - Using AutoIt, Tutorials and the first couple of References) will help you enormously. You should also look at this excellent tutorial - you will find other tutorials in the Wiki (the link is at the top of the page). There are even video tutorials on YouTube if you prefer watching to reading. But I suggest you also read the Forum rules (there is also a link at bottom right of each page) - we would not want another thread locked, would we? As to what you could code - the world is your oyster. Why not look through the Examples section to see what others have done - I ma sure something in there will spark your interest. And remember tnat we will be very happy to help you improve your coding skills if you show you are making an effort to learn for yourself. M231 point
-
How can i learn fast?
Wombat reacted to JLogan3o13 for a topic
Just about anything you can imagine on a windows machine you can automate or create. I think the bigger question is, what is something you would like to make? Trying to code without a goal in mind is difficult indeed. If you still cannot decide, read through the help file thoroughly, and look at all of the examples under each subject. Something you see there may spark your interest.1 point -
_FileWriteLog question
Tripredacus reacted to BrewManNH for a topic
No, it will not create the folder. The FileOpen command inside the _FileWriteLog uses mode 1 (append) but doesn't include the option to create the path if it doesn't exist (option 8).1 point -
_FileWriteLog question
Tripredacus reacted to JLogan3o13 for a topic
I always say, try it #include <File.au3> _FileWriteLog(@DesktopDir & "\TestforTripredacus.txt", "Test") Edit: I just re-read your post. It will create the file, but will not create the folder. Sorry if I misunderstood your intent. #include <File.au3> _FileWriteLog(@DesktopDir & "\Test\TestforTripredacus.txt", "Test") ;Will not create folder 1 point -
Ontosy, Please search for the multiplicity of other threads on this very same subject. Besides I have it on good authority from the WWF that the Oozlum bird is a seriously endangered species and we would not want to let another one vanish up itself, would we. M231 point
-
I use this function created by me. #include <Constants.au3> _INIUnicode(@ScriptDir & '\myINI.ini') Func _INIUnicode($sINI) If FileExists($sINI) = 0 Then Return FileClose(FileOpen($sINI, $FO_OVERWRITE + $FO_UNICODE)) Else Local Const $iEncoding = FileGetEncoding($sINI) Local $fReturn = True If Not ($iEncoding = $FO_UNICODE) Then Local $sData = _GetFile($sINI, $iEncoding) If @error Then $fReturn = False EndIf _SetFile($sData, $sINI, $FO_APPEND + $FO_UNICODE) EndIf Return $fReturn EndIf EndFunc ;==>_INIUnicode Func _GetFile($sFile, $sFormat = $FO_READ) Local Const $hFileOpen = FileOpen($sFile, $sFormat) If $hFileOpen = -1 Then Return SetError(1, 0, '') EndIf Local Const $sData = FileRead($hFileOpen) FileClose($hFileOpen) Return $sData EndFunc ;==>_GetFile Func _SetFile($sString, $sFile, $iOverwrite = $FO_READ) Local Const $hFileOpen = FileOpen($sFile, $iOverwrite + $FO_APPEND) FileWrite($hFileOpen, $sString) FileClose($hFileOpen) If @error Then Return SetError(1, 0, False) EndIf Return True EndFunc ;==>_SetFile1 point
-
Overkill, but just to demonstrate regexp #include <Array.au3> $variable = "Universe" $str="Hello world A" & @CRLF & "Hello Universe B" & @CRLF & "Hello Earth C" & @CRLF ConsoleWrite($str) $array = StringRegExp($str,$variable & "\s(\w+)",3) For $i = 0 To UBound($array)-1 ConsoleWrite("Match=[" & $i+1 & "]; value=[" & $array[$i] & "]" & @CRLF ) Next _ArrayDisplay($array)1 point
-
here ya go #include <Timers.au3> $sTitle = "Title of your App" $sExe = "Your Exe with path" $iIdleTimeMilSec = 120000 While True If Not WinActive($sTitle) And _Timer_GetIdleTime()>$iIdleTimeMilSec Then If Not WinExists($sTitle) Then Run ($sExe) WinSetState ($sTitle, "", @SW_RESTORE) WinSetState ($sTitle, "", @SW_MAXIMIZE) WinActivate ($sTitle) EndIf WEnd1 point
-
; Пример показывает, что не обязательно использовать цикл проверки событий для однотипных элементов. Достаточно указать диапазон в конструкции Switch ; The example shows that it isn't obligatory to use separate events in a loop for the same elements. Sufficient to indicate the range in design Switch $hGui = GUICreate('My Program', 100, 550) $iCount = 21 ; Количество пунктов (The number of items) $iRows = 100 ; Количество строк (The number of rows) Global $BoxConfig[$iCount + 1] = [$iCount], $a[10] = [1, 0, $iRows, 0, 0, 26, 100, -1, 1] ; a[0] - X-координата элемента (The X-coordinate of the element) ; a[1] - Y-координата элемента (The Y-coordinate of the element) ; a[2] - Количество строк в блоке (The number of rows in the block) ; a[3] - X-координата блока (The X-coordinate of the box) ; a[4] - Y-координата блока (The Y-coordinate of the box) ; a[5] - Вертикальный шаг в блоке (Vertical step in block) ; a[6] - Горизонтальный шаг в блоке (Horizontal step in block) ; a[7] - Индекс текущей колонки (The index of the current column) ; a[8] - Индекс пункта следующей колонки (Index of item of the next column) For $i = 1 To $iCount _NextItem($a, $i) $BoxConfig[$i] = GUICtrlCreateButton("Check " & $i, $a[0], $a[1], 96, 24) Next $a = 0 GUICtrlCreateGroup("", -99, -99, 1, 1) GUISetState() While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $BoxConfig[1] To $BoxConfig[$BoxConfig[0]] $j = $nMsg - $BoxConfig[1] + 1 MsgBox(0, 'Check', $j, 0, $hGui) ; Call('Employee' & $j & 'func') Employeefunc($j) Case -3 Exit EndSwitch WEnd Func _NextItem(ByRef $a, $i) If $i = $a[8] Then $a[8] += $a[2] $a[7] += 1 EndIf $a[0] = $a[7] * $a[6] + $a[3] ; X $a[1] = $a[4] + Mod($i - 1, $a[2]) * $a[5] ; Y EndFunc ;==>_NextItem ; Func _NextItem2(ByRef $a, $i) ; $a[0] = (Ceiling($i / $a[2]) - 1) * $a[6] + $a[3] ; X ; $a[1] = $a[4] + Mod($i - 1, $a[2]) * $a[5] ; Y ; EndFunc ;==>_NextItem2 Func Employeefunc($j) Switch $j Case 1 MsgBox(0, 'Yes?', '111') Case 2 MsgBox(0, 'Yes?', '222') Case 3 MsgBox(0, 'Yes?', '333') ; ... ; Case n ; MsgBox(0, 'Yes?', 'nnn') Case Else MsgBox(0, 'Yes?', '444') EndSwitch EndFunc ;==>Employeefunc http://pastebin.com/cBna5Sv31 point