aldona22 Posted August 28, 2005 Share Posted August 28, 2005 I'm writing script for one game, and have problem, here's this part of the code: MouseClick("right", 400, 400, 2) Sleep(1000) It's not clicking by right mouse button two times, it's clicking two times + all the sleep time (example: 1000 ms = a lot of fast right mouse clicks). How to stop/end clicking on sleep time? Thanks Link to comment Share on other sites More sharing options...
Developers Jos Posted August 28, 2005 Developers Share Posted August 28, 2005 MouseClick("right", 400, 400, 2) Sleep(1000)<{POST_SNAPBACK}>This script will do 2 times a Rightmouse click and then wait 1000ms as requested... so what else is it you want it to do ? SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
aldona22 Posted August 28, 2005 Author Share Posted August 28, 2005 (edited) Nope. That's clicking all the sleeping time, the same here: MouseClick("right", 765, 40, 2) Opt("MouseClickDownDelay", 10000) = 2 clicks + 10000ms of clicking... Any ideas? Edited August 28, 2005 by aldona22 Link to comment Share on other sites More sharing options...
BigDod Posted August 28, 2005 Share Posted August 28, 2005 Nope. That's clicking all the sleeping time, the same here:MouseClick("right", 765, 40, 2) Opt("MouseClickDownDelay", 10000)= 2 clicks + 10000ms of clicking...Any ideas?<{POST_SNAPBACK}>In this one you are telling it to hold the mouse click down for 10000ms ??? Time you enjoyed wasting is not wasted time ......T.S. Elliot Suspense is worse than disappointment................Robert Burns God help the man who won't help himself, because no-one else will...........My Grandmother Link to comment Share on other sites More sharing options...
aldona22 Posted August 28, 2005 Author Share Posted August 28, 2005 Nope, I just want do it that way: 2 clicks and after that sleep. But that's clicking all the sleeping time and I've no idea why... Link to comment Share on other sites More sharing options...
BigDod Posted August 28, 2005 Share Posted August 28, 2005 Post the rest of your code so that people can see what you are doing. Time you enjoyed wasting is not wasted time ......T.S. Elliot Suspense is worse than disappointment................Robert Burns God help the man who won't help himself, because no-one else will...........My Grandmother Link to comment Share on other sites More sharing options...
aldona22 Posted August 28, 2005 Author Share Posted August 28, 2005 expandcollapse popupRun("Notepad.exe", "", @SW_MINIMIZE) $i = 0 func start() $i = 0 While $i <= 10 send("{1 2}") WinActivate("Bez tytułu - Notatnik","") Opt("MouseCoordMode", 1) MouseClick("right", 765, 40, 2) Opt("MouseClickDownDelay", 10000) WinActivate("Bez tytułu - Notatnik","") Opt("MouseCoordMode", 1) MouseClick("right", 765, 65, 2) Opt("MouseClickDownDelay", 10000) WinActivate("Bez tytułu - Notatnik","") Opt("MouseCoordMode", 1) MouseClick("right", 765, 90, 2) Opt("MouseClickDownDelay", 10000) WinActivate("Bez tytułu - Notatnik","") Opt("MouseCoordMode", 1) MouseClick("right", 765, 115, 2) Opt("MouseClickDownDelay", 10000) WinActivate("Bez tytułu - Notatnik","") Opt("MouseCoordMode", 1) MouseClick("right", 765, 140, 2) Opt("MouseClickDownDelay", 10000) WinActivate("Bez tytułu - Notatnik","") send("{2 2}") WinActivate("Bez tytułu - Notatnik","") Opt("MouseCoordMode", 1) MouseClick("right", 765, 40, 2) Opt("MouseClickDownDelay", 10000) WinActivate("Bez tytułu - Notatnik","") Opt("MouseCoordMode", 1) MouseClick("right", 765, 65, 2) Opt("MouseClickDownDelay", 10000) WinActivate("Bez tytułu - Notatnik","") Opt("MouseCoordMode", 1) MouseClick("right", 765, 90, 2) Opt("MouseClickDownDelay", 10000) WinActivate("Bez tytułu - Notatnik","") Opt("MouseCoordMode", 1) MouseClick("right", 765, 115, 2) Opt("MouseClickDownDelay", 10000) WinActivate("Bez tytułu - Notatnik","") Opt("MouseCoordMode", 1) MouseClick("right", 765, 140, 2) Opt("MouseClickDownDelay", 10000) WinActivate("Bez tytułu - Notatnik","") send("{3 2}") WinActivate("Bez tytułu - Notatnik","") Opt("MouseCoordMode", 1) MouseClick("right", 765, 40, 2) Opt("MouseClickDownDelay", 10000) WinActivate("Bez tytułu - Notatnik","") Opt("MouseCoordMode", 1) MouseClick("right", 765, 65, 2) Opt("MouseClickDownDelay", 10000) WinActivate("Bez tytułu - Notatnik","") Opt("MouseCoordMode", 1) MouseClick("right", 765, 90, 2) Opt("MouseClickDownDelay", 10000) WinActivate("Bez tytułu - Notatnik","") Opt("MouseCoordMode", 1) MouseClick("right", 765, 115, 2) Opt("MouseClickDownDelay", 10000) WinActivate("Bez tytułu - Notatnik","") Opt("MouseCoordMode", 1) MouseClick("right", 765, 140, 2) Opt("MouseClickDownDelay", 10000) WinActivate("Bez tytułu - Notatnik","") wend endfunc func stop() while 1 sleep (10000) wend endfunc HotKeySet("{NUMPAD7}", "start") HotKeySet("{NUMPAD9}", "stop") while 1 sleep (10000) wend I must activate the Notepad window, cause game is having some securities. All symbols must be typed in the Notepad... Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted August 28, 2005 Moderators Share Posted August 28, 2005 You can set the delay of the mouse click like this:MouseClick("right", 400, 400, 2, 1)Blue = Times to Click as it seems you already knowRed = Speed to Click: 10 is the default... 1 is the fastestI hope this helps, because to be honest... I don't fully understand what your trying to accomplish... GL Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted August 28, 2005 Moderators Share Posted August 28, 2005 (edited) Or you can try this: expandcollapse popupOpt("WinTitleMatchMode", 2) Opt("MouseCoordMode", 1) Run("Notepad.exe", "", @SW_MINIMIZE) $i = 0 func start() $i = 0 While $i <= 10 send("{1 2}") If Not Winactive("Bez tytulu - Notatnik") Then WinActivate("Bez tytulu - Notatnik") MouseClick("right", 765, 40, 2, 1) Sleep(10000); Sleeps approximately 10 seconds If Not Winactive("Bez tytulu - Notatnik") Then WinActivate("Bez tytulu - Notatnik") MouseClick("right", 765, 65, 2, 1) Sleep(10000); Sleeps approximately 10 seconds If Not Winactive("Bez tytulu - Notatnik") Then WinActivate("Bez tytulu - Notatnik") MouseClick("right", 765, 90, 2, 1) Sleep(10000); Sleeps approximately 10 seconds If Not Winactive("Bez tytulu - Notatnik") Then WinActivate("Bez tytulu - Notatnik") MouseClick("right", 765, 115, 2, 1) Sleep(10000); Sleeps approximately 10 seconds If Not Winactive("Bez tytulu - Notatnik") Then WinActivate("Bez tytulu - Notatnik") MouseClick("right", 765, 140, 2, 1) Sleep(10000); Sleeps approximately 10 seconds If Not Winactive("Bez tytulu - Notatnik") Then WinActivate("Bez tytulu - Notatnik") send("{2 2}") If Not Winactive("Bez tytulu - Notatnik") Then WinActivate("Bez tytulu - Notatnik") MouseClick("right", 765, 40, 2, 1) Sleep(10000); Sleeps approximately 10 seconds If Not Winactive("Bez tytulu - Notatnik") Then WinActivate("Bez tytulu - Notatnik") MouseClick("right", 765, 65, 2, 1) Sleep(10000); Sleeps approximately 10 seconds If Not Winactive("Bez tytulu - Notatnik") Then WinActivate("Bez tytulu - Notatnik") MouseClick("right", 765, 90, 2, 1) Sleep(10000); Sleeps approximately 10 seconds If Not Winactive("Bez tytulu - Notatnik") Then WinActivate("Bez tytulu - Notatnik") MouseClick("right", 765, 115, 2, 1) Sleep(10000); Sleeps approximately 10 seconds If Not Winactive("Bez tytulu - Notatnik") Then WinActivate("Bez tytulu - Notatnik") MouseClick("right", 765, 140, 2, 1) Sleep(10000); Sleeps approximately 10 seconds If Not Winactive("Bez tytulu - Notatnik") Then WinActivate("Bez tytulu - Notatnik") send("{3 2}") If Not Winactive("Bez tytulu - Notatnik") Then WinActivate("Bez tytulu - Notatnik") MouseClick("right", 765, 40, 2, 1) Sleep(10000); Sleeps approximately 10 seconds If Not Winactive("Bez tytulu - Notatnik") Then WinActivate("Bez tytulu - Notatnik") MouseClick("right", 765, 65, 2, 1) Sleep(10000); Sleeps approximately 10 seconds If Not Winactive("Bez tytulu - Notatnik") Then WinActivate("Bez tytulu - Notatnik") MouseClick("right", 765, 90, 2, 1) Sleep(10000); Sleeps approximately 10 seconds If Not Winactive("Bez tytulu - Notatnik") Then WinActivate("Bez tytulu - Notatnik") MouseClick("right", 765, 115, 2, 1) Sleep(10000); Sleeps approximately 10 seconds If Not Winactive("Bez tytulu - Notatnik") Then WinActivate("Bez tytulu - Notatnik") MouseClick("right", 765, 140, 2, 1) Sleep(10000); Sleeps approximately 10 seconds If Not Winactive("Bez tytulu - Notatnik") Then WinActivate("Bez tytulu - Notatnik") wend endfunc func stop() while 1 sleep (10000) wend endfunc HotKeySet("{NUMPAD7}", "start") HotKeySet("{NUMPAD9}", "stop") Edit: Had an extra paramater for wintitlematchmode Edited August 28, 2005 by ronsrules Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
LxP Posted August 28, 2005 Share Posted August 28, 2005 Just to clarify, this command:opt("mouseClickDownDelay", ××)should be (generally) used once at the beginning of your script to define how long the mouse button will be held down when AutoIt performs a click. To click the mouse and then wait for 10 seconds:mouseClick(...) sleep(10000)You may find that you don't even need the Opt() command at all if the default click-hold time works for you. 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