MasonMill Posted March 26, 2010 Share Posted March 26, 2010 Ok so after this message tab pops up pixelsearch detects it and sends an away message, i want to start clicking in intervals to the right though. How do i construct the $stop variable to tell it wehn to stop? This is what i have so far. $stop = 539, 693 For $i = 0 to $stop Step 5 mouseclick("left", $redtab[0] + $i , 693) sleep(500) Next Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted March 26, 2010 Moderators Share Posted March 26, 2010 MasonMill,How do i construct the $stop variable to tell it wehn to stop Unless you give us some idea of what criterion you wish to use define the stop point we cannot help. Do you want a fixed number of clicks? Until the edge of the screen? Perhaps until something happens? Over to you! 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...
MasonMill Posted March 26, 2010 Author Share Posted March 26, 2010 well, so 693 is the Y coord I want it to click along and I want it to stop at the X coord 539. Which is where the end of the chat window is located, so i want it to stop there. The ($stop = 539, 693) is basically the mouse coord I dont want it to click past. Link to comment Share on other sites More sharing options...
MasonMill Posted March 26, 2010 Author Share Posted March 26, 2010 i just dont know how to construct $stop such that it wont click past it. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted March 26, 2010 Moderators Share Posted March 26, 2010 MasonMill,So you want to click from the coordinates of $redtab until the point defined in your $stop variable ( example 539 x 693) at 5 pixel intervals.How are the coordinates stored in $stop? If it is an array (Dim $stop = [539, 693]) then you do this:For $i = $redtab[0] To $stop[0] Step 5 mouseclick("left", $i , $stop[1]) NextHow is that? 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...
MasonMill Posted March 26, 2010 Author Share Posted March 26, 2010 Awesome, thank you. Link to comment Share on other sites More sharing options...
MasonMill Posted March 26, 2010 Author Share Posted March 26, 2010 Why do you the Dim? Link to comment Share on other sites More sharing options...
MasonMill Posted March 26, 2010 Author Share Posted March 26, 2010 It gave me an error that says: dim $stop = [539,693] dim $stop = ^ERROR ERROR: Subscript used with non-Array variable. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted March 26, 2010 Moderators Share Posted March 26, 2010 MasonMill,To make clear it was an array. Normally I never use Dim, only Global and Local, but I was not sure of the scope you wanted to use. How do you get the coordinates of the stop point into the variable $stop? Is it from another PixelSearch? If so then AutoIt creates the array for you and you are not forced to declare it beforehand. Other functions (like _FileReadToArray, for example) require you to declare the array yourself before you call the function. It is a good idea to get into the habit of properly declaring your variables in scripts. It will pay dividends when you get into more complex code. 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...
MasonMill Posted March 26, 2010 Author Share Posted March 26, 2010 Yeah pixel search gave me the coords of the tab originally. ($redtab). But the message box ends at 539, 693 so i just picked them myself. I wanted it to click along the tabs becasue they have Xs on them to remove them. so i wanted to click to the right to remove all the tabs. The code is structured properly i believe but I don't know the syntax well enough yet in autoit. Should i use local or global? Link to comment Share on other sites More sharing options...
GEOSoft Posted March 26, 2010 Share Posted March 26, 2010 dim $stop[2] = [539,693] George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!" Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted March 26, 2010 Moderators Share Posted March 26, 2010 George,I will now go and write 50 times on the board: "I will not forget the dimensions when declaring an array the next time". MasonMill,Should i use local or global?It depends on where you are in your code and how you want to use the array.If the array is only used within a single function, the Local is correct. You can still use it in other functions, but you must pass it as a parameter.If the array is used by many functions, then you might consider declaring it as Global so they can all see it. But you should try and limit the number of Global variables to a minimum for various reasons, among which is the chance of overwriting them when you do not mean to! 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...
MasonMill Posted March 26, 2010 Author Share Posted March 26, 2010 So the 2th array cell becomes that coord, correct? So the last cell can have an X and Y coord? I'm sorry I'm just trying to understand why it works the way it does. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted March 26, 2010 Moderators Share Posted March 26, 2010 (edited) MasonMill,There is a very good tutorial on arrays in the Wiki. M23Edit: Speeling! Edited March 26, 2010 by Melba23 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...
MasonMill Posted March 26, 2010 Author Share Posted March 26, 2010 thanks! Ill go check that out. I appreciate the help guys, im almost done with CSE 1311(C programming) at my university and it has given tremendous insight to all this. I love it! Link to comment Share on other sites More sharing options...
MasonMill Posted March 26, 2010 Author Share Posted March 26, 2010 lightbulb!! thanks! Link to comment Share on other sites More sharing options...
GEOSoft Posted March 26, 2010 Share Posted March 26, 2010 George,I will now go and write 50 times on the board: "I will not forget the dimensions when declaring an array the next time". M23I've been letting you off to easy lately, make it a hundred. George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!" Link to comment Share on other sites More sharing options...
MasonMill Posted March 26, 2010 Author Share Posted March 26, 2010 any ideas why this isnt working properly? Its zooms across the screen and doesnt stop at 539, 693. if it steps over that coord does it just keep going? Even when i put step 1 it does the same thing. $stop[2] = [539, 693] For $i = 0 to $stop Step 5 mouseclick("left", $redtab[0] + $i , $stop[1]) sleep(500) Next Link to comment Share on other sites More sharing options...
MasonMill Posted March 26, 2010 Author Share Posted March 26, 2010 It jumps down to the correct Y coordinate then zooms off in the X direction without stopping till it gets way across the screen. Link to comment Share on other sites More sharing options...
Yoriz Posted March 26, 2010 Share Posted March 26, 2010 To use the value 539 from the array as the the ending value of the 'for' loop, so it goes from 0 to 539 you need to use $stop[0] in your 'for' line as below For $i = 0 to $stop[0] Step 5 I dont know what vaule is contained in $redtab[0] but this will stop it ending at 539 as it will be added to 539 and also if wont start at zero, it would start at the value of $redtab[0], if this is intended to be the start pos the following lines would apply. For $i = $redtab[0] to $stop[0] Step 5 mouseclick("left", $i , $stop[1]) Not really understanding what you require and not knowing what $redtab[0] is/does is not helping. sorry if this doesnt help you out much. GDIPlusDispose - A modified version of GDIPlus that auto disposes of its own objects before shutdown of the Dll using the same function Syntax as the original.EzMySql UDF - Use MySql Databases with autoit with syntax similar to SQLite UDF. 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