dexto
Active Members-
Posts
243 -
Joined
-
Last visited
-
Days Won
1
dexto last won the day on June 24 2017
dexto had the most liked content!
About dexto
- Birthday 01/01/1984
dexto's Achievements
Polymath (5/7)
5
Reputation
-
cramaboule reacted to a post in a topic:
_Service_UDF v4 : Build your own service with autoit code
-
Taz77 reacted to a post in a topic:
A Non-Strict JSON UDF (JSMN)
-
argumentum reacted to a post in a topic:
_Service_UDF v4 : Build your own service with autoit code
-
_Service_UDF v4 : Build your own service with autoit code
dexto replied to arcker's topic in AutoIt Example Scripts
In v4 there is a bug in services.au3: Case $SERVICE_CONTROL_STOP,$SERVICE_ACCEPT_SHUTDOWN ; new in v4, stop when system shutdown ( better mmm ? ) https://msdn.microsoft.com/en-us/library/windows/desktop/ms683241(v=vs.85).aspx should be: Case $SERVICE_CONTROL_STOP,$SERVICE_CONTROL_SHUTDOWN ; new in v4, stop when system shutdown ( better mmm ? ) -
dexto reacted to a post in a topic:
_Service_UDF v4 : Build your own service with autoit code
-
Feature request submited: https://www.autoitscript.com/trac/autoit/ticket/3533#no4
-
JSON to MAP:
-
Thank you!
-
dexto reacted to a post in a topic:
Map Array Read
-
dexto reacted to a post in a topic:
Map Array Read
-
Awesome! But how i can set the value for the array element then? Local $json[] Local $map[] $map['test'] = 'hello' Local $array[5] = [1, 2, 3, 4, 5] $json["data"] = $map $json["data"]["arr"] = $array ConsoleWrite(($json["data"]["arr"])[1] & @CRLF) ($json["data"]["arr"])[1]=0 ConsoleWrite(($json["data"]["arr"])[1] & @CRLF)
-
Why idea why would I get an error (Autoit Beta 3.3.15.0): Local $json[] Local $map[] $map['test'] = 'hello' Local $array[5] = [1, 2, 3, 4, 5] $json["data"] = $map $json["data"]["arr"] = $array ConsoleWrite($json["data"]["arr"][0] & @CRLF)
-
argumentum reacted to a post in a topic:
A Non-Strict JSON UDF (JSMN)
-
Implementation of the JSMN using Map available in Autoit Beta (3.3.15): #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Version=Beta #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #include "jsonMap.au3" $json = '{"test":"yay"}' $test = Json_Decode($json) ConsoleWrite($test['test'] & @CRLF) $test['test'] = 'horray!!!' ConsoleWrite($test['test'] & @CRLF) ConsoleWrite(Json_Encode($test) & @CRLF) jsonMap.au3
-
Code to extract plain text from a PDF file
dexto replied to mLipok's topic in AutoIt General Help and Support
So, I'm looking into this and got it to decompress text in PDFs: ; YOU JUST NEED zlib1.dll __Zlib_Startup() $t = GetPdfStreamContent("MY.PDF") ConsoleWrite($t & @CRLF) Func GetPdfStreamContent($fullfilename) ;Finds streams within a PDF. Returns an Array with the streams starting at $strm_Array[1] Local $regex = '(?s)<<[^<]*?FlateDecode[^<]+?Length \d+[^<]*?>>[\r\n]*stream[\r\n]*(.*?)[\r\n]*endstream' ;this is regex, (\d+) will return length, @extended the position of the stream Local $sData = FileRead($fullfilename) Local $arr = StringRegExp($sData, $regex, 3) Local $out = '' For $i = 0 To UBound($arr) - 1 $out &= BinaryToString(__ZLib_UncompressBinary($arr[$i])) Next Return $out EndFunc ;==>GetPdfStreamContent Func __Zlib_Startup() Local $dllPath = @TempDir & '\' & @ScriptName & 'zlib1.dll' FileInstall('zlib1.dll', $dllPath, 1) Global $Zlib_Dll = DllOpen($dllPath) EndFunc ;==>__Zlib_Startup ; Decompresses data, you need to know how large the decompressed data will be. Func __Zlib_Uncompress($CompressedPtr, ByRef $CompressedSize, $UncompressedPtr, $UncompressedSize) ; modified by ProgAndy $call = DllCall($Zlib_Dll, "int:cdecl", "uncompress", "ptr", $UncompressedPtr, "long*", $UncompressedSize, "ptr", $CompressedPtr, "long", $CompressedSize) If @error Then Return SetError(1, 0, -7) $CompressedSize = $call[2] Return $call[0] EndFunc ;==>__Zlib_Uncompress Func __ZLib_UncompressBinary($bBinary, $iLength = 0) ; ProgAndy Local $i = 1, $tBuf, $iSize, $iRes Local $tBin = DllStructCreate("byte[" & BinaryLen($bBinary) & "]") DllStructSetData($tBin, 1, $bBinary) If $iLength < 1 Then $iLength = DllStructGetSize($tBin) * 2 $bBinary = 0 Do $tBuf = DllStructCreate("byte[" & $iLength * $i & "]") $iSize = DllStructGetSize($tBin) $iRes = __Zlib_Uncompress(DllStructGetPtr($tBin), $iSize, DllStructGetPtr($tBuf), DllStructGetSize($tBuf)) $i += 1 Until $iRes <> -5 If $iRes <> 0 Then Return SetError($iRes, 0, "") $tBin = 0 Return DllStructGetData(DllStructCreate("byte[" & $iSize & "]", DllStructGetPtr($tBuf)), 1) EndFunc ;==>__ZLib_UncompressBinary Expecting text in PDF: "AU3" Instead getting scary data structure: /CIDInit /ProcSet findresource begin 12 dict begin begincmap /CMapType 2 def /CMapName/R19 def 1 begincodespacerange <00><ff> endcodespacerange 3 beginbfrange <01><01><0041> <02><02><0055> <03><03><0033> endbfrange endcmap CMapName currentdict /CMap defineresource pop end endI can see ASCII in it spelling 41 55 33 or AU3 but CMap is more complicated than that. Any idea if there some something to decode CMap? -
Once I realised that, everything started to make sense again. Thanks guys.
-
Try: local $hexA = hex(1,2) local $hexB = hex(140,2) ConsoleWrite( $hexA& @CRLF) ConsoleWrite( $hexB& @CRLF) $hexC = $hexB - $hexA ConsoleWrite( $hexC& @CRLF) Output: 01 8C 7 I'm not crazy right? Autoit v3.3.12.0 x86 Edit: This is the only way I found it works: local $hexA = hex(1,2) local $hexB = hex(140,2) ConsoleWrite( $hexA& @CRLF) ConsoleWrite( $hexB& @CRLF) $hexC = Hex(Execute('0x'&$hexB&' - 0x'&$hexA),2) ConsoleWrite( $hexC& @CRLF) Output: 01 8C 8B Well this is not a bug but this IS very inconvenient. I mean hex should be fast and easy... Workaround: ALWAYS do operations with as - + * / with a hex variable (string) that already is in a form of "0xAF". You can NOT: $hexC = '0x'&$hexB - '0x'&$hexA but you CAN: $hexC = ('0x'&$hexB) - ('0x'&$hexA)
-
Bug v2.2: Using FF UDF for a while for its awesome speed and noticed that every time it takes a screenshot it freezes the screen while it taking a screenshot. I understand that its only 50 ms or so but it introduces a screen stutter. VERY annoying in smooth applications. Please fix if possible...
-
<3
-
Would be nice to have a function that can simplify $cmdline parsing and function a bit like like iniRead() does. $cmdline = ' -debug /param "c:"' $debug = cmdline('debug',False) Func cmdline($switchtofind, $default = '') EndFunc Found a function by Prog@ndy that would be nice to unitize for this but there is a bug: can't read when parameter ends with " Any idea how to fix? #include <Array.au3> $CMDString = '/a:"value" -big="this -test:1"23 is & $#@ _ your life" -installpath "c:" -test=th_3 -tte -äß$=/ätest/h.b' $ResultArray = _ParseCMDLine($CMDString) _ArrayDisplay($ResultArray) ;=============================================================================== ; ; Function Name: _ParseCMDLine($CMDString) ; Description:: Parses a CMD-String to Parameters with Values ; Parameter(s): $CMDString -> String to parse ; Requirement(s): ? ; Return Value(s): Error: 0 and @error = StringRegExp-Error ; Success: 2 Dimensional Array: ; $array[$i][0] : Parameter including value ; $array[$i][1] : Parameter ; $array[$i][2] : Value with quotation marks (only if value has quotaion marks) ; $array[$i][3] : Value without quotation marks ; Author(s): Prog@ndy ; ; Basis: http://regexlib.com/REDetails.aspx?regexp_id=1220 ;=============================================================================== ; Func _ParseCMDLine($CMDString) Local $y, $j, $i, $entry Local $x = StringRegExp($CMDString,'(?:s*)(?<=[-|/])(?<name>[^s-|/:|]*)(?:(?:[:|](?:("(?<value1>.*?)(?<!)")|(?<value>S*)))|w*?)',4) If @error Then Return SetError(@error,0,0) Local $ResultArray[UBound($x)][4] For $i = 0 To UBound($x)-1 $entry = $x[$i] For $y = 0 To UBound($entry)-1 $j = $y If $y > 3 Then $j = 3 $ResultArray[$i][$j] = $entry[$y] Next Next Return $ResultArray EndFunc
-
Unix TimeStamp functions doesn't require dll
dexto replied to andrei0x309's topic in AutoIt Example Scripts
bug in UnixTimeStampToTime (time correct, date wrong): UnixTimeStampToTime(1341418339) = [0]|2012 [1]|6 [2]|31 [3]|16 [4]|12 [5]|19 real= 2012-07-04 16:12:19 -
Get disk number from drive letter
dexto replied to twbradio's topic in AutoIt General Help and Support
Your mom is so cool...