please dont hate me

This commit is contained in:
Chr1Z93 2022-12-01 14:39:22 +01:00
parent 9fd95fc126
commit c9c6d2b122
11 changed files with 314 additions and 405 deletions

View File

@ -56,7 +56,7 @@
"BlockRectangle.612072", "BlockRectangle.612072",
"Cluetokens.11e0cf", "Cluetokens.11e0cf",
"Doomtokens.b015d8", "Doomtokens.b015d8",
"AgendaDeck.85c4c6", "DoomCounter.85c4c6",
"Custom_Tile.2eca7c", "Custom_Tile.2eca7c",
"Custom_Tile.fb09d4", "Custom_Tile.fb09d4",
"3DText.65eb7e", "3DText.65eb7e",
@ -208,7 +208,7 @@
"ReturntoTheCircleUndone.757324", "ReturntoTheCircleUndone.757324",
"Playermat4Red.0840d5", "Playermat4Red.0840d5",
"Playermat3Green.383d8b", "Playermat3Green.383d8b",
"MiscDoominplay.652ff3", "OtherDoominPlay.652ff3",
"Playermat1White.8b081b", "Playermat1White.8b081b",
"Playermat2Orange.bd0ff4", "Playermat2Orange.bd0ff4",
"CustomDataHelper.2547b3", "CustomDataHelper.2547b3",

View File

@ -20,8 +20,8 @@
}, },
{ {
"Position": { "Position": {
"x": -5.316, "x": -5.3,
"y": 1.588, "y": 1.583,
"z": 0.378 "z": 0.378
} }
}, },
@ -522,8 +522,8 @@
}, },
{ {
"Position": { "Position": {
"x": -5.369, "x": -5.3,
"y": 1.587, "y": 1.583,
"z": -5.1 "z": -5.1
} }
}, },

View File

@ -33,17 +33,17 @@
"IgnoreFoW": false, "IgnoreFoW": false,
"LayoutGroupSortIndex": 0, "LayoutGroupSortIndex": 0,
"Locked": true, "Locked": true,
"LuaScript": "require(\"core/AgendaDeck\")", "LuaScript": "require(\"core/DoomCounter\")",
"LuaScriptState": "0", "LuaScriptState": "[0,{\"Agenda\":true,\"Playarea\":true,\"Playermats\":true}]",
"MeasureMovement": false, "MeasureMovement": false,
"Name": "Custom_Token", "Name": "Custom_Token",
"Nickname": "Agenda Deck", "Nickname": "Doom Counter",
"Snap": true, "Snap": true,
"Sticky": true, "Sticky": true,
"Tooltip": false, "Tooltip": true,
"Transform": { "Transform": {
"posX": -5.316, "posX": -5.3,
"posY": 1.639, "posY": 1.633,
"posZ": 0.378, "posZ": 0.378,
"rotX": 0, "rotX": 0,
"rotY": 270, "rotY": 270,
@ -53,5 +53,5 @@
"scaleZ": 0.42 "scaleZ": 0.42
}, },
"Value": 0, "Value": 0,
"XmlUI": "" "XmlUI_path": "DoomCounter.85c4c6.xml"
} }

View File

@ -0,0 +1,37 @@
<Defaults>
<Panel rotation="0 0 180"></Panel>
<ToggleButton class="optionButton" colors="#50e610|#f2d82e|#f2d82e" fontSize="45" isOn="0" textAlignment="MiddleLeft" padding="30 30 0 0"></ToggleButton>
</Defaults>
<Panel id="Buttons" offsetXY="0 285">
<TableLayout height="150" width="500" cellSpacing="10">
<Row>
<Cell columnSpan="3">
<Button onClick="startReset" fontSize="80">Reset</Button>
</Cell>
<Cell>
<ToggleButton onClick="toggleOptions" fontSize="55"></ToggleButton>
</Cell>
</Row>
</TableLayout>
</Panel>
<Panel id="Options" offsetXY="0 535" active="false">
<VerticalLayout height="300" width="500" spacing="10" childAlignment="MiddleCenter">
<ToggleButton
class="optionButton"
id="optionAgenda"
onClick="optionClick(Agenda)"
>Doom on Agenda</ToggleButton>
<ToggleButton
class="optionButton"
id="optionPlayarea"
onClick="optionClick(Playarea)"
>Doom in Playarea</ToggleButton>
<ToggleButton
class="optionButton"
id="optionPlayermats"
onClick="optionClick(Playermats)"
>Doom on Playermats</ToggleButton>
</VerticalLayout>
</Panel>

View File

@ -34,16 +34,16 @@
"LayoutGroupSortIndex": 0, "LayoutGroupSortIndex": 0,
"Locked": true, "Locked": true,
"LuaScript": "require(\"core/MasterClueCounter\")", "LuaScript": "require(\"core/MasterClueCounter\")",
"LuaScriptState": "[true,0]", "LuaScriptState": "",
"MeasureMovement": false, "MeasureMovement": false,
"Name": "Custom_Token", "Name": "Custom_Token",
"Nickname": "Master Clue Counter\n", "Nickname": "Master Clue Counter\n",
"Snap": true, "Snap": true,
"Sticky": true, "Sticky": true,
"Tooltip": false, "Tooltip": true,
"Transform": { "Transform": {
"posX": -5.369, "posX": -5.3,
"posY": 1.557, "posY": 1.633,
"posZ": -5.1, "posZ": -5.1,
"rotX": 0, "rotX": 0,
"rotY": 270, "rotY": 270,

View File

@ -34,10 +34,10 @@
"LayoutGroupSortIndex": 0, "LayoutGroupSortIndex": 0,
"Locked": true, "Locked": true,
"LuaScript": "require(\"core/DoomInPlayCounter\")", "LuaScript": "require(\"core/DoomInPlayCounter\")",
"LuaScriptState": "[true,0]", "LuaScriptState": "",
"MeasureMovement": false, "MeasureMovement": false,
"Name": "Custom_Token", "Name": "Custom_Token",
"Nickname": "Misc. Doom in play", "Nickname": "Other Doom in Play",
"Snap": true, "Snap": true,
"Sticky": true, "Sticky": true,
"Tags": [ "Tags": [
@ -45,15 +45,15 @@
], ],
"Tooltip": true, "Tooltip": true,
"Transform": { "Transform": {
"posX": -6.185, "posX": -5.3,
"posY": 1.56, "posY": 1.633,
"posZ": 1.396, "posZ": 1.8,
"rotX": 0, "rotX": 0,
"rotY": 270, "rotY": 270,
"rotZ": 0, "rotZ": 0,
"scaleX": 0.23, "scaleX": 0.25,
"scaleY": 1, "scaleY": 1,
"scaleZ": 0.23 "scaleZ": 0.25
}, },
"Value": 0, "Value": 0,
"XmlUI": "" "XmlUI": ""

View File

@ -1,60 +0,0 @@
-- Doom Counter with Print
-- original by: -
-- changed by: Chr1Z
-- description: Clickable counter for doom on the agenda, changing the value prints the new value, reset button added
information = {
version = "1.4",
last_updated = "12.11.2022"
}
function onSave() return JSON.encode(val) end
function onLoad(saved_data)
if saved_data ~= "" then
val = JSON.decode(saved_data)
else
val = 0
end
self.createButton({
label = tostring(val),
click_function = "addOrSubtract",
function_owner = self,
position = { 0, 0.06, 0 },
height = 800,
width = 800,
font_size = 650,
scale = { 1.5, 1.5, 1.5 },
font_color = { 1, 1, 1, 95 },
color = { 0, 0, 0, 0 }
})
self.createButton({
label = "Reset",
click_function = "setToZero",
function_owner = self,
position = { 0, -0.04, 2.7 },
height = 600,
width = 1250,
font_size = 425
})
self.addContextMenuItem("More Information", function()
printToAll("------------------------------", "White")
printToAll("Doom Counter v" .. information["version"] .. " by Chr1Z", "Orange")
printToAll("last updated: " .. information["last_updated"], "White")
end)
end
function setToZero() updateVal(0) end
function addOrSubtract(_, _, alt_click)
local new_value = math.min(math.max(val + (alt_click and -1 or 1), 0), 99)
if val ~= new_value then updateVal(new_value) end
end
function updateVal(number)
val = number or 0
self.editButton({ index = 0, label = tostring(val) })
printToAll("Doom on agenda set to: " .. val)
end

View File

@ -0,0 +1,75 @@
local optionsVisible = false
local options = {
Agenda = true,
Playarea = true,
Playermats = true
}
val = 0
-- save current value and options
function onSave() return JSON.encode({ val, options }) end
function onLoad(savedData)
if savedData ~= "" then
local loadedData = JSON.decode(savedData)
val = loadedData[1]
options = loadedData[2]
-- restore state for option panel
for key, bool in pairs(options) do
if bool then
self.UI.setAttribute("option" .. key, "isOn", 0)
end
end
end
self.createButton({
label = tostring(val),
click_function = "addOrSubtract",
function_owner = self,
position = { 0, 0.06, 0 },
height = 800,
width = 800,
font_size = 650,
scale = { 1.5, 1.5, 1.5 },
font_color = { 1, 1, 1, 95 },
color = { 0, 0, 0, 0 }
})
end
-- called by the invisible button to change displayed value
function addOrSubtract(_, _, isRightClick)
local newVal = math.min(math.max(val + (isRightClick and -1 or 1), 0), 99)
if val ~= newVal then updateVal(newVal) end
end
function updateVal(number)
val = number or 0
self.editButton({ index = 0, label = tostring(val) })
printToAll("Doom on agenda set to: " .. val)
end
-- called by "Reset" button to remove doom
function startReset()
if options.Agenda then
updateVal(0)
end
getObjectFromGUID("652ff3").call("removeDoom", options)
end
-- XML UI functions
function optionClick(_, optionName)
options[optionName] = not options[optionName]
printToAll("Doom removal of " .. optionName .. (options[optionName] and " enabled" or " disabled"))
end
function toggleOptions()
optionsVisible = not optionsVisible
if optionsVisible then
self.UI.show("Options")
else
self.UI.hide("Options")
end
end

View File

@ -1,104 +1,106 @@
-- Doom-in-Play Counter
-- made by: Chr1Z
-- description: counts the doom tokens in play periodically (excluding the agenda), ignores objects with specified tag
information = {
version = "1.1",
last_updated = "12.11.2022"
}
-- common parameters -- common parameters
local castParameters = {} local castParameters = {}
castParameters.direction = { 0, 1, 0 } castParameters.direction = { 0, 1, 0 }
castParameters.type = 3 castParameters.type = 3
castParameters.max_distance = 0 castParameters.max_distance = 0
local zone = getObjectFromGUID("a2f932") local zone
local doom_url = "https://i.imgur.com/EoL7yaZ.png" local doomURL = "https://i.imgur.com/EoL7yaZ.png"
local IGNORE_TAG = "DoomCounter_ignore" local IGNORE_TAG = "DoomCounter_ignore"
-- playermats 1 to 4 -- playermats 1 to 4
local originAndSize = { local originAndSize = {
{ origin = { -55, 1.6, 16.5 }, size = { 12, 1, 25 } }, { origin = { -55, 1.6, 16.5 }, size = { 12, 1, 25 } },
{ origin = { -55, 1.6, -16.5 }, size = { 12, 1, 25 } }, { origin = { -55, 1.6, -16.5 }, size = { 12, 1, 25 } },
{ origin = { -25, 1.6, 27 }, size = { 25, 1, 12 } }, { origin = { -25, 1.6, 27 }, size = { 25, 1, 12 } },
{ origin = { -25, 1.6, -27 }, size = { 25, 1, 12 } } { origin = { -25, 1.6, -27 }, size = { 25, 1, 12 } }
} }
-- create button, context menu and start loop -- create button, context menu and start loop
function onLoad() function onLoad()
self.createButton({ self.createButton({
label = tostring(0), label = tostring(0),
click_function = "moreInformation", click_function = "none",
function_owner = self, function_owner = self,
position = { 0, 0.06, 0 }, position = { 0, 0.06, 0 },
height = 600, height = 0,
width = 1000, width = 0,
scale = { 1.5, 1.5, 1.5 }, scale = { 1.5, 1.5, 1.5 },
font_size = 600, font_size = 600,
font_color = { 1, 1, 1, 100 }, font_color = { 1, 1, 1, 100 },
color = { 0, 0, 0, 0 } color = { 0, 0, 0, 0 }
}) })
-- context menu zone = getObjectFromGUID("a2f932")
self.addContextMenuItem("More Information", moreInformation) loopID = Wait.time(countDoom, 2, -1)
self.addContextMenuItem("Remove Doom", function()
Wait.stop(loopID)
removeDoom = true
countDoom()
Wait.time(function()
removeDoom = false
loopID = Wait.time(countDoom, 2, -1)
end, 2)
end)
loopID = Wait.time(countDoom, 2, -1)
end
function moreInformation()
printToAll("------------------------------", "White")
printToAll("Doom-in-Play Counter v" .. information["version"] .. " by Chr1Z", "Orange")
printToAll("last updated: " .. information["last_updated"], "White")
printToAll("Automatically counts the doom in play (exluding the agenda and objects with the ignore tag).", "Green")
printToAll("ignore tag: " .. IGNORE_TAG, "White")
end end
-- main function -- main function
function countDoom() function countDoom()
local doom = 0 local doom = 0
for i = 1, 5 do doom = doom + search(i) end for i = 1, 5 do doom = doom + search(i) end
self.editButton({ index = 0, label = tostring(doom) }) self.editButton({ index = 0, label = tostring(doom) })
end end
-- searches playermats (num = 1-4) or the scripting zone (num = 5) -- searches playermats (num = 1-4) or the scripting zone (num = 5)
function search(num) function search(num)
local val = 0 local val = 0
if num == 5 then if num == 5 then
for _, obj in ipairs(zone.getObjects()) do for _, obj in ipairs(zone.getObjects()) do
val = val + isDoom(obj) val = val + isDoom(obj)
end
else
castParameters.origin = originAndSize[num].origin
castParameters.size = originAndSize[num].size
for _, obj in ipairs(Physics.cast(castParameters)) do
val = val + isDoom(obj.hit_object)
end
end end
return val else
castParameters.origin = originAndSize[num].origin
castParameters.size = originAndSize[num].size
for _, obj in ipairs(Physics.cast(castParameters)) do
val = val + isDoom(obj.hit_object)
end
end
return val
end end
-- checks an object for the doom image and gets quantity (for stacks) -- checks an object for the doom image and gets quantity (for stacks)
function isDoom(obj) function isDoom(obj)
if (obj.is_face_down and obj.getCustomObject().image_bottom == doom_url) or if (obj.is_face_down and obj.getCustomObject().image_bottom == doomURL) or
(obj.name == "Custom_Token" and obj.getCustomObject().image == doom_url) then (obj.name == "Custom_Token" and obj.getCustomObject().image == doomURL) then
if not obj.hasTag(IGNORE_TAG) then if not obj.hasTag(IGNORE_TAG) then
if removeDoom then return math.abs(obj.getQuantity())
obj.destruct()
return 0
else
return math.abs(obj.getQuantity())
end
end
end end
return 0 end
return 0
end
-- removes doom from playermats / playarea
function removeDoom(options)
local trashCan = getObjectFromGUID("70b9f6")
local count = 0
if options.Playermats then
for i = 1, 4 do
castParameters.origin = originAndSize[i].origin
castParameters.size = originAndSize[i].size
for _, obj in ipairs(Physics.cast(castParameters)) do
local obj = obj.hit_object
local amount = isDoom(obj)
if amount > 0 then
trashCan.putObject(obj)
count = count + amount
end
end
end
broadcastToAll(count .. " doom removed from Playermats.", "White")
end
local count = 0
if options.Playarea then
for _, obj in ipairs(zone.getObjects()) do
local amount = isDoom(obj)
if amount > 0 then
trashCan.putObject(obj)
count = count + amount
end
end
broadcastToAll(count .. " doom removed from Playarea.", "White")
end
end end

View File

@ -1,161 +1,45 @@
MIN_VALUE = -99 local clueCounters = {}
MAX_VALUE = 999 local clueCounterGUIDS = {
"37be78",
"1769ed",
"032300",
"d86b7c"
}
function onload(saved_data) function onLoad()
light_mode = false self.createButton({
val = 0 label = "0",
click_function = "removeAllPlayerClues",
function_owner = self,
position = { 0, 0.06, 0 },
height = 900,
width = 900,
scale = { 1.5, 1.5, 1.5 },
font_size = 600,
font_color = { 1, 1, 1, 100 },
color = { 0, 0, 0, 0 }
})
if saved_data ~= "" then -- loading object references to the counting bowls via GUID
local loaded_data = JSON.decode(saved_data) for i = 1, 4 do
light_mode = loaded_data[1] clueCounters[i] = getObjectFromGUID(clueCounterGUIDS[i])
val = loaded_data[2] end
end
p1ClueCounter = getObjectFromGUID("37be78")
p2ClueCounter = getObjectFromGUID("1769ed")
p3ClueCounter = getObjectFromGUID("032300")
p4ClueCounter = getObjectFromGUID("d86b7c")
timerID = self.getGUID()..math.random(9999999999999) loopID = Wait.time(sumClues, 2, -1)
Timer.create({
identifier=timerID,
function_name="totalCounters", function_owner=self,
repetitions=0, delay=1
})
createAll()
end
function loadPlayerCounters()
p1ClueCounter = getObjectFromGUID("37be78")
p2ClueCounter = getObjectFromGUID("1769ed")
p3ClueCounter = getObjectFromGUID("032300")
p4ClueCounter = getObjectFromGUID("d86b7c")
end
function totalCounters()
if p1ClueCounter == nil or p2ClueCounter == nil or p3ClueCounter == nil or p4ClueCounter == nil then
loadPlayerCounters()
end
local p1ClueCount = p1ClueCounter.getVar("exposedValue")
local p2ClueCount = p2ClueCounter.getVar("exposedValue")
local p3ClueCount = p3ClueCounter.getVar("exposedValue")
local p4ClueCount = p4ClueCounter.getVar("exposedValue")
val = tonumber(p1ClueCount) + tonumber(p2ClueCount) + tonumber(p3ClueCount) + tonumber(p4ClueCount)
updateVal()
updateSave()
end
function updateSave()
local data_to_save = {light_mode, val}
saved_data = JSON.encode(data_to_save)
self.script_state = saved_data
end
function createAll()
s_color = {0.5, 0.5, 0.5, 95}
if light_mode then
f_color = {1,1,1,95}
else
f_color = {0,0,0,100}
end
self.createButton({
label=tostring(val),
click_function="removeAllPlayerClues",
function_owner=self,
position={0,0.05,0},
height=600,
width=1000,
alignment = 3,
tooltip = "Click button to remove all clues from all investigators",
scale={x=1.5, y=1.5, z=1.5},
font_size=600,
font_color=f_color,
color={0,0,0,0}
})
if light_mode then
lightButtonText = "[ Set dark ]"
else
lightButtonText = "[ Set light ]"
end
end
function removeAll()
self.removeInput(0)
self.removeInput(1)
self.removeButton(0)
self.removeButton(1)
self.removeButton(2)
end end
-- removes all player clues by calling the respective function from the counting bowls
function removeAllPlayerClues() function removeAllPlayerClues()
p1ClueCounter.call("removeAllClues") for i = 1, 4 do
p2ClueCounter.call("removeAllClues") clueCounters[i].call("removeAllClues")
p3ClueCounter.call("removeAllClues")
p4ClueCounter.call("removeAllClues")
end
function reloadAll()
removeAll()
createAll()
updateSave()
end
function swap_fcolor(_obj, _color, alt_click)
light_mode = not light_mode
reloadAll()
end
function swap_align(_obj, _color, alt_click)
center_mode = not center_mode
reloadAll()
end
function editName(_obj, _string, value)
self.setName(value)
setTooltips()
end
function updateVal()
self.editButton({
index = 0,
label = tostring(val),
})
end
function reset_val()
val = 0
updateVal()
updateSave()
end
function setTooltips()
self.editInput({
index = 0,
value = self.getName(),
tooltip = "Click button to remove all clues from all investigators"
})
self.editButton({
index = 0,
value = tostring(val),
})
end
function null()
end
function keepSample(_obj, _string, value)
reloadAll()
end
function onDestroy()
if timerID and type(timerID) == 'object' then
Timer.destroy(timerID)
end end
end end
-- gets the counted values from the counting bowls and sums them up
function sumClues()
local count = 0
for i = 1, 4 do
count = count + tonumber(clueCounters[i].getVar("exposedValue"))
end
self.editButton({ index = 0, label = tostring(count) })
end

View File

@ -1,91 +1,69 @@
--Counting Bowl by MrStump -- Table of items which can be counted in this Bowl
-- Each entry has 2 things to enter
--Table of items which can be counted in this Bowl -- a name (what is in the name field of that object)
--Each entry has 2 things to enter -- a value (how much it is worth)
--a name (what is in the name field of that object) -- a number in the items description will override the number entry in this table
--a value (how much it is worth) local validCountItemList = {
--A number in the items description will override the number entry in this table ["Clue"] = 1,
validCountItemList = { [""] = 1
["Clue"] = 1,
[""] = 1,
--["Name3"] = 2,
--["Name4"] = 31,
--Add more entries as needed
--Remove the -- from before a line for the script to use it
} }
local trashGUID = "70b9f6"
--END OF CODE TO EDIT exposedValue = 0
function onLoad() function onLoad()
timerID = self.getGUID()..math.random(9999999999999) self.createButton({
--Sets position/color for the button, spawns it label = "",
self.createButton({ click_function = "removeAllClues",
label="", click_function="removeAllClues", function_owner=self, function_owner = self,
position={0,0,0}, rotation={0,8,0}, height=0, width=0, height = 0,
font_color={0,0,0}, font_size=2000 width = 0,
}) font_color = { 0, 0, 0 },
--Start timer which repeats forever, running countItems() every second font_size = 2000
Timer.create({ })
identifier=timerID, loopID = Wait.time(countItems, 1, -1)
function_name="countItems", function_owner=self, end
repetitions=0, delay=1
}) -- Activated once per second, counts items in bowls
exposedValue = 0 function countItems()
trashCan = getObjectFromGUID("147e80") local totalValue = -1
local countableItems = findValidItemsInSphere()
for _, entry in ipairs(countableItems) do
local descValue = tonumber(entry.hit_object.getDescription())
local stackMult = math.abs(entry.hit_object.getQuantity())
-- Use value in description if available
if descValue ~= nil then
totalValue = totalValue + descValue * stackMult
else
-- Otherwise use the value in validCountItemList
totalValue = totalValue + validCountItemList[entry.hit_object.getName()] * stackMult
end
end
exposedValue = totalValue
self.editButton({ index = 0, label = totalValue })
end end
function findValidItemsInSphere() function findValidItemsInSphere()
return filterByValidity(findItemsInSphere()) local items = Physics.cast({
end origin = self.getPosition(),
direction = { 0, 1, 0 },
type = 2,
max_distance = 0,
size = { 2, 2, 2 },
--debug=true
})
--Activated once per second, counts items in bowls retval = {}
function countItems() for _, entry in ipairs(items) do
local totalValue = -1 --Ignore the bowl
local countableItems = findValidItemsInSphere() if entry.hit_object ~= self then
for ind, entry in ipairs(countableItems) do --Ignore if not in validCountItemList
local descValue = tonumber(entry.hit_object.getDescription()) local tableEntry = validCountItemList[entry.hit_object.getName()]
local stackMult = math.abs(entry.hit_object.getQuantity()) if tableEntry ~= nil then
--Use value in description if available table.insert(retval, entry)
if descValue ~= nil then end
totalValue = totalValue + descValue * stackMult
else
--Otherwise use the value in validCountItemList
totalValue = totalValue + validCountItemList[entry.hit_object.getName()] * stackMult
end
end end
exposedValue = totalValue end
--Updates the number display return retval
self.editButton({index=0, label=totalValue})
end
function filterByValidity(items)
retval = {}
for _, entry in ipairs(items) do
--Ignore the bowl
if entry.hit_object ~= self then
--Ignore if not in validCountItemList
local tableEntry = validCountItemList[entry.hit_object.getName()]
if tableEntry ~= nil then
table.insert(retval, entry)
end
end
end
return retval
end
--Gets the items in the bowl for countItems to count
function findItemsInSphere()
--Find scaling factor
local scale = self.getScale()
--Set position for the sphere
local pos = self.getPosition()
pos.y=pos.y+(1.25*scale.y)
--Ray trace to get all objects
return Physics.cast({
origin=pos, direction={0,1,0}, type=2, max_distance=0,
size={6*scale.x,6*scale.y,6*scale.z}, --debug=true
})
end end
function removeAllClues() function removeAllClues()
@ -96,19 +74,12 @@ function clueRemovalCoroutine()
for _, entry in ipairs(findValidItemsInSphere()) do for _, entry in ipairs(findValidItemsInSphere()) do
-- Do not put the table in the garbage -- Do not put the table in the garbage
if entry.hit_object.getGUID() ~= "4ee1f2" then if entry.hit_object.getGUID() ~= "4ee1f2" then
--delay for animation purposes -- delay for animation purposes
for k=1,10 do for k = 1, 10 do
coroutine.yield(0) coroutine.yield(0)
end end
trashCan.putObject(entry.hit_object) getObjectFromGUID(trashGUID).putObject(entry.hit_object)
end end
end end
--coroutines must return a value
return 1 return 1
end end
function onDestroy()
if timerID and type(timerID) == 'object' then
Timer.destroy(timerID)
end
end