butji Posted February 25, 2007 Share Posted February 25, 2007 (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 February 25, 2007 by butji Link to comment Share on other sites More sharing options...
BigDod Posted February 25, 2007 Share Posted February 25, 2007 (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 February 25, 2007 by BigDod 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 Link to comment Share on other sites More sharing options...
Sardith Posted February 25, 2007 Share Posted February 25, 2007 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] Link to comment Share on other sites More sharing options...
butji Posted February 25, 2007 Author Share Posted February 25, 2007 ty Link to comment Share on other sites More sharing options...
improbability_paradox Posted February 25, 2007 Share Posted February 25, 2007 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] Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now