This function is fairly simple - you must run it twice within X amount of time in order for it to sendAll the arguments passed.
Where this is useful is when setting either a clickCallBack on a label, or setLink on something which you want to be 'mistake resistant' - they must then double click it in order to send what it is meant to send... They can't accidentally delete all their messages based on that click, for instance, they would have to double-click it.
Here's the function -
function doubleRunToSend(...)
local doubleClick = .4
if not DoubleRunTimer then
DoubleRunTimer = tempTimer(doubleClick,[[killTimer(DoubleRunTimer)
DoubleRunTimer = nil
DoubleRunCounter = nil
]])
end
if DoubleRunCounter then
DoubleRunCounter = DoubleRunCounter + 1
else
DoubleRunCounter = 0
end
if DoubleRunCounter == 1 then
sendAll(...)
end
end
And, here's an example of it's use within a trigger:
selectString(multimatches[2][2], 1)
setUnderline(true)
setLink([[doubleRunToSend("msg delete ]] .. multimatches[2][2] .. [[", false)]], "Double click to delete msg #"..multimatches[2][2])
resetFormat()