custom-hooks-commands
textPage 12 of 152
50 messages on this page
Friday, August 9, 2024
User 44dc99
It's something that has been on my to-do list for eons. Kinda like setting up Takaro. I just don't have much free time or resources to put into it, and then when I have a bit, I end up gaming.
User 2eb44a
Same π€£ imma start learning custom commands tonight after work
User 44dc99
Great. Now all I need to do is figure out how to actually implement that. π
User a506fe
Yips
User a506fe
π€
User a506fe
EVER
User a506fe
Never ever trust any handlebars code I post
User a827fb
Note, the lack of a space after the and in
(and(eq breaks it πUser 44dc99
So if we had something non-standard like 10-day bloodmoons, we could set it up similarly using a small change to that?
{{! Bloodmoon starts in 2 hours!}} {{/if}}```
User a827fb
That's great, thanks Prisma.
User a506fe
replace {{! Bloodmoon starts in 2 hours!}} with whatever commands you d like to use for that
User a506fe
so just checking if days is factor 7 and hours is later than 20 should do the trick for an announcement
User a506fe
{{! Bloodmoon starts in 2 hours!}} {{/if}}```
User a506fe
no factor 7 + 1 and before 04 hours check needed
User a506fe
so for an start announcement you d only need the first part
User a506fe
that is what this code checks
User a506fe
when gamedays is a factor of 7 and after 22 hours (bloodday) OR gamedays is a factor of 7 +1 and before 04 hours (bloodnight) its an active bloodmoon
User a827fb
Hi folks, I want to broadcast an announcement in the 2 hrs before BM. I have the following based on code that Saminal put up a while ago but I don't understand how it works. I was told today that it triggered at the start of BM rather than 2 hrs before. Logic makes my brain swim so I'd appreciate some guidance here. I think if I drop the 22 to 20, that will help. Do I also need to drop the 4 to a 2?
{{ #if (or (and (eq (mod server.stats.gametime.days 7) 0) (gte server.stats.gametime.hours 22)) (and (eq (mod server.stats.gametime.days 7) 1) (lt server.stats.gametime.hours 4)) ) }} {{! It's BM! Do this!}} {{else}} {{! It's not BM! Do nothing. }} {{/if}}```
Wednesday, August 7, 2024
User a827fb
We have a 120min daynightlength. So 2 hrs of game time would be 10mins IRL.
User 44dc99
Oh, the color codes are messing up my search
User a827fb
Thanks for that. I just found that line in my log. Current version is: Server: [00ff00]Better hurry! Its bloodmoon [FF0000]TONIGHT[-] !!![-]
Tuesday, August 6, 2024
User 44dc99
What I had previously, but has not been working since V1.0 is this...
Event: logLine
Commands:
Search String: Better hurry! Its bloodmoon TONIGHT
Event: logLine
Commands:
sendDiscord(1136761515756761161,"**[SERVER]** Come join the team: {{#each server.onlinePlayers}}{{this.name}}, {{/each}}as the blood moon on **Zed Rising** is about to start in **two game hours**! - _7.5 actual minutes_")Search String: Better hurry! Its bloodmoon TONIGHT
This worked great in a21.
https://i.gyazo.com/3562721f19d22a88879227ff41fe123a.png
https://i.gyazo.com/3562721f19d22a88879227ff41fe123a.png
Note that our time-to-live was based on a 90-minute day. Your mileage will vary.
User a827fb
This is a "what's the best way to approach this problem" question. We have a recurring problem with people logging out 5 mins before blood moon. As a result, when the next poor sap logs in, the mayhem starts and they haven't had any time to prepare. I was thinking of sending broadcast or three in the game hours leading up to BM to the effect of "Blood moon in X minutes. Log out now if you're not planning to fight through it!"
Does that seem reasonable? Can you think of a better way?
If this does seem reasonable, I would think a logLine hook is a good way to trigger it. My question for people who know the logs better than I, is what should I be looking for in the log? I can't see any periodic entries (e.g. 1 o'clock, 2 o'lock). Perhaps run it as a PlayerKilledZombie trigger with a 15 minute cooldown?
Sunday, July 28, 2024
User a827fb
LOL OK, fixed it. Leaving this here for the next guy... do not leave a space between sendDiscord and the () π
User a827fb
Can anyone help with sendDiscord() please? I have the following in automation/cronscripts
w2l "discordtest";
sendDiscord (112753redacted12345, "discordtesttext");
sendDiscord (112753redacted12345, "discordtesttext");
When I run it manually, the w2l works as expected but nothing appears in Discord. I've triplechecked the channel ID is correct. The chat bridge is working normally which suggests that the bot is appropriately authorised. 7D v1.0, Alloc's and CPM downloaded fresh when we set up 3 days ago.
User a827fb
Look at the second one here: https://github.com/trevorjd/Trevors_CSMM_Handlebars/blob/main/Custom%20Hook%20-%20Sassy%20Death%20Messages
Tuesday, July 23, 2024
User 7fd701
I am going to try! thanks for the tip
User 6ceaf4
randList, maybe?
User 7fd701
hey guys, is there any way we can send different messages every time the player dies? I thought about using cooldown and several different hooks, but they will be triggered at the same time the first time and if no one dies for a while it will happen again
thanks
thanks
Monday, July 22, 2024
User ee0511
Reading through all of the examples on the website and I'm going to do a bunch of trial and error, so I don't expect anyone to give me the finished answer, but if anyone wants to recommend me in a specific path that you think might be helpful, that won't go unappreciated! Essentially, I am trying to allow bosses to have the ability to spawn screamers that CAN actually scream. Obviously, I can have the gameevents spawn a custom entity that runs at players in the hopes that players will single target dps it down, but if they are using AOE then I just get the
INF Entity ArenaSpawn xxxxx killedand there's no player to "spawnscouts" on. I'd love to be able to have a trigger that wasn't situational on players doing single target damage... I won't post here again about this unless it's follow up to anyone else that posts to me, but thanks for your time in reading this regardless! π
User ee0511
Or failing that, what other location driven gameevents could I cause to occur that would let me hook a location and not only a player for the spawnscouts? Maybe my mind went to kill an enemy but maybe thatβs the wrong trigger
User ee0511
This hook will execute "spawnscouts" flawlessly when a player kills a custom entity named "ArenaSpawn". But if a non-direct player damage (like an AOE from a buff etc) kills this enemy, I want the spawnscouts getting activated on that location where it died OR the nearest player or something. What would the Commands section be for that or is there none that would work?

image.png
PNG β’ 30.2 KB
Tuesday, July 16, 2024
User 69fe02
Thank you, got somewhere to start! I will have a go
User a506fe
@User 22055452 might know that
User a506fe
if you have a custom hook i dunno how that would work to get a player object based on a regex result
User a506fe
BUT
User a506fe
player.role.level
User a506fe
for csmm level for example
User a506fe
with built in you ll have a player object to use
User a506fe
and it depends if you use builtin hooks or customs
User a506fe
for the syntax
User a506fe
{{#if (lte this.role.level 1)}} cgc adduser {{this.entityId}} admins; admin add {{this.entityId}} 1; {{else if (lte this.role.level 100)}} cgc adduser {{this.entityId}} donators; admin add {{this.entityId}} 100; {{else if (lte this.role.level 500)}} cgc adduser {{this.entityId}} regulars; admin remove {{this.entityId}}; {{else}} cgc adduser {{this.entityId}} players; admin remove {{this.entityId}}; {{/if}} {{/each}}```
User a506fe
pm {{player.steamId}} "That worked" {{else}} pm {{player.steamId}} "Sorry, you must be at least level 100 for this command" {{/if}}```
User a506fe
from there as an example you could base on
User a506fe
π€
User a506fe
ghe ghe, aaaaand that is done by handlebar code
User 69fe02
That sounds easier tbh! π
User a506fe
you could wrap a check around the command in the hook that checks for certain donor levels
User 69fe02
Ok great, do you know if there is any examples on the docs that use something similar I can try out?