| Article Index |
|---|
| Copy protecting MaxScripts - Getting hardware lock info |
| How to.. |
| Visual maxscript Editor |
| Gathering the info |
| writing to text file and email |
| Final Code |
| All Pages |
So based on the screenshot and code, you can see that we want to gather the following info:
- Hardware Lock
- Username on PC
- Computer name
- CPU count
- His\Her Email
- And optional location (country\state)
Let's start to code our GUI:
When we start our "Get hardware lock" we just want it to find all the info and fill it in automaticly.
This is done like this:
--Copy from this line of text
on Utility_hardware_lock open do
(
edt_hwlock.text = (hardwarelockid as string)
edt_username.text = (sysInfo.username as string)
edt_comname.text = (sysInfo.computername as string)
edt_cpu_count.text = (sysInfo.cpucount as string)
edt_enter_email.text="Enter Email Here"
edt_location.text="Enter Location Here"
)
--Copy to this line of text
That piece of code is placed underneath the GUI code,
so now the script looks like this:
--Begin code
utility Utility_hardware_lock "Get Hardware Lock ID" width:160 height:472
(
GroupBox grp1 "Required Info" pos:[6,4] width:152 height:212
GroupBox grp16 "Manually enter these:" pos:[9,225] width:144 height:104
edittext edt_hwlock "" pos:[16,40] width:136 height:24 enabled:false
edittext edt_username "" pos:[16,88] width:136 height:24 enabled:false
edittext edt_comname "" pos:[16,136] width:136 height:24 enabled:false
edittext edt_cpu_count "" pos:[16,184] width:136 height:24 enabled:false
edittext edt_enter_email "" pos:[14,257] width:136 height:24
edittext edt_location "" pos:[14,297] width:136 height:24
label lbl1 "Email generated textfile to ENTER YOUR EMAIL HERE" pos:[8,368] width:144 height:32
label lbl9 "HardwareLock" pos:[24,24] width:128 height:16
label lbl10 "Username" pos:[24,72] width:128 height:16
label lbl11 "Computer Name" pos:[24,120] width:128 height:16
label lbl12 "CPU count" pos:[24,168] width:128 height:16
label lbl38 "Email" pos:[22,241] width:120 height:16
label lbl39 "Location" pos:[22,281] width:120 height:16
label lbl40 " You will the license file as soon as possible." pos:[8,400] width:144 height:56
button btn15 "Save info to file" pos:[16,336] width:128 height:16
on Utility_hardware_lock open do
(
edt_hwlock.text = (hardwarelockid as string)
edt_username.text = (sysInfo.username as string)
edt_comname.text = (sysInfo.computername as string)
edt_cpu_count.text = (sysInfo.cpucount as string)
edt_enter_email.text="Enter Email Here"
edt_location.text="Enter Location Here"
)
)
--End code
If you run the script posted above, it should look something like this:





