iepurasul

Repeat code

8 posts in this topic

Hello guys

I have a simple code and i want to repeat over and over again or at least 40 times

 

sleep(10550)


MouseClick("left",188,22)
MouseClick("left",188,22)
sleep(50000)

Thank you

Share this post


Link to post
Share on other sites



Do you mean something like this:

For $x = 1 To 40
    FNC_MouseClick()
Next
Func FNC_MouseClick()
    sleep(10550)
    MouseClick("left",188,22, 2)
    sleep(50000)
EndFunc

 

Share this post


Link to post
Share on other sites

Thank but no, that one was an example

 

The real code i created is

 

sleep(10550)



MouseClick("left",188,22)
MouseClick("left",188,22)
sleep(100001)
WinActivate("Nox")
sleep(2004)
MouseClick("left",1492,763)
sleep(1500)
WinActivate("Nox1")
sleep(2004)
MouseClick("left",734,761)
sleep(1500)
WinActivate("Nox")
sleep(2004)
MouseClick("left",1427,313)
sleep(5001)
MouseClick("left",1256,721)
sleep(2000)
MouseClick("left",1249,665)
sleep(2000)
MouseClick("left",1411,159)
sleep(500)
MouseClick("left",1302,161)
sleep(2000)
Send("...MAIL...")
sleep(1500)
MouseClick("left",1198,216)
sleep(1500)
Send("...Password...")
sleep(1560)
MouseClick("left",1258,283)
sleep(30500)
MouseClick("left",1454,86)
sleep(2000)
MouseClick("left",1168,770)
sleep(2000)
MouseClick("left",1119,82)
sleep(2000)
Send("Charlottte")
sleep(3060)
MouseClick("left",1140,130)
sleep(3000)
MouseClick("left",1423,140)
sleep(3001)
WinActivate("Nox1")
sleep(2004)
MouseClick("left",679,311)
sleep(5001)
MouseClick("left",500,686)
sleep(2000)
MouseClick("left",495,611)
sleep(2000)
MouseClick("left",642,193)
sleep(500)
MouseClick("left",554,194)
sleep(2000)
Send("...MAIL...")
sleep(1560)
MouseClick("left",493,267)
sleep(2000)
Send("Claudiosi28@")
sleep(1560)
MouseClick("left",506,357)
sleep(30500)
MouseClick("left",700,89)
sleep(2000)
MouseClick("left",418,748)
sleep(2000)
MouseClick("left",371,89)
sleep(2000)
Send("Charlottte")
sleep(3000)
MouseClick("left",410,154)
sleep(3000)
MouseClick("left",663,163)
sleep(3001)
WinActivate("Nox")
sleep(1005)
MouseClick("left",1157,771)
sleep(2000)
Send("...PARLA...")
sleep(2000)
MouseClick("left",1441,772)
send("{F9 759}")
sleep(2000)
MouseClick("left",1157,771)
Send("...PARLA...")
sleep(2000)
MouseClick("left",1441,772)
send("{F9 1499}")
sleep(2000)
MouseClick("left",1157,771)
Send("...PARLA...")
sleep(2000)
MouseClick("left",1441,772)
sleep(120000)
MouseClick("left",1450,726)
sleep(1000)
MouseClick("left",1450,726)
sleep(2122)
send("{F10 3}")
send("{F10 3}")
send("{F10 3}")
sleep(1013)
MouseClick("left",1095,653)
Sleep(500)
MouseClick("left",1095,653)
Sleep(500)
MouseClick("left",1095,653)
Sleep(500)
MouseClick("left",1095,653)
Sleep(500)
MouseClick("left",1202,645)
Sleep(500)
MouseClick("left",1202,645)
Sleep(500)
MouseClick("left",1202,645)
Sleep(500)
MouseClick("left",1202,645)
Sleep(500)
send("{F11 3}")
Sleep(2000)
MouseClick("left",1419,722)
Sleep(500)
MouseClick("left",1419,722)
Sleep(500)
MouseClick("left",1419,722)
Sleep(500)
MouseClick("left",1419,722)
Sleep(500)
MouseClick("left",1419,722)
Sleep(500)
MouseClick("left",1419,722)
Sleep(500)
MouseClick("left",1419,722)
Sleep(500)
MouseClick("left",1419,722)
Sleep(500)
MouseClick("left",1419,722)
Sleep(500)
MouseClick("left",1419,722)
Sleep(500)
MouseClick("left",1419,722)
Sleep(500)
MouseClick("left",1419,722)
Sleep(500)
MouseClick("left",1419,722)
Sleep(500)
MouseClick("left",1419,722)
Sleep(500)
MouseClick("left",1419,722)
Sleep(500)
MouseClick("left",1419,722)
Sleep(500)
MouseClick("left",1419,722)
Sleep(500)
MouseClick("left",1419,722)
Sleep(500)
MouseClick("left",1419,722)
Sleep(500)
MouseClick("left",1419,722)
Sleep(500)
MouseClick("left",1419,722)
Sleep(500)
MouseClick("left",1419,722)
Sleep(500)
MouseClick("left",1419,722)
Sleep(500)
MouseClick("left",1419,722)
sleep(1771)
sleep(2122)
MouseClick("left",1215,241)
Sleep(500)
MouseClick("left",1215,241)
sleep(2050)
send("{escape}")
Sleep(500)
send("{escape}")
sleep(120000)
MouseClick("left",1157,771)
sleep(2000)
Send("...PARLA...")
sleep(2000)
MouseClick("left",1441,772)
send("{F9 759}")
sleep(2000)
MouseClick("left",1157,771)
Send("...PARLA...")
sleep(2000)
MouseClick("left",1441,772)
send("{F9 1499}")
sleep(2000)
MouseClick("left",1157,771)
Send("...PARLA...")
sleep(2000)
MouseClick("left",1441,772)
Sleep(5000)
WinActivate("Nox1")
sleep(1005)
MouseClick("left",394,750)
sleep(2000)
Send("...PARLA...")
sleep(2000)
MouseClick("left",682,750)
send("{F9 759}")
sleep(2000)
MouseClick("left",394,750)
Send("...PARLA...")
sleep(2000)
MouseClick("left",682,750)
send("{F9 1499}")
sleep(2000)
MouseClick("left",394,750)
Send("...PARLA...")
sleep(2000)
MouseClick("left",682,750)
sleep(120000)
MouseClick("left",693,690)
sleep(1000)
MouseClick("left",693,690)
sleep(2122)
sleep(1013)
MouseClick("left",664,686)
Sleep(500)
MouseClick("left",664,686)
Sleep(500)
MouseClick("left",664,686)
Sleep(500)
MouseClick("left",664,686)
Sleep(500)
MouseClick("left",452,590)
Sleep(500)
MouseClick("left",452,590)
Sleep(500)
MouseClick("left",452,590)
Sleep(500)
MouseClick("left",452,590)
Sleep(500)
MouseClick("left",344,590)
Sleep(500)
MouseClick("left",344,590)
Sleep(500)
MouseClick("left",344,590)
Sleep(500)
MouseClick("left",344,590)
Sleep(500)
MouseClick("left",344,590)
Sleep(500)
MouseClick("left",344,590)
Sleep(500)
MouseClick("left",344,590)
Sleep(500)
MouseClick("left",344,590)
Sleep(500)
MouseClick("left",344,590)
Sleep(500)
MouseClick("left",344,590)
Sleep(500)
MouseClick("left",344,590)
Sleep(500)
MouseClick("left",344,590)
Sleep(500)
MouseClick("left",344,590)
Sleep(500)
MouseClick("left",344,590)
Sleep(500)
MouseClick("left",344,590)
Sleep(500)
MouseClick("left",344,590)
Sleep(500)
MouseClick("left",344,590)
Sleep(500)
MouseClick("left",344,590)
Sleep(500)
MouseClick("left",344,590)
Sleep(500)
MouseClick("left",344,590)
Sleep(500)
MouseClick("left",344,590)
Sleep(500)
MouseClick("left",344,590)
Sleep(500)
MouseClick("left",344,590)
Sleep(500)
MouseClick("left",344,590)
sleep(1771)
sleep(2122)
MouseClick("left",418,246)
Sleep(500)
MouseClick("left",418,246)
sleep(2050)
send("{escape}")
Sleep(500)
send("{escape}")
sleep(120000)
MouseClick("left",394,750)
sleep(2000)
Send("...PARLA...")
sleep(2000)
MouseClick("left",682,750)
send("{F9 759}")
sleep(2000)
MouseClick("left",394,750)
Send("...PARLA...")
sleep(2000)
MouseClick("left",682,750)
send("{F9 1499}")
sleep(2000)
MouseClick("left",394,750)
Send("...PARLA...")
sleep(2000)
MouseClick("left",682,750)
Sleep(5000)
WinActivate("Nox")
sleep(2000)
MouseClick("left",1491,762)
sleep(1500)
MouseClick("left",1423,745)
sleep(1500)
MouseClick("left",1114,495)
sleep(1500)
MouseClick("left",1145,398)
sleep(1500)
MouseClick("left",1344,390)
sleep(1500)
MouseClick("left",1354,495)
sleep(3500)
WinActivate("Nox1")
sleep(2000)
MouseClick("left",741,755)
sleep(1500)
MouseClick("left",671,707)
sleep(1500)
MouseClick("left",386,635)
sleep(1500)
MouseClick("left",400,273)
sleep(1500)
MouseClick("left",598,488)
sleep(1500)
MouseClick("left",596,521)
sleep(5000)

 

Share this post


Link to post
Share on other sites

iepurasul,

Googling "Nox" gives me lots of hits for a video game - and this looks like a typical beginner bot. Have you read the Forum rules which prohibit discussion of such things?

M23

 


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

@Melba23 , sorry i don't want to brake any rules and yes NOX is an android emulator.

The fact is that WinActivate("Nox") can became WinActivate("Internet Explorer") or any other program , but my simple question is how i can repeat the hole code ?    ( simple for who know and not for me :) )

I repeat myself, i don't want to brake any rules and i'm sorry if i did

 

Thank you again Melba23 and i really appreciate a small help from someone who know

 

 

Share this post


Link to post
Share on other sites

How about this? 

 

HotKeySet("{ESC}", "Terminate")

Opt("WinTitleMatchMode", 2)
AutoItSetOption("MouseCoordMode", 2) ; Do not change this parameter! It's needed for windowed.

Global $icount = 0

mouse_click()

Func Sleep1()
    Global $aTimes[5] = [1, 2, 3, 4, 5]
    Sleep(1000 * $aTimes[Random(0, 4, 1)])
EndFunc   ;==>Sleep1

Func ActiveNoxWindow()
    $hWnd1 = WinGetHandle("[CLASS:Qt5QWindowIcon]")
    If IsHWnd($hWnd1) Then
        WinActivate($hWnd1)
    EndIf
EndFunc   ;==>ActiveNoxWindow

Func mouse_click()
    ActiveNoxWindow()
    GetNoxPos()
    If $icount = 0 Then
        Do
            MouseClick("left", 188, 22, 1, 1)
            $icount = $icount + 1
            Sleep1()
        Until $icount = 2

    EndIf

    If $icount = 2 Then
        Do
            MouseClick("left", 200, 50, 1, 1)
            $icount = $icount + 1
            Sleep1()
        Until $icount = 4
    EndIf
    EndFunc   ;==>mouse_click

    Func GetNoxPos()
        Local $aPos = WinGetPos("[CLASS:Qt5QWindowIcon]")

        If $aPos[0] = 0 And $aPos[1] = 0 Then Sleep(1000)

        If $aPos[0] > 0 And $aPos[1] > 0 Then
            $hWnd1 = WinGetHandle("[CLASS:Qt5QWindowIcon]")
            If IsHWnd($hWnd1) Then
                Sleep(1000)
                WinActivate($hWnd1)
                WinMove($hWnd1, "", 0, 0)
                Sleep(1000)
                Local $aPos = WinGetPos("[CLASS:Qt5QWindowIcon]")
            EndIf
        EndIf
    EndFunc   ;==>GetNoxPos

    Func Terminate()
        Exit
    EndFunc   ;==>Terminate

 

Share this post


Link to post
Share on other sites

Not working aa2zz6 , when the code end and start a new cycle is clicking different , so is not working.

 

Thank you anyway

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

Under the mouse_click() function you have to add in your code. I included a counter variable inside a Do Until loop to do your clicks x-amount of times. The first Do Until loop clicks coordinates (188,22) two times until $icount = 2. 

If $icount = 0 Then
        Do
            MouseClick("left", 188, 22, 1, 1)
            $icount = $icount + 1
            Sleep1()
        Until $icount = 2

You'll have to use the AutoIt v3 Window Info tool located in the AutoIt folder in your Start Menu. Set it like the picture I'll include.. If it's not set like this your clicks will be all over the place.

Make sense?

Nox Pic.png

Edited by aa2zz6

Share this post


Link to post
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