Jump to content

Leaderboard

Popular Content

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

  1. 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 :).
    3 points
  2. TV-Show-Manager is a small, easy to use application that manages all your favorite tv shows. It is a perfect program for you, if you like watching many tv-shows and need help with keeping track of the airdates and times. Features Manage all your favorite TV-Shows with a single program See all airing times of your shows and how many days/hours/minutes you have to wait for the next episode Don't get confused with all the time zones, TV-Show-Manager converts the airing times to your timezone TV-Schedule - See what shows will be airing in the next 48 hours in US an UK Windows 10 inspired user interface - Customize the user interface with different themes See if your favorit tv shows are canceled or renewed with colored status in your list. Download episodes with one click! (Warning: See notes in full description) Supports link collection for one-click hosters and torrents. (Warning: See notes in full description) Stream episodes with one click (Warning: See notes in full description) I have completely rewritten the program over the past months. It uses the latest version of my MetroGUI UDF and demonstrates what you can do with Autoit if you put in enough time You can download the script and the main program from sourceforge. I have removed all download link collection and other anti-bot-protection bypass features from the script that might be used to damage the site owners. So please don't ask for any of these functions on this forum. Images: Download Script and Main program: https://sourceforge.net/projects/tvshowcountdown/files/
    2 points
  3. Your screenshot is for a different ID...try: $hWindow = WinGetHandle("LiveClient") ConsoleWrite($hWindow & @CRLF) WinSetState($hWindow,"",@SW_MAXIMIZE) $hControl = ControlGetHandle($hWindow,"",134) ConsoleWrite($hControl & @CRLF) ControlClick($hWindow,"",$hControl) Verify the console outputed handles are the proper ones in the spy tool. Note: I am intentionally removing the class as the window identifier, because that's so generic it can grab a ton of windows, which may cause you debugging nightmares later.
    2 points
  4. $hWindow = WinGetHandle("LiveClient") ConsoleWrite($hWindow & @CRLF) WinSetState($hWindow,"",@SW_MAXIMIZE) Look at the help file for autoitsetoptions...the key send ones. There is one for the break between character sends, and one for the length of the send of each character. When the functions are in codeblocks, you can click them to see the helpfile...or if they are in scite, click them, and press F1 to see the helpfile.
    2 points
  5. Jos

    A Non-Strict JSON UDF (JSMN)

    You could use this logic and turn that into a Func: #include <json.au3> Global $data = FileRead("test.json") Global $object = json_decode($data) Global $i = 0 While 1 $product_id = json_get($object, '[' & $i & ']') If @error Then ExitLoop $i += 1 WEnd ConsoleWrite('Number of records:' & $i & @CRLF) Jos
    1 point
  6. 1 point
  7. try pressing that button that makes it go full screen that you pointed out. What does the Info Tool say about that?
    1 point
  8. Welcome to the world of Send(). It is not reliable. Could be any number of things. Use ControlClick for best results, if possible.
    1 point
  9. I tested your code with admin. works great on a UNC drive/path.... hmmmm permissions issues for you
    1 point
  10. try this WinWait("[CLASS:#32770]", "") Send("^f")
    1 point
  11. Jos

    A Non-Strict JSON UDF (JSMN)

    I don't understand the question as the json_dump UDF I wrote should tell you exactly what the keys is for a specific field. It helps when you post some example code, define what you expect and what is going wrong. Jos
    1 point
  12. Jos

    A Non-Strict JSON UDF (JSMN)

    Thanks, that helps. So the returned information is not an object so that is why you get that error. What are you exactly after in terms of a count for this json data? Jos
    1 point
  13. I stopped neverending upgrading of my AutoIt when I had too many projects (some really big) where neverending fixing/testing all those script breaking changes in all of them (at least thouse where I could do changes/additions in future) would take too many time.
    1 point
  14. You are ending up with an array of arrays... easier solution, use _FileReadToArray #include <Array.au3> #include <File.au3> Local $aArray _FileReadToArray("E:\AutoIT\Programs\Test\New Text Document.csv", $aArray, 1, " ") _ArrayDisplay($aArray) MsgBox(0,"",$aArray[1][2]) You can specify multiple delimiter characters in the final argument.
    1 point
  15. Thank you Danp2... your code worked perfectly. I understand now where I was wrong.
    1 point
  16. @Danp2 Thank you I found the error in my code, I fixed it.
    1 point
  17. Subz

    Input cannot be selected

    Your labels are over the top of your input fields, change 284 to 140 and it should work fine.
    1 point
  18. If I correctly understand your questione then the solutin is the @Compiled macro. @Compiled Returns 1 if script is a compiled executable or an .a3x file; returns 0 if an .au3 file.
    1 point
  19. Mat

    Reading memory "double"

    I don't think Number(###, 3) will work in this case, as it will still treat the integer value at that memory location as a number, rather than an IEEE754 encoded value. The Dec function does do this conversion though, if you give it a string value. $xMem = 0x40151CAC083126E9 $sMemHex = String(Hex($xMem, 16)) $nNum = Dec($sMemHex, 3) MsgBox(0, $xMem, $nNum) In this case, the expected answer is 5.278. For completeness, to go the other way you can just use the Hex function on a double value.
    1 point
  20. Zedna

    Reading memory "double"

    Maybe try to read 2 bytes separatelly and then combine these two values in AutoIt: $Value1 = Number(_MemoryRead(0x1FECD474, $DllInformation),1) $Value2 = Number(_MemoryRead(0x1FECD475, $DllInformation),1) or try this: $Value = Number(_MemoryRead(0x1FECD474, $DllInformation),3)
    1 point
  21. Problem solved!! Thanks to you Danp2. It took a lot sooner then I thought!! I read about the IE Embedded Control Versioning(use IE9+ and HTML5 in a GUI) I added the UDF IE_EmbeddedVersioning in my include folder. Then I changed my registry so IE can be recognized as IE11. Which is the version of my IE. This is the registry path I changed. HKEY_CURRENT_USER\SOFTWARE\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION I put in 11001. Now everything rendered perfectly in a GUI. Once again, thank you Danp2!!
    1 point
  22. This would be controlled using the DesiredCapabilities parameter that gets passed to _WD_CreateSession. Each driver has it's own implementation method. You can gather more details at these links -- https://github.com/mozilla/geckodriver https://sites.google.com/a/chromium.org/chromedriver/capabilities
    1 point
  23. Yes, you can fake the command line in SciTE. Try Shift-F8.
    1 point
  24. For the inputbox issue use this line to fix it. #pragma compile(inputboxres, true) The default is false which specifies that you don't include the resources for inputboxes in a compiled script, which saves space if you're not going to be using an inputbox.
    1 point
  25. JamesDover

    SMTP with GMAIL

    Hello, I'm trying to send an email through gmail IMAP. It doesn't seem to be working correctly. Could the two step verification be causing the issue? It says it sent it but i never receive it. Cheers #include <file.au3> ;AutoIt Error Object (Prevents script from crashing if an unexpected error occurs Global $oMyError = ObjEvent("AutoIt.Error", "ErrorDebug") ;;SMTP Email Info Local $Subject = "[AutoIt] Subject" Local $Username = "yourusername@gmail.com" Local $Password = "p@5s" Local $SmtpServer = "smtp.gmail.com" Local $FromName = "SomeName" Local $IPPort = 465 Local $ssl = 1 Local $ToAddress = "to@hotmail.com" Local $FromAddress = "autoit@gmail.com" Local $AttachFiles = "" Local $CcAddress = "" Local $BccAddress = "" Local $Importance = "High" Local $body = "This is the body of the message" Local $oMyRet[1] Local $objEmail _INetSmtpMailCom($SMTPSErver,$FromName,$FromAddress,$ToAddress,$Subject,$Body,"","","",$Importance,$Username,$password,$IPPort,$SSL) Func _INetSmtpMailCom($s_SmtpServer, $s_FromName, $s_FromAddress, $s_ToAddress, $s_Subject = "", $as_Body = "", $s_AttachFiles = "", $s_CcAddress = "", $s_BccAddress = "", $s_Importance = "High", $s_Username = "", $s_Password = "", $IPPort = 25, $ssl = 0) $objEmail = ObjCreate("CDO.Message") $objEmail.From = '"' & $s_FromName & '" <' & $s_FromAddress & '>' $objEmail.To = $s_ToAddress Local $i_Error = 0 Local $i_Error_desciption = "" If $s_CcAddress <> "" Then $objEmail.Cc = $s_CcAddress If $s_BccAddress <> "" Then $objEmail.Bcc = $s_BccAddress $objEmail.Subject = $s_Subject If StringInStr($as_Body, "<") And StringInStr($as_Body, ">") Then $objEmail.HTMLBody = $as_Body Else $objEmail.Textbody = $as_Body & @CRLF EndIf If $s_AttachFiles <> "" Then Local $S_Files2Attach = StringSplit($s_AttachFiles, ";") For $x = 1 To $S_Files2Attach[0] $S_Files2Attach[$x] = _PathFull($S_Files2Attach[$x]) ConsoleWrite('@@ Debug(62) : $S_Files2Attach = ' & $S_Files2Attach & @LF & '>Error code: ' & @error & @LF) ;### Debug Console If FileExists($S_Files2Attach[$x]) Then $objEmail.AddAttachment($S_Files2Attach[$x]) Else ConsoleWrite('!> File not found to attach: ' & $S_Files2Attach[$x] & @LF) SetError(1) Return 0 EndIf Next EndIf $objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 $objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = $s_SmtpServer If Number($IPPort) = 0 Then $IPPort = 25 $objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = $IPPort ;Authenticated SMTP If $s_Username <> "" Then $objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1 $objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = $s_Username $objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = $s_Password EndIf If $ssl Then $objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = True EndIf ;Update settings $objEmail.Configuration.Fields.Update ; Set Email Importance Switch $s_Importance Case "High" $objEmail.Fields.Item("urn:schemas:mailheader:Importance") = "High" Case "Normal" $objEmail.Fields.Item("urn:schemas:mailheader:Importance") = "Normal" Case "Low" $objEmail.Fields.Item("urn:schemas:mailheader:Importance") = "Low" EndSwitch $objEmail.Fields.Update ; Sent the Message ConsoleWrite("echo Sending" & @LF) If Not IsObj($objEmail) Then ConsoleWrite("echo error sending (not an object)" & @CRLF) $sendfailed = True Else $sendfailed = False $objEmail.Send EndIf ConsoleWrite("echo SENT" & @LF) If @error Then $sendfailed = True SetError(2) ;~ _ArrayDisplay($oMyRet, "MyRet") Return $oMyRet[1] EndIf $objEmail = 0 EndFunc ;==>_INetSmtpMailCom Func ErrorDebug() Local $HexNumber Local $strMsg $HexNumber = Hex($oMyError.Number, 8) $strMsg = "Error Number: " & $HexNumber & @CRLF $strMsg &= "WinDescription: " & $oMyError.WinDescription & @CRLF $strMsg &= "Script Line: " & $oMyError.ScriptLine & @CRLF FileWrite(@ScriptDir & "\" & @ScriptName & "_ErrorDebug.txt", "------------------[Error]------------------" & @LF & $strMsg & @LF & @LF) SetError(1) EndFunc ;==>ErrorDebug
    1 point
  26. Melba23

    [SOLVED] Inputbox Rules

    johnmcloud, To give you a bit of a hint, this will only accept upper and lowercase ABC characters: ; If there are any banned characters If StringRegExp($sText, "(?i)[^ABC]") Then ; Remove them GuiCtrlSetData($hInput, StringRegExpReplace($sText, "(?i)[^ABC]", "")) EndIf See if you can work it out yourself. Ask if you really get stuck - a minimum of 2 hours from now. M23
    1 point
  27. czardas

    [SOLVED] Inputbox Rules

    Here is an adaptation of a recent function I wrote which you might be able to use. #include <GUIConstants.au3> #include <WindowsConstants.au3> #include <Misc.au3> #Include <GuiButton.au3> _Input() Func _Input() Local $iError = 0 Local $sTitle = "Input Test" Local $hGUI = GUICreate($sTitle, 225, 55, Default, Default) Local $hInput = GUICtrlCreateInput("", 5, 5, 215, 20) GUICtrlSetLimit($hInput, 128) Local $hCancel = GUICtrlCreateButton("Cancel", 35, 30, 70, 20) Local $hOkay = GUICtrlCreateButton("OK", 120, 30, 70, 20) GUISetState(@SW_SHOW) $dll = DllOpen("user32.dll") While 1 $msg2 = GUIGetMsg() If $msg2 = $hCancel Or $msg2 = $GUI_EVENT_CLOSE Then ExitLoop $sUserInput = GUICtrlRead($hInput) If StringRegExp($sUserInput, '[|?&"<>]') Then If $iError = 0 Then GUICtrlSetBkColor($hInput, 0xFFA090) $iError = 1 EndIf ElseIf $iError = 1 Then GUICtrlSetBkColor($hInput, 0xFFFFFF) $iError = 0 EndIf If $msg2 = $hOkay Or (ControlGetFocus ($sTitle) = "Edit1" And _IsPressed("0D")) Then If $iError = 0 Then MsgBox(0, "Success", "The text is valid") ExitLoop Else MsgBox(262160, "Error", "The text you entered contains illegal characters.") _GUICtrlButton_SetFocus($hOkay) EndIf EndIf WEnd DllClose($dll) EndFunc
    1 point
  28. Melba23

    [SOLVED] Inputbox Rules

    johnmcloud, Here is a short example of how you might do it: #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <EditConstants.au3> #include <WinAPI.au3> Global $hInput $sInput = _InputBox("Title", "Prompt") MsgBox(0, "Input", $sInput) Func _InputBox($sTitle, $sPrompt) $hGUI = GUICreate($sTitle, 500, 500) GUICtrlCreateLabel($sPrompt, 10, 10, 480, 20) $hInput = GUICtrlCreateInput("", 10, 50, 480, 20) ; Limit the input to 10 characters GUICtrlSetLimit(-1, 10) $hButton_OK = GUICtrlCreateButton("OK", 10, 100, 80, 30) $hButton_Can = GUICtrlCreateButton("Cancel", 110, 100, 80, 30) GUISetState() GUIRegisterMsg($WM_COMMAND, "_WM_COMMAND") While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE, $hButton_Can Return SetError(1, 0, "") case $hButton_OK Return GUICtrlRead($hInput) EndSwitch WEnd EndFunc Func _WM_COMMAND($hWHnd, $iMsg, $wParam, $lParam) ; If it was an update message from our input If _WinAPI_HiWord($wParam) = $EN_CHANGE And _WinAPI_LoWord($wParam) = $hInput Then ; Read the text $sText = GUICtrlRead($hInput) ; If there are any banned characters If StringRegExp($sText, '&|||<|>|"') Then ; Remove them GuiCtrlSetData($hInput, StringRegExpReplace($sText, '&|||<|>|"', "")) EndIf EndIf EndFunc ;==>_WM_COMMAND Please ask if you have any questions. M23
    1 point
  29. GEOSoft

    GUI Input box

    That isn't posting relevent code. You don't seem to realize there are several reasons we might want to see the code beside the obvious one, I want to steal your ever so secretive code because... , well, just because. Personally I could care less about your code (I have some thanks), but at least post a snippet that demonstrates the problem and make sure the input is created exactly as you have it in your script.
    1 point
×
×
  • Create New...