undying: optimisation; remove old csns

wsc-master
cora 2020-10-17 04:49:12 +02:00
parent b0aa019ce4
commit 04f68c2440
14 changed files with 40 additions and 429 deletions

View File

@ -1,120 +0,0 @@
antigone={}
local antm = false
local chance = 10
local lastutter=0
local qmsg = "Go then if you must, but remember, no matter how foolish your deeds, those who love you will love you still."
local prlv = "Goodbye to the sun that shines for me no longer!"
local smsg = "Unnatural silence signifies no good."
local qdb = {
"All men make mistakes, but a good man yields when he knows his course is wrong, and repairs the evil. The only crime is pride.",
"A man, though wise, should never be ashamed of learning more, and must unbend his mind.",
"I was born to join in love, not hate - that is my nature.",
"Grief teaches the steadiest minds to waver.",
"We have only a little time to please the living. But all eternity to love the dead.",
"When I have tried and failed, I shall have failed.",
"Leave me to my own absurdity.",
"No one loves the messenger who brings bad news.",
"A state which belongs to just one man is no true state.",
"It is not right if I am wrong. But if I am young, and right, what does my age matter?",
"There is no greater evil than men's failure to consult and to consider.",
"Nobody has a more sacred obligation to obey the law than those who make the law.",
"Do not fear for me. Make straight your own path to destiny.",
"Do not believe that you alone can be right. The man who thinks that,The man who maintains that only he has the power. To reason correctly, the gift to speak, the soul. A man like that, when you know him, turns out empty.",
"I have no love for a friend who loves in words alone.",
"There is no happiness where there is no wisdom",
"Numberless are the world's wonders, but none more wonderful than man.",
"Oh it's terrible when the one who does the judging judges things all wrong.",
"I have nothing but contempt for the kind of governor who is afraid, for whatever reason, to follow the course that he knows is best for the State.",
"Reason is God's crowning gift to a man.",
"Tell me the news, again, whatever it is… sorrow and I are hardly strangers. I can bear the worst.",
"What do I care for life when you are dead?",
"It is the dead, not the living, who make the longest demands.",
"A friend in word is never friend of mine.",
"There let her pray to the one god she worships: Death--who knows?--may just reprieve her from death. Or she may learn a last, better late than never, what a waste of breath it is to worship Death.",
"No yield to the dead! Never stab the fighter when he's down. Where's the glory, killing the dead twice over?",
"I know not, but strained silence, so I deem, is no less ominous than excessive grief.",
"What a splendid king you'd make of a desert island - you and you alone.",
"I don't even exist—I'm no one. Nothing.",
"No man, my lord, should make a vow, for if he ever swears he will not do a thing.",
"When misfortune comes, The wisest even lose their mother wit",
"I didn't say yes. I can say no to anything I say vile, and I don't have to count the cost. But because you said yes, all that you can do, for all your crown and your trappings, and your guards—all that your can do is to have me killed.",
"One must wait until evening to see how splendid the day has been.",
"Every way leads but astray.",
"Know'st not whate'er we do is done in love?",
"Love resistless in fight, all yield at a glance of thine eye, Love who pillowed all night on a maiden's cheek dost lie, Over the upland holds. Shall mortals not yield to thee",
"True, as unwisdom is the worst of ills",
"Good advice, if there's any good in suffering. Quickest is best when trouble blocks the way.",
"Chastisement for errors past Wisdom brings to age at last.",
"But if I am young, thou shouldest look to my merits, not to my years.",
"Alas! How sad when reasoners reason wrong",
"To guild refined gold, to paint the lily, to throw perfume on the violet is just fuckin' silly.",
"Each lie we tell incurs a debt to the truth. Sooner or later the debt is paid. That is how an RBMK rector core explodes lies!",
"I know who I am, and I know whatI've done. In a just world, I would be shot for my lies. But not for this. Not for the truth.",
"This death of mine Is of no importance; but if I had left my brother. Lying in death unburied, I should have suffered. Now I do not.",
"Your edict, King, was strong! But all your strength is weakness itself against the immortal unrecorded laws of the Gods.",
"'Why worry about something thatisn't going to happen.' That'sperfect. They should put that on our money",
"This talking is a great weariness: your words are distasteful to me, and I am sure that mine seem so to you. And yet they should not seem so: I should have praise and honor for what I have done. All these men here would praise me were their lips not frozen shut with fear of you.",
"The dead man and the gods who rule the dead know whose act this was. Words are not friends.",
"You shall not lessen my death by sharing it.",
"Out there in the wilderness, and lock her living in a vault of stone. She shall have food, As the custom is, to absolve the State of her death. And there let her pray to the gods of hell. They are her only gods: Perhaps they will show her an escape from death, or she may learn, though late, that piety shown the dead is pity in vain."
}
function cchat.getquote()
if not antm then return end
chance = chance - 1
if math.random(chance) > 1 then return end
chance=10
if os.time() < lastutter + 15 then return end
lastutter=os.time()
local keyset = {}
local qt = 1
for k in pairs(qdb) do
table.insert(keyset, k)
end
-- now you can reliably return a random key
qt = qdb[keyset[math.random(#keyset)]]
minetest.send_chat_message(qt)
end
minetest.register_chatcommand('aqt',{
params='',
description='get a random antigone quote',
func=function(param)
cchat.getquote()
end
})
table.insert(minetest.registered_on_receiving_chat_message, 1, function(msg)
if not antm and minetest.localplayer:get_name() == "antigone" then
antm=true
minetest.display_chat_message("-----antig detected. quote funcs activated.")
end
if not antm then return end
local s = msg:find('^<Berastone>')
local t = msg:find('^<oneplustwo>')
local t = msg:find('^<oneminustwo>')
local u = msg:find('^<mobilec>')
local v = msg:find('^<creon>')
local v = msg:find('^Herpera')
local v = msg:find('^Kant')
local v = msg:find('^Demotivator')
local v = msg:find('^dupp')
local zz = msg:find("^<cora>")
local zzz = msg:find("antigone ")
local zzzz = msg:find(" antigone")
local zzzzz = msg:find("antigone:")
local cc = msg:find("From cora: say")
if cc then chance = 1 end
if s or t or u or v or zz or zzz or zzzz or zzzzz or cc then
cchat.getquote()
--minetest.display_chat_message(msg)
end
end)

View File

@ -1,3 +0,0 @@
name = antigone
author = cora
description = antigone chatbot

View File

@ -1,26 +0,0 @@
autowarp = {}
local storage = minetest.get_mod_storage()
local cond=true;
local function isleep(s)
local ntime = os.time() + s
repeat until os.time() > ntime
end
minetest.register_chatcommand("awarp", {
params = "",
description = "Warp to a set warp or a position.",
func = function(param)
local xx=4000
--for o,p in poss do
--local pos = minetest.parse_pos("4000,20,4000")
while cond do
minetest.localplayer:set_pos({x=xx,y=20,z=4000})
isleep(5)
xx=xx-100
if xx < -4000 then break end
end
end
})

View File

@ -1,3 +0,0 @@
name = autowarp
author = cora
description = dl a section of the map

View File

@ -1,130 +0,0 @@
--
-- cora's defensive combat hax
-- * undying
-- * damagepanic
flightaura = {}
local undying = true --will automatically /sethome when taking damage below 3 hp, tp you back when you die and dig the bones undying needs autorespawn enabled in dragonfire (might steal the code at some point to enable it for vanilla / other clients)
local damagepanic = true --will tp you 50 nodes up on damage taken when hp is < paniclimit
local check_target = true
local paniclimit=17
local tprange=50;
local function sleep(n) -- seconds
local t0 = os.clock()
while os.clock() - t0 <= n do end
end
local function mwarp(pos)
if not pos then return end
--minetest.display_chat_message("Flightaura: Damage taken, target clear. Tping up to "..pos['y'])
minetest.localplayer:set_pos(pos)
end
minetest.register_on_death(function()
if not minetest.settings:get_bool("undying") then return end
minetest.send_chat_message("/home")
sleep(2)
local bn=minetest.find_node_near(minetest.localplayer:get_pos(), 4, {"bones:bones"},true)
if not bn then return end
minetest.dig_node(bn)
end)
local tprangeh=20
local tprangepy=50
local tprangeny=60
local function get_rnd_pos()
local ppos=minetest.localplayer:get_pos()
local xx=1
local yy=40
local zz=1
local pos=vector.add(ppos,{x=xx,y=yy,z=zz})
return pos
end
function flightaura.find_target()
if not minetest.settings:get_bool("damagepanic") then return end
local nod=minetest.get_node_or_nil(get_rnd_pos())
if not nod then return end
while (nod["name"] ~= "air") do
local rpos=get_rnd_pos()
local tpos=vector.add(ppos,rpos)
nod=minetest.get_node_or_nil(tpos)
fnd=true
end
--minetest.display_chat_message(dump(rpos))
if not fnd then
--minetest.display_chat_message("no clear node to flee. turning on Killaura.")
minetest.settings:set_bool("killaura",true)
return false
end
return tpos
end
minetest.register_on_damage_taken(function(hp)
local hhp=minetest.localplayer:get_hp()
--minetest.display_chat_message("hp:"..hp)
--minetest.display_chat_message("hhp:"..hhp)
if (hp==0 ) then return end
if ( hhp < paniclimit ) and (hhp >= 3 ) then
cpos=flightaura.find_target()
if minetest.settings:get_bool("damagepanic") then
minetest.settings:set("free_move", "true")
mwarp(vector.add(cpos,{x=0,y=-1,z=0}))
end
elseif (hp < 3 ) then
if minetest.settings:get_bool("undying") then
minetest.settings:set_bool("autorespawn",true)
minetest.send_chat_message("/sethome") end
end
end
)
minetest.register_chatcommand("eat", {
params = "",
description = "",
func = function()
local pl = minetest.localplayer
local inv = minetest.get_inventory("current_player")
for index, stack in pairs(inv.main) do
minetest.display_chat_message(stack)
if (stack == "mcl_farming:carrot_item_gold") then pl.set_wield_index(index) break end
end
return
end})
minetest.register_chatcommand("dhead", {
params = "",
description = "",
func = function()
--eat()
-- minetest.display_chat_message("head")
-- minetest.display_chat_message(dump(minetest.get_inventory("current_player").main))
minetest.settings:set_bool("autotool",true)
sleep(1)
local ppos=vector.add(minetest.localplayer:get_pos(),{x=0,y=1,z=0})
if ppos then minetest.dig_node(ppos) end
return
end
})
-- REG cheats on DF
if (_G["minetest"]["register_cheat"] ~= nil) then
minetest.register_cheat("Flightaura", "Combat", "damagepanic")
minetest.register_cheat("Undying", "Combat", "undying")
else
minetest.settings:set_bool('undying',true)
minetest.settings:set_bool('damagepanic',false)
end

View File

@ -1,3 +0,0 @@
name = flightaura
author = cora
description = defensive combat hax

View File

@ -1,3 +0,0 @@
undying (Undying) bool false
panicmode (Flightaura) bool false
tprange (Teleport Range) int 50

View File

@ -7,16 +7,11 @@ load_mod_schematicas = true
load_mod_warp = true
load_mod_cchat = true
load_mod_autofly = true
load_mod_aflight = false
load_mod_geass = false
load_mod_autowarp = true
load_mod_panicm = false
load_mod_wisp = true
load_mod_tchat = true
load_mod_esp = true
load_mod_antigone = false
load_mod_dte = true
load_mod_flightaura = false
load_mod_hpchange = true
load_mod_autominer = true
load_mod_itemcount = false
@ -32,3 +27,4 @@ load_mod_autoaim = true
load_mod_peek = true
load_mod_goddessmode = true
load_mod_turtle = true
load_mod_undying = true

View File

@ -1,130 +0,0 @@
--
-- cora's defensive combat hax
-- * undying
-- * damagepanic
panicm = {}
local undying = true --will automatically /sethome when taking damage below 3 hp, tp you back when you die and dig the bones undying needs autorespawn enabled in dragonfire (might steal the code at some point to enable it for vanilla / other clients)
local damagepanic = true --will tp you 50 nodes up on damage taken when hp is < paniclimit
local check_target = true
local paniclimit=17
local tprange=50;
local function sleep(n) -- seconds
local t0 = os.clock()
while os.clock() - t0 <= n do end
end
local function mwarp(pos)
if not pos then return end
--minetest.display_chat_message("Flightaura: Damage taken, target clear. Tping up to "..pos['y'])
minetest.localplayer:set_pos(pos)
end
minetest.register_on_death(function()
if not minetest.settings:get_bool("undying") then return end
minetest.send_chat_message("/home")
sleep(2)
local bn=minetest.find_node_near(minetest.localplayer:get_pos(), 4, {"bones:bones"},true)
if not bn then return end
minetest.dig_node(bn)
end)
local tprangeh=20
local tprangepy=50
local tprangeny=60
function panicm.find_target(check_target)
if not minetest.settings:get_bool("damagepanic") then return end
local ppos=minetest.localplayer:get_pos()
local tpos=vector.add(ppos,{x=0,y=tprange,z=0})
if check_target then return tpos end
local pos=false
for i = 0,tprangepy,1 do
local nod=minetest.get_node_or_nil(vector.add(tpos,{x=0,y=-i,z=0}))
if nod and (nod["name"] == "air") then fnd=true break end
end
if not fnd then
for i = -tprangeh,tprangeh,1 do
local nod=minetest.get_node_or_nil(vector.add(tpos,{x=i,y=0,z=0}))
if nod and (nod["name"] == "air") then fnd=true break end
local nod=minetest.get_node_or_nil(vector.add(tpos,{x=0,y=0,z=i}))
if nod and (nod["name"] == "air") then fnd=true break end
end
end
if not fnd then
for i = -tprangeny,0,1 do
local nod=minetest.get_node_or_nil(vector.add(tpos,{x=0,y=i,z=0}))
if nod and (nod["name"] == "air") then fnd=true break end
end
end
if not fnd then
minetest.display_chat_message("no clear node to flee. turning on Killaura.")
minetest.settings:set_bool("killaura",true)
return false
end
return pos
end
minetest.register_on_damage_taken(function(hp)
local hhp=minetest.localplayer:get_hp()
if (hp==0 ) then return end
if ( hhp < paniclimit ) and (hhp >= 3 ) then
cpos=panicm.find_target(check_target)
if minetest.settings:get_bool("damagepanic") then
minetest.settings:set("free_move", "true")
mwarp(vector.add(cpos,{x=0,y=-1,z=0}))
--sleep(2)
end
elseif (hp < 3 ) then
if minetest.settings:get_bool("undying") then
minetest.settings:set_bool("autorespawn",true)
minetest.send_chat_message("/sethome") end
end
end
)
minetest.register_chatcommand("eat", {
params = "",
description = "",
func = function()
local pl = minetest.localplayer
local inv = minetest.get_inventory("current_player")
for index, stack in pairs(inv.main) do
minetest.display_chat_message(stack)
if (stack == "mcl_farming:carrot_item_gold") then pl.set_wield_index(index) break end
break
end
return
end})
minetest.register_chatcommand("dhead", {
params = "",
description = "",
func = function()
--eat()
-- minetest.display_chat_message("head")
-- minetest.display_chat_message(dump(minetest.get_inventory("current_player").main))
minetest.settings:set_bool("autotool",true)
sleep(1)
local ppos=vector.add(minetest.localplayer:get_pos(),{x=0,y=1,z=0})
if ppos then minetest.dig_node(ppos) end
return
end
})
-- REG cheats on DF
if (_G["minetest"]["register_cheat"] ~= nil) then
minetest.register_cheat("Flightaura", "Combat", "damagepanic")
minetest.register_cheat("Undying", "Combat", "undying")
else
minetest.settings:set_bool('undying',true)
minetest.settings:set_bool('damagepanic',true)
end

View File

@ -1,3 +0,0 @@
name = panicm
author = cora
description = defensive combat hax

View File

@ -1,3 +0,0 @@
undying (Undying) bool false
panicmode (Flightaura) bool false
tprange (Teleport Range) int 50

View File

@ -0,0 +1,35 @@
--
-- undying
minetest.register_on_death(function()
if not minetest.settings:get_bool("undying") then return end
minetest.after(0.2,function()
minetest.send_chat_message("/home")
minetest.after(1.0,function()
local bn=minetest.find_node_near(minetest.localplayer:get_pos(), 6, {"bones:bones"},true)
if not bn then return end
minetest.dig_node(bn)
end)
end)
end)
minetest.register_on_damage_taken(function(hp)
local hhp=minetest.localplayer:get_hp()
if (hhp==0 ) then return end
if (hhp < 3 ) then
if minetest.settings:get_bool("undying") then
minetest.settings:set_bool("autorespawn",true)
minetest.send_chat_message("/sethome") end
end
end
)
-- REG cheats on DF
if (_G["minetest"]["register_cheat"] ~= nil) then
minetest.register_cheat("Undying", "Combat", "undying")
else
minetest.settings:set_bool('undying',true)
end

View File

@ -0,0 +1,3 @@
name = undying
author = cora
description = revert death on servers with /sethome / bones

View File

@ -0,0 +1 @@
undying (Undying) bool false