Author Topic: Checking if command is up to date  (Read 3129 times)

blueknight

  • Newbie
  • *
  • Posts: 14
Checking if command is up to date
« on: April 16, 2018, 10:16:41 PM »
Hello all.
So I have an extensive command that pulls all it's data from the web site on start.
The only issue is that if I modify the data and have a new command (as part of a comma delimited spreadsheet) the user using the command would have to know to update. Since there is nothing stored locally there is nothing to grab on to.

Would there be a way to check that the text in "What I Say" matches a Variable that is pulled from the file. If it is missing a value I can prompt the user of the command to issue another command that would pull the Variable and update the "When I say" manually?

Any idea on how I could accomplish this?

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4790
  • RTFM
Re: Checking if command is up to date
« Reply #1 on: April 18, 2018, 01:45:58 AM »
You can get the "When I Say" contents when the command is executed using the "{CMDWHENISAY}" token.

Otherwise you could try the "CommandExists(string CommandName)" function in an inline function or plugin; It won't get you an exact comparison, but it'd tell you whether there's a command in the profile with a "When I Say" field that matches the new data(or the old, if you want to check that first).