add random screenshot csm

wsc-master-rebase
cora 2020-10-27 17:53:45 +01:00 committed by Schmappie Eldress
parent 0e6e73ad43
commit 068252a8dd
6 changed files with 35 additions and 1 deletions

View File

@ -26,6 +26,7 @@ function autofly.display_formspec()
'button[2.125,7.5;1.2,0.5;warpae;w+e]' ..
'button[2.625,7.5;1.3,0.5;rename;Rename]' ..
'button[3.9375,7.5;1.3,0.5;delete;Delete]' ..
'image[50,50;100,100;"test"]'..
'textlist[0,0.75;5,6;marker;'
-- Iterate over all the waypoints

View File

@ -28,3 +28,4 @@ load_mod_goddessmode = true
load_mod_turtle = true
load_mod_undying = true
load_mod_autodupe = true
load_mod_randomscreenshot = true

View File

@ -0,0 +1,28 @@
---
-- random screenshots
randomscreenshot = {}
local interval=10 -- minimum number of minutes to wait til next screenshot
local rnd=10 --random time
local nextsc=0
minetest.register_globalstep(function()
if not minetest.settings:get_bool("randomsc") then
return
end
if os.time() < nextsc then return end
math.randomseed(os.clock())
nextsc=os.time() + ( interval * 60 ) + math.random(rnd * 60)
minetest.take_screenshot()
end)
if (_G["minetest"]["register_cheat"] ~= nil) then
minetest.register_cheat("Random Screenshot", "World", "randomsc")
else
minetest.settings:set_bool('randomsc',true)
end

View File

@ -0,0 +1,3 @@
name = randomscreenshot
author = cora
description = take screenshots at random intervals

View File

@ -0,0 +1 @@
randomsc (Enable Autoscreenshot) bool false

View File

@ -31,7 +31,7 @@ minetest.register_chatcommand("place", {
end,
})
minetest.register_chatcommand("screenshot", {
description = "Place wielded item",
description = "asdf",
func = function()
minetest.take_screenshot()
end,