custom-hooks-commands

textPage 12 of 152
50 messages on this page
Friday, August 9, 2024
Avatar for 44dc9956fa8ccaebb4f731417c8184f9c2e41fcfb57cea3d7330e76051749608
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.
Avatar for 2eb44ad6a50c42f0312f635d455b93d5ef620a7d86692a3aa6bdbf31d872a724
User 2eb44a
Same 🀣 imma start learning custom commands tonight after work
Avatar for 44dc9956fa8ccaebb4f731417c8184f9c2e41fcfb57cea3d7330e76051749608
User 44dc99
Great. Now all I need to do is figure out how to actually implement that. πŸ˜›
Avatar for a506fee3140c1a9cb5f83c4671951bd488e90ca6dc0482bf1cbc5478a2f8fa6e
User a506fe
Yips
Avatar for a506fee3140c1a9cb5f83c4671951bd488e90ca6dc0482bf1cbc5478a2f8fa6e
User a506fe
πŸ€“
Avatar for a506fee3140c1a9cb5f83c4671951bd488e90ca6dc0482bf1cbc5478a2f8fa6e
User a506fe
EVER
Avatar for a506fee3140c1a9cb5f83c4671951bd488e90ca6dc0482bf1cbc5478a2f8fa6e
User a506fe
Never ever trust any handlebars code I post
Avatar for a827fb800b970377940da84d66abc498ff76568b3c64de46b25aee9fc715a430
User a827fb
Note, the lack of a space after the and in
(and(eq
breaks it πŸ˜„
Avatar for 44dc9956fa8ccaebb4f731417c8184f9c2e41fcfb57cea3d7330e76051749608
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}}```
Avatar for a827fb800b970377940da84d66abc498ff76568b3c64de46b25aee9fc715a430
User a827fb
That's great, thanks Prisma.
Avatar for a506fee3140c1a9cb5f83c4671951bd488e90ca6dc0482bf1cbc5478a2f8fa6e
User a506fe
replace {{! Bloodmoon starts in 2 hours!}} with whatever commands you d like to use for that
Avatar for a506fee3140c1a9cb5f83c4671951bd488e90ca6dc0482bf1cbc5478a2f8fa6e
User a506fe
so just checking if days is factor 7 and hours is later than 20 should do the trick for an announcement
Avatar for a506fee3140c1a9cb5f83c4671951bd488e90ca6dc0482bf1cbc5478a2f8fa6e
User a506fe
    {{! Bloodmoon starts in 2 hours!}}
{{/if}}```
Avatar for a506fee3140c1a9cb5f83c4671951bd488e90ca6dc0482bf1cbc5478a2f8fa6e
User a506fe
no factor 7 + 1 and before 04 hours check needed
Avatar for a506fee3140c1a9cb5f83c4671951bd488e90ca6dc0482bf1cbc5478a2f8fa6e
User a506fe
so for an start announcement you d only need the first part
Avatar for a506fee3140c1a9cb5f83c4671951bd488e90ca6dc0482bf1cbc5478a2f8fa6e
User a506fe
that is what this code checks
Avatar for a506fee3140c1a9cb5f83c4671951bd488e90ca6dc0482bf1cbc5478a2f8fa6e
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
Avatar for a827fb800b970377940da84d66abc498ff76568b3c64de46b25aee9fc715a430
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
Avatar for a827fb800b970377940da84d66abc498ff76568b3c64de46b25aee9fc715a430
User a827fb
We have a 120min daynightlength. So 2 hrs of game time would be 10mins IRL.
Avatar for 44dc9956fa8ccaebb4f731417c8184f9c2e41fcfb57cea3d7330e76051749608
User 44dc99
Oh, the color codes are messing up my search
Avatar for a827fb800b970377940da84d66abc498ff76568b3c64de46b25aee9fc715a430
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
Avatar for 44dc9956fa8ccaebb4f731417c8184f9c2e41fcfb57cea3d7330e76051749608
User 44dc99
What I had previously, but has not been working since V1.0 is this...
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
Note that our time-to-live was based on a 90-minute day. Your mileage will vary.
Avatar for a827fb800b970377940da84d66abc498ff76568b3c64de46b25aee9fc715a430
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
Avatar for a827fb800b970377940da84d66abc498ff76568b3c64de46b25aee9fc715a430
User a827fb
LOL OK, fixed it. Leaving this here for the next guy... do not leave a space between sendDiscord and the () πŸ˜„
Avatar for a827fb800b970377940da84d66abc498ff76568b3c64de46b25aee9fc715a430
User a827fb
Can anyone help with sendDiscord() please? I have the following in automation/cronscripts
w2l "discordtest";
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.
Tuesday, July 23, 2024
Avatar for 7fd701b1a0deec6e66cf33cfedaeec60a9fbce2f681804879bd80bdbfc0e3ec0
User 7fd701
I am going to try! thanks for the tip
Avatar for 6ceaf41ff27d04ff247f59c1bc5a9f4cc4ace95acc526862d52cdbbb8702989b
User 6ceaf4
randList, maybe?
Avatar for 7fd701b1a0deec6e66cf33cfedaeec60a9fbce2f681804879bd80bdbfc0e3ec0
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
Monday, July 22, 2024
Avatar for ee051104e06c7b026308f7b84854d5267f2d6c2ca95424e60290792cfc259f4e
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 killed
and 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! πŸ™‚
Avatar for ee051104e06c7b026308f7b84854d5267f2d6c2ca95424e60290792cfc259f4e
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
Avatar for ee051104e06c7b026308f7b84854d5267f2d6c2ca95424e60290792cfc259f4e
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

image.png

PNG β€’ 30.2 KB

Tuesday, July 16, 2024
Avatar for 69fe0284d684cd81287174e298aca72069643180d138df52daad3a8d67e8ea5a
User 69fe02
Thank you, got somewhere to start! I will have a go
Avatar for a506fee3140c1a9cb5f83c4671951bd488e90ca6dc0482bf1cbc5478a2f8fa6e
User a506fe
@User 22055452 might know that
Avatar for a506fee3140c1a9cb5f83c4671951bd488e90ca6dc0482bf1cbc5478a2f8fa6e
User a506fe
if you have a custom hook i dunno how that would work to get a player object based on a regex result
Avatar for a506fee3140c1a9cb5f83c4671951bd488e90ca6dc0482bf1cbc5478a2f8fa6e
User a506fe
BUT
Avatar for a506fee3140c1a9cb5f83c4671951bd488e90ca6dc0482bf1cbc5478a2f8fa6e
User a506fe
player.role.level
Avatar for a506fee3140c1a9cb5f83c4671951bd488e90ca6dc0482bf1cbc5478a2f8fa6e
User a506fe
for csmm level for example
Avatar for a506fee3140c1a9cb5f83c4671951bd488e90ca6dc0482bf1cbc5478a2f8fa6e
User a506fe
with built in you ll have a player object to use
Avatar for a506fee3140c1a9cb5f83c4671951bd488e90ca6dc0482bf1cbc5478a2f8fa6e
User a506fe
and it depends if you use builtin hooks or customs
Avatar for a506fee3140c1a9cb5f83c4671951bd488e90ca6dc0482bf1cbc5478a2f8fa6e
User a506fe
for the syntax
Avatar for a506fee3140c1a9cb5f83c4671951bd488e90ca6dc0482bf1cbc5478a2f8fa6e
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}}```
Avatar for a506fee3140c1a9cb5f83c4671951bd488e90ca6dc0482bf1cbc5478a2f8fa6e
User a506fe
    pm {{player.steamId}} "That worked"
{{else}}
    pm {{player.steamId}} "Sorry, you must be at least level 100 for this command"
{{/if}}```
Avatar for a506fee3140c1a9cb5f83c4671951bd488e90ca6dc0482bf1cbc5478a2f8fa6e
User a506fe
from there as an example you could base on
Avatar for a506fee3140c1a9cb5f83c4671951bd488e90ca6dc0482bf1cbc5478a2f8fa6e
User a506fe
πŸ€“
Avatar for a506fee3140c1a9cb5f83c4671951bd488e90ca6dc0482bf1cbc5478a2f8fa6e
User a506fe
ghe ghe, aaaaand that is done by handlebar code
Avatar for 69fe0284d684cd81287174e298aca72069643180d138df52daad3a8d67e8ea5a
User 69fe02
That sounds easier tbh! πŸ˜„
Avatar for a506fee3140c1a9cb5f83c4671951bd488e90ca6dc0482bf1cbc5478a2f8fa6e
User a506fe
you could wrap a check around the command in the hook that checks for certain donor levels
Avatar for 69fe0284d684cd81287174e298aca72069643180d138df52daad3a8d67e8ea5a
User 69fe02
Ok great, do you know if there is any examples on the docs that use something similar I can try out?