Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
library DelayedOrder uses TimerIndex
globals
unit array udg_DelayedOrder_WhichUnit
integer array udg_DelayedOrder_OrderId
real array udg_DelayedOrder_TargetPoint_X
real array udg_DelayedOrder_TargetPoint_Y
widget array udg_DelayedOrder_TargetWidget
endglobals
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
function IssueImmediateOrderByIdCallback takes nothing returns nothing
local timer t = GetExpiredTimer()
local integer id = GetTimerData(t)
call ReleaseIndexedTimer(t)
call IssueImmediateOrderById(udg_DelayedOrder_WhichUnit[id], udg_DelayedOrder_OrderId[id])
set udg_DelayedOrder_WhichUnit[id] = null
set udg_DelayedOrder_OrderId[id] = 0
endfunction
function IssueImmediateOrderByIdDelayed takes unit whichUnit, integer order, real delay returns nothing
local timer t = NewIndexedTimer()
local integer id = GetTimerData(t)
set udg_DelayedOrder_WhichUnit[id] = whichUnit
set udg_DelayedOrder_OrderId[id] = order
call TimerStart(t, delay, false, function IssueImmediateOrderByIdCallback)
set t = null
endfunction
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
function IssuePointOrderByIdCallback takes nothing returns nothing
local timer t = GetExpiredTimer()
local integer id = GetTimerData(t)
call ReleaseIndexedTimer(t)
call IssuePointOrderById(udg_DelayedOrder_WhichUnit[id], udg_DelayedOrder_OrderId[id], udg_DelayedOrder_TargetPoint_X[id], udg_DelayedOrder_TargetPoint_Y[id])
set udg_DelayedOrder_WhichUnit[id] = null
set udg_DelayedOrder_OrderId[id] = 0
set udg_DelayedOrder_TargetPoint_X[id] = 0.
set udg_DelayedOrder_TargetPoint_Y[id] = 0.
endfunction
function IssuePointOrderByIdDelayed takes unit whichUnit, integer order, real x, real y, real delay returns nothing
local timer t = NewIndexedTimer()
local integer id = GetTimerData(t)
set udg_DelayedOrder_WhichUnit[id] = whichUnit
set udg_DelayedOrder_OrderId[id] = order
set udg_DelayedOrder_TargetPoint_X[id] = x
set udg_DelayedOrder_TargetPoint_Y[id] = y
call TimerStart(t, delay, false, function IssuePointOrderByIdCallback)
set t = null
endfunction
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
function IssueTargetOrderByIdCallback takes nothing returns nothing
local timer t = GetExpiredTimer()
local integer id = GetTimerData(t)
call ReleaseIndexedTimer(t)
call IssueTargetOrderById(udg_DelayedOrder_WhichUnit[id], udg_DelayedOrder_OrderId[id], udg_DelayedOrder_TargetWidget[id])
set udg_DelayedOrder_WhichUnit[id] = null
set udg_DelayedOrder_OrderId[id] = 0
set udg_DelayedOrder_TargetWidget[id] = null
endfunction
function IssueTargetOrderByIdDelayed takes unit whichUnit, integer order, widget targetWidget, real delay returns nothing
local timer t = NewIndexedTimer()
local integer id = GetTimerData(t)
set udg_DelayedOrder_WhichUnit[id] = whichUnit
set udg_DelayedOrder_OrderId[id] = order
set udg_DelayedOrder_TargetWidget[id] = targetWidget
call TimerStart(t, delay, false, function IssueTargetOrderByIdCallback)
set t = null
endfunction
endlibrary
Here's the method kingkwong described. . . I am amazed you knew that handy hidden feature, I was planning to reveal that in a couple weeks.
Just add the *custom* channel(Disable Right-Click named) ability to any unit/hero you want right-click disabled on.
What is the advantage of this over checking for the "smart" order in combination with an order event? Seems like a pointless workaround for a problem that doesn't even exist to me.Another method is to change the channel ability. Change the base order ID to smart, Options to universal spell and target type to point target. All right clicks by that unit can be detected when they cast that spell.
What is the advantage of this over checking for the "smart" order in combination with an order event? Seems like a pointless workaround for a problem that doesn't even exist to me.
So just adding this ability would already cause the unit to stop moving? No triggers at all? If so, that's just neato!Doesn't require any code/triggers for constant detection so it creates less strain on everyone's computers.
So just adding this ability would already cause the unit to stop moving? No triggers at all? If so, that's just neato!
Does it still work with the channel ability hidden (or without the "visible" flag in the OE)?

Opps, was this supposed to be a secret?
I just share everything I have lol
That's so cool.If you made 3 more to block attack,move,patrol then yes the unit wouldn't be able to move anymore unless aggro'd. Yeah it is pretty neat, a well-kept secret for a long time until now.
Yeah I don't see why not.
That's so cool.
Does the unit still turn towards the target if you right-click?
Might be a nice alternative to pausing units.
