Sign in to follow this  
Followers 0
yummy22543

need help with a simple script

22 posts in this topic

last night i was trying to make a simple script that would repeat over and over until i hit a certain hotkey, and what it was doing was basically clicking in too different spots (used to log into a game, in which the login servers have a hard time connecting you and it takes many tries). i dont have much experience with autoit, or prgramming really, but i tinkered around for awhile last night.

could someone make me an *.au3 file with the continuing and hotkey to end script? i can add the mouse click variables on my own. i need some help to set me in the right direction.

Share this post


Link to post
Share on other sites



#3 ·  Posted (edited)

so i just figured this out:

HotKeySet("END", "MyExit")

WinActivate("Gunz", "")

While 1 = 1

MouseClick("left", 936, 563, 50)

MouseClick("left", 936, 630, 50)

Wend

Func MyExit()

    Exit

EndFunc

i just need help with the hotkey. :(

Edited by yummy22543

Share this post


Link to post
Share on other sites

you are a life saver. thanks a lot w0uter

Share this post


Link to post
Share on other sites

last night i was trying to make a simple script that would repeat over and over until i hit a certain hotkey, and what it was doing was basically clicking in too different spots (used to log into a game, in which the login servers have a hard time connecting you and it takes many tries). i dont have much experience with autoit, or prgramming really, but i tinkered around for awhile last night.

could someone make me an *.au3 file with the continuing and hotkey to end script? i can add the mouse click variables on my own. i need some help to set me in the right direction.

<{POST_SNAPBACK}>

Hmm, something like this :(

HotkeySet("{ESC}","_ESC")


While 1
    $msg = GUIGetMsg()
    
WEnd    

Func _ESC()
    msgbox(0,"","Exiting")
    Exit
EndFunc

Share this post


Link to post
Share on other sites

lol i call that quick support!

Share this post


Link to post
Share on other sites

lol i call that quick support!

<{POST_SNAPBACK}>

we have one minut support here, take a look at the post times!

07:51

07:52

07:53

07:54

07:55

07:56

Share this post


Link to post
Share on other sites

so i thought about making this script a litte bit more complex. before the whole clicking starts, is there a way to have input values for each of the clicks? like 1 and 2? because my resulution is 1600 by 1200, and my click spots could differ from someone elses. so how would i have inoput values for click1 and click2? and to get those values, a person would click. first click's value would be set as click1, and the second click would be set as click2. someone point me in the right direction?

Share this post


Link to post
Share on other sites

you can try the SciTE4Au3.exe !

I Think :SciTE4Au3 has some tools can help you !

Share this post


Link to post
Share on other sites

MouseGetPos() with hotkeys or a Splash Text should help :(


Writing AutoIt scripts since
_DateAdd("d", -2, _NowCalcDate())

Share this post


Link to post
Share on other sites

this is my starting code

HotKeySet("{end}", "mouse1")

func mouse1()

$pos = MouseGetPos()

MsgBox(0, "Mouse x,y:", $pos[0]& "," & $pos[1])

endfunc

when i run the script nothing happens. can someone help?

Share this post


Link to post
Share on other sites

this is my starting code

when i run the script nothing happens. can someone help?

<{POST_SNAPBACK}>

because your script ended. You will need an endless loop.

Cheers

Kurt


__________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *

Share this post


Link to post
Share on other sites

#14 ·  Posted (edited)

i think im way out of my legue here...

this is what the script is suppost to do:

1. Get first mouse click's posistion by pressing number button 1.

2. Get second mouse click's position by pressing number button 2.

3. Go back and forth between mouse click 1 and 2 positions.

4. Only stop when paused or terminated.

Global $Paused

HotKeySet("{PAUSE}", "TogglePause")

HotKeySet("{ESC}", "Terminate")

HotKeySet("1", "mouse1")

while 1 = 1

sleep(100)

wend

func mouse1()

$pos = MouseGetPos()

endfunc

HotKeySet("2", "mouse2")

while 1 = 1

sleep(100)

wend

func mouse2()

$pos = MouseGetPos()

endfunc

MouseClick($mouse1,$pos[0],$pos[1],50)

MouseClick($mouse2,$pos[0],$pos[1],50)

While 1

    Sleep(100)

WEnd

;;;;;;;;

Func TogglePause()

    $Paused = NOT $Paused

    While $Paused

        sleep(100)

        ToolTip('Script is "Paused"',0,0)

    WEnd

    ToolTip("")

Edited by yummy22543

Share this post


Link to post
Share on other sites

#15 ·  Posted (edited)

I think the keyword in HotKeySet() is KEY!. Is a mouse a key? No, why is the keyboard called keyboard? Because it has keys on it. Mouse = Not keyboard = No key.

Use the search function on the forums to search in 'Scripts and Scraps' for a UDF called _IsPressed().

Edited by Burrup

[u]Old Projects:[/u]A3MORGB2Hex[u]Old Functions:[/u]_TimeAdd/_TimeSub_AddComma_BubbleSort _RippleSort "He who does not understand your silence will probably not understand your words." - Elbert Hubbard.

Share this post


Link to post
Share on other sites

I think the keyword in HotKeySet() is KEY!. Is a mouse a key? No, why is the keyboard called keyboard? Because it has keys on it. Mouse = Not keyboard = No key.

Use the search function on the forums to search in 'Scripts and Scraps' for a UDF called _IsPressed().

<{POST_SNAPBACK}>

this is why forums are used for help.

Share this post


Link to post
Share on other sites

HotKeySet("1", "mouse1")

when button 1 is pushed, it makes a function called mouse1. i dont see what is wrong with this. could you try to explain instead of calling me stupid?

Share this post


Link to post
Share on other sites

HotKeySet("1", "mouse1")

when button 1 is pushed, it makes a function called mouse1. i dont see what is wrong with this. could you try to explain instead of calling me stupid?

<{POST_SNAPBACK}>

:(

Contributions: UDF _DateYearFirstChildren are like Farts, you can just about stand your own.Why am I not a Vegetarian?...Well...my ancestors didn't fight & evolve to the Top of the food chain for me to survive on Salad

Share this post


Link to post
Share on other sites

hardcopy that was an absolutly worthless spam post.

i see that i made a mistake on the "1", which is now fixed. i need help with this.

HotKeySet("{END}", "mouse2")

func mouse2()

$pos = MouseGetPos()

endfunc

while 1 = 1

MouseClick($mouse1)

Wend

i need mouseclick to be the position when button END is pressed.

Share this post


Link to post
Share on other sites

hardcopy that was an absolutly worthless spam post.

i see that i made a mistake on the "1", which is now fixed. i need help with this.

i need mouseclick to be the position when button END is pressed.

<{POST_SNAPBACK}>

****-----------

Dude it wasnt spam / I forgot to post a gift for you.

;;; by hardcopy June17 2005  / Autoit beta 3.1.1.46
;;; moves mouse pointer between to specified regions on screen
;;; operation - move mouse to first location + Press "1"  (will show a tooltip)
;;;          move mouse to second location + Press "2"
;;;          once "2" has been pressed script will move mouse between these 2 points  ;;;;         & executing a left mouse click -  until "Esc" key pressed.
;;;;
;;;;           Quick + dirty code.


Global $Paused
dim $pos_one
dim $pos_two

HotKeySet("{PAUSE}", "TogglePause")
HotKeySet("{ESC}", "Terminate")

HotKeySet("1", "mouse1")
HotKeySet("2", "mouse2")




while 1 
    sleep(10)
wend





func mouse1()
    $pos_one = MouseGetPos()
    ToolTip("First Location Set here",$pos_one[0],$pos_one[1])
endfunc


func mouse2()
    $pos_two = MouseGetPos()
    ToolTip("Second Location Set here",$pos_two[0],$pos_two[1])

    while 1 
        MouseClick("left",$pos_one[0],$pos_one[1],1,100)
        MouseClick("left",$pos_two[0],$pos_two[1],1,100)
        sleep(10)
    wend
    
endfunc



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


func Terminate()
    Exit 0
EndFunc

hth

HardCopy

( I too am a newbie to autoit but i learn by solving others problems.) :(


Contributions: UDF _DateYearFirstChildren are like Farts, you can just about stand your own.Why am I not a Vegetarian?...Well...my ancestors didn't fight & evolve to the Top of the food chain for me to survive on Salad

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