Sign in to follow this  
Followers 0
GraveReaper0

Help Needed

5 posts in this topic

Hi all. Just wrote a simple script that will upload numerous amounts of pics by itself. It runs fine, but I don't like the way its set up.

Global $Paused
HotKeySet("{PAUSE}", "TogglePause")
HotKeySet("{ESC}", "Terminate")

Func Terminate()
    Exit 0
EndFunc

Func TogglePause()
    $Paused = NOT $Paused
    While $Paused
        sleep(100)
        ToolTip('Script is "Paused"',0,0)
    WEnd
    ToolTip("")
EndFunc

; Script Start - Add your code below here

$time=8000

WinWaitActive("-storage upload - Mozilla Firefox")
MouseClick("left", 818, 424, 1)
WinWaitActive("File Upload")
Send("{TAB 7}")
Sleep(200)
Send("{DOWN}")
Send("{UP}")
Send("{ENTER}")
Sleep(50)
MouseClick("left", 625, 457, 1)
Sleep($time)
MouseClickDrag("left", 415,386, 820,386)
Send("^c")
MouseClick("left", 107,127, 1)
MouseClick("left", 861,655, 1)
Send("Enjoy :-)")
Send("{ENTER 2}")
Send("[img]")
Send("^v")
Send("[/img]")
Send("{ENTER}")
MouseClick("left", 410,125, 1)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
WinWaitActive("-storage upload - Mozilla Firefox")
MouseClick("left", 822, 470, 1)
WinWaitActive("File Upload")
Send("{TAB 7}")
Sleep(200)
Send("{DOWN}")
Send("{ENTER}")
Sleep(50)
MouseClick("left", 619, 505, 1)
Sleep($time)
MouseClickDrag("left", 415,386, 820,386)
Send("^c")
MouseClick("left", 107,127, 1)
MouseClick("left", 861,655, 1)
Send("[img]")
Send("^v")
Send("[/img]")
Send("{ENTER}")
MouseClick("left", 410,125, 1)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
WinWaitActive("storage upload - Mozilla Firefox")
MouseClick("left", 822, 470, 1)
WinWaitActive("File Upload")
Send("{TAB 7}")
Sleep(200)
Send("{DOWN 2}")
Send("{ENTER}")
Sleep(50)
MouseClick("left", 619, 505, 1)
Sleep($time)
MouseClickDrag("left", 415,386, 820,386)
Send("^c")
MouseClick("left", 107,127, 1)
MouseClick("left", 861,655, 1)
Send("[img]")
Send("^v")
Send("[/img]")
Send("{ENTER}")
MouseClick("left", 410,125, 1)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
WinWaitActive("storage upload - Mozilla Firefox")
MouseClick("left", 822, 470, 1)
WinWaitActive("File Upload")
Send("{TAB 7}")
Sleep(200)
Send("{DOWN 3}")
Send("{ENTER}")
Sleep(50)
MouseClick("left", 619, 505, 1)
Sleep($time)
MouseClickDrag("left", 415,386, 820,386)
Send("^c")
MouseClick("left", 107,127, 1)
MouseClick("left", 861,655, 1)
Send("[img]")
Send("^v")
Send("[/img]")
Send("{ENTER}")
MouseClick("left", 410,125, 1)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
WinWaitActive("storage upload - Mozilla Firefox")
MouseClick("left", 822, 470, 1)
WinWaitActive("File Upload")
Send("{TAB 7}")
Sleep(200)
Send("{DOWN 4}")
Send("{ENTER}")
Sleep(50)
MouseClick("left", 619, 505, 1)
Sleep($time)
MouseClickDrag("left", 415,386, 820,386)
Send("^c")
MouseClick("left", 107,127, 1)
MouseClick("left", 861,655, 1)
Send("[img]")
Send("^v")
Send("[/img]")
Send("{ENTER}")
MouseClick("left", 410,125, 1)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

As you can see they are all the same except the first one, but in the rest of them the only thing that changes is the Send("{DOWN}") command, it just keeps going like that to 100. So if there is less ten 100, I have to sit there and wait till it uploads the last one so I can hit Esc.I wonder if there is a way to have only one section of the command and it would ask me how many times I want to execute it. ATM I am not too good with AutoIt, but slowly learning. :)

Please help. :D

Share this post


Link to post
Share on other sites



As you can see they are all the same except the first one, but in the rest of them the only thing that changes is the Send("{DOWN}") command, it just keeps going like that to 100. So if there is less ten 100, I have to sit there and wait till it uploads the last one so I can hit Esc.I wonder if there is a way  to have only one section of the command and it would ask me how many times I want to execute it.  ATM I am not too good with AutoIt, but slowly learning.  :)

Please help.  :D

<{POST_SNAPBACK}>

ask for the number with inputbox() and then do a For...Next loop...

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

$answer= InputBox("Graveo's Script", "How many pics do you want to upload?")

For $i= 1 to $answer [step 1]

Send("{DOWN $i}")

Next

Seems to work, but it doesnt add +1 for every new loop. How can I fix that?

Share this post


Link to post
Share on other sites

$answer= InputBox("Graveo's Script", "How many pics do you want to upload?")

For $i= 1 to $answer [step 1]

Send("{DOWN $i}")

Next

Seems to work, but it doesnt add +1 for every new loop. How can I fix that?

<{POST_SNAPBACK}>

You need to concatenate variables in this way:

Send("{DOWN " & $i & "}")


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

Works now, thx :-D

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
Sign in to follow this  
Followers 0