Next version "delayed vote" concept, if you try to votemap when a vote is already pending, cubescript will automatically call the vote after the currently pending vote ends, again, only a concept, highly untested:
[cubescript]delayedvotemap = [
votemode = ""; votemapp = ""
votemode = $arg1
votemapp = $arg2
if (&& (strlen $votemode) (strlen $votemapp)) [
if (! $votepending) [ // no votes pending = no delayed vote
tmpdelayedvotealias = "" // blank it just in case
votemap $votemode $votemapp
] [
tmpdelayedvotealias = (format "votemap %1 %2" $votemode $votemapp)
if (! (strstr $onVoteEnd tmpdelayedvotealias)) [
add2alias onVoteEnd [
sleep 500 [ // both sleeps are persistent
tmpdelayedvotealias // execute vote 500 millis after previously pending vote ended
sleep 10 [ // cleanup onVoteEnd 10 millis after that so the initial (strstr) condition will pass on subsequent uses
onVoteEnd = (strreplace $onVoteEnd "tmpdelayedvotealias;" "")
] 1
] 1
]
]
]
]
]
if (! (checkalias mapstartalways)) [ mapstartalways = "" ]
if (! (strstr $mapstartalways tmpdelayedvotealias)) [
add2alias mapstartalways [ tmpdelayedvotealias = "" ]
]
if (! (checkalias onVoteEnd)) [ onVoteEnd = "" ]
addListOnQuit "delayedvotemap votemode votemapp"[/cubescript]
/delayedvotemap
...is the command and it works exactly like the regular /votemap (e.g. /votemap MODE MAP)...only difference being is the delayed functionality.
[cubescript]delayedvotemap = [
votemode = ""; votemapp = ""
votemode = $arg1
votemapp = $arg2
if (&& (strlen $votemode) (strlen $votemapp)) [
if (! $votepending) [ // no votes pending = no delayed vote
tmpdelayedvotealias = "" // blank it just in case
votemap $votemode $votemapp
] [
tmpdelayedvotealias = (format "votemap %1 %2" $votemode $votemapp)
if (! (strstr $onVoteEnd tmpdelayedvotealias)) [
add2alias onVoteEnd [
sleep 500 [ // both sleeps are persistent
tmpdelayedvotealias // execute vote 500 millis after previously pending vote ended
sleep 10 [ // cleanup onVoteEnd 10 millis after that so the initial (strstr) condition will pass on subsequent uses
onVoteEnd = (strreplace $onVoteEnd "tmpdelayedvotealias;" "")
] 1
] 1
]
]
]
]
]
if (! (checkalias mapstartalways)) [ mapstartalways = "" ]
if (! (strstr $mapstartalways tmpdelayedvotealias)) [
add2alias mapstartalways [ tmpdelayedvotealias = "" ]
]
if (! (checkalias onVoteEnd)) [ onVoteEnd = "" ]
addListOnQuit "delayedvotemap votemode votemapp"[/cubescript]
/delayedvotemap
...is the command and it works exactly like the regular /votemap (e.g. /votemap MODE MAP)...only difference being is the delayed functionality.