View Single Post
07-18-21, 01:08 PM   #4
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,877
The function for a slash command receives a single string parameter. If you want to interpret that into say commmands and parameters, you need to break down the string that is passed eg:
Lua Code:
  1. SlashCmdList.SLASHFUNC = function(msg)
  2.     local command, p1, p2, p3, p4 = strsplit(" ", strupper(msg))
  3.     if command == "RESET" then
  4.         FCF_ResetChatWindows()
  5.     elseif command == "LEAVE" then
  6.         if p1 == "TRADE" then
  7.             LeaveChannelByName("Trade")
  8.         else
  9.             print(command, p1, "Not Implemented!")
  10.         end
  11.     end
  12. end
  13.  
  14. -- test
  15. SlashCmdList.SLASHFUNC = function("leave trade")

or are you saying you want to test if RunScript(strLine) is going to run without error before running RunScript(strLine)?
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.

Last edited by Fizzlemizz : 07-18-21 at 01:20 PM.
  Reply With Quote