adding ON/OFF switch to a script?

Hi everyone!, i was wondering if is possible to add an ON/OFF switch to an script, so i can disable/enable it in certain maps?

the scripts are these:

Open menu during message by regendo
https://www.rpgmakercentral.com/topic/375-open-menu-during-message/

message log by Saba Kan
https://forums.rpgmakerweb.com/index.php?threads/saba-kans-galge-conversation-system-0-7.1022/
this one, the sricpt is the third, is just that they come in a pack... the third, message log


Hope anyone can help me, its really a little bit aesthetic but im sure this can help everybody too!

HK
We much prefer that you provide links to scripts, rather than copy/paste them here. There are many reasons for that, including the fact that some scripters specifically ask that people don't repost anywhere. However, in this instance, your copy/paste shows another reason why not - the forum software has converted pieces of script into smilies, so making the code unreadable.

Please edit your post to remove those scripts and give links instead.
i see, im sorry about that, posting cause of the edit, so anyone can see
You cannot turn on/off entire scripts - that is technically impossible.
What you can do is turn on/off functions of a script instead of the entire script.

That however, requires the script to be written (or rewritten) in a way that makes the special functions you're interested in as an optional feature. A lot of scripters do that by default, but a lot of others don't think about that.

What is now needed is for you to specify what function or ability of each script you want to have optional, and then someone can try to write a patch for those scripts. Providing of course the original scripter has allowed edits to his script - if edits are forbidden in the TOS of a script, you're out of luck.
mmm... well, in both scripts i just want them to not trigger what they do in certain maps, example, the first makes the menu window to pop up when the user press a button, even when are messages playing in that moment, but lets see, i make like a title scene not by default, but in a map, for more customization, well, i dont want the menu to appear in that map, the same with the message log, i tried everything (with try and error cuz im not a scripter), i always try the last just for not bothering anyone, but i cant see nothing about "edit under your own risk" or something like that... so... i guess... i cant request it X_X, anyways thank you very much
Open message adjustment
Code:
    BUTTON = Input::B #which button will trigger the menu?
    TURNOFF = 121 # switch used
Code:
  alias update_old update
  def update
    update_old
    if $game_switches[Regendo::Menu_during_Message::TURNOFF] == true
    else
    call_menu if Input.trigger?(BUTTON) && !forbidden_scene_by_regendo
    end
  end

For message log
Code:
    # Width of the Name Column.
    NAME_WIDTH = 100
    
    TURNOFF = 120 #switch used
Code:
  def update_call_msg_log
    if $game_switches[Saba::MessageLog::TURNOFF] == true
    else
    call_msglog if Input.trigger?(Saba::MessageLog::LOG_BUTTON)
    end
  end
  def call_msglog
    Sound.play_ok
    SceneManager.call(Scene_MsgLog)
  end
end
it worked! Thank you very much!!
muy agradecido!

Original thread: https://forums.rpgmakerweb.com/threads/adding-on-off-switch-to-a-script.91447/