mirror of
https://github.com/SquidDev-CC/CC-Tweaked
synced 2025-08-01 16:52:52 +00:00
Revert speaker play argument fix
Already cherry-picked in a version of this.
This commit is contained in:
parent
f9c9b6b119
commit
deda0bb2ec
@ -49,10 +49,6 @@ elseif cmd == "play" then
|
|||||||
|
|
||||||
local speaker = get_speakers(name)[1]
|
local speaker = get_speakers(name)[1]
|
||||||
|
|
||||||
if not file then
|
|
||||||
error("Usage: speaker play <file or url> [speaker]", 0)
|
|
||||||
end
|
|
||||||
|
|
||||||
local handle, err
|
local handle, err
|
||||||
if http and file:match("^https?://") then
|
if http and file:match("^https?://") then
|
||||||
print("Downloading...")
|
print("Downloading...")
|
||||||
@ -167,8 +163,9 @@ elseif cmd == "sound" then
|
|||||||
local speaker = get_speakers(name)[1]
|
local speaker = get_speakers(name)[1]
|
||||||
|
|
||||||
if speaker.playSound(sound, volume, pitch) then
|
if speaker.playSound(sound, volume, pitch) then
|
||||||
print(("Played sound %q on speaker %q with volume %s and pitch %s."):format(sound, peripheral.getName(speaker),
|
print(("Played sound %q on speaker %q with volume %s and pitch %s."):format(
|
||||||
volume or 1, pitch or 1))
|
sound, peripheral.getName(speaker), volume or 1, pitch or 1
|
||||||
|
))
|
||||||
else
|
else
|
||||||
error(("Could not play sound %q"):format(sound), 0)
|
error(("Could not play sound %q"):format(sound), 0)
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user