dev
textPage 14 of 208
50 messages on this page
Tuesday, January 25, 2022
User 6ceaf4
You are retrieving player:counter var, but adding to player:counter var
User 6ceaf4
I see the problem
User bc4343
The count was over 200 when I was testing it ๐
User 6ceaf4
Keep going, you need to do it more than 100 times... or reduce that 100 number ๐คฃ
User 6ceaf4
This is literally the example from the docs
{{ setVar (add "player:counter:" player.steamId) (add 1 (getVar (add "player:counter:" player.steamId))) }};User a12f6e
So this build works fine, but... it doesn't help with what I want to do. I think the reason for this is that CSMM doesn't even detect a disconnection if the server is only offline briefly, which is what happens for our servers, since we have a system that automatically restarts it if it goes down. Either that or the hooks aren't working. ๐
User a12f6e
getVar gets the value of the variable. You have {{getVar "player:counter:" player.steamId}} which is invalid syntax. Also player:counter: will be treated as a plain string in the variable name.User bc4343
no dice so far ๐ค
User bc4343
How do we go about using the player:counter in a conditional statement?
I was thinking something like ```{{ setVar (add "player:counter:" player.steamId) (add 1 (getVar (add "player:counter:" player.steamId))) }};
{{#if (gt player:counter 100)}}
say "TEST"
{{/if}}```
Monday, January 24, 2022
User bc4343
Cool, I have some idea's ๐
User bddf69
Yep should be ^^
User bc4343
Oh it's live on my instance also?
User bddf69
everywhere :)
User bc4343
So I have finally got some time to look into these persistent variables ๐
Is this live on staging @User 22055452 ?
Sunday, January 23, 2022
User a12f6e
Yeah I know ;) just very convinced now it's a great idea haha
User bddf69
Hehe :p Wont be anytime soon I'm afraid
User a12f6e
Man trying to use Handlebars for error handling makes me reallllyyy want that script idea you have in your head lol
Saturday, January 22, 2022
User a12f6e
Set it up yesterday, will be running it on our test server over the weekend
Friday, January 21, 2022
User a12f6e
Nice! Looking forward to trying that out!
User bddf69
There's premade Discord notifications available, or you can add a hook to the events
User bddf69
You can use docker tag
pr-1075 to try it out ^^User bddf69
So dynamically loaded :p
User bddf69
setVar test 1Then a different hook:
setVar test 2 t = getVar test print(t)
That should print 2
User bddf69
Persistent variable wouldnt get passed during startup though, you'll be able to load them in dynamically
User bddf69
Totally
User a12f6e
Sure is! Actually I'm sure if there's a way to populate an object with data on the processing host, you can just as easily send it arguments and persistent variables the same way you send it the data.
User bddf69
But it's a fun excuse for me to play around with Firecracker haha
User a12f6e
๐
User bddf69
Yep, lots of stuff to figure out :p
User a12f6e
Yeah that would be awesome. All I meant was that if that
data object contained the same memory map as what the Handlebars built-in variables do, that would make it easy. Also though the custom variables thing may be hard to pull off, particularly the persistent variables.User bddf69
Persistent vars would be
getVar("test") and setVar("test", 1) etcUser bddf69
execCmd would be a function provided by CSMMUser bddf69
In my head, what you would write instead of current handlebars would be
function main(data) { for (const onlinePlayer of data.onlinePlayers) { if (onlinePlayer.level > 100) { execCmd(`say "Wow ${onlinePlayer.name} is level ${onlinePlayer.level}, what a beast"`); } } }
User a12f6e
That's probably ok depending on what the API looks like. If there are objects served up for the same things Handlebars can get to, those code snips should be very easy to write.
User bddf69
Yeah it could totally be a toggle and support both systems. Would have to be a server-wide thing though cause of how the settings in CSMM work right now
User a12f6e
Well butter my biscuits, if you could offer both (Handlebars for people who don't know how to write code, Firecracker for people who do) or combine them so you could use both a single script somehow, that would be awesome saucem possum
User bddf69
Powered by https://firecracker-microvm.github.io/
(Made by Amazon, they use it a lot in AWS to let people run arbitrary code on their servers)
User bddf69
Remote code execution as a feature... ๐ค
User bddf69
What if you could write any code you wanted in there? Javascript or python for example
User bddf69
I'm kind of considering a bit of an overhaul to the handlebars system
Sunday, January 16, 2022
User bddf69
I thought the EOS system would've been better integrated by now
User a506fe
Dunno how long alloc Will stay quiet
User bddf69
Yeh true and I might have to go for it
User a506fe
Could be a temp workaround
User a506fe
Lcp is cpm
User bddf69
To me allocs = vanilla lol
User bddf69
Woops :p
User a506fe
Lkp is allocs
User bddf69
vanilla commands like lkp dont even return that eos id <.<

