Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 02/09/2018 in all areas

  1. Danp2

    winhttp ExitLoop issue

    This is what you originally stated. That is the outer-most loop, so the looping stops entirely when you use the code I posted. If you want that outer loop to continue, then reduce the ExitLoop value by 1.
    1 point
  2. JohnOne

    winhttp ExitLoop issue

    For $m = 0 To UBound($a) - 1 For $X = 0 To UBound($b) - 1 For $i = 0 To UBound($c) - 1 $con = Connect($a[$m], $b[$X] & $c[$i]) $error = @error ; <============================== ConsoleWrite(" Line Connect : " & @ScriptLineNumber & " -> " & $a[$m] & " " & $b[$X] & " " & $c[$i] & @CRLF) If $error = 1 Then ExitLoop EndIf Next Next Next
    1 point
  3. Danp2

    winhttp ExitLoop issue

    @youtuber What's the issue? The ConsoleWrite comes before the line with ExitLoop, so it appears to me that the loop exited as planned.
    1 point
  4. Danp2

    winhttp ExitLoop issue

    You'll need to provide the optional level parameter to exit all three loops -- ExitLoop 3
    1 point
  5. Remember AutoIt uses Unicode (actually UCS2), so your script won't work in many use cases, assuming there is some.
    1 point
  6. The ConsoleWrite is resetting the error condition, so it will never exit the loop. Hence, get rid of it, or move it elsewhere in your script.
    1 point
  7. Danp2

    winhttp ExitLoop issue

    Remove the ConsoleWrite in the Connect function. Otherwise, you lose the value of @error.
    1 point
  8. Get rid of or move the ConsoleWrite before the check of @error
    1 point
  9. If it is not working from the run command, as was stated, sounds like a PowerShell issue. Perhaps you should ask on a PowerShell forum.
    1 point
  10. Use 7zip for applications. They have an exe you can use from installers and what not. I pack it with my installers to un zip my shit. But it can be used to zip stuff. Are use it to create my build archives
    1 point
  11. Ok, good. I'm sure someone could help with this issue, but it's not an autoit issue. Maybe use the -command parameter? else you have to keep googleing, or go to a powershell forum
    1 point
  12. If you run the exact command in the run window, does it execute fully? windowskey +r
    1 point
  13. I have now also added usage instructions for Add Book & All Formats To Calibre in the first post, spoiler sections. CELEBRATING - My good buddy TheDcoder has just advised me of my 9,999 post status. So I guess this will be number 10,000. TOP
    1 point
  14. And here is optimized version avoiding multiple calls of GUICtrlRead() on the same control ID, removed unnecesary code and also added Round($lengthinmm,3) #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <GUIListBox.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <ComboConstants.au3> #Region ### START Koda GUI section ### Form=c:\users\ash\desktop\programmingsheeet\mccampbell helper\sampleloop.kxf $Form1_1 = GUICreate("Form1", 407, 190, 223, 170) $TubingID = GUICtrlCreateInput("ID of tubing", 8, 72, 153, 21) $Label1 = GUICtrlCreateLabel("Sample Loop Calculator", 72, 24, 207, 27) GUICtrlSetFont(-1, 16, 400, 0, "Times New Roman") $Label2 = GUICtrlCreateLabel("Inside Diameter of tubing", 224, 72, 121, 17) $VolumeID = GUICtrlCreateInput("Desired Volume", 8, 104, 153, 21) $Label4 = GUICtrlCreateLabel("Sample Loop Desired Volume", 224, 104, 143, 17) ;~ $TubingIDUnits = GUICtrlCreateList("", 168, 72, 49, 19) $TubingUnitsID = GUICtrlCreateCombo("mm", 168, 72, 49, 19, BitOR($CBS_DROPDOWN, $CBS_AUTOHSCROLL)) GUICtrlSetData(-1, "cm|inches") $VolumeUnitsID = GUICtrlCreateCombo("mL", 168, 104, 49, 19, BitOR($CBS_DROPDOWN, $CBS_AUTOHSCROLL)) GUICtrlSetData(-1, "uL|Liters") $Label3 = GUICtrlCreateLabel("Length of tubing required is:", 16, 136, 138, 17) $FinalUnitsID = GUICtrlCreateCombo("mm", 168, 136, 49, 19, BitOR($CBS_DROPDOWN, $CBS_AUTOHSCROLL)) GUICtrlSetData(-1, "cm|inches") $Answer = GUICtrlCreateLabel("", 224, 136, 160, 30) $GO = GUICtrlCreateButton("Calculate!", 16, 160, 121, 25) GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif") GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $GO Calculate() EndSwitch WEnd Func Calculate() $Tubing = GUICtrlRead($TubingID) If $Tubing = "ID of tubing" Then MsgBox(0, "Error", "Please Enter Tubing Inside Diameter") EndIf $Volume = GUICtrlRead($VolumeID) If $Volume = "Desired Volume" Then MsgBox(0, "Error", "Please Enter Sample Loop Volume") EndIf ;~ Unit Conversions $TubingUnits = GUICtrlRead($TubingUnitsID) If $TubingUnits = "cm" Then $Tubing = $Tubing * 10 If $TubingUnits = "inches" Then $Tubing = $Tubing * 25.4 $VolumeUnits = GUICtrlRead($VolumeUnitsID) If $VolumeUnits = "uL" Then $Volume = $Volume / 1000 If $VolumeUnits = "Liters" Then $Volume = $Volume * 1000 ; Volume = pie * R^2 * h ; $Volume = ((IDtubing in mm)/2)^2 * pie * length of tubing in mm ;~ $TubingID = .1 ; in mm Local $radius = $Tubing / 2 ; in mm ConsoleWrite("Radius of ID Tubing is: " & $radius & "mm" & @CRLF) ConsoleWrite("Volume Requested is: " & $Volume & "mL" & @CRLF) Local $radiussq = $radius * $radius ConsoleWrite("Radius Squared is: " & $radiussq & @CRLF) Local $radiussqtimespie = $radiussq * 3.14159 ConsoleWrite("Radius Squared times pie is: " & $radiussqtimespie & "in mm^2" & @CRLF) Local $cubicmillimeters = $Volume * 1000 ;1000cubic millimeters = 1mL ConsoleWrite("Cubic millimeters is: " & $cubicmillimeters & @CRLF) Local $lengthinmm = $cubicmillimeters / $radiussqtimespie ConsoleWrite("Length required for 1000mL loop is: " & $lengthinmm & "'s mm of tubing" & @CRLF) Local $lengthininches = $lengthinmm / 25.4 ConsoleWrite("Length required for 1000mL loop is: " & $lengthininches & "'s inches of tubing" & @CRLF) $FinalUnits = GUICtrlRead($FinalUnitsID) If $FinalUnits = "cm" Then $lengthinmm = $lengthinmm / 10 If $FinalUnits = "inches" Then $lengthinmm = $lengthinmm / 25.4 GUICtrlSetData($Answer, Round($lengthinmm,3) & " is the length in " & $FinalUnits) EndFunc ;==>Calculate
    1 point
  15. Mat

    Reading memory "double"

    If _MemoryRead is returning 4 byte values (which I think it does, but I haven't used it in a long time) then to combine you should use BitShift and BitOr. For example: BitOr(BitShift(_MemoryRead(...), 32), _MemoryRead(...)) So this shifts the more significant dword up and combines it with the lower dword. You'll have to do some reading on endianness to work out what addresses each would be. Once you have that value, then you can convert it to floating point using the method above.
    1 point
  16. Zedna

    Simple Multi-GUI problem

    Definitely read this Wiki artickle: https://www.autoitscript.com/wiki/Managing_Multiple_GUIs
    1 point
  17. Added here: https://www.autoitscript.com/wiki/AutoIt_Programs#Misc.2FOthers.2FNot_yet_grouped
    1 point
  18. I started creating a multi tab GUI for my tool PENetworkManager some years ago and it is still in developement. It is used for Windows PE environments. I like clean tidy GUI's BTW: I saw there is/was a translation problem
    1 point
  19. @BatMan22, I have Win7 32bit and no issue found doing below code. #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Start() Sleep(10) Func Start() Global $Form1 = GUICreate("McCampbell Helper - Main Page", 615, 438, 192, 124) $Button1 = GUICtrlCreateButton("SampleLoopCalc", 24, 96, 265, 65) $Button2 = GUICtrlCreateButton("VolumeConv", 24, 176, 265, 49) $Button3 = GUICtrlCreateButton("SurfaceAreaConv", 32, 240, 257, 49) $Button4 = GUICtrlCreateButton("ConcentrationConv", 32, 304, 257, 49) GUISetState() While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 GUIDelete($Form1) SampleLoopCalc() Case $Button2 GUIDelete($Form1) VolumeConv() Case $Button3 GUIDelete($Form1) SurfaceAreaConv() Case $Button4 GUIDelete($Form1) ConcentrationConv() EndSwitch WEnd EndFunc ;==>Start Func SampleLoopCalc() $Form2 = GUICreate("Sample Loop Volume Calculator", 615, 438, 192, 124) GUISetState(@SW_SHOW, $Form2) WinActivate($Form2, "") While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE GUIDelete($Form2) Start() EndSwitch WEnd EndFunc ;==>SampleLoopCalc Func VolumeConv() $Form3 = GUICreate("Volume Converter", 615, 438, 192, 124) GUISetState(@SW_SHOW, $Form3) WinActivate($Form3, "") While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE GUIDelete($Form3) Start() EndSwitch WEnd EndFunc ;==>VolumeConv Func SurfaceAreaConv() $Form4 = GUICreate("Surface Area Converter", 615, 438, 192, 124) GUISetState(@SW_SHOW, $Form4) WinActivate($Form4, "") While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE GUIDelete($Form4) Start() EndSwitch WEnd EndFunc ;==>SurfaceAreaConv Func ConcentrationConv() $Form5 = GUICreate("Concentration Converter", 615, 438, 192, 124) GUISetState(@SW_SHOW, $Form5) WinActivate($Form5, "") While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE GUIDelete($Form5) Start() EndSwitch WEnd EndFunc ;==>ConcentrationConv
    1 point
  20. Subz

    Simple Multi-GUI problem

    Not sure if your code is the same, but I can't trigger the behaviour although I'm on Windows 10 1703 x64 Enterprise: #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Start() Func Start() Global $Form1 = GUICreate("McCampbell Helper - Main Page", 615, 438, 192, 124) $Button1 = GUICtrlCreateButton("SampleLoopCalc", 24, 96, 265, 65) $Button2 = GUICtrlCreateButton("VolumeConv", 24, 176, 265, 49) $Button3 = GUICtrlCreateButton("SurfaceAreaConv", 32, 240, 257, 49) $Button4 = GUICtrlCreateButton("ConcentrationConv", 32, 304, 257, 49) GUISetState() While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 GUIDelete($Form1) SampleLoopCalc() Case $Button2 GUIDelete($Form1) VolumeConv() Case $Button3 GUIDelete($Form1) SurfaceAreaConv() Case $Button4 GUIDelete($Form1) ConcentrationConv() EndSwitch WEnd EndFunc ;==>Start Func SampleLoopCalc() $Form2 = GUICreate("Sample Loop Volume Calculator", 615, 438, 192, 124) GUISetState(@SW_SHOW, $Form2) WinActivate($Form2) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE GUIDelete($Form2) Start() EndSwitch WEnd EndFunc ;==>SampleLoopCalc Func VolumeConv() $Form3 = GUICreate("Volume Converter", 615, 438, 192, 124) GUISetState(@SW_SHOW, $Form3) WinActivate($Form3) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE GUIDelete($Form3) Start() EndSwitch WEnd EndFunc ;==>VolumeConv Func SurfaceAreaConv() $Form4 = GUICreate("Surface Area Converter", 615, 438, 192, 124) GUISetState(@SW_SHOW, $Form4) WinActivate($Form4) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE GUIDelete($Form4) Start() EndSwitch WEnd EndFunc ;==>SurfaceAreaConv Func ConcentrationConv() $Form5 = GUICreate("Concentration Converter", 615, 438, 192, 124) GUISetState(@SW_SHOW, $Form5) WinActivate($Form5) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE GUIDelete($Form5) Start() EndSwitch WEnd EndFunc ;==>ConcentrationConv
    1 point
  21. Have you taken into account @CR and @LF of the form? You may need to do a StringReplace or StringRegExReplace of the InnerHTML first before using _StringBetween alternatively you could also use something like: #include <IE.au3> $oiE = _IECreate("http://somesite.com", 1) $oTRS = _IETagNameGetCollection($oiE, "tr") For $oTR in $oTRS If $oTR.InnerText = "Mensagem: " Then MsgBox(0,'', "InnerHTML = " & $oTR.nextElementSibling.innerHTML) MsgBox(0,'', "InnerText = " & $oTR.nextElementSibling.innerText) EndIf Next
    1 point
  22. Add a check prior to the if statement using the array: Local $aOpera_Pos = WinGetPos($hOpera_Handle) If IsArray($aOpera_Pos) Then If $aOpera_Pos[0] <> $iLast_X Or $aOpera_Pos[1] <> $iLast_Y Then $iLast_X = $aOpera_Pos[0] $iLast_Y = $aOpera_Pos[1] WinMove($hGUI, '', $aOpera_Pos[0] + $aOpera_Pos[2] - 55, $aOpera_Pos[1]) EndIf EndIf Or like this: Local $aOpera_Pos = WinGetPos($hOpera_Handle) If IsArray($aOpera_Pos) And $aOpera_Pos[0] <> $iLast_X Or $aOpera_Pos[1] <> $iLast_Y Then $iLast_X = $aOpera_Pos[0] $iLast_Y = $aOpera_Pos[1] WinMove($hGUI, '', $aOpera_Pos[0] + $aOpera_Pos[2] - 55, $aOpera_Pos[1]) EndIf
    1 point
  23. Subz

    Simple Multi-GUI problem

    Just a quick glance but I see that when you click a button, the new form function, you hide $Form1 and then delete $Form1 and then you use GuiSetState(@SW_SHOW, $Form1) during exit, which no longer exists and then call the Start() function which recreates $Form1. So either remove GuiDelete($Form1) and the Start() function from $GUI_EVENT_CLOSE and just use @SW_HIDE/@SW_SHOW for the form or delete the GUISetState(@SW_HIDE, $Form1) at the top of your function and GUISetState(@SW_SHOW, $Form1) from $GUI_EVENT_CLOSE. Hope that makes sense.
    1 point
  24. Run the script with #requireadmin so you have access to your local directories. When running as admin, do a DriveMapAdd as the shares admin user. Now you are admin in scope locally, and on your share, and the copy should be just fine using the drive letter you set. After mapping the drive, you can open it in an explorer window via your script, and verify you do in fact have access to the directory you are attempting to copy. Explained: when you are running as your local|domain user that you login as, you already have access to the drive without the mapping. When you are running as admin, you are NOT running as your local|domain user, and your local admin does NOT have access to the share, nor any mapped drives. So you can run without #requireadmin, and copy to a folder that doesn't require local administrator rights (not protected folders), or run as admin, and map the drive. This is a windows security thing, and not an autoit 'bug'. And just to say this in general...if you think something IS a bug, I'd bet it's actually a user error :).
    1 point
  25. Jon

    AutoIt v3.3.14.3 Released

    AutoIt v3.3.14.3 has been released. Thanks to everyone involved, both visible and behind the scenes. Download it here. Complete list of changes: History
    1 point
  26. I did not create this, but the GUI for LinuxLive USB Creator is amazing! The cherry on top is that it is made in AutoIt! This is what got me into looking into AutoIt, and the rest is history
    1 point
  27. water

    Active Directory UDF (II)

    Thanks for this function I'm thinking about to extend the UDF with a function to delete objects plus leaf nodes and OUs including all contained objects/leafs/subOUs. This function will be based upon your function plus the ideas I found here: http://www.selfadsi.org/delete.htm What do you (and others) think? Is such a function needed? If yes, is anyone willing to test on a test system? I'm an ordinary user so only have read access to our AD Please click the "Like this" button in the lower right corner of this post. So I know how many of you would like to see this function implemented.
    1 point
  28. You want to upload to https? That UDF can't handle that. But, you can do it this way: #include "WinHttp.au3" $sAddress = "http://www.testbed.loc:443/test_script.php?action=upload" ; target $sFileToUpload = "testuploadfile3.doc" $sForm = _ '<form action="' & $sAddress & '" method="post" enctype="multipart/form-data">' & _ ' <input type="file" name="uploadedfile"/>' & _ ; '</form>' ; Initialize and get session handle $hOpen = _WinHttpOpen() $hConnect = $sForm ; will pass form as string so this is for coding correctness because $hConnect goes in byref ; Fill form $sHTML = _WinHttpSimpleFormFill($hConnect, $hOpen, Default, "name:uploadedfile", $sFileToUpload) If @error Then MsgBox(4096, "Error", "Error number = " & @error) Else ConsoleWrite($sHTML & @CRLF) MsgBox(0, "Info", "Data received:" & @CRLF & $sHTML & @CRLF) EndIf ; Close handles _WinHttpCloseHandle($hConnect) _WinHttpCloseHandle($hOpen) Just set correct address. I left what that guy in the other thread used, which doesn't make sense because port 433 is specified for http. It should be either $sAddress = "https://your.domain.com/test_script.php?action=upload" ; target Or $sAddress = "http://your.domain.com/test_script.php?action=upload" ; target ...for normal configurations.
    1 point
  29. Hi @SaeidN, I read this post, whilst in search of my own answers. And I have sympathy for you regarding the unpleasant responses/tone from some people. Don't worry, it's not just you - I have read hundreds of forum posts on this forum, and many others have suffered the same. It's a shame really, as this has prevented me (for many years) from creating an account here, and participating with this community. Let's hope I don't regret this decision! As you've also encountered, many of the examples provided in responses to peoples questions, simply don't work "as is" (often they're bits and pieces of code that's copied from a script which has dependencies in other scripts). Since the person posting the question clearly wont already know how the solution works, it's tough road ahead to try and understand it, without having a working example. Regarding your main question - Yes, It's possible to ImageSearch a background window and passively control it. Regarding your question about understanding the functions in ImageSearch - Image search should come with 2 files: ImageSearchDLL.DLL, and ImageSearch.au3. Open/Edit the AU3 script, it provides some basic information about how it works, and you can see all the functions it has (which you can call), and what parameters they take. For your purpose, the main "_imageSearch" functional is all you want. *Make sure you get the version of ImageSearch which actually supports searching in another image instead of on screen, this is not clear anywhere, but the original version I had does not have this additional variable in the AU3 script info, nor does it work when you try to search in another Image (image in memory or on file). I am building a framework, which when finished will be utilised the same way you would utilise _imageSearch, except it is designed to fill all the obvious missing features, such as targeting a background window for search and passively clicking. In my frame work, I have been adding notes/code which will avoid confusing issues which many people struggle with, and are given the wrong answer most times (I know I try every wrong answer until I sorted it for myself). So far all these features work, except for MouseDrag on background window (which I am currently working to resolve). You've probable already noticed that ControlClick doesn't support individually; MouseDown, MouseMouse, or MouseUp, thus you cannot do a mouse drag (A simple click on the spot works fine). I'm currently testing "_SendMessage" and directly calling the $User32 DLL itself (PostMessage / SendMessage), to send a standard LeftButton click to MSPaint but not a single one of the examples has worked for me yet. Anyhow, shortly I will now post the scripts which I have built so far:
    1 point
  30. engine

    Local account UDF

    This is my AutoIt Local account UDF. Is supposed to work on all MS OS from Windows 2000 trough Vista. LocalAccount.au3
    1 point
×
×
  • Create New...