dev
textPage 12 of 208
50 messages on this page
Sunday, January 30, 2022
User bddf69
But there's 2 runtimes active in the CSMM custom system.
First all the handlebars stuff gets resolved and only after that, the commands and custom functions get executed
User bddf69
You're still using everything inside handlebars
User bddf69
There'll need to be a few adjustments to your code yeah
User bddf69
Are you testing on staging or on your own instance?
User bc4343
Do I need to make any changes to this code to test it ?
As is I'm getting and API error on the ?second wait (x)?
The log line hooked 4 times in the 10 seconds so it technically should have "fired"
wait(10); {{#if (lte (getVar (add "player:counter:" player.steamId)) 1)}}; {{delVar (add "player:counter:" player.steamId)}}; say "Command will fail {{getVar (add "player:counter:" player.steamId)}} time."; {{/if}} {{#if (gte (getVar (add "player:counter:" player.steamId)) 3)}}; say "Command will fire {{getVar (add "player:counter:" player.steamId)}} time."; {{/if}}```
Command Parameters Result
wait(10) Waited for 10 seconds
say "Command will fail time."
Waited for 10 seconds An error occurred executing the API request to the 7D2D server```
wait(10) Waited for 10 seconds
say "Command will fail time."
Waited for 10 seconds An error occurred executing the API request to the 7D2D server```
User bddf69
Awesome :D
User bc4343
I'll be able to have a play with it a bit later today, will let you know ๐
Saturday, January 29, 2022
User 6ceaf4
This works great
foo {{else}} bar {{/inArray}}```
User 6ceaf4
{{filter server.onlinePlayers "a"}}also gives me options.inverse is not a functionUser 6ceaf4
I was trying
foo {{else}} bar {{/inArray}}```
User bddf69
This should work: https://github.com/Budibase/handlebars-helpers#split
User bddf69
So depending on the command, you'll need to split on something to turn it into an array
User bddf69
Oh it's a string that comes out
User 6ceaf4
Not sure how to use the data from a
{{execCmd "pd list"}}. Is it an array? Also, what would be a correct array format? I've tested "a,b,c", "[a,b,c]", "'1','2','3'"...User bddf69
that would mean it's never triggering ;O How are you testing it?
User 6bbafa
I tried every combination in the document and 8n searching here. I will give Playground a try and post my findings

Screenshot_20220129-100903_Chrome.jpg
JPG โข 614.7 KB
User 6bbafa
I will try some Playground stuff as I was testing from in game
User 6bbafa
Last result isn't recording anything but the above does work
User 6bbafa
say "[FF7F00]${player.name} [FFFF00]has reached level [9400D3]${newLvl} [FFFF00]and has earned ${newLvl} Dukes"; giveplus Steam_${player.steamId} casinoCoin ${newLvl}
User bddf69
Playground will eventually replace that last result info from the settings page
User bddf69
^ also available in the playground btw, with a bunch more info available ๐
User a506fe
did you check last result in the hook to see what is actually executed?
User 6bbafa
Tried this and it didn't work either. Spent an hour testing...
User bddf69
Oh and @User 59898394 re the stuff you asked in #csmm-support , about getting the permadeath status of a player
Adding this to staging in a few minutes too.
{{execCmd "command"}} helper
unknown.png
PNG โข 15.3 KB
User bddf69
I can give you admin on my test server on staging if you dont want to add your own server
User bddf69
so potentially big impact
User bddf69
now they can
User bddf69
It changes how custom functions get resolved now. Before, they couldn't be nested
User bddf69
Would either of you mind giving it a test and see what gives? Before I merge it to master?
User bddf69
It's going live on staging now
User bddf69
buuuut there's no conditional in the customFunction runtime, so I'm not sure if it'll fully solve the usecase
User bddf69
Also stuff like
setVar("test2", getVar("test")) will workUser bddf69
wait(10); getVar("aaa")
Will wait 10 seconds before reading the variable
User bddf69
I hope :O
User bddf69
It's not a full fix to your use case but it should help I think
User bddf69
@User 44583928 and @User 59898394
https://github.com/CatalysmsServerManager/7-days-to-die-server-manager/pull/1090
https://github.com/CatalysmsServerManager/7-days-to-die-server-manager/pull/1090
๐
This PR will allow you to use persistent variables as custom CSMM functions
User a506fe
So summary:
If you use the default Level Up hook from cssm use
If you use a custom hook and extract newLvl with regex from logline use
If you use the default Level Up hook from cssm use
{{multiply newLvl 10}}If you use a custom hook and extract newLvl with regex from logline use
{{multiply custom.newLvl 10}}User a506fe
100% true
User e5e1a1
Well either way I'm confident ${this} won't work inside a {{helper}}
User a506fe
so depending on which it is it need custom.
User a506fe
but it could be the internal of hook playerLeveled too
User e5e1a1
I think it is being picked up by a hook on the CPM level up line
User bddf69
And use tha playground if you dont yet. Helps a lot with debugging
User a506fe
i think
User a506fe
not a custom
User a506fe
newLvl is an internal
User e5e1a1
{{multiply custom.newLvl 10}}
User e5e1a1
{{helper (variable) 5}}
User e5e1a1
Including how to do maths and how to nest helpers
