Jump to content

Double Click?


Recommended Posts

Hi,

While 1
    $pos = MouseGetPos()
    MouseClick("left",$pos[0],$pos[1],2)
    Sleep(1000 * 60 * 5) 
WEnd

p.s. please first take a look at the help file :)

Edited by Pakku
Link to comment
Share on other sites

While 1
Mouseclick("Left",X, Y, 2, 0)
Sleep(5*60*1000)
WEnd
i updated my post while you were adding one :)
Link to comment
Share on other sites

hmm... why isn't this double clicking every 10 seconds

While 1

$slp = Random(20000, 60000, 1)

Sleep($slp)

Send("{F3}")

Sleep(5500)

Send("{F1}")

WEnd

While 1

$pos = MouseGetPos()

MouseClick("left",$pos[0],$pos[1],2)

Sleep(10000)

WEnd

Link to comment
Share on other sites

hmm... why isn't this double clicking every 10 seconds

While 1

$slp = Random(20000, 60000, 1)

Sleep($slp)

Send("{F3}")

Sleep(5500)

Send("{F1}")

WEnd

While 1

$pos = MouseGetPos()

MouseClick("left",$pos[0],$pos[1],2)

Sleep(10000)

WEnd

Most likely because it is stuck in the first loop.
Link to comment
Share on other sites

You've got 2 loops there:

While 1

$slp = Random(20000, 60000, 1)

Sleep($slp)

Send("{F3}")

Sleep(5500)

Send("{F1}")

WEnd

While 1

$pos = MouseGetPos()

MouseClick("left",$pos[0],$pos[1],2)

Sleep(10000)

WEnd

They happen one after nother, but since they are both infinite loops, the second doesnt get done, and I dont know enough about loops to tell you how to dodge that but you can do this:

$timer=TimerInit() ;set time 1

$timer2=TimerInit() ; set timer 2

$slp = Random(20000, 60000, 1) ;set random

While 1

If TimerDiff($timer) > 10000 Then ; Check timer 1

_Function1

EndIf

If TimerDiff($timer2) > $slp Then ; Check timer 2

_Function2

EndIf

Func _Function1() ;Function 1

$pos = MouseGetPos()

MouseClick("left",$pos[0],$pos[1],2)

$timer=TimerInit(); Reset Timer

EndFunc

Func _Function2()

$slp = Random(20000, 60000, 1)

$timer2=TimerInit(); Reset Timer

Send("{F3}")

Sleep(5500)

Send("{F1}")

EndFunc

I havent tested that but something along those lines should work

Edited by MethodZero

[center]"When you look at old, classic games like Snake, you often put it off because it's such a simple game, but it's only when you actually try and create your own unique game from scratch, do you finally appreciate those games."[/center][center]Don't ask for answers if you haven't TRIED yet![/center][center]Most answers can be answered in the help file! Use it![/center]

Link to comment
Share on other sites

how do i make it not do that?

You can set a hotkey to do one and a different one for the other.

ie:

Hotkeyset("1", "_one")
Hotkeyset("2", "_two")

while 1
sleep(100)
WEnd

Func _one()
While 1
$slp = Random(20000, 60000, 1)
Sleep($slp)
Send("{F3}")
Sleep(5500)
Send("{F1}")
WEnd
EndFunc

Func _two()
While 1
$pos = MouseGetPos()
MouseClick("left",$pos[0],$pos[1],2)
Sleep(10000)
WEnd
EndFunc
Link to comment
Share on other sites

hmm... Paulie it doesn't repeat on its own with that, though.

It does for me....

You have to push the hotkeys to make it work though.

If you push 1, it will do the first loop (the one without clicking)

Then you push 2 and it wil stop doing the first loop and do the mouse clicks.

Link to comment
Share on other sites

Well, my goal here is to be able to have a repeating loop the pressing f1 and f3, and a repeating loop of double clicking every 5 minutes (10 seconds for the test). I don't want to have to press 1 and 2 and stay at my computer for the script to work.

Thanks for all your help by the way, guys

Link to comment
Share on other sites

You don't have to stay at your computer, just press 1 and 2 for the first time and it will do it on its own from then on =P

Edited by MethodZero

[center]"When you look at old, classic games like Snake, you often put it off because it's such a simple game, but it's only when you actually try and create your own unique game from scratch, do you finally appreciate those games."[/center][center]Don't ask for answers if you haven't TRIED yet![/center][center]Most answers can be answered in the help file! Use it![/center]

Link to comment
Share on other sites

Really? well then make 2 scripts lol =P

[center]"When you look at old, classic games like Snake, you often put it off because it's such a simple game, but it's only when you actually try and create your own unique game from scratch, do you finally appreciate those games."[/center][center]Don't ask for answers if you haven't TRIED yet![/center][center]Most answers can be answered in the help file! Use it![/center]

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