doubleRunToSend

Share your scripts and packages with other Mudlet users.
Post Reply
Phoenix
Posts: 92
Joined: Tue Feb 15, 2011 3:23 am

doubleRunToSend

Post 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()

sofiajoe
Posts: 1
Joined: Fri Nov 14, 2014 10:54 am

Re: doubleRunToSend

Post 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.

User avatar
Akaya
Posts: 414
Joined: Thu Apr 19, 2012 1:36 am

Re: doubleRunToSend

Post 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?

phasma
Posts: 191
Joined: Sat Aug 03, 2013 7:00 pm
Discord: phasma#4694

Re: doubleRunToSend

Post by phasma »

Was just a spam post by the looks.

User avatar
SlySven
Posts: 1022
Joined: Mon Mar 04, 2013 3:40 pm
Location: Deepest Wiltshire, UK
Discord: SlySven#2703

Re: doubleRunToSend

Post by SlySven »

Seems so, will watch for more issues from that IP... :frown:

Post Reply