Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 06/10/2020 in all areas

  1. I was rooting for "Doughnut Script", but I guess that would have just made TheSaint hungry every time he read the project updates.
    3 points
  2. I think regular progress reports might be a good idea, it will help keep my motivation afloat Today I read some stuff about parsing, scanning (lexical analysis) etc., but nothing really note-worthy. I still don't have a good idea on the overall design of the code... but I have the big picture in mind, and I guess the code will naturally evolve as I work on it. The first major-ish hurdle is actually reading the code from the file, I was thinking about loading the whole thing into memory as it sounds simple, but I found out that there are not standard C functions to reliably calculate the size of the total stuff in a file, so not very easy unless I resort to platform-specific API. An alternative and in my opinion a better method is to buffer the file, only keeping a part of it in memory. It is pretty easy to do, but the problem arises when we have to work near the boundaries, where a token might be split unevenly. It is 5 AM here right now and I should really head to sleep, my sleep schedule is a bit messed up at the moment Bye!
    2 points
  3. Hello everyone, Just a small but important update, as of today I have officially started work on the project, and I have chosen to name it EasyCodeIt There are a handful of reasons why I chose that name: It reflects one of the important goals, keeping it easy to code It somewhat makes sense and rhymes with AutoIt By far, it is the only name which hasn't been used by others (DuckDuckGo shows that no results contain that word) It is shorter than other potential names while still being meaningful ...there might be other reasons which I cannot recall right now If I come across a better name, I might change it still, so nothing is set in concrete. I am licensing the code under GPL (v3), a newer version of the same license under which AutoIt3 used to be under. I don't really have a problem with others forking my code, but I sure do not want the forks to be closed source, that is the reason why I did not choose a 100% free license. Eventually we would need exceptions down the road to allow binary distribution of executable without having to require disclosing their own source code. My current aim is to build a bare-minimum cross-platform interpreter which can act as a proof-of-concept, and we can build from there I will release the code publicly once I actually finish something presentable, right now my code is not very different than a simple imitation of command-line tools like cat or type
    2 points
  4. In the beginning I also had F5 for "run" in PSPad to be as similar as possible to SciTE and to make the switch easier. But Ctrl+F5, Shift+F5, Ctrl+F7, ... was too cumbersome to reach with one hand. Therefore I used the F9 key. This corresponds to the original PSPad and the Delphi IDE. (Besides, I often pressed F5 by mistake, because I had "refresh" from the browser in mind). That's how I see it. (Positive) criticism does not mean to do something bad, but to point out mistakes. I see it as something good that helps me find bugs and actually use it as a kind of debugging. And like last time, your information helps me. Thanks for that. πŸ‘
    1 point
  5. I think that it is what @Musashi wanted to show you $coords = PixelSearch(49,422,237,814,0xFFF43C,1) If @error Then Exit PixelSearch($coords[0]-25,$coords[1]-25,$coords[0]+100,$coords[1]+100,0xFCFCFC,10) $x = @error PixelSearch(237,442,337,690,0xFCFCFC,10) $y = @error PixelSearch(237,566,337,690,0xFCFCFC,10) $z = @error If not $x And $y And $z Then Send("{s 2}") ElseIf not $x And $y And not $z Then Send("s") EndIf
    1 point
  6. You may want to try this : #include <IE.au3> #include <Array.au3> Local $oIE = _IEAttach("SMART") $oTable = _IETableGetCollection ($oIE, 1) $aTableData = _IETableWriteToArray ($oTable) _ArrayDisplay($aTableData); have I got the right table $oLinks = _IETagNameGetCollection ($oTable, "a") For $oLink In $oLinks ConsoleWrite (_IEPropertyGet ($oLink, "innertext") & @CRLF) If StringInStr($oLink.innerText , "Click" ) Then _IEAction($oLink, "click") ExitLoop EndIf Next _IELoadWait( $oIE )
    1 point
  7. "showAdditionalInfo(orderTaskDetail.task.additionalInfo)" and "ng-scope" aren't valid element names, so the errors you received are expected. In the code where you loop through all links, there's no way to tell if it found the desired link. You should add a ConsoleWrite or a MessageBox for diagnostic purposes.
    1 point
  8. Andreik

    GDIPlus adjust font size

    Thanks UEZ it's a clean script but it doesn't work for any random string. Just comment the last 5 lines of $sString and see what I mean. EDIT: I modified a little bit your script to ensure the visibility of the longest line also and seems to work good #include <GDIPlus.au3> #include <GUIConstantsEx.au3> Local $hGUI, $hGraphic, $hBrush, $hFormat, $hFamily, $hFont, $tLayout, $sString, $iFontSize Local $iW = @DesktopWidth / 4, $iH = @DesktopHeight / 4 $hGUI = GUICreate("GDI+", $iW, $iH) ;, 0, 0, 0x80000000) GUISetState(@SW_SHOW) $sString = 'Take this kiss upon the brow!' & @CRLF $sString &= 'And, in parting from you now,' & @CRLF $sString &= 'Thus much let me avow--' & @CRLF $sString &= 'You are not wrong, who deem' & @CRLF $sString &= 'That my days have been a dream;' & @CRLF $sString &= 'Yet if hope has flown away' & @CRLF $sString &= 'In a night, or in a day,' & @CRLF $sString &= 'In a vision, or in none,' & @CRLF $sString &= 'Is it therefore the less gone?' & @CRLF $sString &= 'All that we see or seem' & @CRLF $sString &= 'Is but a dream within a dream.' _GDIPlus_Startup() $hGraphic = _GDIPlus_GraphicsCreateFromHWND($hGUI) $hBrush = _GDIPlus_BrushCreateSolid(0xFFFFFFFF) $hFormat = _GDIPlus_StringFormatCreate(0x1000) _GDIPlus_StringFormatSetAlign($hFormat, 1) _GDIPlus_StringFormatSetLineAlign($hFormat, 1) $hFamily = _GDIPlus_FontFamilyCreate("Arial") $tLayout = _GDIPlus_RectFCreate(20, 20, $iW - 40, $iH - 40) $iFontSize = Measure($sString, $iW - 40, $iH - 40) $hFont = _GDIPlus_FontCreate($hFamily, $iFontSize) ; <<< Adjust font size _GDIPlus_GraphicsClear($hGraphic) _GDIPlus_GraphicsDrawStringEx($hGraphic, $sString, $hFont, $tLayout, $hFormat, $hBrush) $hPen = _GDIPlus_PenCreate(0xFF00F000) _GDIPlus_GraphicsDrawRect($hGraphic, $tLayout.x, $tLayout.y, $tLayout.width, $tLayout.height, $hPen) Do Until GUIGetMsg() = $GUI_EVENT_CLOSE _GDIPlus_PenDispose($hPen) _GDIPlus_FontDispose($hFont) _GDIPlus_FontFamilyDispose($hFamily) _GDIPlus_StringFormatDispose($hFormat) _GDIPlus_BrushDispose($hBrush) _GDIPlus_GraphicsDispose($hGraphic) _GDIPlus_Shutdown() Func Measure($sString, $iW, $iH, $sFont = "Arial", $iStyle = 0) Local $LongestLine Local Const $hFormat = _GDIPlus_StringFormatCreate() Local Const $hFamily = _GDIPlus_FontFamilyCreate($sFont) Local Const $iFontSize = 4 Local Const $hFont = _GDIPlus_FontCreate($hFamily, $iFontSize, $iStyle) Local Const $hGraphics = _GDIPlus_GraphicsCreateFromHDC(_WinAPI_GetWindowDC(0)) Local $tLayout = _GDIPlus_RectFCreate(0, 0, $iW, $iH) Local $aLines = StringSplit($sString, @CRLF, 1) For $Index = 1 To $aLines[0] $LongestLine = StringLen($LongestLine) > StringLen($aLines[$Index]) ? $LongestLine : $aLines[$Index] Next Local Const $aInfo1 = _GDIPlus_GraphicsMeasureString($hGraphics, $LongestLine, $hFont, $tLayout, $hFormat) Local $iSizeW = $iFontSize * $iW / $aInfo1[0].width Local Const $aInfo2 = _GDIPlus_GraphicsMeasureString($hGraphics, $sString, $hFont, $tLayout, $hFormat) Local $iSizeH = $iFontSize * $iH / $aInfo2[0].height _GDIPlus_FontDispose($hFont) _GDIPlus_FontFamilyDispose($hFamily) _GDIPlus_StringFormatDispose($hFormat) _GDIPlus_GraphicsDispose($hGraphics) Return $iSizeW > $iSizeH ? $iSizeH : $iSizeW EndFunc
    1 point
  9. UEZ

    GDIPlus adjust font size

    Try this: #include <GDIPlus.au3> #include <GUIConstantsEx.au3> Local $hGUI, $hGraphic, $hBrush, $hFormat, $hFamily, $hFont, $tLayout, $sString, $iFontSize Local $iW = @DesktopWidth / 4, $iH = @DesktopHeight / 4 $hGUI = GUICreate("GDI+", $iW, $iH) ;, 0, 0, 0x80000000) GUISetState(@SW_SHOW) $sString = 'Take this kiss upon the brow!' & @CRLF $sString &= 'And, in parting from you now,' & @CRLF $sString &= 'Thus much let me avow--' & @CRLF $sString &= 'You are not wrong, who deem' & @CRLF $sString &= 'That my days have been a dream;' & @CRLF $sString &= 'Yet if hope has flown away' & @CRLF $sString &= 'In a night, or in a day,' & @CRLF $sString &= 'In a vision, or in none,' & @CRLF $sString &= 'Is it therefore the less gone?' & @CRLF $sString &= 'All that we see or seem' & @CRLF $sString &= 'Is but a dream within a dream.' _GDIPlus_Startup() $hGraphic = _GDIPlus_GraphicsCreateFromHWND($hGUI) $hBrush = _GDIPlus_BrushCreateSolid(0xFFFFFFFF) $hFormat = _GDIPlus_StringFormatCreate(0x1000) _GDIPlus_StringFormatSetAlign($hFormat, 1) _GDIPlus_StringFormatSetLineAlign($hFormat, 1) $hFamily = _GDIPlus_FontFamilyCreate("Arial") $tLayout = _GDIPlus_RectFCreate(20, 20, $iW - 40, $iH - 40) $iFontSize = Measure($sString, $iW - 40, $iH - 40) $hFont = _GDIPlus_FontCreate($hFamily, $iFontSize ) ; <<< Adjust font size _GDIPlus_GraphicsClear($hGraphic) _GDIPlus_GraphicsDrawStringEx($hGraphic, $sString, $hFont, $tLayout, $hFormat, $hBrush) $hPen = _GDIPlus_PenCreate(0xFF00F000) _GDIPlus_GraphicsDrawRect($hGraphic, $tLayout.x, $tLayout.y, $tLayout.width, $tLayout.height, $hPen) Do Until GUIGetMsg() = $GUI_EVENT_CLOSE _GDIPlus_PenDispose($hPen) _GDIPlus_FontDispose($hFont) _GDIPlus_FontFamilyDispose($hFamily) _GDIPlus_StringFormatDispose($hFormat) _GDIPlus_BrushDispose($hBrush) _GDIPlus_GraphicsDispose($hGraphic) _GDIPlus_Shutdown() Func Measure($sString, $iW, $iH, $sFont = "Arial", $iStyle = 0) Local Const $hFormat = _GDIPlus_StringFormatCreate() Local Const $hFamily = _GDIPlus_FontFamilyCreate($sFont) Local Const $iFontSize = 4 Local Const $hFont = _GDIPlus_FontCreate($hFamily, $iFontSize, $iStyle) Local Const $hGraphics = _GDIPlus_GraphicsCreateFromHDC(_WinAPI_GetWindowDC(0)) Local $tLayout = _GDIPlus_RectFCreate(0, 0, $iW, $iH) Local Const $aInfo = _GDIPlus_GraphicsMeasureString($hGraphics, $sString, $hFont, $tLayout, $hFormat) _GDIPlus_FontDispose($hFont) _GDIPlus_FontFamilyDispose($hFamily) _GDIPlus_StringFormatDispose($hFormat) _GDIPlus_GraphicsDispose($hGraphics) If $iW > $iH Then Return $iFontSize * $iH / $aInfo[0].height Return $iFontSize * $iW / $aInfo[0].width EndFunc
    1 point
  10. DonutIt or DoughnutIt has a nice ring (sic) to it .... and rolls off the tongue ... quite a tasty title. DognutIt.
    1 point
  11. What I really want to know, which is by far the most important aspect of all this right now. Do I need one big bag of popcorn .... or several .... while you work on ImagineIt?
    1 point
  12. This is indicative of a website using AngularJS, which has proven problematic to automate. Why would you need to do this? Does the name dynamically change each time? This is too vague. Show us the actual error message if you want meaningful help. πŸ˜‰
    1 point
  13. What information was shown in the Scite output panel? If the link wasn't found, then you should have seen something like --> IE.au3 T3.0-2 Warning from function _IELinkClickByText, $_IESTATUS_NoMatch Have you checked to see if the site uses frames?
    1 point
  14. I assume you tried something like this? IELinkClickByText($oIE, "Click Here")
    1 point
  15. I also didn't see any link for a download. They may have simply removed it from the site in the meantime. Interacting with the site can be done with the webdriver. As i cannot download said calculator, can't help in that angle.
    1 point
  16. @DonChunior Looks like you need to tell geckodriver to use the correct port -- _WD_Option('DriverParams', '--log trace --marionette-port 2828')
    1 point
  17. @Justin_Christian Instead of FileInstall() use FileCopy(), rest of your script should stay the same. You may post source of your function where you encounter problems ... _InstallMSIPackageWithOption() EDIT: I also recommend to use ABSOLUTE paths in all commands.
    1 point
  18. @DonChunior If you check the Geckodriver console, does it provide any additional details?
    1 point
  19. @DonChunior I haven't used that browser, so I'm not sure how much help I can be. I did have a few questions / comments -- You are using an older version of the Webdriver UDF. Please update to the latest version (0.3.0.1) There's a newer version of the WinHTTP UDF. Grab the source from here. What version of Geckodriver are you attempting to use? Why the switch from port 4444 to 9150?
    1 point
  20. @FrancescoDiMuro https://www.autoitscript.com/forum/index.php?showtopic=135994 https://www.autoitscript.com/forum/index.php?showtopic=83355 Edit : You will find the discussion under : https://autoit.de/index.php?thread/86586-windows-aufgabenplanung-per-schtasks-exe-einen-task-erstellen-und-abfragen/&pageNo=1 BTW : After years of reading, this is my first post here πŸ™‚. Edit 2 : @FrancescoDiMuro Thank you for your friendly welcome. I'm editing this in my post here because I don't want to disturb the main thread . Greetings Musashi
    1 point
  21. Try this: ;code by UEZ #include <Clipboard.au3> #include <ScreenCapture.au3> $err = False $hHBITMAP = _ScreenCapture_Capture("", 0, 0, 100, 100) If Not _ClipBoard_Open(0) Then $err = @error $err_txt = "_ClipBoard_Open failed!" EndIf If Not _ClipBoard_Empty() Then $err = @error $err_txt = "_ClipBoard_Empty failed!" EndIf If Not _ClipBoard_SetDataEx($hHBITMAP, $CF_BITMAP) Then $err = @error $err_txt = "_ClipBoard_SetDataEx failed!" EndIf _ClipBoard_Close() _WinAPI_DeleteObject($hHBITMAP) If Not $err Then MsgBox(0, "Information", "Image put to clipboard!", 10) Else MsgBox(0, "Error", "An error has occured: " & $err_txt, 10) EndIf Exit You can change ScreenCapture_Capture() to _ScreenCapture_CaptureWnd(), the result should be the same. For capturing an area of your desktop you can use this: Br, UEZ
    1 point
  22. AdmiralAlkex

    3D Array

    Have you used a 1d or 2d array? Just do the same but with 3 dimensions. $avArray1d[1] $avArray2d[1][1] $avArray3d[1][1][1] If you are still unsure about anything, there's a Array Tutorial in the wiki you could look at Sorry, but I'm too confused by your description of the "second" and third" -dimension to answer that. Person? Permissions? Resource? Maybe a drawing or something would help
    1 point
×
×
  • Create New...