How would I check a script boxes data in my plugin?

Discussion in 'Javascript/Plugin Support' started by MechaGS, Oct 28, 2015.

  1. MechaGS

    MechaGS Veteran Veteran

    Messages:
    40
    Likes Received:
    6
    First Language:
    English
    Hi everyone, I'm confusing myself by trying to check what the user is entering into the script box. I need a way to check because of a plugin I'm updating.

    I'd like to do something like the following and gather the information between the square brackets.

    [MechaGS_Function]param1 = valueparam2 = valueparam3 = value[/MechaGS_Function]Any help with understanding how to approach this would be greatly appreciated.
     
    #1
  2. Jeremy Cannady

    Jeremy Cannady Coldfire Veteran

    Messages:
    449
    Likes Received:
    261
    Location:
    Texas
    First Language:
    English
    Have you tried using the debug console?
     
    #2
  3. MechaGS

    MechaGS Veteran Veteran

    Messages:
    40
    Likes Received:
    6
    First Language:
    English
    Yep, I've been releasing scripts and using the debug console to get around everything.

    The only reason I asked was because I'm interested in cleaning a function up because in the Plugin Command window it looks really long right now.

    I just haven't figured out how to read from the script area.
     
    Last edited by a moderator: Oct 28, 2015
    #3
  4. Jeremy Cannady

    Jeremy Cannady Coldfire Veteran

    Messages:
    449
    Likes Received:
    261
    Location:
    Texas
    First Language:
    English
    What do you mean exactly? Read data from note tags? Read data from the plugin menu where you can specify parameters?

    Find out what a value of your function in your script is?
     
    #4
  5. MechaGS

    MechaGS Veteran Veteran

    Messages:
    40
    Likes Received:
    6
    First Language:
    English
    I want to read the script area, but I haven't found a way. I can read from the plugin command area but it looks really messy.

    Here's my plugin. you'll see that the command is quite long, I'd like to tidy it up by using a more readable method like posted in the main topic above.
     
    #5
  6. Iavra

    Iavra Veteran Veteran

    Messages:
    1,797
    Likes Received:
    856
    First Language:
    German
    The content of the "Script" event command is executed via eval(), so you should just call one of your functions and pass the parameters.
     
    #6
  7. Andar

    Andar Veteran Veteran

    Messages:
    28,446
    Likes Received:
    6,490
    Location:
    Germany
    First Language:
    German
    Primarily Uses:
    RMMV
    You need to specify what you mean, because you're not using the correct nomenclature.


    Are you talking about the note box in the database where most scripts and plugins place additional data?


    Are you talking about the script command in the event commands?


    Are you talking about the old script editor from Ace that does not exist in MV anymore?


    Because there is nothing named "script area" or "Script Box" in the entire editor...
     
    Last edited by a moderator: Oct 28, 2015
    #7
  8. MechaGS

    MechaGS Veteran Veteran

    Messages:
    40
    Likes Received:
    6
    First Language:
    English
    Sorry if I'm not clear enough, I mean the script command area.

    Capture.JPG
     
    Last edited by a moderator: Oct 28, 2015
    #8
  9. Jeremy Cannady

    Jeremy Cannady Coldfire Veteran

    Messages:
    449
    Likes Received:
    261
    Location:
    Texas
    First Language:
    English
    I agree with lavra.
     
    #9
  10. Andar

    Andar Veteran Veteran

    Messages:
    28,446
    Likes Received:
    6,490
    Location:
    Germany
    First Language:
    German
    Primarily Uses:
    RMMV
    In the script command, you can only place commands - your original post was formatted like a notetag, that will never work in a script command.


    To transfer data by script command, you need to write a function in your plugin that will be used to receive that data as arguments.


    This function needs to store the data into the script variables that you want to use that.


    Then you call that function inside the script command, giving the data you want as arguments of that function.
     
    #10
  11. MechaGS

    MechaGS Veteran Veteran

    Messages:
    40
    Likes Received:
    6
    First Language:
    English
    Hmm, unfortunate. I'll leave it with the Plugin Command style then.

    I was just looking to see if there was a better way of handling it.
     
    #11

Share This Page