Azlier
Old World Ghost
- Reaction score
- 461
Does anyone feel like testing something for me? Also, try to fix any silly syntax errors if they pop up.
I hope for someone to test this on Battle.net. This should print a list of players' names, along with how much delay they have (in seconds). The thing I'm looking for is if it shows a different value for each player.
The player at the top of the list should always be host. If not, post it. A screenshot would be cool, too.
I hope for someone to test this on Battle.net. This should print a list of players' names, along with how much delay they have (in seconds). The thing I'm looking for is if it shows a different value for each player.
The player at the top of the list should always be host. If not, post it. A screenshot would be cool, too.
JASS:
library PrintDelayList initializer Init
globals
private unit array U
private timer Timer = CreateTimer()
private unit Enummed
private group Group = CreateGroup()
endglobals
private function FindSelected takes nothing returns boolean
if Enummed == null then
set Enummed = GetFilterUnit()
endif
return false
endfunction
function PrintDelayList takes nothing returns nothing
local integer i = 11
loop
set Enummed = null
call GroupEnumUnitsSelected(Group, Player(i), Filter(function FindSelected))
if GetLocalPlayer() == Player(i) then
call SelectUnit(Enummed, false)
call SelectUnit(U<i>, true)
call TimerStart(Timer, 10, false, null)
call SelectUnit(U<i>, false)
call SelectUnit(Enummed, true)
endif
exitwhen i == 0
set i = i - 1
endloop
endfunction
private function Print takes nothing returns boolean
call DisplayTextToPlayer(GetLocalPlayer(), 0, 0, GetPlayerName(GetOwningPlayer(GetTriggerUnit())) + ": " + R2S(TimerGetElapsed(Timer) / 2))
return false
endfunction
private function Init takes nothing returns nothing
local integer i = 11
local trigger t = CreateTrigger()
loop
set U<i> = CreateUnit(Player(i), 039;hfoo039;, 10000, 10000, 270)
call PauseUnit(U<i>, true)
call TriggerRegisterUnitEvent(t, U<i>, EVENT_UNIT_SELECTED)
exitwhen i == 0
set i = i - 1
endloop
call TriggerAddCondition(t, Condition(function Print))
/////////////////////////////
call TimerStart(CreateTimer(), 5, true, function PrintDelayList)
/////////////////////////////
endfunction
endlibrary</i></i></i></i></i>