custom-hooks-commands

textPage 9 of 152
50 messages on this page
Friday, September 6, 2024
Avatar for 23fa6481638002a74556b9cac6e9e906cdf12551a21ddd6d0b0134fc009c8f88
User 23fa64
But, maybe regedit is something else, and I would like to know what that is.
Avatar for 23fa6481638002a74556b9cac6e9e906cdf12551a21ddd6d0b0134fc009c8f88
User 23fa64
You can go even further too.
image.png

image.png

PNG70.9 KB

Avatar for 23fa6481638002a74556b9cac6e9e906cdf12551a21ddd6d0b0134fc009c8f88
User 23fa64
This time it offered a different RegEx, but it should work provided there is no space in the players name.
image.png

image.png

PNG90.4 KB

Avatar for 23fa6481638002a74556b9cac6e9e906cdf12551a21ddd6d0b0134fc009c8f88
User 23fa64
You want RegEx, not regedit.
Avatar for 6ceaf41ff27d04ff247f59c1bc5a9f4cc4ace95acc526862d52cdbbb8702989b
User 6ceaf4
you can give return random items in a list with randList, and use those with the giveplus command...
Avatar for 6ceaf41ff27d04ff247f59c1bc5a9f4cc4ace95acc526862d52cdbbb8702989b
User 6ceaf4
care to explain a little better?
Avatar for 2fc02addfc2b08cf731c591ce3ec1458095131979eff88a05d79d32a80be0d20
User 2fc02a
thanks! when i use chatGTP and ask it to write code to give an item using regedit, it says it's not a good language to use..
it is covered in this conversation, but it isn't clear what the solution is.
Before I spend the next few days beating my head against the wall, is it possible to get a random item using a hook?
Avatar for 6ceaf41ff27d04ff247f59c1bc5a9f4cc4ace95acc526862d52cdbbb8702989b
User 6ceaf4
the problem I see is csmm is triggered by a single log line and that log line is all that exists. You can't access a second log line to get extra information. You could try to store the first line information in a variable and when the second triggers you retrieve it, but a lot could go wrong
Avatar for 23fa6481638002a74556b9cac6e9e906cdf12551a21ddd6d0b0134fc009c8f88
User 23fa64
So, this isn't coding.
What Cata and Prisma do is coding.
Avatar for 2fc02addfc2b08cf731c591ce3ec1458095131979eff88a05d79d32a80be0d20
User 2fc02a
i haven't really either. Bad player is my savior. he's a coding god
Avatar for f7ec307c8f1e046d385a1bf1dccc23c91ed912516ec4a207eda6e351ec8ea78e
User f7ec30
ok ill try, thanks I have never coded in my life so getting it to tell the time is witchcraft to me.
Avatar for 2fc02addfc2b08cf731c591ce3ec1458095131979eff88a05d79d32a80be0d20
User 2fc02a
the numbers it output was the seconds. didvide it by the amount of seconds in a day and see if they line up
Avatar for f7ec307c8f1e046d385a1bf1dccc23c91ed912516ec4a207eda6e351ec8ea78e
User f7ec30
ok thnx anyways.
Avatar for 23fa6481638002a74556b9cac6e9e906cdf12551a21ddd6d0b0134fc009c8f88
User 23fa64
Don't think that works anymore.
Avatar for 23fa6481638002a74556b9cac6e9e906cdf12551a21ddd6d0b0134fc009c8f88
User 23fa64
RegEx
Avatar for f7ec307c8f1e046d385a1bf1dccc23c91ed912516ec4a207eda6e351ec8ea78e
User f7ec30
I'm pretty sure its {{time}} but that gives me a really long string of numbers plus the date. :\
Avatar for f7ec307c8f1e046d385a1bf1dccc23c91ed912516ec4a207eda6e351ec8ea78e
User f7ec30
sorry for the newb question but is there a {command} for {current.time}. I'm using the hooks for custom commands.
Avatar for 2fc02addfc2b08cf731c591ce3ec1458095131979eff88a05d79d32a80be0d20
User 2fc02a
What is the code called? I'm trying to ask chatGPT for help.
Avatar for 2fc02addfc2b08cf731c591ce3ec1458095131979eff88a05d79d32a80be0d20
User 2fc02a
Okay. Thanks! Saved me a huge headache and a long rabbit hole
Avatar for 23fa6481638002a74556b9cac6e9e906cdf12551a21ddd6d0b0134fc009c8f88
User 23fa64
I see what you are saying.
No, you can only do 1 log line at a time.
Avatar for 2fc02addfc2b08cf731c591ce3ec1458095131979eff88a05d79d32a80be0d20
User 2fc02a
Yeah, i changed it trying different stuff since, so I'll keep working at it.
Avatar for 23fa6481638002a74556b9cac6e9e906cdf12551a21ddd6d0b0134fc009c8f88
User 23fa64
No content
image.png

image.png

PNG4.6 KB

image.png

image.png

PNG2.5 KB

Avatar for 23fa6481638002a74556b9cac6e9e906cdf12551a21ddd6d0b0134fc009c8f88
User 23fa64
No, you didn't.
Avatar for 2fc02addfc2b08cf731c591ce3ec1458095131979eff88a05d79d32a80be0d20
User 2fc02a
So the zombies actually register as a player. Ok that helps. I used the lines you gave me exactly but that didn't work.
Avatar for 23fa6481638002a74556b9cac6e9e906cdf12551a21ddd6d0b0134fc009c8f88
User 23fa64
Work on 1 thing at a time.
Avatar for 23fa6481638002a74556b9cac6e9e906cdf12551a21ddd6d0b0134fc009c8f88
User 23fa64
Change entity to player in the RegEx.
Avatar for 2fc02addfc2b08cf731c591ce3ec1458095131979eff88a05d79d32a80be0d20
User 2fc02a
Log lines:
2024-09-05T22:18:25 10765.662 INF [CSMM_Patrons]damageDetection(Entity): Player dvtien95 (Steam_76561198082551621) triggered damage detection! Damage done: 14531

2024-09-05T22:18:25 10765.663 INF Entity zombieBoe 601849 killed by dvtien95 53960

2024-09-05T22:18:25 10765.663 INF [CSMM_Patrons]entityKilled: dvtien95 (Steam_76561198082551621) killed zombie zombieBoe with Lightning Rod
Avatar for 2fc02addfc2b08cf731c591ce3ec1458095131979eff88a05d79d32a80be0d20
User 2fc02a
No content
Screenshot_20240905-200515.png

Screenshot_20240905-200515.png

PNG114.3 KB

Avatar for 2fc02addfc2b08cf731c591ce3ec1458095131979eff88a05d79d32a80be0d20
User 2fc02a
No content
Screenshot_20240905-200436.png

Screenshot_20240905-200436.png

PNG308.1 KB

Avatar for 2fc02addfc2b08cf731c591ce3ec1458095131979eff88a05d79d32a80be0d20
User 2fc02a
So I got the command to work for damage. But I think the log line I'm trying to capture is a second log line. And can't get it to tell me the entity
Thursday, September 5, 2024
Avatar for 374c5d8a234dd3a84b2e7712113bccfc34abaf33083b895e688b9899a24261ca
User 374c5d
Please take into consideration that the staff is all volunteers that work full time jobs and also have real world responsibilities. We (the staff) reply when we are free and able to help. Sometimes it could be a short wait or it could be the next day. We do our best to respond as quickly as we can.
Avatar for c66f411827d0d81315c4c713bc24db8830ee32fad441841b7030d011e3cc6051
User c66f41
I asked for help yesterday and received no response
Avatar for c66f411827d0d81315c4c713bc24db8830ee32fad441841b7030d011e3cc6051
User c66f41
No one responds to me in that channel.
Avatar for 23fa6481638002a74556b9cac6e9e906cdf12551a21ddd6d0b0134fc009c8f88
User 23fa64
This should be in #cpm-support
Avatar for 2fc02addfc2b08cf731c591ce3ec1458095131979eff88a05d79d32a80be0d20
User 2fc02a
Awesome! I'm learning I think, thanks @User 45622657
Avatar for 23fa6481638002a74556b9cac6e9e906cdf12551a21ddd6d0b0134fc009c8f88
User 23fa64
This worked better for the damage done.
Damage\sdone:\s(\d+)

And this for the player.
Player\s(\w+)\s\(
Avatar for 23fa6481638002a74556b9cac6e9e906cdf12551a21ddd6d0b0134fc009c8f88
User 23fa64
And the variables you added need to be like this.
${custom.Damage done:}

${custom.Entity}
But those are terrible variable names, I would recommend something else.
${custom.detectionDamage}

${custom.damagedPlayer}

Or something similar.
Avatar for 23fa6481638002a74556b9cac6e9e906cdf12551a21ddd6d0b0134fc009c8f88
User 23fa64
The variables at the bottom are wrong.
They don't even match what is in your commands section.
Avatar for 23fa6481638002a74556b9cac6e9e906cdf12551a21ddd6d0b0134fc009c8f88
User 23fa64
Where are you adding the Python script?
Avatar for 2fc02addfc2b08cf731c591ce3ec1458095131979eff88a05d79d32a80be0d20
User 2fc02a
Sorry, this line:
import re

log_line = "6738.891 INF [CSMM_Patrons]damageDetection(Entity): Player Pusheenlight (Steam_76561199082902036) triggered damage detection! Damage done: 10033"
match = re.search(r'Damage done:\s(\d+)', log_line)

if match:
    damage_done = match.group(1)
    print(f"Damage done: {damage_done}")
else:
    print("Damage amount not found")```
Avatar for 2fc02addfc2b08cf731c591ce3ec1458095131979eff88a05d79d32a80be0d20
User 2fc02a
But received this:
Screenshot_20240905-174228.png

Screenshot_20240905-174228.png

PNG91.5 KB

Avatar for 2fc02addfc2b08cf731c591ce3ec1458095131979eff88a05d79d32a80be0d20
User 2fc02a
And did the regedit like this:
Screenshot_20240905-173728.png

Screenshot_20240905-173728.png

PNG282.6 KB

Avatar for 2fc02addfc2b08cf731c591ce3ec1458095131979eff88a05d79d32a80be0d20
User 2fc02a
I got this from chatgpt:
Screenshot_20240905-174110.png

Screenshot_20240905-174110.png

PNG203.0 KB

Avatar for 2fc02addfc2b08cf731c591ce3ec1458095131979eff88a05d79d32a80be0d20
User 2fc02a
Thank you I'll try this also
Avatar for 2fc02addfc2b08cf731c591ce3ec1458095131979eff88a05d79d32a80be0d20
User 2fc02a
Thank you, I'll try this
Avatar for 6ceaf41ff27d04ff247f59c1bc5a9f4cc4ace95acc526862d52cdbbb8702989b
User 6ceaf4
chatGPT is also hepful for that...
Wednesday, September 4, 2024
Avatar for 963f555b96e0b42febfe9c8744aacd2b11893c566055bfc6419084c10409fa2f
User 963f55
A good tool to use is regexr.com, you can also put the line in chatgpt ask it for regex line assistance... There is also some examples in the documents https://docs.csmm.app/en/csmm/custom-notifications.html#string-matching
Avatar for 2fc02addfc2b08cf731c591ce3ec1458095131979eff88a05d79d32a80be0d20
User 2fc02a
i promise I've looked and I know I'm just being old and dumb. But i cannot find what regedit would output the location. is there a good example? Talk to me like I know nothing, because i don't
Here's the line i want it to send the location to discord.
2024-09-02T23:30:45 7100.762 WRN Entity FallingBlock_395051 (EntityFallingBlock) fell off the world, id=395051 pos=(93.4, -1.6, 982.4)
Saturday, August 31, 2024
Avatar for 23fa6481638002a74556b9cac6e9e906cdf12551a21ddd6d0b0134fc009c8f88
User 23fa64
Nope, but CPM has what you want.
Avatar for 9a42c5504cf5dfe5fc74961a64884e5b849e39b6ad47d8a2626bc5f11108aeff
User 9a42c5
Hello. I would like to know if there is a command that removes all abandoned vehicles? Or destroys those that are not stored.