Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 11/15/2019 in all areas

  1. Maybe you can use this function to dimm the color of the inactive window. Func ReduceRGBColorChannels($iColor, $fFactor = 0.5, $bAlpha = False) Local $a, $r, $g, $b $a = BitAND(0xFF, BitShift($iColor, 24)) $a = $a < 0 ? 0 : $a > 255 ? 255 : $a $r = BitShift(BitAND(0xFF0000, $iColor), 16) * $fFactor $r = $r < 0 ? 0 : $r > 255 ? 255 : $r $g = BitShift(BitAND(0xFF00, $iColor), 8) * $fFactor $g = $g < 0 ? 0 : $g > 255 ? 255 : $g $b = BitAND(0xFF, $iColor) * $fFactor $b = $b < 0 ? 0 : $b > 255 ? 255 : $b $a = $bAlpha ? $a * $fFactor : $a Return BitOR(BitShift($a, -24), BitShift($r, -16), BitShift($g, -8), $b) EndFunc Local $iColor = 0xFFABCDEF ConsoleWrite(Hex($iColor, 8) & " -> 0x" & Hex(ReduceRGBColorChannels($iColor), 8) & @CRLF)
    1 point
  2. faustf

    regexp why not match \r ?

    Amico Fritz @Musashi thankz , you win a beer , when you will come in italy (near vinci , do you know leonardo? .....probably yes), Thanks, I get up in the morning to improve myself, I go to sleep hoping to have done so.
    1 point
  3. In that image, they've combined the front window's colors with the black of the background by making the edges of the window transparent. What I'm confused about now though, is whether you're trying to re-create this effect on the edges of a GUI for a program or simulate this inside of the program that you've posted. I have no idea on the first, but with the second, I think I can help... see this thread.
    1 point
  4. To make it clear right from the beginning : This advice is meant to be a serious help. I do not intend to insult or disparage @faustf in any way. @faustf : From what I can determine, your native language is Italian (which is a beautiful language ). My problem (and maybe that of others as well) is, that sometimes I cannot even figure out what you are trying to say (in English). Perhaps it may help you, if you take a look at the following website (it's free) : https://www.deepl.com/translate As far as I can judge, the quality of the translations is better than Google. You can e.g. click on individual words in the translation and a selection of alternative words will appear. I use this site occasionally myself as a final control for long texts. My English also is far from being perfect .
    1 point
  5. seadoggie01

    Hotkey Problem

    You got the right idea when you removed the hotkey before sending the text, but you failed to unregister both hotkeys, which causes both hotkey functions to fire, I imagine Basically, this happens? You run the script and press 1... This launches HotKey1, which unregisters 1 as a hotkey it then types testkey1_1testkey1_2 and launches HotKey2 HotKey2 unregisters itself and sends all it's text HotKey1 continues
    1 point
  6. Nine

    Hotkey Problem

    No wonder that the script is messing with the 2 hotkeys. Using Send is just like typing. So in hot 2 there a few 1 and in hot 1 there a few 2.
    1 point
  7. The most likely cause is the _DateAdd() function is failing, which would make $sNewDate = 0. Since you do a ClipPut() of $sNewDate, that is why you are probably seeing a "0". And the reason the _DateAdd() is probably failing is because the value in $sDateField is most likely invalid. If you would add error checking after your function calls it would be much easier for you to debug. The snippet below will let you confirm or rule out my suspicion about _DateAdd() failing. It will generate a console message and exit if the function fails. It will also display the value in $sDateField. ;F6 Func _Przelozenie() ToolTip("PRZEŁOŻENIE ROZMOWY NA ZA TYDZIEŃ PO 17:00", 0, 0) MouseMove (98, 76) MouseClick ("left") Sleep(540) MouseMove (296, 506) MouseClick ("left") Sleep(540) ClipPut("") MouseClickDrag ( "left", 335, 465, 238, 460, 2) ; (2 is speed) Sleep(10) Send ("^c") ; copy field in clipboard Sleep(10) ConsoleWrite('date() -> Send ("^c")' & @CRLF) $sDateField = ClipGet () ; retrieve date string ConsoleWrite('date() -> $sDateField = ClipGet () => ' & $sDateField & @CRLF) $sDateField = StringReplace ($sDateField, "-", "/") ; field must be formatted YYYY/MM/DD ConsoleWrite('date() -> $sDateField = StringReplace ($sDateField, "-", "/")' & $sDateField & @CRLF) $sNewDate = _DateAdd ("D", 7, $sDateField) ; add 7 days If @error Then ConsoleWrite("ERROR: _DateAdd() failed. @error = " & @error & @CRLF) ConsoleWrite("ERROR: $sDateField = " & $sDateField & @CRLF) Exit -1 EndIf ConsoleWrite('date() -> $sNewDate = _DateAdd ("D", 1, $sDateField)' & $sDateField & @CRLF) $sNewDate = StringReplace ($sNewDate, "/", "-") ; replacing strings back ConsoleWrite('date() -> $sNewDate = StringReplace ($sNewDate, "/", "-")' & $sNewDate & @CRLF) ClipPut($sNewDate) ConsoleWrite('date() -> ClipPut($sNewDate)' & $sNewDate & @CRLF) Sleep(10) Send ("^v") ; paste field ConsoleWrite('date() -> Send ("^v")' & @CRLF) Sleep(10) MouseClickDrag ( "left", 462, 465, 409, 461, 2) ; (2 is speed) Local $sRandomTime $sRandomTime = StringFormat("%02i:%02i", Random(17, 19, 1) , Random(0, 55, 1)) ClipPut($sRandomTime) Sleep(10) Send ("^v") ; paste hour Sleep(10) ClipPut("") MouseMove (590, 871) MouseClick ("left") Send("{Enter}") MouseMove (167, 809) MouseClick ("left") Sleep(2) MouseMove (245, 867) Sleep(1000) MouseClick ("left") ToolTip("", 0, 0) MouseMove (600, 520) EndFunc ;==>_Przelozenie
    1 point
  8. Have you looked at the ClipPut() function? Take a look at the Remarks section.
    1 point
  9. Do the date first then. Also you do not need the mouseclickdrag with the hour part since you don't use the original value anyway. Just double click the hour instead and paste your random time.
    1 point
  10. The clipget in the hour section is useless, do you know why ?
    1 point
  11. I meant look into the variables e.g. : ConsoleWrite('date() -> $sDateField = ClipGet () => ' & $sDateField & @CRLF)
    1 point
  12. The (SciTE-)console is the bottom window in the SciTE editor.
    1 point
  13. Now you need to learn how to debug a script. In the date part, insert after each line a ConsoleWrite that shows the current value of the variables you are manipulating. Run it and show us the result of the Scite console, along with the modified script... EDIT : what is that ? Send ("{Delete}")
    1 point
  14. hmmm, there is 2 clipget in hour part...
    1 point
  15. You must have saved the script at least once, otherwise the mechanism won't work.
    1 point
  16. To the other members : "I would like to apologize for posting three replies in a row, but this might be useful for beginners ." @CzarnyKhaki : I haven't mentioned one variation to open the help yet. Move the cursor to the desired command or function in the source code below (i.e. StringReplace). #include <Date.au3> Const $x = 300, $y = 200 ; to be modify for position of the date field MouseClick ("left", $x, $y, 2, 1) ; double click the date field to highlight it Send ("^c") ; copy field in clipboard $sDateField = ClipGet () ; retrieve date string $sDateField = StringReplace ($sDateField, "-", "/") ; field must be formatted YYYY/MM/DD $sNewDate = _DateAdd ("D", 1, $sDateField) ; add one day MsgBox ($MB_SYSTEMMODAL,"",$sNewDate) Now simply click on it or press right mouse button -> open new window or tab.
    1 point
  17. See Help : HotKeySet The following hotkeys cannot be set: ASC nnnn Cannot be used as in Send(). It will use "A" first char as Send() does when the "{...}" is invalid. Ctrl+Alt+Delete It is reserved by Windows F12 It is also reserved by Windows, according to its API. NumPad's Enter Key Instead, use {Enter} which captures both Enter keys on the keyboard. Win+B,D,E,F,L,M,R,U; and Win+Shift+M These are built-in Windows shortcuts. Note: Win+B and Win+L might only be reserved on Windows XP and above. Alt, Ctrl, Shift, Win These are the modifier keys themselves! Other Any global hotkeys a user has defined using third-party software, any combos of two or more "base keys" such as '{F1}{F2}', and any keys of the form '{LALT}' or '{ALTDOWN}'.
    1 point
  18. Are you running the Full Version of SciTE : SciTE4AutoIt3.exe ? https://www.autoitscript.com/site/autoit-script-editor/downloads/
    1 point
  19. You can start the help in SciTE with F1 (you probably already know that 😀) . As an alternative, you can also start the AutoIt.chm file directly from the AutoIt folder. Go on Search and enter one or more keywords. "Display an Array" e.g. shows a matchlist with the function _ArrayDisplay right at the beginning. Doesn't that work for you?
    1 point
  20. Yes I know. This is your homework to complete the script with what I gave you. Open help file look under at the functions that I used. You will find a way to do it. A little effort on your part to learn a new method will benefit you for sure...
    1 point
  21. #include should be set at the very top of your script...
    1 point
  22. Really ? Well, since you are already using mouse* function. You could do something like this : #include <Date.au3> Const $x = 300, $y = 200 ; to be modify for position of the date field MouseClick ("left", $x, $y, 2, 1) ; double click the date field to highlight it Send ("^c") ; copy field in clipboard $sDateField = ClipGet () ; retrieve date string $sDateField = StringReplace ($sDateField, "-", "/") ; field must be formatted YYYY/MM/DD $sNewDate = _DateAdd ("D", 1, $sDateField) ; add one day MsgBox ($MB_SYSTEMMODAL,"",$sNewDate)
    1 point
  23. Right click on the date field, and choose Inspect popup menu option (should be something similar like this, I have french browser). Then show us the HTML code of the field.
    1 point
  24. Oh, that is an Internet Explorer application. You should carefully look at IE.au3 UDF. You maybe able to automate everything without mouse* functions. Would make your script much more robust. But for now, show DOM of the date, we should be able to read it easily.
    1 point
  25. Take a look at ControlClick.
    1 point
  26. Well, the pause func should stay in the function when Pause is True. Now the function is simply a toggle of a variable and a display of messages... Edit : Give meaningful name to variables is a good idea !
    1 point
  27. HotKeySet("{ESC}", "close") HotKeySet("{F2}", "pause") HotKeySet("{F5}", "Fax") Global $g_bClick = True MsgBox(64, "Autokonsultant", "ESC = Zamkniecie. F2 = pauza. F5 = Fax.") While 1 Sleep(100) WEnd Func close() Exit EndFunc ;==>close Func pause() If $g_bClick = False Then $g_bClick = True ToolTip("Autokonsultant chodzi", 0, 0) ConsoleWrite("Autokonsultant chodzi -> Running..." & @CRLF) Else $g_bClick = False ToolTip("Autokonsultant zapauzowany", 0, 0) ConsoleWrite("Autokonsultant zapauzowany -> Paused..." & @CRLF) EndIf EndFunc ;==>pause Func Fax() MouseMove (25, 76 ) ConsoleWrite('Fax() -> MouseMove (25, 76 )' & @CRLF) EndFunc ;==>Fax Next time provide the error message !
    1 point
  28. You haven't declared the $click variable anywhere in your script. Suggest that you review the Variables entry in the help file.
    1 point
  29. Because you need to add statements telling the script to wait until one of the hotkeys was pressed. Usually this is a While loop - insert after MsgBox: While 1 Sleep(100) WEnd
    1 point
  30. Made it easier for people to understand how to edit this code to make it usable for them. #include <IE.au3> ;open survey ie link Local $oIE = _IECreate(url) ;change url to your specific url Local $dCSV = _IEGetObjById($oIE,objIDname) ;find obj id to click on specific to your page _IEAction ($dCSV,"click") ;click object e.g download button sleep(1000) ;focus download dialog - dont need to change any of this $hIE = WinGetHandle("[Class:IEFrame]") $hCtrl = ControlGetHandle($hIE,"","[Class:DirectUIHWND]") $aPos = ControlGetPos($hIE,"",$hCtrl) $x = $aPos[2]-160 $y = $aPos[3]-30 ;Use - dont need to change any of this WinActivate($hIE) ;doesn't work in the background ControlClick($hIE,"",$hCtrl,"primary",1,$x,$y) ;this only gives focus to the save button ControlSend($hIE,"",$hCtrl,"{down}") ;this does work once the save button is focussed ControlSend($hie, "", "[Class:DirectUIHWND]","a") ;save as - Dont need to change any of this except for filepath. WinActivate("Save As", "Save"); WinWaitActive("Save As", "Save", 10); ControlSetText("Save As", "", "Edit1", filepath); ControlClick("Save As", "", "&Save", "left", 1, 5, 5); sleep(100) ControlClick("Confirm Save As","","Button1", "left", 1, 0, 0); ;quit ie _IEQuit($oIE)
    1 point
×
×
  • Create New...