Jump to content

Spr243

Members
  • Content Count

    4
  • Joined

  • Last visited

Community Reputation

0 Neutral

About Spr243

  • Rank
    Newbie
  1. Thank you again for your response. I really appreciate it.
  2. Thank you for your response. My actual intended use is for programming a bot in Discord, but I figured the general principle would be the same. I will be aware of the potential security implications, but this bot is private and limited in its use to trusted people. Ignoring security issues, what would be the way to do what I mentioned in my original post, as making switch statements for each would take tremendous amounts of effort for the goal I am trying to achieve.
  3. How can I run a method stored in a variable? For example, there is a dropdown of available methods and the selects a method that the user wants it to complete. That method is stored in the variable, userSelectedMethod. For the example, that method would be toUpperCase(). var userSelectedMethod = "toUpperCase()" I want the script to run the method that is in the variable and apply it to the enteredText variable. I tried using the following code. (Didn't work, obviously) /// Attempt 1 var newResult = enteredText.userSelectedMethod; /// Attempt 2 var newResult = enteredText.M
  4. How can I run a method stored in a variable? For example, the user selects a method that the user wants it to complete. That method is stuck in the variable, userSelectedMethod. var userSelectedMethod = "toUpperCase()" I want the script to run the method that is in the variable. I tried using the following code. (Didn't work, obviously) /// Attempt 1 var newResult = enteredText.userSelectedMethod; /// Attempt 2 var newResult = enteredText.Module[userSelectedMethod]; /// Attempt 3 var newResult = enteredText.callback(userSelectedMethod); I want the newResult to run whatever m
×
×
  • Create New...