Sign in to follow this  
Followers 0
butji

dsdsd

5 posts in this topic

#1 ·  Posted (edited)

EDIT: im sorry about name..... i cant undo it

how can i get this to work:

HotKeySet( "a", "a" )
HotKeySet( "b", "b" )

Func a()
    $lol = MouseGetPos()
EndFunc

Func b()
MsgBox( 1, "lol", "X = " & $lol[0] "  Y = " & $lol[1] )
EndFunc
While 1 = 1
WEnd

what i want it to do:

when a is pressed it remembers the mouse pos and when b is presses it shows the pos when a was pressed. but it doesnt show

Edited by butji

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Declare variable globally

HotKeySet( "a", "a" )
HotKeySet( "b", "b" )
Global $lol
Func a()
    $lol = MouseGetPos()
EndFunc

Func b()
MsgBox( 1, "lol", "X = " & $lol[0] & "  Y = " & $lol[1] )
EndFunc
While 1 = 1
WEnd
Edited by BigDod


Get Beta versions Here Get latest SciTE editor Here AutoIt 1-2-3 by Valuater - A great starting point.

Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Share this post


Link to post
Share on other sites

Global $lol; Recomended that you put your globals at the top for the script

HotKeySet( "a", "a" )
HotKeySet( "b", "b" )

Func a()
    $lol = MouseGetPos()
EndFunc

Func b()
MsgBox( 1, "lol", "X = " & $lol[0] & "  Y = " & $lol[1] )
EndFunc
While 1 = 1
WEnd


[font="Verdana"]Valik:Get it straight - I'm not here to say please, I'm here to help - if my help's not appreciated then lotsa luck, gentlemen.[/font]

Share this post


Link to post
Share on other sites

you may also want to declare it as an array, or else you may get an error if you press b before a

Global $lol[2]

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