x2ruff4u Posted September 5, 2006 Share Posted September 5, 2006 (edited) How would I go about putting these 2 together on one script having trouble here n thnx in advance!! or could someone do it for me n thnx! HotKeySet("{ESC}", "quit") While 1 WinWaitActive("XP") Send ("1") Sleep(900000) WEnd Func quit() Exit EndFunc HotKeySet("{ESC}", "quit") While 1 WinWaitActive("XP") Send ("2") Sleep(200000) WEnd Func quit() Exit EndFunc Edited September 5, 2006 by x2ruff4u Link to comment Share on other sites More sharing options...
Achilles Posted September 5, 2006 Share Posted September 5, 2006 (edited) How would I go about putting these 2 together on one script having trouble here n thnx in advance!! or could someone do it for me n thnx! HotKeySet("{ESC}", "quit") While 1 WinWaitActive("XP") Send ("1") Sleep(900000) WEnd Func quit() Exit EndFunc HotKeySet("{ESC}", "quit") While 1 WinWaitActive("XP") Send ("2") Sleep(200000) WEnd Func quit() Exit EndFunc Why don't you just make it send "12" and sleep for 900000? 'Cause both Winwaitactive's are the same so it's going to end up sending "1" and "2" anwyays, and it also end up sleeping 900000 anyways... Piano_Man It would look like this HotKeySet("{ESC}", "quit") While 1 WinWaitActive("XP") Send ("12") Sleep(900000) WEnd Func quit() Exit EndFunc Edited September 5, 2006 by Piano_Man My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list] Link to comment Share on other sites More sharing options...
x2ruff4u Posted September 5, 2006 Author Share Posted September 5, 2006 no no i need to make the timing different for each one, how would i fix this O.o thnx in advance Link to comment Share on other sites More sharing options...
Achilles Posted September 5, 2006 Share Posted September 5, 2006 no no i need to make the timing different for each one, how would i fix this O.o thnx in advanceI sort of get the impression this isn't the full script... It might help if you were to post it (I might be wrong but I see no point the script you posted)... However, I still stand by what I said before, If you have one program waiting for "XP" to be active and when "XP" is Active they both send a different value and then sleep different values... for one it's just going to send one value right after the other and it will also just sleep for 900000 so it would be pointless to tell it to sleep 200000 as well as sleeping 900000... I think the problem is that we're not seeing the full script... Sincerely Piano_Man My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list] Link to comment Share on other sites More sharing options...
x2ruff4u Posted September 5, 2006 Author Share Posted September 5, 2006 (edited) it is there just broke in half from the first one to the other, I just want to run them both in one script at different times for each buton dats all Edited September 5, 2006 by x2ruff4u Link to comment Share on other sites More sharing options...
x2ruff4u Posted September 5, 2006 Author Share Posted September 5, 2006 bump hump! XD Link to comment Share on other sites More sharing options...
Uten Posted September 5, 2006 Share Posted September 5, 2006 I have refactored your code a bit. It did not make much sense as it was and it does not make muche sense now but I guess you have your reasons. HotKeySet("{ESC}", "quit") Local $longwait = 1 ;Need somthing to set this. GUI, window popping up timeofday? While 1 ; TODO Make some calling logic, If, Select or Switch If $longwait = 1 then LongWait() Else ShortWait() EndIf WEnd ; === Functions Func LongWait() WinWaitActive("XP") Send ("1") Sleep(900000) ;900 sec wait? EndFunc Func ShortWait() WinWaitActive("XP") Send ("2") Sleep(200000); 200Sec wait EndFunc Func quit() Exit EndFunc Please keep your sig. small! Use the help file. Search the forum. Then ask unresolved questions :) Script plugin demo, Simple Trace udf, TrayMenuEx udf, IOChatter demo, freebasic multithreaded dll sample, PostMessage, Aspell, Code profiling 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