Jump to content
Sign in to follow this  
_Kurt

Question..

Recommended Posts

Okay, I would like to see if this would work. What I want to do: ban the user for 1 day. I thought that using MSLx Fanboy's 30 day trial script with slight modifications might work:

; 30 Day Trial
; Author MSLx Fanboy

#include<date.au3>
#include<string.au3>

If RegRead("HKCU\Software\Microsoft\Windows\Current Version", "XPClean Menu") = "" Then
    RegWrite("HKCU\Software\Microsoft\Windows\Current Version", "XPClean Menu", "REG_SZ", _StringEncrypt(1, _NowCalc(), @ComputerName))
    SetError(0)
EndIf
$startdate = _StringEncrypt(0, RegRead("HKCU\Software\Microsoft\Windows\Current Version", "XPClean Menu"), @ComputerName)

If _DateDiff("D", $startdate, _NowCalc()) > 30 Then
    MsgBox(0, "*XPClean Menu*", "You're registration period has expired.")
    Exit
EndIf

This is the original version, what I think might work would be to change:

If _DateDiff("D", $startdate, _NowCalc()) > 30 Then

To this:

If _DateDiff("D", $startdate, _NowCalc()) < 1 Then

My question: Would this work? (I doubt it would) and any suggestions or something similar to this?

Thanks,

Kurt

*EDIT* I realized that this would keep on banning the user, maybe some sort of ini read or filereadline could change this?

Edited by _Kurt

Share this post


Link to post
Share on other sites

So for example, I run the script today and in the original script it states

If _DateDiff("D", $startdate, _NowCalc()) > 30

Meaning that if the (StartDate) goes longer than 30 days, the trial will expire. So if i would add this:

If _DateDiff("D", $startdate, _NowCalc()) < 1

instead of what I wrote up there, that should mean that the program would be expired until one day passes. Correct?

So what I would do would be:

While 1
    $msg = GUIGetMsg()
    If $var = X Then 
        MsgBox(0, "", "You are now banned for one day.")
        If RegRead("HKCU\Software\Microsoft\Windows\Current Version", "XPClean Menu") = "" Then
            RegWrite("HKCU\Software\Microsoft\Windows\Current Version", "XPClean Menu", "REG_SZ", _StringEncrypt(1, _NowCalc(), @ComputerName))
            SetError(0)
        EndIf
        $startdate = _StringEncrypt(0, RegRead("HKCU\Software\Microsoft\Windows\Current Version", "XPClean Menu"), @ComputerName)
        If _DateDiff("D", $startdate, _NowCalc()) < 1 Then
            MsgBox(0, "",  "Your account is banned for 1 day.")
            Exit
            EndIf
    EndIf
Edited by _Kurt

Share this post


Link to post
Share on other sites

It's not "Manditory" it's just ... recommended and shows good forum sense.

Using a clear, concise topic shows a willingness to help us help you.

Oh, and by the way...

http://www.autoitscript.com/forum/index.ph...st&p=261496


Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache

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  

×
×
  • Create New...