Jump to content

Question


Recommended Posts

The question has to do with delays I suppose. Is there anyway to have a script cycle, off the windows clock?

So if it's 11am it will run the already running script in the background?

[font="Verdana"]Valik:Get it straight - I'm not here to say please, I'm here to help - if my help's not appreciated then lotsa luck, gentlemen.[/font]

Link to comment
Share on other sites

trying to make some more sense of what id like.... The script is already running, it's like a delay.. it reads windows clock' and at 11am it stops the delay and runs the rest of the script.

[font="Verdana"]Valik:Get it straight - I'm not here to say please, I'm here to help - if my help's not appreciated then lotsa luck, gentlemen.[/font]

Link to comment
Share on other sites

Interesting I'll give that a try thanks alot.

[font="Verdana"]Valik:Get it straight - I'm not here to say please, I'm here to help - if my help's not appreciated then lotsa luck, gentlemen.[/font]

Link to comment
Share on other sites

What do you mean by _nowtime(4)

What does the the 4 indicate? Could I have, above my script..

nowtime(1) = "10:00pm"

nowtime(2) = "1:00pm"

?

[font="Verdana"]Valik:Get it straight - I'm not here to say please, I'm here to help - if my help's not appreciated then lotsa luck, gentlemen.[/font]

Link to comment
Share on other sites

If _NowTime(4) = "11:00" Then kill()
Endif

Func kill()
If WinExists("Darkages") Then
WinKill("Darkages");Gets rid of the running DA
Else

sleep(1200);Time delay for launch
Mouseclick("left", 170, 749, 1); For Launching
Sleep(2000)
logon()
Endif
EndFunc


;logon()
;Endif


Func logon()
Mouseclick("left", 166, 231, 1)
Mouseclick("left", 166, 231, 1)
Mouseclick("left", 166, 231, 1)
sleep(2000)
Mouseclick("left", 236, 419, 1)
sleep(700)
Mouseclick("left", 109, 347, 1)
sleep(1000)
$hWnd = WinGetHandle("Darkages");Name of the programs' title
_Sendkeys($hWnd, "+Nicad");Name
sleep(2000)
_Sendkeys($hWnd, "{TAB}")
sleep(500)
_Sendkeys($hWnd, "******");Password
sleep(500)
_Sendkeys($hWnd, "{ENTER}")
EndFunc

Not sure where im going wrong..

Edited by Sardith

[font="Verdana"]Valik:Get it straight - I'm not here to say please, I'm here to help - if my help's not appreciated then lotsa luck, gentlemen.[/font]

Link to comment
Share on other sites

you didnt add in a loop to keep checking

quick question, what UDF has _sendkeys?

why not just use send()

hile 1
If _NowTime(4) = "11:00" Then 
    kill()
WEnd
Func kill()
If WinExists("Darkages") Then
WinKill("Darkages");Gets rid of the running DA
Else
sleep(1200);Time delay for launch
Mouseclick("left", 170, 749, 1); For Launching
Sleep(2000)
logon()
Endif
EndFunc


;logon()
;Endif


Func logon()
Mouseclick("left", 166, 231, 1)
Mouseclick("left", 166, 231, 1)
Mouseclick("left", 166, 231, 1)
sleep(2000)
Mouseclick("left", 236, 419, 1)
sleep(700)
Mouseclick("left", 109, 347, 1)
sleep(1000)
$hWnd = WinGetHandle("Darkages");Name of the programs' title
_Sendkeys($hWnd, "+Nicad");Name
sleep(2000)
_Sendkeys($hWnd, "{TAB}")
sleep(500)
_Sendkeys($hWnd, "******");Password
sleep(500)
_Sendkeys($hWnd, "{ENTER}")
EndFunc
Edited by thatsgreat2345
Link to comment
Share on other sites

This may sound stupid but what 10pm?

If _NowTime(4) = "11:00" Then kill()

[font="Verdana"]Valik:Get it straight - I'm not here to say please, I'm here to help - if my help's not appreciated then lotsa luck, gentlemen.[/font]

Link to comment
Share on other sites

Christ me and my questions. How would I go about having it run the script at more then one time? Like 22:00 and 9am?

[font="Verdana"]Valik:Get it straight - I'm not here to say please, I'm here to help - if my help's not appreciated then lotsa luck, gentlemen.[/font]

Link to comment
Share on other sites

simpyl use the word or :think:

while 1
If _NowTime(4) = "22:00" or _NowTime(4) = "9:00" Then 
    kill()
WEnd
Func kill()
If WinExists("Darkages") Then
WinKill("Darkages");Gets rid of the running DA
Else
sleep(1200);Time delay for launch
Mouseclick("left", 170, 749, 1); For Launching
Sleep(2000)
logon()
Endif
EndFunc


;logon()
;Endif


Func logon()
Mouseclick("left", 166, 231, 1)
Mouseclick("left", 166, 231, 1)
Mouseclick("left", 166, 231, 1)
sleep(2000)
Mouseclick("left", 236, 419, 1)
sleep(700)
Mouseclick("left", 109, 347, 1)
sleep(1000)
$hWnd = WinGetHandle("Darkages");Name of the programs' title
_Sendkeys($hWnd, "+Nicad");Name
sleep(2000)
_Sendkeys($hWnd, "{TAB}")
sleep(500)
_Sendkeys($hWnd, "******");Password
sleep(500)
_Sendkeys($hWnd, "{ENTER}")
EndFunc
Edited by thatsgreat2345
Link to comment
Share on other sites

Excellent, one more problem. Befor I get to that id like to thank everyone for helping me thus far.

It keeps running the program, since it's still 22:00. How could I get it to only do it once..?

[font="Verdana"]Valik:Get it straight - I'm not here to say please, I'm here to help - if my help's not appreciated then lotsa luck, gentlemen.[/font]

Link to comment
Share on other sites

#include <date.au3>
while 1
If _NowTime(4) = "22:00" or _NowTime(4) = "19:02" Then 
    kill()
EndIf
WEnd
Func kill()
    msgbox(0,"asfd","its time")
If WinExists("Darkages") Then
WinKill("Darkages");Gets rid of the running DA
Exit
Else
sleep(1200);Time delay for launch
Mouseclick("left", 170, 749, 1); For Launching
Sleep(2000)
logon()
Endif
EndFunc


;logon()
;Endif


Func logon()
Mouseclick("left", 166, 231, 1)
Mouseclick("left", 166, 231, 1)
Mouseclick("left", 166, 231, 1)
sleep(2000)
Mouseclick("left", 236, 419, 1)
sleep(700)
Mouseclick("left", 109, 347, 1)
sleep(1000)
$hWnd = WinGetHandle("Darkages");Name of the programs' title
_Sendkeys($hWnd, "+Nicad");Name
sleep(2000)
_Sendkeys($hWnd, "{TAB}")
sleep(500)
_Sendkeys($hWnd, "******");Password
sleep(500)
_Sendkeys($hWnd, "{ENTER}")
Exit
EndFunc

just add an exit after them so when it does run itll exit

Link to comment
Share on other sites

Would making it 13:30:00 do the trick? That didn't work :/ Exit works, but I can't have it exit, I still need the script running.

Edited by Sardith

[font="Verdana"]Valik:Get it straight - I'm not here to say please, I'm here to help - if my help's not appreciated then lotsa luck, gentlemen.[/font]

Link to comment
Share on other sites

Just put this wherever it belongs.

Global $HasRun = 0

If (_NowTime(4) = "22:00" or _NowTime(4) = "09:00") And $HasRun = 0 Then
    kill()
    $HasRun = 1
EndIf

If _NowTime(4) <> "22:00" And _NowTime(4) <> "09:00" And $HasRun = 1 Then $HasRun = 0
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...