QuesTMajoR 4 Report post Posted August 7, 2012 I want a Script to Limit my Game like a TRIAL Version. :( I saw this Script class Scene_Serial def initialize @productnum = “Serial No.” 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”) # Show error if script not found print (‘Serial Key Not Valid’) # Quit game exit 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, “Twilight Shadows”) self.contents.font.color = system_color self.contents.font.size = 12 self.contents.draw_text(x, y + 4, 600, 32, ” Serial Key Valid Loading. . .”) end end Insert this as a new class called “Window_Base” class Window_Base 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 BUT I Think that theres a Problem here that's why this doesnt work. Can Someone Please Fix This For Me. :) Thanks! Share this post Link to post Share on other sites
0 ForeverZer0 44 Report post Posted August 7, 2012 Serial systems kind of become useless when the script is basically open-source. Share this post Link to post Share on other sites
0 Polraudio 122 Report post Posted August 7, 2012 Its kind of hard to do without some encryption and would be a pain to generate all the serial numbers your self, insert them into the script, and you would have to release a new game every time you run out of serial numbers. There may be other ways with making a server to handle serials. If 1 person got the serial key everyone got the key and you may not get more sales. Unless you do the server thingy to tie a key to an account or something. Im assuming you are selling your game since you have a serial system. Not sure what other ways there are. Someone with better knowledge than me will know an easier way. In the end its not worth the trouble. Share this post Link to post Share on other sites
0 QuesTMajoR 4 Report post Posted August 7, 2012 Is there any other Way? What do you guys think? Share this post Link to post Share on other sites
0 ForeverZer0 44 Report post Posted August 7, 2012 Serial numbers in RGSS just aren't practical. Serial numbers are usually made by performing an algorithm on the hardware id. It's extremely simple to view RPG maker scripts, even with encrypted games, which will expose the algorithm. After that, its a simple matter of using it to generate your own serial number. I am farely confident that any competent scripter could crack a serial number system in less than five minutes. It's just that easy. You wouldnt even need to reverse it, just completely bypass it. Share this post Link to post Share on other sites
I want a Script to Limit my Game like a TRIAL Version. :( I saw this Script
class Scene_Serial
def initialize
@productnum = “Serial No.”
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”)
# Show error if script not found
print (‘Serial Key Not Valid’)
# Quit game
exit
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, “Twilight Shadows”)
self.contents.font.color = system_color
self.contents.font.size = 12
self.contents.draw_text(x, y + 4, 600, 32, ” Serial Key Valid Loading. . .”)
end
end
Insert this as a new class called “Window_Base”
class Window_Base 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
BUT I Think that theres a Problem here that's why this doesnt work. Can Someone Please Fix This For Me. :) Thanks!
Share this post
Link to post
Share on other sites