Sign in to follow this  
Followers 0
Sparrowlord

Need Some Help

10 posts in this topic

I have this following script:

#include <Misc.au3>
Global $Paused
HotKeySet("{END}", "TogglePause")
HotKeySet("{HOME}", "Terminate")
$dll = DllOpen("user32.dll")


WinActivate("d2", "")
sleep(200)
WinMove("d2", "", 0, 0)

sleep(1000)

$i = 0
While $i <= 2



$timer = TimerInit()
$tizz = 5000

While TimerDiff($timer) < $tizz
Sleep(100)
MouseClick("left", 243, 126, 1)
WEnd

sleep(1000)
MouseClick("left", 243, 126, 1)
sleep(1000)
MouseClick("left", 350, 187, 1)
sleep(1000)
MouseClick("left", 243, 126, 1)
sleep(1000)

$time = TimerInit()

While TimerDiff($time) < $tizz
Sleep(100)
MouseClick("left", 350, 187, 1)
WEnd

sleep(1000)
MouseClick("left", 350, 187, 1)
sleep(1000)
MouseClick("left", 243, 126, 1)
sleep(1000)
MouseClick("left", 350, 187, 1)
sleep(1000)
    $i = $i + 1
Wend




Func TogglePause()
    $Paused = NOT $Paused
    While $Paused
        sleep(100)
    WEnd
EndFunc

While 1
    Sleep(100)
     If _IsPressed("01", $dll) Then
         
WEnd



Func Terminate()
    Exit 0
EndFunc

But the While is setup to do 2 of it, but is there a way to add something else below that, that happens after the 2 times the While goes threw then back to the While?

And with the " If _IsPressed("01", $dll) Then" is there a way to make everytime the mouse is clicked and log that to a ini and show in a GUI that constantly refreshes?

Share this post


Link to post
Share on other sites



Wow, I can honestly say that:

But the While is setup to do 2 of it, but is there a way to add something else below that, that happens after the 2 times the While goes threw then back to the While?

Is totally confusing.

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

Wow, I can honestly say that:Is totally confusing.

Heres a example of what I mean:

While $i <= 2

MouseClick("left", 350, 187, 1)

Wend

But is there a way to make it do something after it does that twice and then it goes back clicking

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

I think he is saying that he wants the whiles in a loop

you beat me to it

Edited by codemyster

Share this post


Link to post
Share on other sites

$Count = 0
While 1
    $Count = $Count + 1
    MouseClick('whateverhere')
    If $Count = 2 Then
       ;Do something here
    EndIf
    Sleep(10)
WEnd
Like that?


[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

$Count = 0
While 1
    $Count = $Count + 1
    MouseClick('whateverhere')
    If $Count = 2 Then
      ;Do something here
    EndIf
    Sleep(10)
WEnd
Like that?
Thanks, that looks like it will work perfect. Does anyone know my problem about the GUI and the mouseclicks, I just need to log all the mouse clicks to a traytip or a GUI or something like that.

Thanks

Share this post


Link to post
Share on other sites

Look at _ispressed in the beta helpfile

Share this post


Link to post
Share on other sites

Well what do you mean log? You mean it's position it clicked, or just how many times it did?


[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

Just how many times its clicked

Share this post


Link to post
Share on other sites

Just how many times its clicked

Hmm, have you tried anything, I mean I gave you the code above to do something after 2 clicks... wouldn't that make since that it clicked x times?
$Count = 0
While 1
    $Count = $Count + 1
    MouseClick('Primary', 300, 300, 1, 1)
    If $Count = 2 Then
      ;Do something here
    EndIf
    TrayTip('Click Count', 'Click1 has been clicked: ' & $Count & ' Times.', 0)
    Sleep(10)
WEnd

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

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