mirror of
https://gitlab.com/hoggit/developers/hoggit.git
synced 2025-11-10 15:43:28 +00:00
Fixed random list, Fixed MEssage for all
This commit is contained in:
parent
c24de38b21
commit
0775914a1c
@ -1,6 +1,5 @@
|
|||||||
trigger.action.outText(HOGGIT.script_base, 25)
|
|
||||||
trigger.action.outText(HOGGIT.log_base, 25)
|
|
||||||
dofile(HOGGIT.script_base..[[\HOGGIT\lib\error_handling.lua]])
|
dofile(HOGGIT.script_base..[[\HOGGIT\lib\error_handling.lua]])
|
||||||
dofile(HOGGIT.script_base..[[\HOGGIT\lib\logging.lua]])
|
dofile(HOGGIT.script_base..[[\HOGGIT\lib\logging.lua]])
|
||||||
dofile(HOGGIT.script_base..[[\HOGGIT\lib\utils.lua]])
|
dofile(HOGGIT.script_base..[[\HOGGIT\lib\utils.lua]])
|
||||||
dofile(HOGGIT.script_base..[[\HOGGIT\lib\spawner.lua]])
|
dofile(HOGGIT.script_base..[[\HOGGIT\lib\spawner.lua]])
|
||||||
|
dofile(HOGGIT.script_base..[[\HOGGIT\lib\group_commands.lua]])
|
||||||
|
|||||||
@ -12,7 +12,7 @@ HOGGIT.GroupCommand = function(group, text, parent, handler)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
HOGGIT.GroupMenuAdded={}
|
HOGGIT.GroupMenuAdded={}
|
||||||
GroupMenu = function( groupId, text, parent )
|
HOGGIT.GroupMenu = function( groupId, text, parent )
|
||||||
if HOGGIT.GroupMenuAdded[tostring(groupId)] == nil then
|
if HOGGIT.GroupMenuAdded[tostring(groupId)] == nil then
|
||||||
log("No commands from groupId " .. groupId .. " yet. Initializing menu state")
|
log("No commands from groupId " .. groupId .. " yet. Initializing menu state")
|
||||||
HOGGIT.GroupMenuAdded[tostring(groupId)] = {}
|
HOGGIT.GroupMenuAdded[tostring(groupId)] = {}
|
||||||
@ -24,13 +24,13 @@ GroupMenu = function( groupId, text, parent )
|
|||||||
return HOGGIT.GroupMenuAdded[tostring(groupId)][text]
|
return HOGGIT.GroupMenuAdded[tostring(groupId)][text]
|
||||||
end
|
end
|
||||||
|
|
||||||
MessageToGroup = function(groupId, text, displayTime, clear)
|
HOGGIT.MessageToGroup = function(groupId, text, displayTime, clear)
|
||||||
if not displayTime then displayTime = 10 end
|
if not displayTime then displayTime = 10 end
|
||||||
if clear == nil then clear = false end
|
if clear == nil then clear = false end
|
||||||
trigger.action.outTextForGroup( groupId, text, displayTime, clear)
|
trigger.action.outTextForGroup( groupId, text, displayTime, clear)
|
||||||
end
|
end
|
||||||
|
|
||||||
MessageToAll = function( text, displayTime )
|
HOGGIT.MessageToAll = function( text, displayTime )
|
||||||
if not displayTime then displayTime = 10 end
|
if not displayTime then displayTime = 10 end
|
||||||
trigger.action.outText( text, displayTime )
|
trigger.action.outText( text, displayTime )
|
||||||
end
|
end
|
||||||
|
|||||||
@ -1,3 +1,8 @@
|
|||||||
|
HOGGIT.randomInList = function(list)
|
||||||
|
local idx = math.random(1, #list)
|
||||||
|
return list[idx]
|
||||||
|
end
|
||||||
|
|
||||||
HOGGIT.filterTable = function(t, filter)
|
HOGGIT.filterTable = function(t, filter)
|
||||||
local out = {}
|
local out = {}
|
||||||
for k,v in pairs(t) do
|
for k,v in pairs(t) do
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user