Can't get time schedules to work anymore
Hello

I have been working on the TruePVE mod and suprisingly was able to setup a lot of items.  I had it working with proper time schedules but now unfortunatly it is not working anymore... the json file does not create the configuration and I am unable to check what I am currenly doing wrong.   

Please note I have no coding experience so it is a learning curve everytime something bombs out on me.   

On the attached config file there is time entries but I dont think these are working and I fear it will wipe out once the server restarts (added manually).
What is the correct syntax code in order to add it to the code direcly so that it will automatically write it in the config file? 

Schedule": {
"enabled": true,
"useRealtime": true,
"broadcast": true,
"entries": ["*.09:00 default Time to rebuild!",
"*.07:00 pvp Early bird catches the worm!",
"*.12:00 pvp Midday madness!",
"*.13:00 default Lunch time!",
"*.16:00 pvp Afternoon witch hunt!",
"*.17:00 default Heading home!",
"*.19:00 pvp Whatcha cooking in there!",
"*.22:00 default Lights out!"]


In response to Poedil ():
Hello

I have been working on the TruePVE mod and suprisingly was able to setup a lot of i...
I am currently working on creating a schedule of timed PVP as well.  I was dealing with users accidentally damaging thier own properties and then dieing from the damage.  I came here to solve it with this add on, and hoping it works.  Its not intuitive enough to give so little information on modifying it.

Merged post

For lack of better judgment here is my entire file that the schedule is in.

{
	"Config Version": "0.9.0",
	"Default RuleSet": "default",
	"Configuration Options": {
		"handleDamage": true,
		"useZones": true
	},
	"Mappings": {
		"default": "default"
	},
	"Schedule": {
		"enabled": true,
		"useRealtime": true,
		"broadcast": true,
		"entries": ["*.22:30 default TruePVE13", "*.00:00 pvp True PVP1", "*.00:30 default True PVE1", "*.02:00 pvp True PVP2", "*.02:10 default TruePVE2", "*.04:00 pvp True PVP3", "*.04:30 default TruePVE3", "*.06:06 pvp TruePVP4", "*.06:36 default TruePVE5", "*.08:00 pvp TruePVP6", "*.08:30 default True PVE6", "*.10:00 pvp TruePVP7", "*.10:30 default TruePVE7", "*.12:00 pvp TruePVP8", "*.12:30 default TruePVE8", "*.14:00 pvp TruePVP9", "*.14:30 default TruePVE9", "*.16:00 pvp TruePVP10", "*.16:30 default TruePVE10", "*.18:00 pvp TruePVP11", "*.18:30 default TruePVE11", "*.20:00 pvp TruePVP12", "*.20:30 default TruePVE12", "*.22:00 pvp TruePVP13"]
	},
	"RuleSets": [{
		"name": "default",
		"enabled": true,
		"defaultAllowDamage": false,
		"flags": "HumanNPCDamage, LockedBoxesImmortal, LockedDoorsImmortal, CupboardOwnership, ProtectedSleepers, TrapsIgnorePlayers, TurretsIgnorePlayers",
		"rules": ["nothing can hurt dispensers", "anything can hurt players", "players cannot hurt players", "nothing can hurt traps", "traps cannot hurt players", "players can hurt barricades", "barricades cannot hurt players", "highwalls cannot hurt players", "anything can hurt heli", "anything can hurt npcs", "fire cannot hurt players", "anything can hurt resources"]
	}, {
		"name": "pvp",
		"enabled": true,
		"defaultAllowDamage": true,
		"flags": "HumanNPCDamage, CupboardOwnership, ProtectedSleepers",
		"rules": ["anything can hurt dispensers", "anything can hurt players", "players can hurt players", "anything can hurt traps", "traps can hurt players", "players can hurt barricades", "barricades can hurt players", "highwalls can hurt players", "anything can hurt heli", "anything can hurt npcs", "fire can hurt players", "anything can hurt resources"]
	}],
	"Entity Groups": [{
		"name": "dispensers",
		"members": "BaseCorpse, HelicopterDebris",
		"exclusions": ""
	}, {
		"name": "players",
		"members": "BasePlayer",
		"exclusions": ""
	}, {
		"name": "traps",
		"members": "AutoTurret, BearTrap, FlameTurret, Landmine, GunTrap, ReactiveTarget, spikes.floor",
		"exclusions": ""
	}, {
		"name": "barricades",
		"members": "Barricade",
		"exclusions": ""
	}, {
		"name": "highwalls",
		"members": "wall.external.high.stone, wall.external.high.wood, gates.external.high.wood, gates.external.high.wood",
		"exclusions": ""
	}, {
		"name": "heli",
		"members": "BaseHelicopter",
		"exclusions": ""
	}, {
		"name": "npcs",
		"members": "NPCPlayerApex, BradleyAPC",
		"exclusions": ""
	}, {
		"name": "fire",
		"members": "FireBall",
		"exclusions": ""
	}, {
		"name": "resources",
		"members": "ResourceEntity, TreeEntity, OreResourceEntity",
		"exclusions": ""
	}]
}​
In response to thewhoracle ():
I am currently working on creating a schedule of timed PVP as well.  I was dealing with users accide...
Excuse that jumbled text, probably hard to make anything out of it.   Schedule does not seem to be taking effect at all.  and when I use tpve.sched "true" I get an error saying "schedule is not valid"  From my investigation into the source code, what I can see is that it requires 2 or more rulesets, which I have, and 3 or more timed events, which I have 24. (the stupid TruePVP6 and TruePVE6 messages are just for a visual cue during testing)

Moderator edit: Please use code blocks or a paste site when posting config files.

Merged post

I used one above, and it looked like cancer.  Anyways, I got it to work.  With the code you removed.

Merged post

Poedil.  Your coding seems to be fine.  Its really similar to what I used.  Just ensure you have 2 "profiles" default and PVP for example.  As well as at least 3 timed intervals, which you appear to have.    And the command to make it start using the schedule is (tpve.sched enable "true") notice there is no " . " between sched and enable and true is in quotations.
@thewhoracle, what you paste in the code blocks is what shows, it doesn't format the pasted content for you, it just keeps it formatted how you pasted it and prevents the pasted text from taking up an entire page.
Yeah, I know.  But good luck reading that and making sense of it.  If I post this into a notepad will it automatically format it for me?  Lets find out.  Nope, it did not.  My eyes have cancer now.  What I posted before could more easily be read.  We are here to help each other, and this is not helpful.  Of coruse, he might be able to copy and past my code into his file and run it from there.  Then I assume the mod will sort it out the way it was supposed to be written instead of everything on one line word wraped.  Maybe.
In response to thewhoracle ():
Yeah, I know.  But good luck reading that and making sense of it.  If I post this into a notepad wil...
If you use Notepad, it will remove the formatting in most things that aren't originally formatted with it or as a Windows-style document. Most files here would use Linux-style line endings, which Notepad cannot handle. The solution would be to use an editor such as Notepad++ or another one that can handle properly opening and reading ALL files, regardless of what style they are. The content can then be pasted into a code block on the site here (not directly into a post).

If you'd like to see what usage of the code in posts here should look like, I've updated one of your previous posts with the content while still being formatted. The purpose of using the code blocks is to prevent causing readability issues on the site when pasting large amounts of text (such as config files, logs, etc.), which we would otherwise have to remove or format for you.
In response to Wulf ():
@thewhoracle, what you paste in the code blocks is what shows, it doesn't format the pasted content...
Wolf or anyone with knowledge,

Hi,

Can you assist with the TruePVE.json configuration to enable a schedule for PVE for 2 weeks and PVP for 2 weeks to coincide with Facepunch monthly schedule for updates? We want try to coincide as close as possible, which I think they release the first Thursday of each month right? 

For 2 weeks of PVP, I like to ensure all flags/rules are off except ProtectedSleepers, CupboardOwnership, HumanNPCDamage,

For 2 weeks of PVE, I like the below but add Turrents ignore NPCs, Turrents ignore Players, Turrentsignoreanimals, murderers, HTNPlayers, scarecrows, scientists. (this way turrents don't drain during PVE)

PVE Flags and Rules below that I currently have in the TruePVE.json file, need how to add schedule and PVP section???

"flags": "AuthorizedDamage, LockedBoxesImmortal, AdminsHurtSleepers, ProtectedSleepers, TurretsIgnorePlayers, CupboardOwnership, HumanNPCDamage, TrapsIgnorePlayers", "TrapsIgnorenpcs",
"rules": [
"anything can hurt dispensers",
"anything can hurt players",
"players cannot hurt players",
"npcs cannot hurt HTNPlayer",
"anything can hurt traps",
"traps cannot hurt players",
"traps cannot hurt npcs",
"players can hurt npcs",
"players can hurt barricades",
"barricades cannot hurt players",
"highwalls cannot hurt players",
"anything can hurt heli",
"anything can hurt npcs",
"fire cannot hurt players",
"anything can hurt resources"
I am not aware of anything built-in that allows scheduling on specific dates or weeks of the month, only within a day.  Best case it should be able to make a change only on specific days of the week, e.g. Monday or Friday.

You might be able to work something out using TimedExecute to modify zones, but I am not sure how that would work.  In my case, having full access to the OS of my server, I would schedule a file rename on the day of the month desired.  On the next restart the replaced configuration would come into play.

Another option would be to use TimedExecute to unload TruePVE on specific dates some time after server restart.
It would work if you could put days + a number that represents days so say you start it on a Sunday and put code to say Sun + 14 days that would work?? 
 I am relatively certain that the days are numbered 0-6.  So, as written, I don't think that would work.
Rfc1920,

Can you address this issue - Even though I turned off TruePVE to false the Flags are still working, i.e. Turrents Ignore Players.

Can you please address this so I don't have to remove the TruePVE.cs and TruePVE.json from their folders when I switch the server to PVP?


All you would have to do is oxide.unload TruePVE.cs.
Hi Poedil 

The configuration files are in JSON syntax so any mistakes to the config will cause the system to create a default config. I suggest that you use a JSON editor to make sure that the syntax is correct.