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 

License before Laszlo's rego script

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
Logman



Joined: 19 Feb 2008
Posts: 55

PostPosted: Tue Aug 05, 2008 3:35 pm    Post subject: License before Laszlo's rego script Reply with quote

Hi,
I am using Laszlo's script with Icarus's Library (TY,very awesome). I'm trying to add a license agreement as well. My idea is to have in the .ini a value for if they have read and accepted the agreement before, if they have then it will go onward through to the rego part, if not it won't let them attempt to register without pressing OK. If I put 1 for read in the ini, it is going straight to the rego part as it should, but if it is zero the rego window is coming up along with the license agreement. Can you tell me how to make the register window come after the OK has been pressed on the license. Does it look pretty sound in principle? First go at something like this, still a noob. Very Happy

Code:
;-----------------------------------------------------------------------------------------
IniRead, Read, Preferences.ini, License, Read
Gosub License
;-----------------------------------------------------------------------------------------
License:
  If (Read=1)
    {
     Gosub Main
    }
  Else
    {
     Gosub, Agreement
    }
Return
;-----------------------------------------------------------------------------------------
Agreement:
FileRead,Contents, Agreement.txt
Gui, Add, Edit, w750 h200 ReadOnly, %Contents%
Gui, Add, Text, x300 y218 W350 H20, By pressing OK I agree to the terms and conditions of the license.
Gui, Add, Button, x200 y215 w80 h20 vOklicense gOklicense, OK
Gui, Show, x250 y250 h250 w800, License Agreement

Oklicense: 
    {
      Read=1
      IniWrite, %Read%,Preferences.ini, License, Read
      Gosub, Main
    }
Return

#Include SWProtect-Internal.ahk
#Include SWProtect-GUI.ahk

Main:
 
Back to top
View user's profile Send private message
Micahs



Joined: 01 Dec 2006
Posts: 343

PostPosted: Sat Aug 23, 2008 4:39 am    Post subject: Reply with quote

Code:
;-----------------------------------------------------------------------------------------
IniRead, Read, Preferences.ini, License, Read
Gosub License
Return ;added return #1
;-----------------------------------------------------------------------------------------
License:
  If (Read=1)
    {
     Gosub Main
    }
  Else
    {
     Gosub, Agreement
    }
Return
;-----------------------------------------------------------------------------------------
Agreement:
FileRead,Contents, Agreement.txt
Gui, Add, Edit, w750 h200 ReadOnly, %Contents%
Gui, Add, Text, x300 y218 W350 H20, By pressing OK I agree to the terms and conditions of the license.
Gui, Add, Button, x200 y215 w80 h20 vOklicense gOklicense, OK
Gui, Show, x250 y250 h250 w800, License Agreement
Return ;added return #2

Oklicense:
    {
      Read=1
      IniWrite, %Read%,Preferences.ini, License, Read
      Gosub, Main
    }
Return

#Include SWProtect-Internal.ahk
#Include SWProtect-GUI.ahk

Main:



'License' is being executed twice when 'read' is 0. The first time, it goes to 'Agreement' and displays the license but without the second 'return' the var 'read' is set to 1. The second time, with 'read=1' it then proceeds to the reg stuff. HTH.
_________________
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
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