custom-hooks-commands
textPage 9 of 152
50 messages on this page
Friday, September 6, 2024
User 23fa64
But, maybe regedit is something else, and I would like to know what that is.
User 23fa64
This time it offered a different RegEx, but it should work provided there is no space in the players name.

image.png
PNG • 90.4 KB
User 23fa64
You want RegEx, not regedit.
User 6ceaf4
you can give return random items in a list with randList, and use those with the giveplus command...
User 6ceaf4
care to explain a little better?
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?
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?
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
User 23fa64
So, this isn't coding.
What Cata and Prisma do is coding.
User 2fc02a
i haven't really either. Bad player is my savior. he's a coding god
User f7ec30
ok ill try, thanks I have never coded in my life so getting it to tell the time is witchcraft to me.
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
User f7ec30
ok thnx anyways.
User 23fa64
Don't think that works anymore.
User 23fa64
RegEx
User f7ec30
I'm pretty sure its {{time}} but that gives me a really long string of numbers plus the date. :\
User f7ec30
sorry for the newb question but is there a {command} for {current.time}. I'm using the hooks for custom commands.
User 2fc02a
What is the code called? I'm trying to ask chatGPT for help.
User 2fc02a
Okay. Thanks! Saved me a huge headache and a long rabbit hole
User 23fa64
I see what you are saying.
No, you can only do 1 log line at a time.
User 2fc02a
Yeah, i changed it trying different stuff since, so I'll keep working at it.
User 23fa64
No, you didn't.
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.
User 23fa64
Work on 1 thing at a time.
User 23fa64
Change entity to player in the RegEx.
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: 145312024-09-05T22:18:25 10765.663 INF Entity zombieBoe 601849 killed by dvtien95 539602024-09-05T22:18:25 10765.663 INF [CSMM_Patrons]entityKilled: dvtien95 (Steam_76561198082551621) killed zombie zombieBoe with Lightning RodUser 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
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.
User c66f41
I asked for help yesterday and received no response
User c66f41
No one responds to me in that channel.
User 23fa64
This should be in #cpm-support
User 2fc02a
Awesome! I'm learning I think, thanks @User 45622657
User 23fa64
This worked better for the damage done.
And this for the player.
Damage\sdone:\s(\d+)And this for the player.
Player\s(\w+)\s\(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.
Or something similar.
${custom.detectionDamage}${custom.damagedPlayer}Or something similar.
User 23fa64
The variables at the bottom are wrong.
They don't even match what is in your commands section.
They don't even match what is in your commands section.
User 23fa64
Where are you adding the Python script?
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")```
User 2fc02a
Thank you I'll try this also
User 2fc02a
Thank you, I'll try this
User 6ceaf4
chatGPT is also hepful for that...
Wednesday, September 4, 2024
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
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.
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
User 23fa64
Nope, but CPM has what you want.
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.







