Sign in to follow this  
Followers 0
x2ruff4u

Putting these scripts together

7 posts in this topic

#1 ·  Posted (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 by x2ruff4u

Share this post


Link to post
Share on other sites



#2 ·  Posted (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 by Piano_Man

My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list]

Share this post


Link to post
Share on other sites

no no i need to make the timing different for each one, how would i fix this O.o thnx in advance

Share this post


Link to post
Share on other sites

no no i need to make the timing different for each one, how would i fix this O.o thnx in advance

I 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]

Share this post


Link to post
Share on other sites

#5 ·  Posted (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 by x2ruff4u

Share this post


Link to post
Share on other sites

bump hump! XD

Share this post


Link to post
Share on other sites

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.:P

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

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0