AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Implement a TTL - time to live
Goto page 1, 2  Next
 
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
Gspot
Guest





PostPosted: Tue Jun 28, 2005 10:27 pm    Post subject: Implement a TTL - time to live Reply with quote

I need to implement a kind of time to live to my macro, for example after 3 months it will not work any more, or in a specific date,....
Any ideas or code???? (preferably a way that is not easy to overrule)
Thanks
Very Happy
Back to top
Guest






PostPosted: Tue Jun 28, 2005 10:40 pm    Post subject: Reply with quote

selfdestructioncode?
Back to top
Belial



Joined: 26 Jun 2005
Posts: 40
Location: Portugal

PostPosted: Wed Jun 29, 2005 12:07 am    Post subject: Reply with quote

what about a program that checks the date on an internet site, if the specific date > todays date then ExitApp

of course this need an internet connection .. maybe a better way is to put the program counting the days passing .. that way even if you change your date the program stills don't function ^^

This are only some Ideas, and yes, it would be indeed useful =)
_________________
Belial
Back to top
View user's profile Send private message MSN Messenger
Gspot
Guest





PostPosted: Wed Jun 29, 2005 8:39 am    Post subject: Reply with quote

More ideas ???????????????????? Please
For a selfdestruction code but with expiration date Very Happy Very Happy
Back to top
garry



Joined: 19 Apr 2005
Posts: 2212
Location: switzerland

PostPosted: Wed Jun 29, 2005 9:03 am    Post subject: Reply with quote

this is just a calculation with date
don't know where to store(hidden) the new date(30 days later) after the first start
Code:
B=%A_NOW%
stringmid,TODAY,B,1,8
EnvAdd,ND1,30,days
stringmid,NEWDATE,ND1,1,8
msgbox,Date TODAY=%TODAY%
msgbox,Date in 30 days=%NEWDATE%
if (TODAY>=NEWDATE)
msgbox,over
else
msgbox,not over
Back to top
View user's profile Send private message
4Nothing
Guest





PostPosted: Wed Jun 29, 2005 9:15 am    Post subject: Reply with quote

Code:
RegRead, Value, RootKey, SubKey, ValueName
If Errorlevel = 1
{
   ExpDate = %A_Now%
   ExpDate += 30, Days
   RegWrite, REG_DWORD, RootKey, SubKey, ValueName, %ExpDate%
}
If Value >= %A_Now%
   ExitApp
Back to top
Gspot
Guest





PostPosted: Wed Jun 29, 2005 9:28 am    Post subject: Reply with quote

Thanks for the ideas/code.

A question, the samples code that you give work with the date, if the user change the date, it will overrride the selfdestruction?????
(Sorry but i started to work with Autohotkey 4 days ago)
Back to top
garry



Joined: 19 Apr 2005
Posts: 2212
Location: switzerland

PostPosted: Wed Jun 29, 2005 9:48 am    Post subject: Reply with quote

my script is not useful , have no good ideas..., just example for date calculation
if user change date(older<newdate) , you can start your script
ask 4Nothing (for nothing Very Happy)
Back to top
View user's profile Send private message
Belial



Joined: 26 Jun 2005
Posts: 40
Location: Portugal

PostPosted: Wed Jun 29, 2005 6:32 pm    Post subject: Reply with quote

come on .. I gave 2 ideias that actually work and even if the user changes the date the program won't work ^^

you just need 2 code it ..
I don't have much time, but if you have any problems putting it into code I can do it, it isn't so hard =)
_________________
Belial
Back to top
View user's profile Send private message MSN Messenger
Decarlo110



Joined: 15 Dec 2004
Posts: 303
Location: United States

PostPosted: Wed Jun 29, 2005 9:28 pm    Post subject: Reply with quote

I can code it, but i need to know... When the countdown is finally reached, what do you want your program to do?
_________________
1) The Open Source Definition http://www.opensource.org/docs/definition_plain.php

2) Intuitive. Logical. Versatile. Adaptable. <<AutoHotkey>>
Back to top
View user's profile Send private message
Guest






PostPosted: Thu Jun 30, 2005 4:08 pm    Post subject: Reply with quote

Decarlo110 wrote:
I can code it, but i need to know... When the countdown is finally reached, what do you want your program to do?


Just exit, i don't wont error messages.
Thank's for the help
Back to top
4Nothing
Guest





PostPosted: Sat Jul 02, 2005 7:47 am    Post subject: Reply with quote

Typical behaviour of a virus. Destroy. Hide/selfdestroy. No errormsgs.
Back to top
Belial



Joined: 26 Jun 2005
Posts: 40
Location: Portugal

PostPosted: Sun Jul 03, 2005 12:29 am    Post subject: Reply with quote

lol
_________________
Belial
Back to top
View user's profile Send private message MSN Messenger
Gspot
Guest





PostPosted: Mon Jul 04, 2005 1:39 pm    Post subject: Reply with quote

4Nothing wrote:
Typical behaviour of a virus. Destroy. Hide/selfdestroy. No errormsgs.


A virus that destroys im self?????????????
It's not a virus. I don't wont to destroy nothing, the idea was more like a trial, after the trial period dosen't work (is this a virus????)
Back to top
Belial



Joined: 26 Jun 2005
Posts: 40
Location: Portugal

PostPosted: Fri Jul 08, 2005 1:31 am    Post subject: Reply with quote

If anyone makes a code for this .. please notify me ^^
_________________
Belial
Back to top
View user's profile Send private message MSN Messenger
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group