Hey! I'm relatively new to Denizen and have been thoroughly following the beginners guide for a script that I'm trying to make. Basiclaly, I'd like the script to function as such: When a player types "--" at the end of their message, the text before the "--" will be saved and stored, allowing the user to continue the message past minecrafts chat text limit. Once a message is send without a "--" then the two messages would be combined to send one full message that exceeds minecrafts chat limit. I've successfully been able to script this. However, there are some small things i'd like to tweak which I am a bit lost on how to do so. When sending the combined message, it appears that minecraft still capitalizes the first letter of the first word of each message. I was wondering if there was a way to adjust my script so that I can bypass the capitalization of the first letter for each message AFTER the first saved message. Additionally, I have scripted a narrate which basically says "You have <player.flag[messages].size> appended messages.". Though, with the way I scripted this, it always says "You have 1 appended messages." no matter the amount of appended messages I have saved. I'd appreciate any help a ton! I can also send the current script here if needed!
#(7NEL) Help needed. Questions about a script. (Fixing capitalization/integer issues)
1 messages · Page 1 of 1 (latest)
Hi I'm AutoThreadBot! Don't mind me, I'll just be adding the helper team to this thread so they can see it. A human will get to you soon.
!pastelog
Help us help you by pasting your full server log directly to https://paste.denizenscript.com/New/Log (and not any other pastebin service) and linking it back here.
Could you use our paste site please so we dont have to download your script?
Gotcha!
oops
ill just paste the link
Content of Denizen Script Paste #124601: Appendscript... pasted 2024/07/14 11:37:42 UTC-07:00, Paste length: 823 characters across 22 lines, Content: ChatAppend: type: world
lmao
i thought it would put the little viewable command box LOL
If you need help with a script issue, one of the most powerful tools Denizen has to offer is full debug output. This is displaying in your console whenever scripts are running until you turn debug off. To share a debug log quickly and easily with helpers, simply run the command /denizen debug -r in-game to begin recording, then run through the part of the script you need help with, then run the command /denizen submit. This will give you a link to a paste of the debug log, which you can then copy/paste back to us!
Content of Server Log Paste #124602: Denizen Debug Logs From TEST SERVER ROLEPLAY... pasted 2024/07/14 11:40:15 UTC-07:00, Paste length: 19107 characters across 186 lines, Content: Java Version: 21.0.3Up-time: 25m
that was odd. it seemed to cut out a previous message after the 3rd and 4th appends
ah this is all so confusing haha
use <context.message.split.(your options)>
in what context? like where?
i see, so id replace the content of the if statement with that?
what would that fix exactly?
it should work
sorry, what should though? would it fix the capitalization?
yes, try it
gotcha let me try
im getting this warning "ag tracer: Tag part '("--")' does not exist for object type ListTagDenizen Script Checker(tag_trace_failure)
Invalid tag part ("--") (check !tag ... to find valid tags).Denizen Script Checker(bad_tag_part)"
i put the "--" where you said to put your options
!paste
Help us help you by pasting your script to https://paste.denizenscript.com/New/Script and linking it back here.
Content of Denizen Script Paste #124603: appendscript... pasted 2024/07/14 12:27:56 UTC-07:00, Paste length: 822 characters across 22 lines, Content: ChatAppend: type: world
would the split syntax work with an if condition? it doesnt return any boolean values
Reviewing this script
What if the message ends with -- and the user has the flag messages?
This would reset saved strings.
ahhh i see thats probably why the messages didnbt send after the 4th append
would there be an easy fix to that?
Also line 6 gets everything before --, what if -- is in the middle of text?
Returns the portion of an element before the last occurrence of a specified element.
For example: abcabc .before_last[b] returns abca.
element manipulation
ElementTag
i believe it wouldnt register? or maybe it would. i havent tested
let me try right now
No like
What if -- is at the end and in the middle of the text? It would get only half of the message. Thats why you should use before_last instead of before.
gotchaa i see i mostly made it "--" because its uncommon for a user to use those symbols two times. kind of like a thing where they know thats the function of the symbols
The fix would be using data actions and add to the list on line 7 and check if the message does not ends with -- + player has flag on line 10
"messages:-:><[message]> "
!lang data actions
Several commands function as a way to modify data values,
including !command flag, !command yaml, and !command define.
These commands each allow for a set of generic data change operations.
These operations can be used with a syntax like "<key>:<action>:<value>"
For example "mykey:+:5" will add 5 to the value at 'mykey'.
The following actions are available:
Actions that take no input value:
Increment: '++': raises the value numerically up by 1. Example: - define x:++
Decrement: '--': lowers the value numerically down by 1. Example: - define x:--
Remove: '!': removes the value entirely. Example: - define x:!
Actions that take an input value:
Add: '+': adds the input value to the value at the key. Example: - define x:+:5
Subtract: '-': subtracts the input value from ...
Useful Lists
like this?
Content of Denizen Script Paste #124607: appendscript... pasted 2024/07/14 12:50:17 UTC-07:00, Paste length: 869 characters across 23 lines, Content: ChatAppend: type: world
Need to use quotes like this ^
i didnt haha
And line 10 should check if the message does not end with -- plus the flag check
i see
- else if <player.has_flag[messages]> and if !<context.message.ends_with[--]>:
would that work?
View the guide page 'Changing The Path: The If Command' at: https://guide.denizenscript.com/guides/basics/if-command.html
+++ Info disablereplies: Please disable reply-pings when responding to helpers. This relates to Rule #3: https://denizenscript.com/discord_rules#rule3
https://denizenscript.com/discimg/disable_replies.png
So sorry! will do
done. work better?
odd, i just tested it out but it seems to not send anything past the most recent message
so the appended messages arent sending
!debug
If you need help with a script issue, one of the most powerful tools Denizen has to offer is full debug output. This is displaying in your console whenever scripts are running until you turn debug off. To share a debug log quickly and easily with helpers, simply run the command /denizen debug -r in-game to begin recording, then run through the part of the script you need help with, then run the command /denizen submit. This will give you a link to a paste of the debug log, which you can then copy/paste back to us!
View the guide page 'Solving Problems You Encounter' at: https://guide.denizenscript.com/guides/first-steps/problem-solving.html
ok will do ty so much
@worthy lance were you able to figure it out?
no haha
still trying rn
Wanna post your current script and debug?
yea i sure
Content of Denizen Script Paste #124615: appendscript... pasted 2024/07/14 13:56:16 UTC-07:00, Paste length: 905 characters across 23 lines, Content: ChatAppend: type: world
currently restarting the server for the updated script so ill send the debug once thats done restarting
Line 7 you need quotes, you want - flag <player> "messages:->:<[message]> "
ahh i see. what does that do?
So it counts as one argument, and adds that space in that you had earlier.
While looking on your proc, that's slightly overcomplicated.
Actually, you want - flag <player> messages:->:<[message]>, no need for the extra space here
Because you can replace your proc with a tag
!t list.space_separated
Returns the list in a cleaner format, separated by spaces.
ElementTag
# Narrates "one two three"
- narrate <list[one|two|three].space_separated>
i actually needed the space so that it automatically puts a space between each appended message. I assumed that that how itd work?
Please read my full reply
oh i see, apologies
You can also determine passively so the script queue still runs.
- determine <[appended_message]> passively
- flag <player> messages:!
This will let you run commands after determine ^
I seeee
and this is supposed to be with or without quotes including the exclusion of the extra space?
You only need quotes when you have an extra space that is not enclosed in <[]>
i see i see. gotcha
<element[This requires no quotes]>
gonna try this new version out
it seems to ALMOST work as intended. For some reason, it's leaving out any appended messages that ARENT the first and last appended messages. let me send the debug here!
Content of Server Log Paste #124617: Denizen Debug Logs From TEST SERVER ROLEPLAY... pasted 2024/07/14 14:08:22 UTC-07:00, Paste length: 13209 characters across 133 lines, Content: Java Version: 21.0.3Up-time: 2m 13s
when typing "test1--" "test2--" "test3--" and "test4", i only get "test1test4" with no space in between as well
Content of Denizen Script Paste #124618: appendscript... pasted 2024/07/14 14:13:46 UTC-07:00, Paste length: 719 characters across 15 lines, Content: ChatAppend: type: world
like that?
Youre still using your proc
oh sorry, i believe im confused as to what you meant by that then. I assumed it meant the procedure at which i was using to combine the messages.
oh i see
sorry
i was confused
let me fix
so like this?
Content of Denizen Script Paste #124619: appendscript... pasted 2024/07/14 14:20:11 UTC-07:00, Paste length: 940 characters across 24 lines, Content: ChatAppend: type: world
Well does it work now as intended?
almost. when i type test1-- then test2, i get the result "Test1 Test2Test2"
tfor some reason it repeats the last one
Sounds like you add it twice
Probably dont even need a debug
this is it right here lol
Ya check yer script
i think i see the issue
let me retry
it works now! Though, i was wondering if there was any way to stop the capitalization of the first letter after the first append?
like for example:
Are you on a custom client?
Is it possible to adjust the script so that The T in test2 and Test3 are lowercase?
yea im currently using lunar
Can you try on vanilla
sure!
there might be an option to disable that
Also there is some room to clean up your script
- define appended_message <player.flag[messages].space_separated>
- determine <[appended_message]> passively
- flag <player> messages:!
- determine <[appended_message]>
You're determining twice for no reason
And the definition is argueably redundant, could determine <player.flag[messages].space_separated> directly.
It's just an extra step
The proc CombineMessage can be entirely removed, if not already.
I'll go to sleep now, have a great day.
Has your issue been resolved, or your question been answered?
If so, please use the </resolved:1028673926114594866> command to close your thread.
Or </invalid:1028673926898909185> if it's not possible to resolve.
If not yet resolved, please reply below to tell us what you still need.
(Note that if there is no reply for a few days, this thread will eventually close itself.)
@worthy lance
thank you so much for the help!
:D
Has your issue been resolved, or your question been answered?
If so, please use the </resolved:1028673926114594866> command to close your thread.
Or </invalid:1028673926898909185> if it's not possible to resolve.
If not yet resolved, please reply below to tell us what you still need.
(Note that if there is no reply for a few days, this thread will eventually close itself.)
@worthy lance