Jump to content

Mouse click <First ever script>


Recommended Posts

I think thats a bit to much for a simple gui script that randomly clicks the mouse. And no it doesn't click a bunch of times it only clicks once(my script), but you can make a new input box saying "clicks" or something..

Edited by SupraNatural

Visit http://www.blizzedout.com/forums/register....referrerid=8306 for the top blizzard hacks. WoW, TfT, D2/LOD, CS. You name it we got it!

Link to comment
Share on other sites

I think thats a bit to much for a simple gui script that randomly clicks the mouse. And no it doesn't click a bunch of times it only clicks once(my script), but you can make a new input box saying "clicks" or something..

<{POST_SNAPBACK}>

Yes your script does just click once, The Script I wrote clicked a bunch of times a sec. I am trying to figure out what to add to make it to where after the start button is pushed it clicks then loops for the delay time in the input boxes and loops till told to stop. I have a cpl questions I think what I am hung up on is the structure of it, will edit in few mins have run.

$inputTS1 = GUICtrlCreateInput("10",20,20,30,20,$ES_NUMBER)

$inputTE2 = GUICtrlCreateInput ("15",100,20,30,20,$ES_NUMBER)

$start = GUICtrlCreateButton ( "Start", 201,94,75,23,$BS_VCENTER)

$inputTS1

$inputTE2 -Where do these come from??

$start

Func getCoords()

$TS = GUICtrlRead($inputTS1)<<< Telling it what TS is for the sleep command

$TE = GUICtrlRead($inputTE2)<<<Telling it what TE is for the sleep command

$sleep = Random($TS*1000,$TE*1000,1)<<< Tells how long to wait before clicking

Sleep($sleep)<<< preforms the delay

MouseClick("Left")<<< Makes it click the left button

EndFunc<<< after the click if performed tells the program to stop

I was thinking of using

IF mouseclick("left")

Then [ code to repeat func get coords()] that should send it into a loop till the script is stopped right? I did try while/WEnd and IF last night but kept erroring. I dl SciTE last night hoping it would help. Learning this from ground zero is a lil ruffer then I Thought it would be use to do computer stuff as a kid but after school lost touch and now diving back in is kind of fun!

Edited by Wepwawet
Link to comment
Share on other sites

IF mouseclick will not do anything, search the forums for _isPressed.

$TS = Time Start

$TE = Time End

So let me get this straight, this is what you want it to do:

1.user enters time for start and end and hits start

2.mouse sleeps for random time, then clicks

3.loop step 2 until told to stop

Something to know:

When using onevent mode (Opt("GUIOnEventMode", 1)) you must set every GUICtrl you make that will be interactive with a variable. I.E;

$inputTS1 = GUICtrlCreateInput("10",20,20,30,20,$ES_NUMBER)

This is done so that you can later read the control with guictrlread.

Edited by SupraNatural

Visit http://www.blizzedout.com/forums/register....referrerid=8306 for the top blizzard hacks. WoW, TfT, D2/LOD, CS. You name it we got it!

Link to comment
Share on other sites

1.user enters time for start and end and hits start

2.mouse sleeps for random time, then clicks

3.loop step 2 until told to stop

Yes

I been playing around not getting it to work yet, I think I going to have to play with tuttoials some more to get a good understanding of the structure of why this is there and in that line. I am having fun so thats a good start to me. :whistle:

Link to comment
Share on other sites

Does it have to be an infinite loop? Or can the user specify how many clicks. Other than that you will need another button for stop.

<{POST_SNAPBACK}>

Yea I was thinking a stop button was going to be needed will at that and will post what I have.

PS need it to loop till told to stop

Edited by Wepwawet
Link to comment
Share on other sites

#include <GuiConstants.au3>

Opt("GUIOnEventMode", 1)

$GUI = GUICreate("WepMouse",285,130)

$inputTS1 = GUICtrlCreateInput("10",20,20,30,20,$ES_NUMBER)

$inputTE2 = GUICtrlCreateInput ("15",100,20,30,20,$ES_NUMBER)

$start = GUICtrlCreateButton ( "Start", 201,70,75,23,$BS_VCENTER)

$stop = GUICtrlCreateButton ( "STOP", 201,94,75,23,$BS_VCENTER)

GUISetOnEvent($GUI_EVENT_CLOSE, "CLOSE")

GUICtrlSetOnEvent($start,"getCoords")

GUICtrlSetOnEvent($stop,ExitLoop 1)

GUISetState(@SW_SHOW)

While 1

Sleep(1000)

WEnd

Do

Func getCoords()

$TS = GUICtrlRead($inputTS1)

$TE = GUICtrlRead($inputTE2)

$sleep = Random($TS*1000,$TE*1000,1)

Sleep($sleep)

MouseClick("Left")

Until

EndFunc

Func CLOSE()

Exit

EndFunc

Two probloms

1) My stop button dont understand what to stop :dance:

2) Unsure what to tell the Until to make it see to keep looping till the stop is pushed.

Hints plz :whistle:

Link to comment
Share on other sites

GUICtrlSetOnEvent($stop,"Done")
GUISetState(@SW_SHOW)

While 1
Sleep(1000)
WEnd


Func getCoords()
Do
    $TS = GUICtrlRead($inputTS1)
    $TE = GUICtrlRead($inputTE2)
    $sleep = Random($TS*1000,$TE*1000,1)
    Sleep($sleep)
    MouseClick("Left")
    ContinueLoop
Until $stop
EndFunc

Func Done()
    $stop = ExitLoop
EndFunc

Ok so move the Do inside so that should loop it right?

My understanding of the Do/Until commands will loop till the value of untill is meet.

EDIT: new code etc :whistle:

Stop dont work hope to have that working by morning

Its not looking even tho I told it to ContinueLoop Until $stop which is the stop button. So I will search around the forms for looping and see if I cant Figure both probloms so cross your fingers that I have a working GUI working by morning.

WTB being able to sleep

Edited by Wepwawet
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...