By Rmxp

Serial Key System Advanced – Like the orginal, but I have modified it to have a ‘trial’ Serial Key that deletes after a certain amount of time.(MY FIRST SCRIPT!!!)

Insert as a new script called “Scene_Serial”

class Scene_Serial
def initialize
@productnum = “yourtrialserialnumberhere”
@productnumreal = “yourpurchasedserialnumberhere”
end
def main
if $BTEST
battle_test
return
end
$game_system = Game_System.new
@bar = Window_Bar.new
# Execute transition
Graphics.transition
# Main loop
loop do
# Update game screen
Graphics.update
# Update input information
Input.update
# Frame update
update
# Abort loop if screen is changed
if $scene != self
break
end
end
# Prepare for transition
Graphics.freeze
@bar.dispose
end
def update
@bar.update
@bar.refresh
# Locate Database
if not FileTest.exist?(@productnum + “.txt”)
if not FileTest.exist?(@productnumreal + “.txt”)
# Show error if script not found
print (‘Serial Key Not Valid, Please purchase one’)
# Quit game

exit
else
@bar.load += 1
end
else
@bar.load += 1
end
if @bar.load == @bar.max
toscene
end
end
def toscene
$game_system = nil
$scene = Scene_Title.new
end
def exit
$scene = nil
end
end
class Window_Bar < Window_Base
attr_accessor :load
attr_accessor :max
def initialize
super(0,0,640,480)
@load = 0
@max = 300
self.contents = Bitmap.new(width – 32, height – 32)
end
def refresh
self.contents.clear
draw_load(0,235)
end
def draw_load(x, y, width = 600)
rate = @load / @max.to_f
plus_x = 0
rate_x = 0
plus_y = 25
plus_width = 0
rate_width = 100
height = 10
align1 = 1
align2 = 2
align3 = 0
grade1 = 1
grade2 = 0
color1 = Color.new(0, 0, 0, 192)
color2 = Color.new(255, 255, 192, 192)
color3 = Color.new(0, 0, 0, 192)
color4 = Color.new(64, 0, 0, 192)
color5 = Color.new(80 – 24 * rate, 80 * rate, 14 * rate, 192)
color6 = Color.new(240 – 72 * rate, 240 * rate, 62 * rate, 192)
od = (width + plus_width) * @load * rate_width / 100 /
@max
gauge_rect(x + plus_x + width * rate_x / 100, y + plus_y,
width, plus_width + width * rate_width / 100,
height, od, align1, align2, align3,
color1, color2, color3, color4, color5, color6, grade1, grade2)
self.contents.font.color = system_color
self.contents.font.size = 30
self.contents.draw_text(120, 40 + 4, 600, 32, “GameName”)#Enter your game name here
self.contents.font.color = system_color
self.contents.font.size = 12
self.contents.draw_text(x, y + 4, 600, 32, ” Serial Key Valid Loading. . .”)# Text to appear on the Loading bar
end
end

Insert this as a new script called “Window_Base”

class Window_Base < Window
#————————————————————————–
# * Drawing of gauge
#————————————————————————–
def gauge_rect(x, y, rect_width, width, height, gauge, align1, align2, align3,
color1, color2, color3, color4, color5, color6, grade1, grade2)
case align1
when 1
x += (rect_width – width) / 2
when 2
x += rect_width – width
end
case align2
when 1
y -= height / 2
when 2
y -= height
end
# Framework Drawing
self.contents.fill_rect(x, y, width, height, color1)
self.contents.fill_rect(x + 1, y + 1, width – 2, height – 2, color2)
if align3 == 0
if grade1 == 2
grade1 = 3
end
if grade2 == 2
grade2 = 3
end
end
if (align3 == 1 and grade1 == 0) or grade1 > 0
color = color3
color3 = color4
color4 = color
end
if (align3 == 1 and grade2 == 0) or grade2 > 0
color = color5
color5 = color6
color6 = color
end
# Drawing of empty gauge
self.contents.gradation_rect(x + 2, y + 2, width – 4, height – 4,
color3, color4, grade1)
if align3 == 1
x += width – gauge
end
# Drawing of actual gauge
self.contents.gradation_rect(x + 2, y + 2, gauge – 4, height – 4,
color5, color6, grade2)
end
end

#——————————————————————————
# New routine added to the Bitmap class.
#==============================================================================

class Bitmap
#————————————————————————–
# * Rectangle Gradation Indicator
# color1: Start color
# color2: Ending color
# align: 0: On side gradation
# 1: Vertically gradation
# 2: The gradation (intense concerning slantedly heavily note)
#————————————————————————–
def gradation_rect(x, y, width, height, color1, color2, align = 0)
if align == 0
for i in x…x + width
red = color1.red + (color2.red – color1.red) * (i – x) / (width – 1)
green = color1.green +
(color2.green – color1.green) * (i – x) / (width – 1)
blue = color1.blue +
(color2.blue – color1.blue) * (i – x) / (width – 1)
alpha = color1.alpha +
(color2.alpha – color1.alpha) * (i – x) / (width – 1)
color = Color.new(red, green, blue, alpha)
fill_rect(i, y, 1, height, color)
end
elsif align == 1
for i in y…y + height
red = color1.red +
(color2.red – color1.red) * (i – y) / (height – 1)
green = color1.green +
(color2.green – color1.green) * (i – y) / (height – 1)
blue = color1.blue +
(color2.blue – color1.blue) * (i – y) / (height – 1)
alpha = color1.alpha +
(color2.alpha – color1.alpha) * (i – y) / (height – 1)
color = Color.new(red, green, blue, alpha)
fill_rect(x, i, width, 1, color)
end
elsif align == 2
for i in x…x + width
for j in y…y + height
red = color1.red + (color2.red – color1.red) *
((i – x) / (width – 1.0) + (j – y) / (height – 1.0)) / 2
green = color1.green + (color2.green – color1.green) *
((i – x) / (width – 1.0) + (j – y) / (height – 1.0)) / 2
blue = color1.blue + (color2.blue – color1.blue) *
((i – x) / (width – 1.0) + (j – y) / (height – 1.0)) / 2
alpha = color1.alpha + (color2.alpha – color1.alpha) *
((i – x) / (width – 1.0) + (j – y) / (height – 1.0)) / 2
color = Color.new(red, green, blue, alpha)
set_pixel(i, j, color)
end
end
elsif align == 3
for i in x…x + width
for j in y…y + height
red = color1.red + (color2.red – color1.red) *
((x + width – i) / (width – 1.0) + (j – y) / (height – 1.0)) / 2
green = color1.green + (color2.green – color1.green) *
((x + width – i) / (width – 1.0) + (j – y) / (height – 1.0)) / 2
blue = color1.blue + (color2.blue – color1.blue) *
((x + width – i) / (width – 1.0) + (j – y) / (height – 1.0)) / 2
alpha = color1.alpha + (color2.alpha – color1.alpha) *
((x + width – i) / (width – 1.0) + (j – y) / (height – 1.0)) / 2
color = Color.new(red, green, blue, alpha)
set_pixel(i, j, color)
end
end
end
end
end

Insert this as a new script called “Scene_SerialDeleter”

class Scene_SerialDeleter
def initialize
@productnum = “0bp4560365″ #Enter the name of your ‘Trial’ Serial Key
end
def main # }
if $BTEST # }
battle_test # } not sure what this does….
return # }
end
if not FileTest.exist?(“yourtrialserialnumberhere.txt”)
File.delete(“yourtrialserialnumberhere.txt”)
p”Demo Expired, please purchase a licence key”
exit
end
end
end

Replace “Main” with this

#==============================================================================
# ** Main
#——————————————————————————
# After defining each class, actual processing begins here.
#==============================================================================

begin
# Prepare for transition
Graphics.freeze
# Make scene object (title screen)
$scene = Scene_Serial.new
# Call main method as long as $scene is effective
while $scene != nil
$scene.main
end
# Fade out
Graphics.transition(20)
rescue Errno::ENOENT
# Supplement Errno::ENOENT exception
# If unable to open file, display message and end
filename = $!.message.sub(“No such file or directory – “, “”)
print(“Unable to find file #{filename}.”)
end

and in a new common event write this:

Conditional Branch: Timer 0min 0sec less
Script: if FileTest.exist?("yourtrialserialnumberhere.txt)
$scene = Scene_SerialDeleter.new
end

else
end


8 Responses to “Serial Key System Advanced”


  1. 1 A maddie which is also a saddie!
    May 22, 2008 at 6:16 pm

    Doesn’t work! It sounds soo cool, but it *sniff* doesn’t work. Maybe typing it in so indenting is done right, might help? Only a few scripts with 3 end like this;
    end
    end
    end

    will work…

  2. 2 Alex
    August 25, 2008 at 3:20 pm

    Send there’s an error: Script ‘Scene_Serial’ Line 39: syntaxError Occurred.

    Can you help me with this?

  3. 3 Nogard171
    December 19, 2008 at 2:07 am

    def initialize
    super(“Serial Key Not Valid, Please purchase one?”)
    end

    This fix’s that error.

  4. 4 Nogard171
    December 19, 2008 at 2:09 am

    Paste in The scene serial you made.

    Line 39[Delete this line:print (’Serial Key Not Valid, Please purchase one’)]

  5. May 25, 2009 at 5:08 pm

    secure virginia slims ultra phosphorescence cigarettes
    second-rate doral cigarette cheaply doral cigarette|cheap doral cigarettes
    low-priced doral cigarettes cheap doral cigarettes
    for peanuts gpc cigarette reduced gpc cigarettes
    cheap gpc cigarettes tinpot gpc cigarettes
    virginia slims ultra

  6. February 21, 2010 at 1:03 pm

    Line 68 i got an error!! and on the window one line 28 another error Please help me!!!!

  7. July 11, 2010 at 1:38 am

    If you man watching football, then you probably also love to venture on the match, and especially on your favorite teams?


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s




Blog Stats

  • 152,961 hits

Recent Comments

Anonymous on SDK
connor hage on Characters
Nova on RGSS Script Requests
Roofo on Serial Key System Advance…
Dfzoz on RGSS Script Requests
kram on RGSS Script Requests
Brian on Serial Key System
jere911 on RGSS Scripts
Jian James P. Astrer… on RGSS Script Requests
Hellfire on RGSS Script Requests
Anonymous on RGSS Script Requests
Anonymous on RGSS Script Requests
Anonymous on RGSS Script Requests
Jian James P. Astrer… on RGSS Script Requests
Jian James P. Astrer… on RGSS Script Requests

Real-Time RMXP Viewers

website counter

Post Counts

 

June 2012
M T W T F S S
« Jun    
 123
45678910
11121314151617
18192021222324
252627282930  

Follow

Get every new post delivered to your Inbox.