Welcome Guest.   Make a donation to an author on the site September 21, 2014, 07:11:12 PM  *

Please login or register.
Or did you miss your validation email?


Login with username and password (forgot your password?)
Why not become a lifetime supporting member of the site with a one-time donation of any amount? Your donation entitles you to a ton of additional benefits, including access to exclusive discounts and downloads, the ability to enter monthly free software drawings, and a single non-expiring license key for all of our programs.


You must sign up here before you can post and access some areas of the site. Registration is totally free and confidential.
 
Learn about the DonationCoder.com microdonation system (DonationCredits).
   
   Forum Home   Thread Marks Chat! Downloads Search Login Register  
Pages: Prev 1 [2]   Go Down
  Reply  |  New Topic  |  Print  
Author Topic: AHK Help anyone?  (Read 9074 times)
ak_
Supporting Member
**
Posts: 223


see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #25 on: August 16, 2007, 05:27:44 AM »

Here's how i would do it :
[copy or print]
Activate:
Loop %ProgramFiles%\Dr. Windows\*.exe
{
  FileList = %A_LoopFileLongPath%`n%FileList%
}
StringSplit File, FileList, `n
random rnd, 1, %File0%
fileToRun = File%rnd%
fileToRun := %fileToRun%
Run %fileToRun%

Maybe there's a simpler solution but it works.
« Last Edit: August 16, 2007, 05:32:07 AM by ak_ » Logged

wreckedcarzz
Charter Member
***
Posts: 1,620



Happy wolfie ^_^

see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #26 on: August 16, 2007, 08:38:50 PM »

OK cool, I will give it a go and see what happens. Thanks a lot, this was really getting annoying getting irrelevant search results  smiley
Logged

New website! With a fancy domain name and everything! *gasp*
http://www.wreckedcarzz.com/
ak_
Supporting Member
**
Posts: 223


see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #27 on: August 16, 2007, 10:56:38 PM »

You're welcome smiley

By the way, i found out that this has the same result and takes less code :
[copy or print]
Loop %ProgramFiles%\Dr. Windows\*.exe
{
  FileList = %A_LoopFileLongPath%`n%FileList%
}
StringSplit File, FileList, `n
random rnd, 1, %File0%
Run % File%rnd%

I didn't know about this "% " thing and it's very convenient.
Logged

wreckedcarzz
Charter Member
***
Posts: 1,620



Happy wolfie ^_^

see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #28 on: September 20, 2007, 04:08:23 PM »

New problem! Sad

Ok, so here is what I am trying to do (as simply explained as possible):

I need a script to be able to check the date that a file was CREATED. I think I got this part down...
[copy or print]
FileGetTime, TimeToFix, fixschedule.txt, C
Return

But here is the problem- How do I make the script do X after Y amount of time has passed? I thought about it for a while and still don't get it. read Variables aren't my thing smiley

ex:
[copy or print]
If %TimeToFix% > amount of time (week?)
Run myjunk.exe
else
Return

Does anyone understand? Am I just talking to the wall, and no one knows where I am coming from or what I am trying to do? Can anyone give any ideas? tellme

Thanks in advance,
-Brandon
Logged

New website! With a fancy domain name and everything! *gasp*
http://www.wreckedcarzz.com/
lanux128
Global Moderator
*****
Posts: 6,089



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #29 on: September 20, 2007, 08:42:01 PM »

try without enclosing the variable in quotes, also you need to define formatting for TimeToFix since FileGetTime returns the date in this format: YYYYMMDDHH24MISS

Quote from: Autohotkey.chm
Note: Date-time values can be compared, added to, or subtracted from via EnvAdd and EnvSub. Also, it is best to not use greater-than or less-than to compare times unless they are both the same string length. This is because they would be compared as numbers; for example, 20040201 is always numerically less (but chronologically greater) than 200401010533. So instead use EnvSub to find out whether the amount of time between them is positive or negative.
Logged

TheQwerty
Supporting Member
**
Posts: 84

see users location on a map View Profile Give some DonationCredits to this forum member
« Reply #30 on: September 21, 2007, 06:05:44 AM »

You probably want something like:
[copy or print]
;Get the current time.
now := A_Now

;Subtract the creation time from current (give result in days, other options listed under EnvSub)
now -= %TimeToFix%, Days

if (now > 7) {
Run myjunk.exe
}
return
Logged
BinderDundat
Supporting Member
**
Posts: 31

View Profile Give some DonationCredits to this forum member
« Reply #31 on: September 23, 2007, 12:10:46 PM »

Does anyone have a basic reference for ahk scripting concepts.  The help file is nice, but I have trouble doing anything more complex than creating hotkeys mainly because I really don't know basic concepts.  The wiki on ahk is really incomplete and I have a few really basic projects that I can't make happen despite trying several plausible approaches.  I don't want to have you all writing trivial scripts for me, so if you know of a useful resource - even a different language that shares concepts with ahk - I would be grateful.
Logged
jgpaiva
Global Moderator
*****
Posts: 4,710



Artificial Idiocy

see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #32 on: September 23, 2007, 12:12:56 PM »

I think that the perfect place to start would be skrommel's 1hour software site, there are lots of scripts over there, and some of those are quite complex!
Logged

Pages: Prev 1 [2]   Go Up
  Reply  |  New Topic  |  Print  
 
Jump to:  
   Forum Home   Thread Marks Chat! Downloads Search Login Register  

DonationCoder.com | About Us
DonationCoder.com Forum | Powered by SMF
[ Page time: 0.037s | Server load: 0.08 ]