Rewl Posted November 17, 2010 Posted November 17, 2010 Hey guys so I'm making a script, and I want it so if i MouseClick("right") Then script sleeps for 2 seconds. I've tried everything though.. even the following.. And it doesn't work, can you guys help me? $right = MpuseClick("right") also you might need this to understand what $click is Dim $click = False Func startpause() If $click = False Then $click = True Else $click = False EndIf EndFunc While True If $click = True Then MouseClick("left") EndIf sleep(20) WEnd and this is the code that I tried to use and it doesn't work If $right Then $click = False sleep(2000) Else $click = True EndIf [size="1"]Programs: Draw Tool | [/size]
iamtheky Posted November 17, 2010 Posted November 17, 2010 check the help for _ispressed ,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-. |(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/ (_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_) | | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) ( | | | | |)| | \ / | | | | | |)| | `--. | |) \ | | `-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_| '-' '-' (__) (__) (_) (__)
Rewl Posted November 17, 2010 Author Posted November 17, 2010 (edited) check the help for _ispressed thanks for your help iamtheky! so this is what I have, and it still doesn't work IF _IsPressed("02") Then Sleep(2000) EndIf I've also tried IF _IsPressed("02" , $dll) Then Sleep(2000) EndIf DllClose($dll) Edited November 17, 2010 by Rewl [size="1"]Programs: Draw Tool | [/size]
wakillon Posted November 17, 2010 Posted November 17, 2010 (edited) have you try like this ? #include <Misc.au3> While 1 If _IsPressed ( "02" ) = 1 Then ConsoleWrite ( "Sleep ( 2000 )" & @Crlf ) Sleep ( 2000 ) EndIf Sleep ( 10 ) WEnd Edited November 17, 2010 by wakillon AutoIt 3.3.14.2 X86 - SciTE 3.6.0 - WIN 8.1 X64 - Other Example Scripts
Rewl Posted November 17, 2010 Author Posted November 17, 2010 have you try like this ? #include <Misc.au3> While 1 If _IsPressed ( "02" ) = 1 Then ConsoleWrite ( "Sleep ( 2000 )" & @Crlf ) Sleep ( 2000 ) EndIf Sleep ( 10 ) WEnd just did it and it still doesn't work :/ [size="1"]Programs: Draw Tool | [/size]
wakillon Posted November 17, 2010 Posted November 17, 2010 just did it and it still doesn't work :/"02" is the right click mouse button, so try with another But for me it works fine ! AutoIt 3.3.14.2 X86 - SciTE 3.6.0 - WIN 8.1 X64 - Other Example Scripts
Rewl Posted November 17, 2010 Author Posted November 17, 2010 hmm, show me your whole source? [size="1"]Programs: Draw Tool | [/size]
iamtheky Posted November 17, 2010 Posted November 17, 2010 How about? You show us your whole source, and we will show you why its not making with the right click sleep action. ,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-. |(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/ (_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_) | | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) ( | | | | |)| | \ / | | | | | |)| | `--. | |) \ | | `-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_| '-' '-' (__) (__) (_) (__)
Rewl Posted November 17, 2010 Author Posted November 17, 2010 How about? You show us your whole source, and we will show you why its not making with the right click sleep action. expandcollapse popup#include<IE.au3> HotKeySet("{ESC}" , "close") HotKeySet("{SPACE}" , "startpause") Dim $click = False $dll = DllOpen("user32.dll") MsgBox(64, "Rewl's XXXX v1.0" , "Thank-you for using Auto Clicker, Press ""ESC"" to close the program and ""G"" to pause the clicker and SpaceBar to start it.") Func close() $iE = _IECreate() $m = MsgBox(4 , "Rewl's XXXXX v1.0" , "Thank-you for trying the program, Press yes to visit Auto-IT Thread.") IF $m = 6 Then _IENavigate($iE , "") EndIf Exit EndFunc Func startpause() If $click = False Then $click = True ToolTip("Rewl XXXXXX v1.0 Running." , 0 , 0) Else $click = False ToolTip("Rewl XXXXXX v1.0 Paused." , 0 , 0) EndIf EndFunc While True If $click = True Then MouseClick("left") EndIf sleep(20) WEnd #include <Misc.au3> While 1 If _IsPressed ( "02" ) = 1 Then ConsoleWrite ( "Sleep ( 2000 )" & @Crlf ) Sleep ( 2000 ) EndIf Sleep ( 10 ) WEnd [size="1"]Programs: Draw Tool | [/size]
iamtheky Posted November 17, 2010 Posted November 17, 2010 multiple whiles is teh ugly expandcollapse popup#include<IE.au3> #include <Misc.au3> HotKeySet("{ESC}" , "close") HotKeySet("{SPACE}" , "startpause") Dim $click = False $dll = DllOpen("user32.dll") MsgBox(64, "Rewl's XXXX v1.0" , "Thank-you for using Auto Clicker, Press ""ESC"" to close the program and ""G"" to pause the clicker and SpaceBar to start it.") Func close() $iE = _IECreate() $m = MsgBox(4 , "Rewl's XXXXX v1.0" , "Thank-you for trying the program, Press yes to visit Auto-IT Thread.") IF $m = 6 Then _IENavigate($iE , "") EndIf Exit EndFunc Func startpause() If $click = False Then $click = True ToolTip("Rewl XXXXXX v1.0 Running." , 0 , 0) Else $click = False ToolTip("Rewl XXXXXX v1.0 Paused." , 0 , 0) EndIf EndFunc While 1 If _IsPressed ( "02" ) = 1 Then ConsoleWrite ( "Sleep ( 2000 )" & @Crlf ) Sleep ( 2000 ) EndIf If $click = True Then ConsoleWrite ( "TRUE" & @Crlf ) EndIf sleep(20) WEnd ,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-. |(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/ (_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_) | | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) ( | | | | |)| | \ / | | | | | |)| | `--. | |) \ | | `-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_| '-' '-' (__) (__) (_) (__)
Rewl Posted November 17, 2010 Author Posted November 17, 2010 so now after i right click it doesnt start clicking again, ill fix it. thanks [size="1"]Programs: Draw Tool | [/size]
Rewl Posted November 17, 2010 Author Posted November 17, 2010 Nvm I fixed it . [size="1"]Programs: Draw Tool | [/size]
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