mirror of
https://gitlab.com/2009scape/2009scape.git
synced 2026-08-25 04:15:14 -06:00
move jingles command to other branch
This commit is contained in:
parent
aa9e245901
commit
f2e794b6c7
1 changed files with 0 additions and 23 deletions
|
|
@ -48,29 +48,6 @@ class MusicCommandSet : CommandSet(Privilege.STANDARD){
|
|||
notify(player,"Now playing jingle $id")
|
||||
}
|
||||
|
||||
define("jingles", Privilege.ADMIN, "::jingles <lt>From Jingle ID<gt> <lt>To Jingle ID<gt> <lt>(opt) Duration Per Jingle<gt>", "Plays jingles from the From ID to the To ID, with a delay of 5 between each, unless specified otherwise") { player, args ->
|
||||
|
||||
if (args.size < 3) {
|
||||
reject(player, "Syntax error: ::jingles <From Jingle ID> <To Jingle ID> <(opt) Duration Per Jingle>")
|
||||
return@define
|
||||
}
|
||||
val jingleFrom = args[1].toInt()
|
||||
val jingleTo = args[2].toInt()
|
||||
val jingleDelay = (args.getOrNull(3) ?: "5").toInt()
|
||||
|
||||
queueScript(player, 1, QueueStrength.WEAK) { stage: Int ->
|
||||
val jingleId = jingleFrom + stage
|
||||
PacketRepository.send(MusicPacket::class.java, MusicContext(player, jingleId, true))
|
||||
notify(player, "Now playing jingle $jingleId")
|
||||
|
||||
if (jingleId == jingleTo) {
|
||||
return@queueScript stopExecuting(player)
|
||||
}
|
||||
|
||||
return@queueScript delayScript(player, jingleDelay)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Command that lets you play a song via the ID instead of the song name
|
||||
* this is mostly useful for custom tracks that aren't in the ingame
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue