Implement /delay N somecommand

RESOLVED FIXED

Status

--
enhancement
RESOLVED FIXED
10 years ago
9 years ago

People

(Reporter: Gijs, Assigned: Gijs)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [cz-0.9.86])

Attachments

(1 attachment)

2.86 KB, patch
bugzilla-mozilla-20000923
: review+
Details | Diff | Splinter Review
(Assignee)

Description

10 years ago
Spun off from bug 476933.

I don't really think it would be as useful to have a type of special marker in the autoperform list that would delay the rest of the autoperform. Instead, I think implementing an actual command that delays execution for the <rest> of its arguments by N seconds would be easier and more versatile (could also easily do an alias for timed bans, for instance).

Presumably this would work approximately like this:

cmd.delay.params = <delay> <rest>

function cmdDelay(e)
{
    setTimeout(dispatch, e.delay * 1000, e.rest, e, e.isInteractive, undefined);
}

(setting all the params because otherwise the timeout difference will be filled in there, potentially breaking things - could work around that with an anonymous function as well, if desired)

Comment 1

10 years ago
For those wanting this functionality in current builds, the following alias should suffice.

/alias delay eval var obj = this\; setTimeout(function() { obj.dispatch("$(2+)") },$(1) * 1000)

Comment 2

10 years ago
I think /delayed would be a better name; /delay sounds like a blocking sleep, where as this would execute the command asynchronously.
(Assignee)

Comment 3

9 years ago
Created attachment 410595 [details] [diff] [review]
Patch

File it, fix it, as they say...
Assignee: rginda → gijskruitbosch+bugs
Status: NEW → ASSIGNED
Attachment #410595 - Flags: review?(silver)

Updated

9 years ago
Attachment #410595 - Flags: review?(silver) → review+
(Assignee)

Comment 4

9 years ago
http://hg.mozilla.org/chatzilla/rev/d9cb5dc50dd0
Status: ASSIGNED → RESOLVED
Last Resolved: 9 years ago
Resolution: --- → FIXED
Whiteboard: [cz-0.9.86]
You need to log in before you can comment on or make changes to this bug.