Jump to content

Move mouse and click script


Recommended Posts

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.

Link to comment
Share on other sites

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. 

Edited by Nine
Link to comment
Share on other sites

4 hours ago, CzarnyKhaki said:

it doesn't react to right mouse click

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)

 

Link to comment
Share on other sites

HotKeySet("{ESC}", "_Exit")
HotKeySet("{F1}", "_Przygotowanie")
HotKeySet("{F2}", "_Fax")
HotKeySet("{F3}", "_Odmowa")
HotKeySet("{F4}", "_Pomylka")
HotKeySet("{F5}", "_NiePracuje")
HotKeySet("{F6}", "_Przelozenie")
HotKeySet("{F7}", "_MialSpotkanie")
HotKeySet("{F8}", "_MaPolise")
HotKeySet("{F9}", "_OlewaNN")
HotKeySet("{F10}", "_NieUbezpieczaSie")
HotKeySet("{F11}", "_RODO")
HotKeySet("{F12}", "_UmawiaSie")
HotKeySet("{PAUSE}", "_TogglePause")


Global $g_bPaused = False

MsgBox(64, "AUTOKONSULTANT A**A", "Najpierw się zaloguj i wybierz kampanię. Następnie wciśnij F1.                Funkcje do zapamiętania (klawisze na klawiaturze):                                  ESC = Zamknięcie. F1 = Przygotowanie. F2 = Poczta głosowa. F3 = Odmowa rozmowy. F4 = Pomyłka. F5 = Nie ma stałego źródła dochodu. F6 = Przełożenie rozmowy na 17:55. Pause|Break = Pauza Autokonsultanta A**a.")


While 1
    Sleep(4)
WEnd


;ESC
Func _Exit()
    Exit
EndFunc   ;==>_Exit


;F1
Func _Przygotowanie()
    ToolTip("TRWA PRZYGOTOWANIE PROGRAMU", 0, 0)
    MouseClickDrag ( "left", 241, 240, 49, 15, 5)   ; (5 is speed)
    MouseClickDrag ( "left", 896, 531, 747, 980, 4) ; (4 is speed)
    MouseClickDrag ( "left", 739, 972, 745, 979, 2) ; (2 is speed)
    MouseMove (627, 44)
    ConsoleWrite('Fax() -> MouseMove (627, 44)' & @CRLF)
    MouseClick ("left")
    MouseMove (634, 570)
    MouseClick ("left")
    ToolTip("GOTOWE!", 658, 578)
    Sleep(1500)
    ToolTip("", 750, 990)
EndFunc   ;==>_Przygotowanie


;PAUSE
Func _TogglePause()
    $g_bPaused = Not $g_bPaused
    While $g_bPaused
        Sleep(4)
        ToolTip("AUTOKONSULTANT A***A ZAPAUZOWANY. WCINIŚNIJ Pause|Break ABY ODPAUZOWAĆ", 0, 0)
    WEnd
    ToolTip("", 0, 0)
EndFunc   ;==>_TogglePause


;F2
Func _Fax()
    ToolTip("POCZTA GŁOSOWA", 0, 0)
    MouseMove (25, 76)
    MouseClick ("left")
    Sleep(140)
    MouseMove (179, 477)
    Sleep(260)
    MouseClick ("left")
    MouseMove (229, 812)
    Sleep(260)
    MouseClick ("left")
    ToolTip("", 0, 0)
EndFunc   ;==>_Fax


;F3
Func _Odmowa()
    ToolTip("ODMOWA ROZMOWY", 0, 0)
    MouseMove (25, 76)
    MouseClick ("left")
    Sleep(240)
    MouseMove (179, 708)
    Sleep(260)
    MouseClick ("left")
    MouseMove (226, 811)
    Sleep(260)
    MouseClick ("left")
    ToolTip("", 0, 0)
EndFunc   ;==>_Odmowa


;F4
Func _Pomylka()
    ToolTip("POMYŁKA", 0, 0)
    MouseMove (25, 76)
    MouseClick ("left")
    Sleep(240)
    MouseMove (180, 611)
    MouseClick ("left")
    MouseMove (229, 812)
    Sleep(260)
    MouseClick ("left")
    ToolTip("", 0, 0)
EndFunc   ;==>_Pomylka


;F5
Func _NiePracuje()
    ToolTip("NIE MA STAŁEGO ŹRÓDŁA DOCHODU", 0, 0)
    MouseMove (168, 494)
    MouseClick ("left")
    Sleep(140)
    MouseMove (241, 600)
    MouseClick ("left")
    Sleep(240)
    MouseMove (175, 564)
    MouseClick ("left")
    Sleep(240)
    MouseMove (215, 674)
    MouseClick ("left")
    Sleep(240)
    MouseMove (177, 647)
    MouseClick ("left")
    Sleep(240)
    MouseMove (243, 728)
    MouseClick ("left")
    MouseMove (175, 673)
    Sleep(240)
    MouseClick ("left")
    MouseMove (240, 725)
    Sleep(240)
    MouseClick ("left")
    MouseMove (198, 574)
    Sleep(240)
    MouseClick ("left")
    MouseMove (265, 923)
    Sleep(240)
    MouseClick ("left")
    MouseMove (197, 467)
    Sleep(240)
    MouseClick ("left")
    MouseMove (223, 520)
    Sleep(190)
    MouseClick ("left")
    MouseMove (173, 493)
    Sleep(260)
    MouseClick ("left")
    MouseMove (206, 550)
    Sleep(260)
    MouseClick ("left")
    ToolTip("", 0, 0)
EndFunc   ;==>_Niepracuje


;F6
Func _Przelozenie()
#include <Date.au3>
    ToolTip("PRZEŁOŻENIE ROZMOWY NA JUTRO", 0, 0)
    MouseMove (98, 76)
    MouseClick ("left")
    Sleep(240)
    MouseMove (296, 506)
    MouseClick ("left")
    Sleep(190)
    MouseMove (226, 811)
    MouseClick ("left")
    MouseClickDrag ( "left", 462, 465, 409, 461, 2)   ; (2 is speed)
    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)
    MouseMove (590, 871)
    MouseClick ("left")
    MouseMove (167, 809)
    MouseClick ("left")
    Sleep(260)
    MouseMove (245, 867)
    Sleep(260)
    MouseClick ("left")
    ToolTip("", 0, 0)
EndFunc   ;==>_Przelozenie


;F7
Func _MialSpotkanie()
    ToolTip("JEST PO SPOTKANIU Z PRZEDSTAWICIELEM", 0, 0)
    MouseMove (167, 550)
    MouseClick ("left")
    Sleep(250)
    MouseMove (266, 602)
    MouseClick ("left")
    Sleep(250)
    MouseMove (176, 709)
    MouseClick ("left")
    Sleep(250)
    MouseMove (300, 923)
    MouseClick ("left")
    MouseMove (176, 466)
    MouseClick ("left")
    MouseMove (299, 522)
    MouseClick ("left")
    Sleep(250)
    MouseMove (172, 494)
    MouseClick ("left")
    MouseMove (274, 547)
    MouseClick ("left")
    ToolTip("", 0, 0)
EndFunc   ;==>_MialSpotkanie


;F8
Func _MaPolise()
    ToolTip("JUŻ MA UBEZPIECZENIE", 0, 0)
    MouseMove (167, 548)
    MouseClick ("left")
    Sleep(30)
    MouseMove (311, 604)
    MouseClick ("left")
    Sleep(350)
    MouseMove (176, 763)
    MouseClick ("left")
    MouseMove (265, 923)
    Sleep(150)
    MouseClick ("left")
    MouseMove (177, 465)
    MouseClick ("left")
    MouseMove (236, 516)
    Sleep(140)
    MouseClick ("left")
    MouseMove (172, 493)
    Sleep(260)
    MouseClick ("left")
    MouseMove (226, 549)
    Sleep(260)
    MouseClick ("left")
    ToolTip("", 0, 0)
EndFunc   ;==>_MaPolise


;F9
Func _OlewaNN()
    ToolTip("BRAK ZAINTERESOWANIA MARKĄ NN", 0, 0)
    MouseMove (260, 551)
    MouseClick ("left")
    Sleep(240)
    MouseMove (260, 603)
    MouseClick ("left")
    Sleep(250)
    MouseMove (242, 629)
    MouseClick ("left")
    Sleep(100)
    MouseMove (279, 925)
    MouseClick ("left")
    Sleep(10)
    MouseMove (203, 466)
    MouseClick ("left")
    MouseMove (260, 551)
    MouseClick ("left")
    MouseMove (254, 521)
    MouseClick ("left")
    MouseMove (172, 493)
    Sleep(260)
    MouseClick ("left")
    MouseMove (249, 549)
    Sleep(260)
    MouseClick ("left")
    ToolTip("", 0, 0)
EndFunc   ;==>_OlewaNN

;F10
Func _NieUbezpieczaSie()
    ToolTip("NIGDZIE SIĘ NIE UBEZPIECZA", 0, 0)
    MouseMove (168, 549)
    MouseClick ("left")
    MouseMove (245, 600)
    MouseClick ("left")
    Sleep(260)
    MouseMove (176, 735)
    MouseClick ("left")
    MouseMove (279, 927)
    MouseClick ("left")
    Sleep(260)
    MouseMove (177, 466)
    MouseClick ("left")
    MouseMove (289, 521)
    MouseClick ("left")
    Sleep(260)
    MouseMove (172, 494)
    MouseClick ("left")
    MouseMove (237, 548)
    MouseClick ("left")
    ToolTip("", 0, 0)
EndFunc   ;==>_NieUbezpieczaSie


;F11
Func _RODO()
    ToolTip("BRAK ZGODY NA PRZETWARZANIE DANYCH OSOBOWYCH", 0, 0)

    ToolTip("", 0, 0)
EndFunc   ;==>_RODO


;F12
Func _UmawiaSie()
    ToolTip("ZAINTERESOWANIE SPOTKANIEM", 0, 0)

    ToolTip("", 0, 0)
EndFunc   ;==>_UmawiaSie

 

SCREEN ERROR.png

Edited by CzarnyKhaki
Link to comment
Share on other sites

;F6
Func _Przelozenie()

    ToolTip("PRZEŁOŻENIE ROZMOWY NA JUTRO", 0, 0)
    MouseMove (98, 76)
    MouseClick ("left")
    Sleep(440)
    MouseMove (296, 506)
    MouseClick ("left")
    Sleep(390)
    MouseMove (226, 811)
    MouseClick ("left")
    
    MouseClickDrag ( "left", 462, 465, 409, 461, 2)   ; (2 is speed)
    Local $sRandomTime
    $sRandomTime = StringFormat("%02i:%02i", Random(17, 19, 1) , Random(0, 56, 1))

    MouseClickDrag ( "left", 335, 465, 238, 460, 2)   ; (2 is speed)
    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)

    MouseMove (590, 871)
    MouseClick ("left")
    MouseMove (167, 809)
    MouseClick ("left")
    Sleep(260)
    MouseMove (245, 867)
    Sleep(260)
    MouseClick ("left")
    ToolTip("", 0, 0)
EndFunc   ;==>_Przelozenie

Text is correctly highlited but it doesn't react as suposed. After highliting the hour it doesn't do anything with it, at next it highlights the date and all it does is just showing this window, and it doesn't change the date, it just continues further.

screen data.png

Edited by CzarnyKhaki
ortography
Link to comment
Share on other sites

3 hours ago, CzarnyKhaki said:

Text is correctly highlited but it doesn't react as suposed. After highliting the hour it doesn't do anything with it, at next it highlights the date and all it does is just showing this window, and it doesn't change the date, it just continues further.

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...

Edited by Nine
Link to comment
Share on other sites

I can't take it home, because I can program it only while I have access to the program at work.
Can you at least tell me what should I search for in the help file?
By the way, help file is not working for me: I search for topics or index and click "Show" after choosing one and it shows me nothing so I use www help: https://www.autoitscript.com/autoit3/docs/functions.htm
 

Edited by CzarnyKhaki
more info
Link to comment
Share on other sites

1 hour ago, CzarnyKhaki said:

By the way, help file is not working for me: I search for topics or index and click "Show" after choosing one and it shows me nothing

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?

Musashi-C64.png

"In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move."

Link to comment
Share on other sites

Ok, help there works.

but omg...
I'm afraid I'm gonna be fired from work if I waste 20-50 more hours on writing this script and I see I have whole book to read before I know where to start lerning.

I searched "_ArrayDisplay" (it gives result "AU3Recorder") and "Display on Array" (it gives result "CodeWizard") and didn't find anything helpful there.

Please give me a list of things I should read to insert the prepared as above hour and date in window.

Edit: And why dahell is that F12 not working?
 

HotKeySet("{F12}", "_BrakCzasu")

;F12
Func _BrakCzasu()
    ToolTip("BRAK CZASU NA SPOTKANIE W CZASIE TRWANIA AKCJI", 0, 0)
    MouseMove (166, 550)
    MouseClick ("left")
    MouseMove (241, 600)
    MouseClick ("left")
    ToolTip("", 0, 0)
    MouseMove (600, 520)
EndFunc   ;==>_BrakCzasu

 

Edited by CzarnyKhaki
Link to comment
Share on other sites

4 hours ago, CzarnyKhaki said:

Can you at least tell me what should I search for in the help file?

Already told you.

On 11/6/2019 at 7:08 AM, Nine said:

Open help file look under at the functions that I used

If you spend 20-50 hours to add 3-4 lines of code, well, I will feel sorry for you...

It is against the approach of this forum to spoon-fed people.  We are helping people to help themselves. 

Edited by Nine
Link to comment
Share on other sites

;( it's black magic for me

"look under at the functions that I used"

Do you mean me to search for: Local,  StringFormat, Random, Send, ClipGet, StringReplace, _DateAdd; MsgBox, MB_SYSTEMMODAL? after reading the results will it be clear to me how to insert hour and date in box?
 

Link to comment
Share on other sites

Link to comment
Share on other sites

when I search for these things help gives me completely different results, I don't get it...

For example, when I search for "Send" it gives me "SciTE-LUA Interface" index result, and "SciTE Director Interface" search result.

Edited by CzarnyKhaki
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...