Vindicator209 Posted July 26, 2006 Share Posted July 26, 2006 Sorry if this was answered else where... What could i use to count how many times a script was executed? Is this possible? Example: Stop running a script after 30 uses, such as a "Trial Version" I was thinking something rather more in-script, because i heard you can have a script read a .txt file but i think someone could change the .txt file... if this isint possible, state it, and thanks in advance, although i might end up saying thanks again anyway and if any of you are wondering why i ask such newbish questions, its obviously cause im new at this and i have no idea where things are in the help file..(The heck is Macro Reference! ) [center]"When you look at old, classic games like Snake, you often put it off because it's such a simple game, but it's only when you actually try and create your own unique game from scratch, do you finally appreciate those games."[/center][center]Don't ask for answers if you haven't TRIED yet![/center][center]Most answers can be answered in the help file! Use it![/center] Link to comment Share on other sites More sharing options...
eynstyne Posted July 26, 2006 Share Posted July 26, 2006 You probably need to save something in the registry, but it has to be in a very deep and secretive key. This is to ensure that users cannot tamper with the count information. Everytime the script is executed you can write something into a file or the registry which contains the count. #include <Guiconstants.au3> $count = 0 ; number of times $read = Regread("HKLM\Software\Trial Version","Days Left") $count = $read + 1 ; Reads how many times run regwrite("Hklm\Software\Trail Version","Days Left", "Reg_SZ",$count) This is very rough, but it should get somewhere... F@m!ly Guy Fr33k! - Avatar speaks for itself__________________________________________________________________________________________ite quotes... - Is your refrigerator running? If it is, It probably runs like you...very homosexually - Christians don't believe in gravity - Geeze Brian where do you think you are, Payless?- Show me potato Salad!__________________________________________________________________________________________Programs available - Shutdown timer[indent][/indent] Link to comment Share on other sites More sharing options...
Briegel Posted July 27, 2006 Share Posted July 27, 2006 You can use '_StringEncrypt ()' (from BETA) to encrypt the number of starts. Then write the encrypted string into the registry or a file. Only you can read the string. Link to comment Share on other sites More sharing options...
nfwu Posted July 27, 2006 Share Posted July 27, 2006 Newbies should not mess with the registry until they fully understand what they are doing (and what is the registry in the first place). Mess around with the IniWrite instead. #) TwitterOut of date stuff:Scripts: Sudoku Solver | Webserver | 3D library (Pure AutoIt) | Wood's GadgetsUDFs: _WoodUniqueID() | _DialogEditIni() | _Console*() | _GetIPConfigData() | _URLEncode/Decode() Link to comment Share on other sites More sharing options...
eynstyne Posted July 27, 2006 Share Posted July 27, 2006 $count = regread("HKLM\Software\Trial Version","Days") $count = $count + 1 regwrite("HKLM\Software\Trial Version","Days","REG_SZ",$count) if $count >= 30 Then msgbox(0,"","Trial Version Expired") Exit EndIf F@m!ly Guy Fr33k! - Avatar speaks for itself__________________________________________________________________________________________ite quotes... - Is your refrigerator running? If it is, It probably runs like you...very homosexually - Christians don't believe in gravity - Geeze Brian where do you think you are, Payless?- Show me potato Salad!__________________________________________________________________________________________Programs available - Shutdown timer[indent][/indent] Link to comment Share on other sites More sharing options...
dandymcgee Posted August 8, 2006 Share Posted August 8, 2006 (edited) Not to be a smart ass or anything , but if the count increases every use and the title of the message box is "days" its a little misleading eh? LOL just a thought. Edited August 8, 2006 by dandymcgee - Dan [Website] Link to comment Share on other sites More sharing options...
dandymcgee Posted August 8, 2006 Share Posted August 8, 2006 (edited) hehe wrong forum woops (hit the dang back button few too many lol) Edited August 8, 2006 by dandymcgee - Dan [Website] 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