Kickassjoe Posted March 23, 2007 Share Posted March 23, 2007 I don't know if this is helpful to anyone, but here it is... Func _MouseMoveCircle($xcenter, $ycenter, $radius) $r2 = $radius * $radius For $y = 0 to $radius $x = int(sqrt($r2 - $y * $y) + 0.5) Mousemove($xcenter - $x, $ycenter + $y, 0) Next For $x = 0 to $radius $y = int(sqrt($r2 - $x * $x) + 0.5) Mousemove($xcenter + $x, $ycenter + $y, 0) Next For $y = 0 to $radius $x = int(sqrt($r2 - $y * $y) + 0.5) Mousemove($xcenter + $x, $ycenter - $y, 0) Next For $x = 0 to $radius $y = int(sqrt($r2 - $x * $x) + 0.5) Mousemove($xcenter - $x, $ycenter - $y, 0) Next EndFunc It moves the mouse in a circle, with the specified radius, around a specified point. I don't know of anything this would be useful for, except maybe modified to be useful for pixelsearches, but I had nothing else to do earlier, so, tell me what you think. What goes around comes around... Payback's a bitch. Link to comment Share on other sites More sharing options...
Cyber Posted March 23, 2007 Share Posted March 23, 2007 YES! Thanks!!! Console Browse: Navigate on the WEB in a textual consoleMultiPing!: Show computer on the lan and/or show the local/remote task, ALL animated!KillaWin: Event executingCryptPage: Crypt your webpage and show only with key Link to comment Share on other sites More sharing options...
BillLuvsU Posted March 23, 2007 Share Posted March 23, 2007 Useful for those times I need to draw a perfect circle =D [center][/center]Working on the next big thing.Currently Playing: Halo 4, League of LegendsXBL GT: iRememberYhslaw Link to comment Share on other sites More sharing options...
Kickassjoe Posted March 23, 2007 Author Share Posted March 23, 2007 Cyber, may I ask what you are using it for? and fear... if you mean in paint, you can just press shift.... (paint is as advanced with graphics as I get) What goes around comes around... Payback's a bitch. Link to comment Share on other sites More sharing options...
zmp Posted April 11, 2007 Share Posted April 11, 2007 (edited) Helpful yes, but excess code Func _MouseMoveCircle($x, $y, $r, $t); x coord, y coord, radius, time to loop (milliseconds) $tInit = TimerInit() While 1 $timer = TimerDiff($tInit) MouseMove($x + ($r * Sin($timer/100)), $y + ($r * Cos($timer/100)) ,1); simple math :P If $timer > $t Then ExitLoop WEnd EndFunc That one wont stop after going a full circle, I've used similar code to find monsters in diablo 2 That diablo monster search function increased radius in every cycle thus making not circle but a spiral ^^ Could be used in.. hmm let's see, finding a corpse to loot near the player? Edited April 11, 2007 by Xythe I code bots :: Need a bot? :: xythec@gmail.com Link to comment Share on other sites More sharing options...
DarkAngelBGE Posted April 11, 2007 Share Posted April 11, 2007 Thanks Xythe, very cool. Mind sharing your diablo scripts? Link to comment Share on other sites More sharing options...
BillLuvsU Posted April 11, 2007 Share Posted April 11, 2007 (edited) I used to play Diablo 2. Evan better way is you use a funtion in bliz32.dll i think and it will return an array with all clickable things, their coordnates and your coordnates. amazingly useful for making bots ;P Edit: Spelling Edited April 11, 2007 by fear1313 [center][/center]Working on the next big thing.Currently Playing: Halo 4, League of LegendsXBL GT: iRememberYhslaw Link to comment Share on other sites More sharing options...
zmp Posted April 12, 2007 Share Posted April 12, 2007 Hmm, using dll's works better but that's merely an example of optimized code.. hmm I can't edit that last post so I have to type the damn thing again here A bit more optimization Func _MouseMoveCircle($x, $y, $r, $t); x coord, y coord, radius, time to loop (milliseconds) $tInit = TimerInit() Do $timer = TimerDiff($tInit) MouseMove($x + ($r * Sin($timer/100)), $y + ($r * Cos($timer/100)) ,1); simple math :P Until $timer > $t EndFunc I code bots :: Need a bot? :: xythec@gmail.com Link to comment Share on other sites More sharing options...
naam Posted April 12, 2007 Share Posted April 12, 2007 It can be done easier just use Cos and Sin CODE ;$ is the radius ;$x and $y represent the center of the circle $r = 200 $x = 400 $y = 400 For $angle = 0 to 20 step 0.1 Mousemove($x + $r * Cos($angle),$y + $r * Sin($angle),0) sleep(10) Next Link to comment Share on other sites More sharing options...
BillLuvsU Posted April 12, 2007 Share Posted April 12, 2007 Gah, trigonometry. Were going over that in math class right now and I just don't have the brain capacity for it. [center][/center]Working on the next big thing.Currently Playing: Halo 4, League of LegendsXBL GT: iRememberYhslaw Link to comment Share on other sites More sharing options...
Kickassjoe Posted April 13, 2007 Author Share Posted April 13, 2007 Those examples are only a couple of years out of my league! What goes around comes around... Payback's a bitch. Link to comment Share on other sites More sharing options...
Toady Posted April 13, 2007 Share Posted April 13, 2007 (edited) Cool little script.. sparked my interest so I made it so your mouse moves in a spiral. Open up MS Paint, place your mouse cursor somewhere to draw and press the Enter key. It draws a spiral!!! #include <Misc.au3> HotKeySet("{ESC}","_Exit") While 1 Local $pos = MouseGetPos() If _IsPressed("0D") Then _MouseMoveCircle($pos[0],$pos[1], 1, 7000) Sleep(1000/@DesktopRefresh) WEnd Func _MouseMoveCircle($x, $y, $r, $t); x coord, y coord, radius, time to loop (milliseconds) $tInit = TimerInit() MouseDown("left") Do $timer = TimerDiff($tInit) $r += 0.1 ;Increase radius a little bit at a time to make spiral MouseMove($x + ($r * Sin($timer/100)), $y + ($r * Cos($timer/100)) ,1); simple math :P Until $timer > $t MouseUp("left") EndFunc Func _Exit() Exit EndFunc Edited April 13, 2007 by Toady www.itoady.com A* (A-star) Searching Algorithm - A.I. Artificial Intelligence bot path finding 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