Here's a script that goes through an event page's commands.
It is taken from this script: More Input Digits
All it does is determine whether there's a comment following a "show number input" command and then parses the comment to see if there are any special instructions.
This is a pretty basic way to iterate over an array.
Does it look good?
Is there a more efficient way to do this?
It is taken from this script: More Input Digits
All it does is determine whether there's a comment following a "show number input" command and then parses the comment to see if there are any special instructions.
module RPG class Event:
age alias :th_more_input_digits_list :list def list parse_more_input_digits unless @more_input_digits_parsed th_more_input_digits_list end def parse_more_input_digits @more_input_digits_parsed = true i = 0 while i < @list.size cmd = @list # Number Input command if cmd.code == 103 next_cmd = @list[i+1] # Collect all comments under it comment = "" while next_cmd.code == 108 || next_cmd.code == 408 i += 1 comment << "\n" << next_cmd.parameters[0] next_cmd = @list[i+1] end # Check if there's something special if comment =~ TH::More_Input_Digits::Regex num = $1.to_i cmd.parameters[1] = num end end i += 1 end end endendAll of this is just so that I can do this:
Does it look good?
Is there a more efficient way to do this?
Last edited by a moderator:
