1
0
mirror of https://github.com/kepler155c/opus synced 2024-12-27 09:00:41 +00:00
This commit is contained in:
kepler155c@gmail.com 2018-11-26 20:53:28 -05:00
parent a0d47a5f1a
commit eb799004f8
3 changed files with 16 additions and 1 deletions

View File

@ -81,7 +81,8 @@ local function loopback(port, sport, msg)
end
local function newSocket(isLoopback)
for i = 16384, 32767 do
for _ = 16384, 32767 do
local i = math.random(16384, 32767)
if not device.wireless_modem.isOpen(i) then
local socket = {
shost = os.getComputerID(),

12
sys/apis/sound.lua Normal file
View File

@ -0,0 +1,12 @@
local peripheral = _G.peripheral
local speaker = peripheral.find('speaker')
local Sound = { }
function Sound.play(sound, vol)
if speaker then
speaker.playSound('minecraft:' .. sound, vol or 1)
end
end
return Sound

View File

@ -3,6 +3,7 @@ local class = require('class')
local Event = require('event')
local Input = require('input')
local Peripheral = require('peripheral')
local Sound = require('sound')
local Transition = require('ui.transition')
local Util = require('util')
@ -2542,6 +2543,7 @@ end
function UI.Notification:error(value, timeout)
self.backgroundColor = colors.red
Sound.play('entity.villager.no', .5)
self:display(value, timeout)
end