Page 1 of 1

doubleRunToSend

Posted: Fri Jan 18, 2013 2:57 am
by Phoenix
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 -
Code: [show] | [select all] lua
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:
Code: [show] | [select all] lua
selectString(multimatches[2][2], 1)
setUnderline(true)
setLink([[doubleRunToSend("msg delete ]] .. multimatches[2][2] .. [[", false)]], "Double click to delete msg #"..multimatches[2][2])
resetFormat()

Re: doubleRunToSend

Posted: Fri Nov 14, 2014 10:57 am
by sofiajoe
That was one of their motivations for releasing it as an open source project. While they may not have the time or budget to port it to other operating systems, they're hoping the community will be able to move forward with the project.

Re: doubleRunToSend

Posted: Fri Nov 14, 2014 8:58 pm
by Akaya
sofiajoe wrote:That was one of their motivations for releasing it as an open source project. While they may not have the time or budget to port it to other operating systems, they're hoping the community will be able to move forward with the project.
What? Is this out of context or am I not understanding how it relates to this thread?

Re: doubleRunToSend

Posted: Sat Nov 15, 2014 12:23 am
by phasma
Was just a spam post by the looks.

Re: doubleRunToSend

Posted: Mon Jan 19, 2015 12:27 am
by SlySven
Seems so, will watch for more issues from that IP... :frown: