Use this instead of the existing Ryinn_Command function:
Lua Code:
local function Ryinn_Command(msg, editBox)
-- String library functions can be called as methods on strings.
msg = msg:trim()
if msg == "" then
RyinnsCursorFinder_Enabled = not RyinnsCursorFinder_Enabled
frame:SetShown(RyinnsCursorFinder_Enabled) -- `frame:SetShown(val)` is equivalent to `if val then frame:Show() else frame:Hide() end`
print(("Ryinn's Flash Cursor is now %s. Use /rvm to toggle."):format(RyinnsCursorFinder_Enabled and "Enabled" or "Disabled"))
else
print("v" .. AddonVersion)
print("Use /rcf to enable/disable")
end
end
After looking at the code more closely, I realised that the x, y and speed variables
do need to be declared outside of the OnUpdate function as the values from the previous call are used to calculate the new value of speed each time.