-
Posts
701 -
Joined
-
Last visited
About IanN1990
- Birthday 01/13/1990
Recent Profile Visitors
The recent visitors block is disabled and is not being shown to other users.
IanN1990's Achievements
-
imacari reacted to a post in a topic: Http Get Crashes Autoit rc:-1073741819
-
Hi All, After more research i came to understand each pixel was an object within the graphic. I thought if i reduced the number of total objects this would fix the issue. Instead of a dotted grid, I would created a line-grid (see below) which ended up having 72 objects and a big improvement but a noticeable delay remained. GUICtrlSetGraphic($hGraphicDiagram, $GUI_GR_COLOR, 0xCACACA) For $iW = 1 To $iWidth GUICtrlSetGraphic($hGraphicDiagram, $GUI_GR_MOVE, $GridSize * $iW, 0) GUICtrlSetGraphic($hGraphicDiagram, $GUI_GR_LINE, $GridSize * $iW, $iDiagramHeight) Next For $iH = 1 To $iHeight GUICtrlSetGraphic($hGraphicDiagram, $GUI_GR_MOVE, 0, $GridSize * $iH) GUICtrlSetGraphic($hGraphicDiagram, $GUI_GR_LINE, $iDiagramWidth, $GridSize * $iH) Next Unlimitedly the solution came from using GUISetState(@SW_LOCK) and GUISetState(@SW_UNLOCK) while updating the controls.
-
Hi All, I have discovered something odd and am unsure how to counter it. I am using labels (for BkColor) to act as coloured borders for richedit controls (for coloured text). When loading a number of items (50 for example) there is a noticeable delay, after troubleshooting this is down to GUICtrlSetBkColor. Normally GUICtrlSetBkColor() is really fast <0.5-0.7 MS but when i load my grid (using graphics) this slows down to 5-5.5MS. In the above case this is adds a 250ms delay vs 25ms without the grid. Example Code. #NoTrayIcon #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> local $iDiagramWidth = 664, $iDiagramHeight = 498 local $iDiagramPadding = 8, $GridSize = 16 GUICreate("Example", $iDiagramWidth, $iDiagramHeight+$GridSize, -1, -1, -1, $WS_EX_COMPOSITED) $hGraphic = GUICtrlCreateGraphic(0, $GridSize, $iDiagramWidth, $iDiagramHeight, BitOR($GUI_SS_DEFAULT_PIC,$WS_BORDER)) $hLabel = GUICtrlCreateLabel("Example", 0, 0, $iDiagramWidth,$GridSize) GUISetState() MsgBox(0, "Msg", "Click Ok to start") AvgBckColorChange() CreateGrid() AvgBckColorChange() MsgBox(0, "Msg", "End of Demo") While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd Func AvgBckColorChange() ;Timer to change BCKColor of Label 10 times $Test = TimerInit() For $i = 1 to 10 GUICtrlSetBkColor($hLabel, 0x00000 & $i) Next MsgBox(0, "Msg", "Avg time to change color 10 times " & TimerDiff($Test)/10) EndFunc Func CreateGrid() ;Create Grid $iWidth = Floor(($iDiagramWidth - ($iDiagramPadding * 2)) / $GridSize) $iHeight = Floor(($iDiagramHeight - ($iDiagramPadding * 2)) / $GridSize) GUICtrlSetGraphic($hGraphic, $GUI_GR_COLOR, 0x000000) $icount = 0 For $iH = 0 To $iHeight For $iW = 0 To $iWidth GUICtrlSetGraphic($hGraphic, $GUI_GR_PIXEL, $iDiagramPadding + ($iW * $GridSize) - 1, $iDiagramPadding + ($iH * $GridSize) - 1) $icount += 1 Next Next ConsoleWrite($icount & @CRLF) GUICtrlSetGraphic($hGraphic, $GUI_GR_REFRESH) EndFunc I have a bloated workaround (see below) but wondered if the orginal issue can be fixed or if i am using graphics* incorrectly. Load the grid in a separate $WS_POPUP GUI Screencapture the GUI in memory (as the script will not have write permissions) Apply the $hBitmap to a PIC control Delete the $hBitmap, graphic & GUI *I am aware the more added to a graphic can slow it down but this should be around the 50k mark, My grid is only 1,250.
-
IanN1990 reacted to a post in a topic: CryptoNG UDF - Cryptography API: Next Gen
-
IanN1990 reacted to a post in a topic: CryptoNG UDF - Cryptography API: Next Gen
-
IanN1990 reacted to a post in a topic: CryptoNG UDF - Cryptography API: Next Gen
-
IanN1990 reacted to a post in a topic: CryptoNG UDF - Cryptography API: Next Gen
-
CryptoNG UDF - Cryptography API: Next Gen
IanN1990 replied to TheXman's topic in AutoIt Example Scripts
Hi, i have had a read through the posts and the UDFs. Am i correct that atm it is unable to encrypt / decrypt data (using RSA) using the public / private blobs it can create? #include "CryptoNG.au3" _CryptoNG_CreateRSAKeyPair(512, ".\Keys\publickey.blob", ".\Keys\privatekey.blob") $sEncryptedData = _CryptoNG_EncryptData($CNG_BCRYPT_RSA_ALGORITHM, "Test", FileRead(".\Keys\privatekey.blob")) ;$sEncryptedData = _CryptoNG_EncryptData($CNG_BCRYPT_RSAPRIVATE_BLOB, "Test", FileRead(".\Keys\privatekey.blob")) ConsoleWrite($sEncryptedData & @CRLF) ;Returns blank -
*Update after hours of troubleshooting, i think i am barking up the wrong tree. So not to waste anyone time, i am closing this for now. Hi All, I was wondering if there is a programmatic way to get the current x of a scrolled GUI? In my code below, an example made from a larger script, every function of _GUIScrollBars_Get* returns 0. _GUIScrollBars_GetScrollPos _GUIScrollBars_GetScrollInfoTrackPos _GUIScrollBars_GetScrollInfoPos #NoTrayIcon $DLLUser32 = DllOpen("user32.dll") $iScrollTotal = 875 $iScrollCurrent = 0 $hGUI = GUICreate("Example", 500, 250, -1, -1) GUICtrlCreateButton("Button 1", -125, 0, 125, 250) GUICtrlCreateButton("Button 2", -375, 0, 125, 250) GUISetState() AdlibRegister("Idle", 10) while 1 Switch GUIGetMsg() Case -3 Exit EndSwitch WEnd Func Idle() Scroll(1) EndFunc Func Scroll($iAmount) If $iScrollCurrent + $iAmount > $iScrollTotal Then $iAmount -= $iScrollTotal $iScrollCurrent += $iAmount DllCall($DLLUser32, "bool", "ScrollWindow", "hwnd", $hGUI, "int", $iAmount, "int", 0, "ptr", 0, "ptr", 0) EndFunc My current workaround is to store the info in a variable but now i need to branch this function between exes. It would be much easier to be able to just retrieve the info from the GUI itself, rather then storing it in registry / writing to a file / sharing memory / creating a dummy GUI to hold the info / sending messages back & forth etc Kind Regards, Ian P.S The reason i am moving the scroll animation to a separate exe is i want greater control over the animation speed. AdlibRegister has a minimum delay of 15ms and fluctuates between 10ms-20ms (which can look a little jittery). Using $hDll=DllOpen("winmm.dll") $hDll1=DllOpen("kernel32.dll") DllCall( $hDll, "dword", "timeBeginPeriod", "int", 1 ) ; Steps = 1 ms DllCall( $hDll1, "none", "Sleep", "int", 1) ; Steps = 1 ms DllCall( $hDll, "dword", "timeEndPeriod", "int", 1 ) ; Steps = 1 ms I can get much shorter timings in regular intervals.
-
StringRegExp but replace non-matching lines
IanN1990 replied to IanN1990's topic in AutoIt General Help and Support
@Malkey After a month of reliable work, i have discovered an unique trait! $CSVString = '1,Enabled,"Mr,Test",Test,Location' & @CRLF & '2,Enabled,"Mr,Test",Location,Test' & @CRLF $Result1 = StringRegExpReplace($CSVString, '(?m)^(("[^"]+",)|([^,]*,)){4}(Location).*(*SKIP)(*F)|^.*\R?', "") ConsoleWrite($Result1 & @CRLF & @CRLF) $Result2 = StringRegExpReplace($CSVString, '(?m)^(?!(("[^"]+",)|([^,]*,)){4}(Location).*)^.*\R?', "") ConsoleWrite($Result2 & @CRLF & @CRLF) It is returning both lines when only one has "Location" in column four? -
StringRegExp but replace non-matching lines
IanN1990 replied to IanN1990's topic in AutoIt General Help and Support
@Malkey Hi, both of your examples work perfectly. I am very jealous of the wizardry others have in RegExp, it is a hard art! -
IanN1990 reacted to a post in a topic: StringRegExp but replace non-matching lines
-
StringRegExp but replace non-matching lines
IanN1990 replied to IanN1990's topic in AutoIt General Help and Support
@mikell Your code has served me faithfully but has recently run into a slight issue. The lastest CSV sent by management can now have dual-roles. Where each role is separated by a , Is there a way the Regex could be changed to ignore , inside of quotes? The example below shows when i am looking match column 4 but an item is missed. $CSVString = '1,Enabled,"Mr,Test",Location' & @CRLF & '2,Enabled,"Mr Test",Location' & @CRLF $Result1 = StringRegExpReplace($CSVString, '(?m)^([^,]*,){' & 3 & '}(' & 'Location' & ').*(*SKIP)(*F)|^.*\R?', "") ConsoleWrite($Result1 & @CRLF & @CRLF) $Result2 = StringRegExpReplace($CSVString, '(?m)^([^,]*,){' & 4 & '}(' & 'Location' & ').*(*SKIP)(*F)|^.*\R?', "") ConsoleWrite($Result2 & @CRLF) -
Danp2 reacted to a post in a topic: WebDriver UDF - Help & Support (II)
-
WebDriver UDF - Help & Support (II)
IanN1990 replied to Danp2's topic in AutoIt General Help and Support
@Danp2 You are legend. Thank you. Your code works perfectly. -
IanN1990 reacted to a post in a topic: WebDriver UDF - Help & Support (II)
-
IanN1990 reacted to a post in a topic: WebDriver UDF - Help & Support (II)
-
IanN1990 reacted to a post in a topic: WebDriver UDF - Help & Support (II)
-
IanN1990 reacted to a post in a topic: WebDriver UDF - Help & Support (II)
-
IanN1990 reacted to a post in a topic: WebDriver UDF - Help & Support (II)
-
WebDriver UDF - Help & Support (II)
IanN1990 replied to Danp2's topic in AutoIt General Help and Support
@Danp2 _WD_Option('DriverParams', '--log trace --marionette-port 2828') You were correct. Adding the above brought everything to life. $sDesiredCapabilities = '{"capabilities":{"alwaysMatch": {"moz:firefoxOptions": {"args": ["-kiosk", "-private", "-profile", "C:\\Users\\IanN1990\\Desktop\\09-02-2020b\\Firefox"]}}}}' $sDesiredCapabilities = '{"desiredCapabilities":{"javascriptEnabled":true,"nativeEvents":true,"acceptInsecureCerts":true, "pageLoadStrategy":"none"}}' Individually they both work flawlessly, but no matter what combination i try i am unable to merge them together. Looking at your combined attempt, i tried to work backwards by removing the firefoxoptions but i get the error below; $sDesiredCapabilities = '{"capabilities":{"alwaysMatch":{"desiredCapabilities":{"javascriptEnabled":true,"nativeEvents":true,"acceptInsecureCerts":true, "pageLoadStrategy":"none"}}}}' __WD_Post: URL=HTTP://127.0.0.1:4444/session; $sData={"capabilities":{"alwaysMatch":{"desiredCapabilities":{"javascriptEnabled":true,"nativeEvents":true,"acceptInsecureCerts":true, "pageLoadStrategy":"none"}}}} __WD_Post: StatusCode=400; ResponseText={"value":{"error":"invalid argument","message":"desiredCapabilities is not the name of a known capability or extension capability","stacktrace":""}} _WD_CreateSession: {"value":{"error":"invalid argument","message":"desiredCapabilities is not the name of a known capability or extension capability","stacktrace":""}} _WD_CreateSession ==> Webdriver Exception: desiredCapabilities is not the name of a known capability or extension capability -
WebDriver UDF - Help & Support (II)
IanN1990 replied to Danp2's topic in AutoIt General Help and Support
Same issue Version i had previously was 1.6.4.1 (the one you linked is 1.6.4.2) -
WebDriver UDF - Help & Support (II)
IanN1990 replied to Danp2's topic in AutoIt General Help and Support
@Danp2 Apologies for the delay. I was trying to troubleshoot #NoTrayIcon #AutoIt3Wrapper_Run_AU3Check=n #include ".\Includes\wd_core.au3" #include ".\Includes\wd_helper.au3" $_WD_DEBUG = $_WD_DEBUG_Info _WD_Option('Driver', @ScriptDir & '\Includes\geckodriver-v0.26.0.exe') _WD_Option('Port', 4444) $sDesiredCapabilities = '{"capabilities":{"alwaysMatch": {"moz:firefoxOptions": {"args": ["-profile", "C:/Users/Vocalink/Desktop/Firefox"]}}}}' _WD_Startup() If @error <> $_WD_ERROR_Success Then Exit MsgBox(0, "Error", "Firefox Driver failed to load") $sSession = _WD_CreateSession($sDesiredCapabilities) If @error <> $_WD_ERROR_Success Then Exit MsgBox(0, "Error", "Firefox Driver failed to create a session") _WD_Navigate($sSession, "https://www.bbc.com") The other two args ("-kiosk", "-private") work without issue. It is -profile which is causing the problem which is odd as Firefox is loading my profile. Here is the output though it is a little sparce. _WDStartup: AutoIt: 3.3.14.5 _WDStartup: WD.au3: 0.2.0.5 _WDStartup: WinHTTP: 1.6.4.1 _WDStartup: Driver: C:\Users\Vocalink\Desktop\09-02-2020\Includes\geckodriver-v0.26.0.exe _WDStartup: Params: _WDStartup: Port: 4444 __WD_Post: URL=HTTP://127.0.0.1:4444/session; $sData={"capabilities":{"alwaysMatch": {"moz:firefoxOptions": {"args": ["-profile", "C:/Users/Vocalink/Desktop/Firefox"]}}}} __WD_Post: StatusCode=0; ResponseText=0 __WD_Post ==> Send / Recv error _WD_CreateSession: 0 _WD_CreateSession ==> Webdriver Exception: HTTP status = 0 -
WebDriver UDF - Help & Support (II)
IanN1990 replied to Danp2's topic in AutoIt General Help and Support
@Danp2 Implementing your recommendations produces the following output. #NoTrayIcon #AutoIt3Wrapper_Run_AU3Check=n #include ".\Includes\wd_core.au3" #include ".\Includes\wd_helper.au3" $_WD_DEBUG = $_WD_DEBUG_Info _WD_Option('Driver', @ScriptDir & '\Includes\geckodriver-v0.26.0.exe') _WD_Option('Port', 4444) $sDesiredCapabilities = '{"capabilities":{"alwaysMatch": {{"desiredCapabilities":{"javascriptEnabled":true,"nativeEvents":true,"acceptInsecureCerts":true, "pageLoadStrategy":"none", "moz:firefoxOptions": {"args": ["-kiosk", "-private", "-profile", "C:/Users/Ian/Desktop/Firefox"]}}}}' _WD_Startup() If @error <> $_WD_ERROR_Success Then Exit MsgBox(0, "Error", "Firefox Driver failed to load") $sSession = _WD_CreateSession($sDesiredCapabilities) If @error <> $_WD_ERROR_Success Then Exit MsgBox(0, "Error", "Firefox Driver failed to create a session") _WD_Navigate($sSession, "https://www.bbc.com") _WDStartup: OS: WIN_10 WIN32_NT 18363 _WDStartup: AutoIt: 3.3.14.5 _WDStartup: WD.au3: 0.2.0.5 _WDStartup: WinHTTP: 1.6.4.1 _WDStartup: Driver: C:\Users\Vocalink\Desktop\09-02-2020\Includes\geckodriver-v0.26.0.exe _WDStartup: Params: _WDStartup: Port: 4444 __WD_Post: URL=HTTP://127.0.0.1:4444/session; $sData={"capabilities":{"alwaysMatch": {{"desiredCapabilities":{"javascriptEnabled":true,"nativeEvents":true,"acceptInsecureCerts":true, "pageLoadStrategy":"none", "moz:firefoxOptions": {"args": ["-kiosk", "-private", "-profile", "C:/Users/Ian/Desktop/Firefox"]}}}} __WD_Post: StatusCode=400; ResponseText={"value":{"error":"invalid argument","message":"Failed to decode request as JSON: {\"capabilities\":{\"alwaysMatch\": {{\"desiredCapabilities\":{\"javascriptEnabled\":true,\"nativeEvents\":true,\"acceptInsecureCerts\":true, \"pageLoadStrategy\":\"none\", \"moz:firefoxOptions\": {\"args\": [\"-kiosk\", \"-private\", \"-profile\", \"C:/Users/Ian/Desktop/Firefox\"]}}}}","stacktrace":"Syntax error at :1:34"}} _WD_CreateSession: {"value":{"error":"invalid argument","message":"Failed to decode request as JSON: {\"capabilities\":{\"alwaysMatch\": {{\"desiredCapabilities\":{\"javascriptEnabled\":true,\"nativeEvents\":true,\"acceptInsecureCerts\":true, \"pageLoadStrategy\":\"none\", \"moz:firefoxOptions\": {\"args\": [\"-kiosk\", \"-private\", \"-profile\", \"C:/Users/Ian/Desktop/Firefox\"]}}}}","stacktrace":"Syntax error at :1:34"}} _WD_CreateSession ==> Webdriver Exception: Failed to decode request as JSON: {"capabilities":{"alwaysMatch": {{"desiredCapabilities":{"javascriptEnabled":true,"nativeEvents":true,"acceptInsecureCerts":true, "pageLoadStrategy":"none", "moz:firefoxOptions": {"args": ["-kiosk", "-private", "-profile", "C:/Users/Ian/Desktop/Firefox"]}}}} **A small note, i noticed the forum is adding hidden characters. I had to copy it to notepad first to remove them. -
WebDriver UDF - Help & Support (II)
IanN1990 replied to Danp2's topic in AutoIt General Help and Support
@Danp2 Following your advice; #NoTrayIcon #AutoIt3Wrapper_Run_AU3Check=n #include ".\Includes\wd_core.au3" #include ".\Includes\wd_helper.au3" ProcessClose("geckodriver-v0.26.0.exe") $_WD_DEBUG = 0 _WD_Option('Driver', @ScriptDir & '\Includes\geckodriver-v0.26.0.exe') _WD_Option('Port', 4444) ;$sDesiredCapabilities = '{"desiredCapabilities":{"javascriptEnabled":true,"nativeEvents":true,"acceptInsecureCerts":true, "pageLoadStrategy":"none"}}' $sDesiredCapabilities = '{"capabilities":{"alwaysMatch": {"moz:firefoxOptions": {"args": ["-kiosk", "-private", "-profile", "C:/Users/Ian/Desktop/Firefox"]}}}}' _WD_Startup() If @error <> $_WD_ERROR_Success Then Exit MsgBox(0, "Error", "Firefox Driver failed to load") $sSession = _WD_CreateSession($sDesiredCapabilities) If @error <> $_WD_ERROR_Success Then Exit MsgBox(0, "Error", "Firefox Driver failed to create a session") _WD_Navigate($sSession, "https://www.google.com") Firefox now starts in Kiosk mode, with my profile and in private window but it now hangs at _WD_CreateSession($sDesiredCapabilities) I am also unsure how to merge the desiredCapabilities with the capabilities -
WebDriver UDF - Help & Support (II)
IanN1990 replied to Danp2's topic in AutoIt General Help and Support
Hi, #NoTrayIcon #AutoIt3Wrapper_Run_AU3Check=n #include ".\Includes\wd_core.au3" #include ".\Includes\wd_helper.au3" $_WD_DEBUG = 0 _WD_Option('Driver', @ScriptDir & '\Includes\geckodriver-v0.26.0.exe') _WD_Option('Port', 4444) $sDesiredCapabilities = '{"desiredCapabilities":{"javascriptEnabled":true,"nativeEvents":true,"acceptInsecureCerts":true, "pageLoadStrategy":"none", "args":["-kiosk"], "args":["-p Automation"] }}' _WD_Startup() If @error <> $_WD_ERROR_Success Then Exit MsgBox(0, "Error", "Firefox Driver failed to load") $sSession = _WD_CreateSession($sDesiredCapabilities) If @error <> $_WD_ERROR_Success Then Exit MsgBox(0, "Error", "Firefox Driver failed to create a session") _WD_Navigate($sSession, "https://www.google.com") Are you about to spot where i have gone wrong? Firefox loads and navigates to google but my two args ("-kiosk") and ("-p Automation") are not having an effect. I have tested them outside of Webdriver and confirmed they work. -
argumentum reacted to a post in a topic: [Solved] AutoIT Project Mode
-
[Solved] AutoIT Project Mode
IanN1990 replied to IanN1990's topic in AutoIt General Help and Support
@argumentum Sent me on the right track. Was what i remembered I just thought it was part of the offical release for some reason