Jump to content

Array loop problems


Flickblue
 Share

Recommended Posts

Hello,
I´m new to Autoit and Coding is my passion. but currently I´m stuck at this codding to move to further steps:

The script run only 4 time from the array list and stop. I want the script to run 4 arrays then repeat again and again


Func ssss ()
    For $c = 7 To 1 Step -1
        For $i = 1 To 5 Step 1
            drop ($i)
           jump()
            run()
        Next
    Next
EndFunc

---------------------------------------------------------

Local $arr[4] ; Make room for three elements
;Assign some data
$arr[0] = example1
$arr[1] = example2
$arr[2] = example3
$arr[3] = example4


Local $arr1[4] ; Make room for three elements
;Assign some data
$arr1[0] = example1
$arr1[1] = "example2
$arr1[2] = example3
$arr1[3] = example4


For $d = 0 To 4 Step 1
    MouseClick($MOUSE_CLICK_LEFT, 1196, 53, 1)
    ClipPut ("google.com")
    sleep(500)
    Send("^v")
    sleep(500)
    Send("{ENTER}")
    Sleep(5000)
    MouseClick($MOUSE_CLICK_LEFT, 1886, 110, 1)
    sleep(2000)
    MouseClick($MOUSE_CLICK_LEFT, 1722, 470, 1)
    sleep(2000)
    MouseClick($MOUSE_CLICK_LEFT, 1886, 110, 1)
    sleep(2000)
    MouseClick($MOUSE_CLICK_LEFT, 930, 613, 1)
    sleep(2000)
    MouseClick($MOUSE_CLICK_LEFT, 1063, 540, 1)
    sleep(2000)
    MouseClick($MOUSE_CLICK_LEFT, 1018, 657, 1)
    sleep(500)
    ClipPut ($arr[$d])
    sleep(500)
    Send("^a")
    sleep(500)
    Send("^v")
    sleep(500)
    Send("{ENTER}")
    sleep(500)
    Send("{ENTER}")
    sleep(500)
    ClipPut ($arr1[$d])
    sleep(1000)
    Send("^v")
    sleep(1000)
    Send("{ENTER}")
    sleep(5000)
    ssss()
Next

 

Please help me

Link to comment
Share on other sites

  • Moderators

@Flickblue What, exactly, are you attempting to accomplish with this script? There may be a better way to accomplish what you are after.

 

===For everyone else, please stay out for the moment===

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

For anyone wondering he wants a repeating loop with two phases. First phase it counts from 0 to 3 second phase it counts from 3 to 0.

Hi @Flickblue.

The code you gave is pseudo code and won't run, so i modified it a bit for a running example.

#include <AutoItConstants.au3>

Func ssss ()
    For $c = 7 To 1 Step -1
        For $i = 1 To 5 Step 1
            ;drop ($i)
            ;jump()
            ;run()
        Next
    Next
EndFunc

Local $arr[4] ; Make room for three elements
;Assign some data
$arr[0] = "example1"
$arr[1] = "example2"
$arr[2] = "example3"
$arr[3] = "example4"

Local $arr1[4] ; Make room for three elements
;Assign some data
$arr1[0] = "example1"
$arr1[1] = "example2"
$arr1[2] = "example3"
$arr1[3] = "example4"

$i = 0
$j = +1
While 1
    MouseClick($MOUSE_CLICK_LEFT, 1196, 53, 1)
    ClipPut ("google.com")
    sleep(500)
    Send("^v")
    sleep(500)
    Send("{ENTER}")
    Sleep(5000)
    MouseClick($MOUSE_CLICK_LEFT, 1886, 110, 1)
    sleep(2000)
    MouseClick($MOUSE_CLICK_LEFT, 1722, 470, 1)
    sleep(2000)
    MouseClick($MOUSE_CLICK_LEFT, 1886, 110, 1)
    sleep(2000)
    MouseClick($MOUSE_CLICK_LEFT, 930, 613, 1)
    sleep(2000)
    MouseClick($MOUSE_CLICK_LEFT, 1063, 540, 1)
    sleep(2000)
    MouseClick($MOUSE_CLICK_LEFT, 1018, 657, 1)
    sleep(500)
    ClipPut ($arr[$i])
    sleep(500)
    Send("^a")
    sleep(500)
    Send("^v")
    sleep(500)
    Send("{ENTER}")
    sleep(500)
    Send("{ENTER}")
    sleep(500)
    ClipPut ($arr1[$i])
    sleep(1000)
    Send("^v")
    sleep(1000)
    Send("{ENTER}")
    sleep(5000)
    ssss()

    If $i = 0 Then
        $j = +1
    ElseIf $i = 3 Then
        $j = -1
    EndIf
    $i += $j
WEnd

Be aware there is no code to stop the script currently.

Edited by genius257
Link to comment
Share on other sites

  • Moderators
9 hours ago, genius257 said:

For anyone wondering he wants a repeating loop with two phases. First phase it counts from 0 to 3 second phase it counts from 3 to 0.

Exactly what part of Stay Out did you not understand?

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

  • Moderators

@Flickblue You did not answer my previous question. What is the intent of your script, or what are you trying to accomplish (the application you're automating, the website, etc.)?

 

=================Hopefully much more plaint this time - Everyone else please stay out while a Mod is determining legitimacy of the post=================

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

  • Developers
1 hour ago, Flickblue said:

I m doing a script to switch google account automated.

Please try again and this time be a little bit more serious with your answer taking into account you are dealing with intelligent humans.  

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

  • Moderators

@Flickbluelet's try this another way. Your script looks very much like you are automating a game. This thread is locked until you A: Familiarize yourself with the forum rules. If you want to PM me and convince me this is not for a game, we'll talk about unlocking it.

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

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