E1M1 Posted February 2, 2010 Share Posted February 2, 2010 (edited) If i change $multiy and $starty manually (every time script finishes I change these 2 numbers and then press f5 again) then it works fine but if I use $n = 1 To 3 to update these variables then it turns buggy. I debbugged with msgbox, it showd that i get same numbers as I get with static code, but some reason it's not same.Here's my dynamic code.Opt("MouseClickDelay", 0) ;10 milliseconds Opt("MouseClickDownDelay", 0) ;10 milliseconds Opt("MouseClickDragDelay", 0) ;250 milliseconds Sleep(1000) $startx = 1050 $starty = 485 $multy = 22 $multx = 40 For $n = 1 To 3 $starty = 500 + ($n * 10) $x = 1050 $y = $starty $multy -= 2 MsgBox(0, $starty, $multy) For $i = 1 To 8 Step 0.08 ;~ Circle $y += Sin($i) * $multy $x += Cos($i) * $multx ;~ Wave ;~ $y +=1 ;~ $x +=(sin($i)*3)+0 If $x > 1200 Or $y > 1000 Then Exit ToolTip($x & @LF & $starty & @LF & $multy, 0, 0) MouseClickDrag("left", $startx, $starty, $x, $y, 0) $startx = MouseGetPos(0) $starty = MouseGetPos(1) Next Sleep(500) NextHere's pic made with dynamic code. If you look this pic close you can see that this picture has 2 lines out of ellipse.here's my static codeOpt("MouseClickDelay", 0) ;10 milliseconds Opt("MouseClickDownDelay", 0) ;10 milliseconds Opt("MouseClickDragDelay", 0) ;250 milliseconds Sleep(1000) $startx = 1050 $starty = 515 $multy = 18 $multx = 40 ;~ For $n = 1 To 3 ;~ $starty = 500 + ($n * 10) $x = 1050 $y = $starty ;~ $multy -= 2 ;~ MsgBox(0, $starty, $multy) For $i = 1 To 8 Step 0.08 ;~ Circle $y += Sin($i) * $multy $x += Cos($i) * $multx ;~ Wave ;~ $y +=1 ;~ $x +=(sin($i)*3)+0 If $x > 1200 Or $y > 1000 Then Exit ToolTip($x & @LF & $starty & @LF & $multy, 0, 0) MouseClickDrag("left", $startx, $starty, $x, $y, 0) $startx = MouseGetPos(0) $starty = MouseGetPos(1) Next ;~ Sleep(500) ;~ Nextand here's the static imageAny Ideas why this pics are diferent or why 1st picture have these 2 lines out of ellipse? Edited February 2, 2010 by E1M1 edited Link to comment Share on other sites More sharing options...
KaFu Posted February 3, 2010 Share Posted February 3, 2010 (edited) You didn't reset coords properly. Opt("MouseClickDelay", 0) ;10 milliseconds Opt("MouseClickDownDelay", 0) ;10 milliseconds Opt("MouseClickDragDelay", 0) ;250 milliseconds Sleep(1000) $multy = 22 $multx = 40 For $n = 1 To 3 $startx = 1050 $starty = 485 $x = $startx $y = $starty $multy -= 2 MsgBox(0, $starty, $multy) For $i = 1 To 8 Step 0.08 ;~ Circle $y += Sin($i) * $multy $x += Cos($i) * $multx ;~ Wave ;~ $y +=1 ;~ $x +=(sin($i)*3)+0 If $x > 1200 Or $y > 1000 Then Exit ToolTip($x & @LF & $starty & @LF & $multy, 0, 0) MouseClickDrag("left", $startx, $starty, $x, $y, 0) $startx = MouseGetPos(0) $starty = MouseGetPos(1) Next Sleep(500) Next Edited February 3, 2010 by KaFu OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2022-Nov-26) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Feb-16) HMW - Hide my Windows (2018-Sep-16) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2023-Jun-03) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) 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