mirror of
https://github.com/OTCv8/otclientv8.git
synced 2025-04-29 18:59:20 +02:00
32 lines
665 B
Lua
32 lines
665 B
Lua
local context = G.botContext
|
|
|
|
context.getSoundChannel = function()
|
|
if not g_sounds then
|
|
return
|
|
end
|
|
return g_sounds.getChannel(SoundChannels.Bot)
|
|
end
|
|
|
|
context.playSound = function(file)
|
|
local botSoundChannel = context.getSoundChannel()
|
|
if not botSoundChannel then
|
|
return
|
|
end
|
|
botSoundChannel:setEnabled(true)
|
|
botSoundChannel:stop(0)
|
|
botSoundChannel:play(file, 0, 1.0)
|
|
return botSoundChannel
|
|
end
|
|
|
|
context.stopSound = function()
|
|
local botSoundChannel = context.getSoundChannel()
|
|
if not botSoundChannel then
|
|
return
|
|
end
|
|
botSoundChannel:stop()
|
|
end
|
|
|
|
context.playAlarm = function()
|
|
return context.playSound("/sounds/alarm.ogg")
|
|
end
|