Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 08/02/2016 in all areas

  1. Hello. Create your own function like this. #include <Array.au3> Local $BaseArray[0][2] Local $FillArray[2][2] = [["New Item 2 - 1", "New Item 2 - 2"], ["New Item 3 - 1", "New Item 3 - 2"]] _ArrayAdd($BaseArray, $FillArray) _ArrayDisplay($BaseArray) Local $FillArray2[2][2] = [["New Item 4 - 1", "New Item 4 - 2"], ["New Item 5 - 1", "New Item 5 - 2"]] _ArrayCombine($BaseArray, $FillArray2) _ArrayDisplay($BaseArray) Func _ArrayCombine(ByRef $array1, ByRef $array2) ; Function to combine 2D arrays in column direction Local $a1 = UBound($array1, 2) Local $a2 = UBound($array2, 1) ReDim $array1[UBound($array1, 1)][UBound($array1, 2) + UBound($array2, 2)] For $i = 0 To $a2 - 1 For $x = $a1 To $a1 + UBound($array2, 2) - 1 $y = $x - $a1 $array1[$i][$x] = $array2[$i][$y] Next Next EndFunc ;==>_ArrayCombine Saludos
    1 point
  2. AutoBert

    Annoying Error

    Yes have a look on this small script: #include <Array.au3> local $sFile1 = @scriptdir & '\file2.txt' Local $aResult=StringSplit(StringStripWS(StringReplace(StringReplace(StringReplace(FileRead('file2.txt'),@CRLF,' '),@TAB,' '),',',' '),7),' ',3) For $i=0 To UBound($aResult) ConsoleWrite($i&': '$aResult[$i]) Next _ArrayDisplay($aResult) the error is in line 7. But there is one include, so linenumber in exe not 7. Using au3stripper with param /mo i get this file: test_stripped.au3 The exe throw's error: Yet, having a look in the stripped au3 file what's in line will get result: ConsoleWrite($i&': '&$aResult[$i])
    1 point
  3. Read http://www.networkautomation.com/urc/knowledgebase/running-interactive-tasks-in-minimized-remote-desktop-windows/4ecdf43e03470/ and you understand why script don'work when vm is in background.
    1 point
  4. Yeah, it's just not all that reliable, which is why in every topic where send comes up as a means to automation, people suggest to try and find another way to automate. As an added precautionary measure against conflicts, you could (should, IMHO ) also always make theese functions wait until you release all keys in the combo. Especially when you combine stuff with Send. So in this case: #include <Misc.au3> HotKeySet("^+t", "WriteTxt") Func WriteTxt() HotKeySet("^+t") While _IsPressed(10) Or _IsPressed(11) Or _IsPressed(54) ; <-- wait as long as any key of the ^+t combo is still pressed Sleep(10) WEnd WinWaitActive("Untitled - Notepad") $var = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" Send($var, 1) HotKeySet("^+t", "WriteTxt") EndFunc ;==>WriteTxt While 1 Sleep(500) WEnd
    1 point
  5. Seems like an ideal use of the IsDeclared function. Declare a variable in your additional au3, say $additional in your main script something like ... If Not IsDeclared("additional") build32() Endif
    1 point
  6. loganizzi

    HTML editor

    Awesome! Thank you so much for digging this up, I know how nerve racking resurrecting old code can be
    1 point
  7. Yeah, comment out the FileWrite and FileClose lines and try it again.
    1 point
  8. Dent, It was indeed a format problem - this pattern works for me: #include <Array.au3> $sText = FileRead("M:\Downloads\Page.htm") ; You read the page directly here $aExtract = StringRegExp($sText, "<strong>(\d+)</strong>\s+properties", 3) _ArrayDisplay($aExtract, "", Default, 8) M23
    1 point
  9. Here another example AutoIt vs FreeBasic: FB: 25.000 Partikel @ 1024x768 Au3: 1.000 Partikel @ 800x600. Download source + compiled exes: Particles Mouse Attraction - Au3 vs FB.zip Just move your mouse around on the GUI...
    1 point
  10. ProgAndy

    URL Encoding

    I wrote some functions including UTF-8 conversion Func _URIEncode($sData) ; Prog@ndy Local $aData = StringSplit(BinaryToString(StringToBinary($sData,4),1),"") Local $nChar $sData="" For $i = 1 To $aData[0] ; ConsoleWrite($aData[$i] & @CRLF) $nChar = Asc($aData[$i]) Switch $nChar Case 45, 46, 48 To 57, 65 To 90, 95, 97 To 122, 126 $sData &= $aData[$i] Case 32 $sData &= "+" Case Else $sData &= "%" & Hex($nChar,2) EndSwitch Next Return $sData EndFunc Func _URIDecode($sData) ; Prog@ndy Local $aData = StringSplit(StringReplace($sData,"+"," ",0,1),"%") $sData = "" For $i = 2 To $aData[0] $aData[1] &= Chr(Dec(StringLeft($aData[$i],2))) & StringTrimLeft($aData[$i],2) Next Return BinaryToString(StringToBinary($aData[1],1),4) EndFunc MsgBox(0, '', _URIDecode(_URIEncode("testäöü fv"))) Edit 2012: Fixed bug in _URIEncode, removed debug output
    1 point
×
×
  • Create New...