Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Expected output from the default inputs
- plugin_entry = %Q({
- "name" : "DoubleX RMMV Partitioned Random v100b",
- "status" : true,
- "description" : "Lets users changes the number of partitions the RNG being run per Math.random() call to control the RNG distributions on the fly",
- "parameters" : {
- "parts" : "10"
- }
- }, )
- # Edit these
- PLUGIN_NAME = %Q("DoubleX RMMV Partitioned Random v100b")
- PLUGIN_STATUS = %Q(true)
- PLUGIN_PARAMS = %Q( * @plugindesc Lets users changes the number of partitions the RNG being run per
- * Math.random() call to control the RNG distributions on the fly
- * @author DoubleX
- *
- * @param parts
- * @desc RNG will be run under each of parts equal-sized partitions
- * No partition will be run under twice before they've all been run under
- * parts shouldn't be too large nor too small to maximize the chance for
- * the RNG generated by Math.random() to be more evenly distributed
- * Larger parts means more resources(mainly time) needed to run it
- * @default 10)
- OUTPUT_FILE = "RMMV Plugin.txt"
- # Don't edit these
- data_field = nil
- params = true
- File.open(OUTPUT_FILE, "a") { |file|
- file.print(%Q({\n "name" : #{PLUGIN_NAME},\n))
- file.print(%Q( "status" : #{PLUGIN_STATUS},\n))
- PLUGIN_PARAMS.split(/[\r\n]+/).each { |line|
- line = line[2..-1]
- next if !line || line.empty?
- if line.include?(%Q(@plugindesc))
- data_field = %Q("description")
- next file.print(%Q( "description" : "#{line.sub(/ @plugindesc /, "")}))
- elsif line.include?(%Q(@author))
- data_field = %Q("parameters")
- next file.print(%Q(",\n "parameters" : {))
- elsif line.include?(%Q(@param))
- data_field = %Q(#{line.sub(/ @param /, "")})
- next file.print(%Q(",\n "#{data_field}" : )) unless params
- params = false
- next file.print(%Q(\n "#{data_field}" : ))
- elsif line.include?(%Q(@default))
- data_field = %Q(@default)
- next file.print(%Q("#{line.sub(/ @default */, "")}))
- end
- next data_field = %Q(@desc) if line.include?(%Q(@desc))
- file.print(line) if data_field != %Q(@desc)
- }
- file.print(params ? %Q(}\n}, ) : %Q("\n }\n}, ))
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement