如题最近在和小伙伴玩海钓模式,因为产生的垃圾实在是太多了,手动去清理又很麻烦,即便是管理员去清理垃圾也很麻烦,要走到哪里删除到哪里。试过强力清理,清理大师xx的,但是效果不太理想。所幸发现了一个神奇的mod,自动清理(扫地),这个mod可以很好的解决我的问题。只不过需要编辑文件。然后我搜集了网络上能获取的代码,有些可能没遇到,遇到的大部分都添加了,配置文件如下,基本上可以实现扫地级别的清理。


(资料图片仅供参考)

会用的小伙伴,直接复制到需要编辑的文件,自己在改动一下就ok了

(env, { __index = function(t, k) return (GLOBAL, k) end })

local _G = GLOBAL

--local Mod_C_CeShi = GetModConfigData("M_CeShi")

--自动清除躺在地上的超过设定时间的物品,不在地上的不会清理,打包的不会清理

local function ClOnDropped_disappears(inst)

:PrepareDisappear()

end

local function ClOnPickup_disappears(inst, owner)

:StopDisappear()

end

local function ClAutoDisappears(inst, delayTime)

inst:AddComponent("disappears")

= ~= nil and "dontstarve_DLC001/common/firesupressor_impact" or nil --消失组件里没有对声音组件的判断

= "disappear"

= delayTime --设置消失延迟时间

if ~= nil then

local Clonputininventoryfn_old =

:SetOnPutInInventoryFn(function(item, owner)

if Clonputininventoryfn_old ~= nil then

Clonputininventoryfn_old(item, owner)

end

ClOnPickup_disappears(item, owner)

end)

end

inst:ListenForEvent("ondropped", ClOnDropped_disappears)

:PrepareDisappear()

end

--可手动添加,服务器添加就行,记得加逗号,不加逗号崩给你看

-- 1天消失的

local cklist1 = {

--冬季盛宴,9种食物,1姜饼人曲奇饼,2糖屑曲奇饼,3拐杖糖,4永远水果蛋糕,棱镜做爆炸蛋糕需要哦,5巧克力木头蛋糕,6李子布丁,7苹果酒,8热可可,9天堂蛋酒

"winter_food1","winter_food2","winter_food3","winter_food4","winter_food5","winter_food6","winter_food7","winter_food8","winter_food9",

--冬季盛宴,12种挂饰

"winter_ornament_plain1","winter_ornament_plain2","winter_ornament_plain3","winter_ornament_plain4","winter_ornament_plain5","winter_ornament_plain6","winter_ornament_plain7","winter_ornament_plain8","winter_ornament_plain9","winter_ornament_plain10","winter_ornament_plain11","winter_ornament_plain12",

--冬季盛宴,8种灯泡

"winter_ornament_light1","winter_ornament_light2","winter_ornament_light3","winter_ornament_light4","winter_ornament_light5","winter_ornament_light6","winter_ornament_light7","winter_ornament_light8",

--冬季盛宴,8种灯形不发光挂饰

"winter_ornament_fancy1","winter_ornament_fancy2","winter_ornament_fancy3","winter_ornament_fancy4","winter_ornament_fancy5","winter_ornament_fancy6","winter_ornament_fancy7","winter_ornament_fancy8",

--冬季盛宴,BOSS挂饰

"winter_ornament_boss_bearger","winter_ornament_boss_deerclops","winter_ornament_boss_moose","winter_ornament_boss_antlion","winter_ornament_boss_dragonfly","winter_ornament_boss_beequeen","winter_ornament_boss_fuelweaver","winter_ornament_boss_krampus","winter_ornament_boss_klaus","winter_ornament_boss_noeyered","winter_ornament_boss_noeyeblue","winter_ornament_boss_toadstool","winter_ornament_boss_wagstaff","winter_ornament_boss_celestialchampion1","winter_ornament_boss_celestialchampion2","winter_ornament_boss_celestialchampion3","winter_ornament_boss_celestialchampion4",

--万圣节,14种食物

"halloweencandy_1","halloweencandy_2","halloweencandy_3","halloweencandy_4","halloweencandy_5","halloweencandy_6","halloweencandy_7","halloweencandy_8","halloweencandy_9","halloweencandy_10","halloweencandy_11","halloweencandy_12","halloweencandy_13","halloweencandy_14","trinket_46",

--猪王之年

"pig_token",--金色要带

--模组,狗血、纸钱、手持蜂巢、熊爪、熔岩口器、诅咒鹿爪、皮肤券

"gouxue","paper_ground","um_beegun","beargerclaw","slobberlobber","cursed_antler","medal_skin_coupon",

"sketch",--所有雕塑图纸

"blueprint",--所有蓝图

"redpouch","redpouch_yotp","redpouch_yot_catcoon","lucky_goldnugget",--红包,火鸡之年、座狼之年、猪王之年、萝卜鼠之年、浣猫之年

--万圣节,15种玩具

"trinket_32","trinket_33","trinket_34","trinket_35","trinket_36","trinket_37","trinket_38","trinket_39","trinket_40","trinket_41","trinket_42","trinket_43","trinket_44","trinket_45",

--以下添加均为扫地模式

"sewing_kit",

"sewing_tape",

"flowerhat",

"strawhat",

"tophat",

"rainhat”",

"earmuffshat",

"beefalohat",

"winterhat",

"catcoonhat",

"watermelonhat",

"icehat",

"beehat",

"featherhat",

"bushhat",

"minerhat",

"molehat",

"eyebrellahat",

"footballhat",

"red_mushroomhat",

"green_mushroomhat",

"blue_mushroomhat",

"spiderhat",

"walrushat",

"goggleshat",

"deserthat",

"hivehat",

"wathgrithrhat",

"slurtlehat",

"ruinshat",

"armorgrass",

"armorwood",

"armormarble",

"armordragonfly",

"raincoat",

"sweatervest",

"trunkvest_summer",

"trunkvest_winter",

"reflectivevest",

"hawaiianshirt",

"cane",

"beargervest",

"armor_sanity",

"armorruins",

"armorsnurtleshell",

"armorskeleton",

"armorslurper",

"nightmare_timepiece",

"amulet",

"orangeamulet",

"yellowamulet",

"greenamulet",

"blueamulet",

"purpleamulet",

"saltrock",

"driftwood_log",

"spoiled_fish",

"spoiled_fish_small",

"malbatross_beak",

"malbatross_feather",

"multiplayer_portal_moonrock_constr_plans",

"moonrockidol",

"moonrockseed",

"cutgrass",

"rope",

"twigs",

"log",

"boards",

"rocks",

"cutstone",

"flint",

"nitre",

"marble",

"goldnugget",

"ice",

"livinglog",

"charcoal",

"ash",

"petals",

"petals_evil",

"nightmarefuel",

"poop",

"cactus_flower",

"lightbulb",

"wormlight",

"wormlight_lesser",

"spore_small",

"spore_medium",

"spore_tall",

"cutreeds",

"papyrus",

"waxpaper",

"beeswax",

"moonrocknugget",

"thulecite",

"thulecite_pieces",

"redgem",

"bluegem",

"purplegem",

"greengem",

"orangegem",

"yellowgem",

"opalpreciousgem",

"moonrockcrater",

"redmooneye",

"orangemooneye",

"yuellowmooneye",

"greenmooneye",

"bluemooneye",

"purplemooneye",

"townportaltalisman",

"transistor",

"gears",

"beardhair",

"houndstooth",

"boneshard",

"silk",

"spidergland",

"beefalowool",

"horn",

"lightninggoathorn",

"honeycomb",

"stinger",

"pigskin",

"trunk_summer",

"trunk_winter",

"phlegm",

"steelwool",

"coontail",

"glommerwings",

"glommerflower",

"glommerfuel",

"rottenegg",

"feather_crow",

"feather_robin",

"feather_robin_winter",

"feather_canary",

"guano",

"walrus_tusk",

"mosquitosack",

"tentaclespots",

"goose_feather",

"bearger_fur",

"deerclops_eyeball",

"deer_antler1",

"deer_antler2",

"deer_antler3",

"klaussackkey",

"dragon_scales",

"lavae_egg",

"lavae_cocoon",

"lavae_tooth",

"shadowheart",

"manrabbit_tail",

"batwing",

"slurtleslime",

"slurtle_shellpieces",

"cookiecuttershell",

"slurper_pelt",

"minotaurhorn",

"shroom_skin",

"cookbook",

"pocket_scale",

"oceanfishingrod",

"fishingnet",

"mast_item",

"mast_malbatross_item",

"malbatross_feathered_weave",

"oar",

"oar_driftwood",

"oceanfishingbobber_ball",

"oceanfishingbobber_ball_tacklesketch",

"oceanfishingbobber_canary",

"oceanfishingbobber_canary_tacklesketch",

"oceanfishingbobber_goose",

"oceanfishingbobber_goose_tacklesketch",

"oceanfishingbobber_malbatross",

"oceanfishingbobber_malbatross_tacklesketch",

"oceanfishingbobber_oval",

"oceanfishingbobber_oval_tacklesketch",

"oceanfishingbobber_robin",

"oceanfishingbobber_robin_tacklesketch",

"miniflare",

"saltbox",

"torch",

"pumpkin_lantern",

"axe",

"goldenaxe",

"pickaxe",

"goldenpickaxe",

"shovel",

"goldenshovel",

"hammer",

"multitool_axe_pickaxe",

"pitchfork",

"razor",

"featherpencil",

"saddlehorn",

"saddle_basic",

"saddle_war",

"saddle_race",

"brush",

"lantern",

"reviver",

"healingsalve",

"bandage",

"lifeinjector",

"trap",

"fishingrod",

"diviningrod",

"grass_umbrella",

"umbrella",

"waterballoon",

"compass",

"backpack",

"piggyback",

"icepack",

"bedroll_straw",

"bedroll_furry",

"bundlewrap",

"bundle",

"minifan",

"featherfan",

"fertilizer",

"onemanband",

"mapscroll",

"batnosehat",

"kelphat",

"sewing_kit",

"flowerhat",

"strawhat",

"tophat",

"rainhat",

"earmuffshat",

"beefalohat",

"winterhat",

"catcoonhat",

"cookiecutterhat",

"watermelonhat",

"icehat",

"beehat",

"featherhat",

"bushhat",

"minerhat",

"molehat",

"footballhat",

"red_mushroomhat",

"green_mushroomhat",

"blue_mushroomhat",

"spiderhat",

"walrushat",

"goggleshat",

"deserthat",

"hivehat",

"slurtlehat",

"ruinshat",

"armorgrass",

"armorwood",

"armormarble",

"armordragonfly",

"raincoat",

"sweatervest",

"trunkvest_summer",

"trunkvest_winter",

"reflectivevest",

"hawaiianshirt",

"cane",

"beargervest",

"armor_sanity",

"armorruins",

"armorsnurtleshell",

"armorskeleton",

"skeletonhat",

"armorslurper",

"nightmare_timepiece",

"trinket_1",

"trinket_2",

"trinket_3",

"trinket_4",

"trinket_5",

"trinket_6",

"trinket_7",

"trinket_8",

"trinket_9",

"trinket_10",

"trinket_11",

"trinket_12",

"trinket_13",

"trinket_14",

"trinket_15",

"trinket_16",

"trinket_17",

"trinket_18",

"trinket_19",

"trinket_20",

"trinket_21",

"trinket_22",

"trinket_23",

"trinket_24",

"trinket_25",

"trinket_26",

"trinket_27",

"trinket_28",

"trinket_29",

"trinket_30",

"trinket_31",

"redlantern",

"twiggy_nut", --多汁树种子

"plantregistryhat", --耕作先驱帽子

"nutrientsgoggleshat",

"farm_plow_item",

"compostingbin",

"sewing_mannequin",--假人

"palmcone_scale",--棕与松树果鳞片

"eyemaskhat", --眼面具

"farm_hoe",

"golden_farm_hoe",

"messagebottleempty",

"voidcloth", --暗夜碎布

"trophyscale_oversizedveggies",

"farm_plow_item",

"seedpouch",

"spear_wathgrithr",

"mermhat",

"purebrilliance",

"lunarplant_husk",

"bomb_lunarplant",

"staff_lunarplant",

"sword_lunarplant",

"armor_lunarplant",

"lunarplanthat",

"pickaxe_lunarplant",

"shovel_lunarplant",

"moonglassaxe",

"boatpatch",

"monkey_mediumhat",

"monkey_smallhat",

"cutless",

"cursed_monkey_token", --诅咒饰品

"cursed_monkey_token_prop",

"glasscutter",

"singingshell_octave3",

"singingshell_octave4",

"singingshell_octave5",

"abigail_flower",

"ghostflower",

}

-- 2天消失的

local cklist2 = {

"spear",

"balloon",

"hambat",

"nightstick",

"whip",

"blowdart_sleep",

"blowdart_fire",

"blowdart_pipe",

"blowdart_yellow",

"boomerang",

"beemine",

"trap_teeth",

"trap_teeth_maxwell",

"beemine_maxwell",

"staff_tornado",

"gunpowder",

"icestaff",

"firestaff",

"tentaclespike",

"batbat",

"nightsword",

"ruins_bat",

"diviningrod",

"sporecloud",

"mushroombomb",

"mushroombomb_dark",

"gnarwail_horn",

"seedshell",

"horrorfuel",

"moonglass",

}

-- 7天消失的

local cklist7 = {

}

-- 15天消失的

local cklist15 = {

}

-- 35天消失的

local cklist35 = {

}

-- 1年消失的

local cklist70 = {

}

for a, b in pairs(cklist1) do --i数组,n值,pairs取数组

AddPrefabPostInit(b, function (inst)

if not then

return inst

end

ClAutoDisappears(inst, _DAY_TIME )--TOTAL_DAY_TIME 一天的时间 8 分钟

end)

end

for c, d in pairs(cklist2) do

AddPrefabPostInit(d, function (inst)

if not then

return inst

end

ClAutoDisappears(inst, _DAY_TIME * 2)

end)

end

for e, f in pairs(cklist7) do

AddPrefabPostInit(f, function (inst)

if not then

return inst

end

ClAutoDisappears(inst, _DAY_TIME * 7)

end)

end

for g, h in pairs(cklist15) do

AddPrefabPostInit(h, function (inst)

if not then

return inst

end

ClAutoDisappears(inst, _DAY_TIME * 15)

end)

end

for i, j in pairs(cklist35) do

AddPrefabPostInit(j, function (inst)

if not then

return inst

end

ClAutoDisappears(inst, _DAY_TIME * 35)

end)

end

for l, n in pairs(cklist70) do

AddPrefabPostInit(n, function (inst)

if not then

return inst

end

ClAutoDisappears(inst, _DAY_TIME * 70)

end)

end

上一篇:星辰变:帝级金属兽具体等级,桑渊星守护长老又是什么境界?

下一篇:最后一页

x

推荐阅读

更多