Muchuchu Posted April 29, 2008 Share Posted April 29, 2008 I want me script to do function firstround, then take the arrays/variables from there and use them in function secondround which comes after a loop of firstround. I want it to do a pixelsearch, get the coordinates, then do a getmouseposition, take those coordinates, then use them in the second function, but it is saying my arrays are not written correctly, but i really don't know why. expandcollapse popupfunc firstround() do do $i = 0 global $arr1[2][1000] sleep("1000") global $coord1 = PixelSearch(0, 0, 1279, 1023, $vary4) If @error Then PixelSearch(0, 0, 1279, 1023, $vary4) EndIf until not @error global $arr1[0][$i] = $coord1[0] global $arr1[1][$i] = $coord1[1] Sleep("70") MouseMove($coord1[0], $coord1[1]) Sleep("70") MouseDown("right") Sleep("100") MouseUp("right") ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;Goes down 40 pixels global $a = mousegetpos() sleep("1000") global $right = mousemove($a[0], $a[1] + 40) sleep("600") MouseDown("right") Sleep("100") MouseUp("right") ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; sleep("600") MouseDown("left") Sleep("200") MouseUp("left") $i = $i + 1 until $i = 1 endfunc ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; func secondround() do sleep("1000") MouseMove($coord1[0], $coord1[1]) sleep("600") MouseDown("right") Sleep("100") MouseUp("right") sleep("600") MouseMove($coord1[0], $coord1[1] + 40) sleep("400") MouseDown("left") Sleep("200") MouseUp("left") $i = $i + 1 until $i = 1 endfunc Link to comment Share on other sites More sharing options...
rasim Posted April 29, 2008 Share Posted April 29, 2008 Declare array outside of function as Global. 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