dev
textPage 11 of 208
50 messages on this page
Friday, February 25, 2022
User bddf69
Couldn't do 'first' or 'last' since those are already helpers (which get prio over data in the handlebars engine) so I went with 'isFirst' and 'isLast' instead :)
{{#times 10}} first: {{isFirst}} index: {{index}} last: {{isLast}} {{/times}}
User bddf69
๐
User bddf69
I'll try and add it tonight but not sure how much PC time I'll have o.o
User bddf69
Ooh I see, looks useful for sure
User 6ceaf4
So a {{times 10}} would do a loop ten times, allowing the use of {{@first}} {{@index}} and {{@last}}
User 6ceaf4
Found this online for a For loop:
Handlebars.registerHelper('times', function(n, block) { var accum = ''; for(var i = 0; i < n; ++i) { block.data.index = i; block.data.first = i === 0; block.data.last = i === (n - 1); accum += block.fn(this); } return accum; });
User bddf69
What do you have in mind? I can help you write code to get this running
User bddf69
Depends on what you mean
CSMM is open source so you can always submit new code which then becomes part of core CSMM (provided that I review and approve the code ofc)
If you mean, add helpers 'during runtime', then no, I don't think that's possible with Handlebars. All helpers need to be registered when the app initializes
User 6ceaf4
Can
I directly add a custom helper? Or is it something only you can do?Sunday, February 13, 2022
User 374c5d
ah
User bddf69
No new feature, just an update to the docs
User 374c5d
ooo what new feature?
User bddf69
Merged, many thanks for your contribution @User 59898394 โค๏ธ
User bddf69
User bddf69
So I can see the two changes files there
User bddf69
I think I can do it from your repo :P
User bddf69
but I think you have to make a new PR to submit the changes to the main repo
User bddf69
That looks good actually, I can see the updated images inside your frok
Saturday, February 12, 2022
User 6ceaf4
tried again. Seems to lead me to the same place
Thursday, February 10, 2022
User bddf69
Would you mind pressing that green button again? I don't have a new PR yet
https://github.com/CatalysmsServerManager/docs/pulls?q=is%3Apr+is%3Aopen+sort%3Aupdated-desc
https://github.com/CatalysmsServerManager/docs/pulls?q=is%3Apr+is%3Aopen+sort%3Aupdated-desc
User bddf69
Most definitly is not ๐
User 6ceaf4
I've made a commitment in my branch... I think. gitHub is not quite noob friendly.
User bddf69
Didn't know how/where to add them -> they're hidden 15 sub folders deep so can't blame ya :pUser bddf69
These files would need replacing
https://github.com/CatalysmsServerManager/docs/tree/master/docs/.vuepress/public/assets/images/CSMM/advanced-feature-guide
https://github.com/CatalysmsServerManager/docs/tree/master/docs/.vuepress/public/assets/images/CSMM/advanced-feature-guide
User bddf69
I didnt think of replacing those x.x
User bddf69
Ooh nice thanks
User 6ceaf4
Didn't know how/where to add them
User 6ceaf4
First and last image replacement for PR 365 changes @User 22055452
Monday, January 31, 2022
User 782482
๐ฎ this would have been so handy a few days ago ๐
User 6ceaf4
It will wait if I want to, lol
{{setVar (add "player:control:" player.steamId) (date "hhmmss")}} {{setVar (add "player:counter:" player.steamId) 1}} {{/if}} {{#if (lt 10 (subtract (date "hhmmss") (getVar (add "player:control:" player.steamId)) ))}} {{setVar (add "player:control:" player.steamId) (date "hhmmss")}} {{setVar (add "player:counter:" player.steamId) 1}} {{else}} {{#if (gte (getVar (add "player:counter:" player.steamId)) 3)}}; say "Command will fire {{getVar (add "player:counter:" player.steamId)}} time."; {{setVar (add "player:counter:" player.steamId) (add 1 (getVar (add "player:counter:" player.steamId)))}} {{else}} say "Command will fail {{getVar (add "player:counter:" player.steamId)}} time."; {{setVar (add "player:counter:" player.steamId) (add 1 (getVar (add "player:counter:" player.steamId)))}} {{/if}} {{/if}}```
Sunday, January 30, 2022
User e5e1a1
and allows waits
User e5e1a1
w2l is a nice tidy way to chain hooks together :)
User bddf69
- One hook fires when the log line you are interested in appears, this increments a counter
- A different hook which checks the counter, if it's higher than x then it does something
- A cronjob that resets the counter every x time. (or maybe a hook here too? Something to reset the counter)
User bddf69
Or would need a proper environment like an imperative language (js, python, smth like that)
User bddf69
It would need the conditional stuff added as custom functions I suppose
User bddf69
I don't know if this'll be possible in one hook like this
User bddf69
Hmm I think I was mistaking in thinking that I was solving your usecase :p
User bc4343
wait(10); getVar("player:counter:" player.steamId) {{#if (lte (getVar (add "player:counter:" player.steamId)) 1)}}; 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}}```
User bc4343
On staging, Am I on the right path here?
I get the feeling that it's still reading the
{{#if (lte (getVar (add "player:counter:" player.steamId)) 1)}}; or {{#if (gte (getVar (add "player:counter:" player.steamId)) 3)}}; everytime the hook fires , do I need to get them out of handlebars so it doesn't get read before the wait(x) finishes, also I'm guessing the setVar at the start would need to be in {{}} so it does gets read first?User 6ceaf4
Pass ๐ lol.
User e5e1a1
by adding a server ๐
User 6ceaf4
Not afraid to sound dumb, but I have no servers there, how do I access playground?
User bddf69
Aka the 'develop' branch on git ๐
User bddf69
staging.csmm.app
User 6ceaf4
I have no idea what that means.
User bddf69
See the thing I replied to for the more detailed explanation



