DirtyWhyte Posted November 14, 2006 Share Posted November 14, 2006 Hello, all. How are you all today? Well, I seem to be having a problem:I want to make an AutoIt Script Application that, when I press Control and SpaceBar together (^{SPACE}), the Script should be told to Paste from Clipboard and then press enter, or if I send Shift and SpaceBar (+{SPACE}), It should tell it to send "{ENTER}", "{Paste from Clipboard}", "{Enter}"... But something's just not letting it work right, and it's definately an operator error (An error on behalf of myself).Well, here's the script, or at least the parts of it needed to understand my problem.. ANY comments and/or suggestions are asked of you all.Global $WinEx = 0, $Var = 0, $SpammerA = 0, $SpammerB = 0, $Clip = ClipGet() ;My Variables -- you should note only $SpammerA, $SpammerB, $Clip HotKeySet("{PAUSE}", "RunWC3BL") ;You don't need these HotKeySet("^{TAB}", "RunApps") ;You don't need these HotKeySet("^{SPACE}", "Spammer1") ;This is one of them HotKeySet("+{SPACE}", "Spammer2") ;This is one of them HotKeySet("^+{SPACE}", "EndSpam") ;This is one of them Func Spammer1() ;When (^{SPACE}) [or Ctrl and Space] are pressed $SpammerA = 1 ;Set $SpammerA equal to 1 EndFunc ;End Function Command Func Spammer2() ;When (+{SPACE}) [or Shift and Space] are pressed $SpammerB = 1 ;Set $SpammerB equal to 1 EndFunc ;End Function Command Func EndSpam() ;For Ending $Spammer2 and $Spammer1 Function Commands--That's all you need to know $SpammerA = 0 $SpammerB = 0 EndFunc While $SpammerA = 1 ;While $SpammerA is active [After Func Spammer1 has been issued] Send("$Clip") ;paste from the Clipboard [Remember, $Clip = ClipPut()] Send("{Enter}") ;Send {ENTER} Key. WEnd ;End While Command While $SpammerB = 1 ;While $SpammerB is active [After Func Spammer2 has been issued] Send("{Enter}") ;Send {ENTER} Send("$Clip") ;paste from the Clipboard [Remember, $Clip = ClipPut()] Send("{ENTER}") ;Send {ENTER} WEnd ;End While CommandIf anyone could possibly help me fix this problem, I'd appreciate it greatly.I thank you all so very much just for taking the time to read my post, but, please, help me out here? Thanks.DirtyWhyteJacob Black Link to comment Share on other sites More sharing options...
Zedna Posted November 14, 2006 Share Posted November 14, 2006 Hello Your question is not exact and you didn't stated where exactly problem is. So here are two possible solutions: first version - On hotkey Send() is processed only once expandcollapse popupHotKeySet("^{SPACE}", "Spammer1") HotKeySet("+{SPACE}", "Spammer2") HotKeySet("^+{SPACE}", "EndSpam") Func Spammer1() Send(ClipGet(),1) Send("{Enter}") EndFunc Func Spammer2() Send("{Enter}") Send(ClipGet(),1) Send("{ENTER}") EndFunc Func EndSpam() HotKeySet("^{SPACE}") HotKeySet("+{SPACE}") HotKeySet("^+{SPACE}") Exit EndFunc While 1 Sleep(100) WEnd oÝ÷ ÚÇ¢woz»"¢s§d{$ج¦ºzËv·©y«^vºÚ"µÍÛØ[ ÌÍÔÜ[[YHH ÌÍÔÜ[[YHÝÙ^TÙ] ][Ý×ÔÔPÑ_I][ÝË ][ÝÔÜ[[YI][ÝÊHÝÙ^TÙ] ][ÝÊÞÔÔPÑ_I][ÝË ][ÝÔÜ[[Y][ÝÊHÝÙ^TÙ] ][Ý×ÞÔÔPÑ_I][ÝË ][ÝÑ[Ü[I][ÝÊH[ÈÜ[[YJ HIÌÍÔÜ[[YHHH[[È[ÈÜ[[Y HIÌÍÔÜ[[YHH[[È[È[Ü[J H ÌÍÔÜ[[YHH ÌÍÔÜ[[YH[[ÂÚ[HBRY ÌÍÔÜ[[YHHH[BTÙ[ ÛÙ] KJBBTÙ[ ][ÝÞÑ[I][ÝÊHQ[YBRY ÌÍÔÜ[[YHH[BTÙ[ ][ÝÞÑ[I][ÝÊHBTÙ[ ÛÙ] KJBBTÙ[ ][ÝÞÑSTI][ÝÊHQ[YBTÛY L BÑ[ Resources UDF ResourcesEx UDF AutoIt Forum Search 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