SkyBlzr Posted May 2, 2011 Share Posted May 2, 2011 Hi, i'm trying to make a short script that when the left mouse button is pressed the Y coords will change depending on what value they are set too. I can move the mouse with just useing this MouseMove($pos[0],$pos[1]+10, 5) But as i'm wanting to eddit the value without having to keep altering the source it would be more uselfull. Heres the code so far: #include <Misc.au3> Opt ("MouseCoordMode",2) HotKeySet ("{ESC}","_ExitApp") While 1 $var1 = (100) $pos = MouseGetPos() $End = ($var1 -1) ToolTip($var1) If _IsPressed(0x01) Then MouseMove($pos[0],$pos[1]+$var1, 5) EndIf WEnd Func _ExitApp() Exit EndFunc I'm trying to make $var1 the variable to be changed when pressing the 'End' key. With ToolTip showing the current value. Any help would be much appreciated. I'm new to this and still learning, sorry for any crappy code. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted May 2, 2011 Moderators Share Posted May 2, 2011 SkyBlzr, I am not altogether sure what you are trying to do - is this close? #include <GUIConstantsEx.au3> Opt("MouseCoordMode", 2) HotKeySet("{END}", "Inc_Var") Global $var = 100 $hGUI = GUICreate("Test", 500, 500) $hLabel = GUICtrlCreateLabel(100, 10, 10, 30, 20) GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $GUI_EVENT_PRIMARYDOWN $pos = MouseGetPos() MouseMove($pos[0], $pos[1] + $var, 5) Do Sleep(10) Until GUIGetMsg() = $GUI_EVENT_PRIMARYUP EndSwitch WEnd Func Inc_Var() $var -= 1 GUICtrlSetData($hLabel, $var) EndFunc ;==>Inc_Var If not, can you explain again or at least tell me why this is not correct. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
SkyBlzr Posted May 2, 2011 Author Share Posted May 2, 2011 Almost what I was wanting With the code you provided I was able to finish it! Thank's a ton for your help! 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