Fixed random list, Fixed MEssage for all

This commit is contained in:
Jeremy Smitherman 2018-12-24 17:11:04 -06:00
parent c24de38b21
commit 0775914a1c
3 changed files with 9 additions and 5 deletions

View File

@ -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\logging.lua]])
dofile(HOGGIT.script_base..[[\HOGGIT\lib\utils.lua]])
dofile(HOGGIT.script_base..[[\HOGGIT\lib\spawner.lua]])
dofile(HOGGIT.script_base..[[\HOGGIT\lib\group_commands.lua]])

View File

@ -12,7 +12,7 @@ HOGGIT.GroupCommand = function(group, text, parent, handler)
end
end
HOGGIT.GroupMenuAdded={}
GroupMenu = function( groupId, text, parent )
HOGGIT.GroupMenu = function( groupId, text, parent )
if HOGGIT.GroupMenuAdded[tostring(groupId)] == nil then
log("No commands from groupId " .. groupId .. " yet. Initializing menu state")
HOGGIT.GroupMenuAdded[tostring(groupId)] = {}
@ -24,13 +24,13 @@ GroupMenu = function( groupId, text, parent )
return HOGGIT.GroupMenuAdded[tostring(groupId)][text]
end
MessageToGroup = function(groupId, text, displayTime, clear)
HOGGIT.MessageToGroup = function(groupId, text, displayTime, clear)
if not displayTime then displayTime = 10 end
if clear == nil then clear = false end
trigger.action.outTextForGroup( groupId, text, displayTime, clear)
end
MessageToAll = function( text, displayTime )
HOGGIT.MessageToAll = function( text, displayTime )
if not displayTime then displayTime = 10 end
trigger.action.outText( text, displayTime )
end

View File

@ -1,3 +1,8 @@
HOGGIT.randomInList = function(list)
local idx = math.random(1, #list)
return list[idx]
end
HOGGIT.filterTable = function(t, filter)
local out = {}
for k,v in pairs(t) do