Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Free trial

I would like a script that adds a vairiable every time you select the option Free trial. One that vairiable reaches 10 it disables free trial. Like how continue is disabled. Leaving the options Activate and end. I am using this script for activation.
Code:
#==============================================================================
# ** Scene_Serial - Based In Scene_Register from Netplay+
#------------------------------------------------------------------------------
# Author    Mr.Mo and Me?, modified by Chaosg1
# Version   1.0
# Date      14-12-06
#==============================================================================
class Scene_Register
  def initialize
    # Load database
    $data_actors        = load_data("Data/Actors.rxdata")
    $data_classes       = load_data("Data/Classes.rxdata")
    $data_skills        = load_data("Data/Skills.rxdata")
    $data_items         = load_data("Data/Items.rxdata")
    $data_weapons       = load_data("Data/Weapons.rxdata")
    $data_armors        = load_data("Data/Armors.rxdata")
    $data_enemies       = load_data("Data/Enemies.rxdata")
    $data_troops        = load_data("Data/Troops.rxdata")
    $data_states        = load_data("Data/States.rxdata")
    $data_animations    = load_data("Data/Animations.rxdata")
    $data_tilesets      = load_data("Data/Tilesets.rxdata")
    $data_common_events = load_data("Data/CommonEvents.rxdata")
    $data_system        = load_data("Data/System.rxdata")
    # Make system object
    $game_system = Game_System.new
    @code = Codex.new
    #saves the File To create only one serial
    begin
      file = File.open("Serial.rxdata", "rb")
      a = Marshal.load(file)
      file.close
      @serial = a
    rescue #Loads the file
      @serial =  @code.generate_code
      p @serial,@code.decode(@serial) if $DEBUG
      file = File.open("Serial.rxdata", "wb")
      Marshal.dump(@serial, file)
      file.close
      a = @serial
    end
    @wserial = Window_Help.new
    @wserial.set_text("Your Id is: " + a.values.to_s + ", insert the serial below")
  end
  #--------------------------------------------------------------------------
  #  Main Processing
  #--------------------------------------------------------------------------
  def main
    @user_window = Window_Username.new
    @user_window.active = true
    @user_window.width = 100*2 + 180     
    #sets necassary variables
    @user_name = []
    # Graphic Transition.
    Graphics.transition
    # Srarts LOOP Update.
    loop do
      # Update
      Input.update
      Graphics.update
      update
      #Checks if the scene self.
      if $scene != self
      #If not break.
        break
      end
    end
    # Wait.
    Graphics.freeze
    # Dispose stuff.
    @user_window.dispose
    @wserial.dispose
  end
  #--------------------------------------------------------------------------
  #  Update
  #--------------------------------------------------------------------------
  def update
    #Updates Windows.
    @user_window.update           
    #Updates User Name or Password
    update_user 
    if $DEBUG
      p (@code.decode(@serial)).values if Input.triggerd?(Input::Letters["A"])
      p @code.decode(@serial) if Input.triggerd?(Input::Letters["B"])
    end
  end
  #--------------------------------------------------------------------------
  # Check Code
  #--------------------------------------------------------------------------
  def check
    p @user_name, (@code.decode(@serial)).values if $DEBUG
    if @user_name == (@code.decode(@serial)).values
      p Code::OK_Message
      $scene = Scene_Title.new
    else
      p Code::Wrong_Message
      $scene = nil
    end
  end
  #--------------------------------------------------------------------------
  #  Update User
  #--------------------------------------------------------------------------
   def update_user
      if Input.triggerd?(Input::Enter)
        p "Insert Serial" if @user_name == []
        return if @user_name == []
        check
      end
      #Checks for backspace.
       @user_name.delete_at(-1) if Input.triggerd?(Input::Back) and @user_name.size != 0
       return if @user_name.size == Code::Code_Size
       #Checks for Numberkeys input.
      for key in Input::Numberkeys.keys
       @user_name.push(key.to_s) if Input.triggerd?(Input::Numberkeys[key])
      end
     #Checks for Letter input.
      for key in Input::Letters.keys
        if Input.triggerd?(Input::Letters[key])
          if Input.pressed?(Input::Shift)
            @user_name.push(key.upcase)
          else
            @user_name.push(key.downcase) 
          end
        end
      end
      #Checks for Underscore
        if Input.triggerd?(Input::Underscore)
          if Input.pressed?(Input::Shift)
           @user_name.push("_")
          else
           @user_name.push("-")
          end
        end
        @user_window.text = @user_name.to_s
        @user_window.update
        return
  #ends method
  end
  #--------------------------------------------------------------------------
  #  End Of class
  #--------------------------------------------------------------------------
end
Code:
 #==============================================================================
# ** Codex
#------------------------------------------------------------------------------
# Version 1.0 (
# Author: Chaosg1(RMXP.org) aka Dr.X
# Date : 05-11-2006
#==============================================================================--------------------------------------------
#  NOTE: THIS IS EXCLUSIVE TO RMXP.org!!
#------------------------------------------------------------------------------
module Code
  OK_Message = "Serial Accepted!"
  Wrong_Message = "Wrong serial, game will close."
  #The Generated code Size (Recomended no less than 8)
  Code_Size = 2
  #Holds the desencription code.
  Code = {}
  Code = {
  #Encryption 1
    0 => {'a'=>'c', 'b'=>'h', 'c'=>'a', 'd'=>'o', 'e'=>'s', 
          'f'=>'b', 'g'=>'d', 'h'=>'e', 'i'=>'f', 'j'=>'g', 
          'k'=>'i', 'l'=>'j', 'm'=>'k', 'n'=>'l', 'o'=>'m', 
          'p'=>'n', 'q'=>'p', 'r'=>'q', 's'=>'r', 't'=>'t',
          'u'=>'u', 'v'=>'v', 'w'=>'w', 'x'=>'x', 'y'=>'y', 
          'z'=>'z'},
  #Encryption 2 
    1 => {'a'=>'b', 'b'=>'d', 'c'=>'e', 'd'=>'f', 'e'=>'g', 
          'f'=>'i', 'g'=>'j', 'h'=>'k', 'i'=>'l', 'j'=>'m', 
          'k'=>'n', 'l'=>'p', 'm'=>'q', 'n'=>'r', 'o'=>'t', 
          'p'=>'u', 'q'=>'v', 'r'=>'w', 's'=>'x', 't'=>'y',
          'u'=>'z', 'v'=>'c', 'w'=>'h', 'x'=>'a', 'y'=>'o', 
          'z'=>'s'
    },
  #Encryption 3
    2 =>{'a'=>'00','b'=>'01','c'=>'02','d'=>'03',
         'e'=>'04','f'=>'05','g'=>'06','h'=>'07',
         'i'=>'08','j'=>'09','k'=>'10','l'=>'11',
         'm'=>'12','n'=>'13','o'=>'14','p'=>'15',
         'q'=>'16','r'=>'17','s'=>'18','t'=>'19',
         'u'=>'20','v'=>'21','w'=>'22','x'=>'23',
         'y'=>'24','z'=>'25'
    }
  }
end
class Codex
  def initialize
    @serial ={} 
    @id = {}
  end
  #----------------------------------------------------------------------------
  # * This will generate a random code for this and this game only.
  #----------------------------------------------------------------------------
  def generate_code
    #Generate the Code
    time = 0
    Code::Code_Size.times do
      #All the Alphabet letters
      a = rand(25)
      #change the numbers in letters.
      #Put the letter in the serial
      i = get_letter(a)
      @serial[time] = i
      #Add time plus 1
      time += 1
    end
    @id = code_serial(@serial)
    return @id
  end
  #----------------------------------------------------------------------------
  # * Code
  #----------------------------------------------------------------------------
  def code_serial(code)
    hold = {}
    time = 0
    #Encrypt First Time
    for i in code.values
      a = Code::Code[0][i]
      hold[time] = a
      time += 1
    end
    #Encrypt Second Time
    time = 0
    hold2 = {}
    for i in hold.values
      a = Code::Code[1][i]
      hold2[time] = a
      time += 1
    end
    #Encrypt Third Time
    time = 0
    hold3 = {}
    for i in hold2.values
      a = Code::Code[2][i]
      hold3[time] = a
      time += 1
    end
    return hold3
  end
  #----------------------------------------------------------------------------
  # * Decode
  #----------------------------------------------------------------------------
  def decode(value)
    #De-encrypt Third Time
    time = 0
    hold = {}
    for i in value.values
      a = Code::Code[2].index(i) 
      hold[time] = a
      time += 1
    end
    #De-encrypt Third Time
    time = 0
    hold1 = {}
    for i in hold.values
      a = Code::Code[1].index(i) 
      hold1[time] = a
      time += 1
    end
    #De-encrypt Third Time
    time = 0
    hold2 = {}
    for i in hold1.values
      a = Code::Code[0].index(i) 
      hold2[time] = a
      time += 1
    end
    return hold2
  end
  #----------------------------------------------------------------------------
  # * Change number to letter
  #----------------------------------------------------------------------------
  def get_letter(number)
    #Letter array
    @letters= {'0'=>'a', '1'=>'b','2'=>'c', '3'=>'d','4'=>'e',
               '5'=>'f', '6'=>'g','7'=>'h', '8'=>'i','9'=>'j',
               '10'=>'k','11'=>'l','12'=>'m','13'=>'n','14'=>'o',
               '15'=>'p','16'=>'q','17'=>'r','18'=>'s', '19'=>'t',
               '20'=>'u', '21'=>'v', '22'=>'w','23'=>'x','24'=>'y',
               '25'=>'z'}
    return @letters[number.to_s]
  end
end
#==============================================================================
# ** Window_Username -  Username Input
#------------------------------------------------------------------------------
# Author    Me?
# Base      Mr.Mo
# Version   1.0
#==============================================================================
class Window_Username < Window_Base
  #--------------------------------------------------------------------------
  # * Attributes
  #-------------------------------------------------------------------------- 
  attr_accessor :text
  attr_accessor :actives  
  #--------------------------------------------------------------------------
  # * Initializes  input window.
  #--------------------------------------------------------------------------  
  def initialize
    super(120, 202, 100 + 180, 48)
    self.width = 100*2 + 180
    self.contents = Bitmap.new(self.width-32, height-32)
    self.contents.font.size = 16
    self.opacity = 160
    @text = []
    @wait = 0
    @actives = true
    refresh
  end
  #--------------------------------------------------------------------------
  # * Refreshes input window.
  #--------------------------------------------------------------------------  
  def refresh
    self.contents.clear
    self.contents.font.color = normal_color
    self.contents.draw_text(0, -8, self.width-64, 32, "Serial:")
    self.contents.draw_text(70, -16, self.width-64, 48, @text.to_s) if not self.active 
    self.contents.draw_text(70, -16, self.width-64, 48, @text.to_s + ' |') if self.active
    self.contents.draw_text(70, -16, self.width-64, 48, @text.to_s) if self.active
  end
  #--------------------------------------------------------------------------
  # * Update
  #-------------------------------------------------------------------------- 
  def update
    refresh
  end
end
 
I dont really think this is possible... there might be a way to do this though:

(this is in no way a script lol just a way to represent a way a script could be made)

if game ran = x amount of times, disable option on main menu s1 and s2 (i think thats the option names lol)
 
Just letting you know, scripting isn't exactly the best way to make this function... because someone could just re-download the game, and since the script stores variables IN-GAME, not on your computer, if you install a new copy you could just replay the 10-day trial.
 
The best bet is to store the counter to your registry, so redownloading won't work. Better, encrypt it if you're really paranoid :)

I see the script above already use encryption method, but revealing it through the script will have us easily decrypt the code. If you are really concerned about this, you might want to use advanced encryption method, as DES/AES, Blowfish, etc. (though so far I didn't see any script that used any of them).
 

Anonymous

Guest

It can be done, I played a Japanese one a while ago on some old forum and the creator scripted in a trial but she did say that it could just be re-downloaded, I'll have a look but I'm sure the forum is dead.
 
Keygen: Key Generator...

Shiroun... i just got very suspicious... its not an RMXP Keygen... IS IT?!
Because those are illegal :yes:...

I guess Exsharaen's idea would be best for this :p
 
It seems like the topic isn't about illegal RMXP keygens, but this post seems to be about that (or else it wouldn't need to be taken to PM). In which case...

shiroun":3ts1hf0p said:
I can pm you a keygen... just pm me :P

Don't mention this on the public forums in the future. If you're offering, PM him first. We don't allow blatant piracy.

If that's not the case, carry on folks.
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top