#can someone explain to me or give me a example of how to parse from a string
1 messages ยท Page 1 of 1 (latest)
and how would i use this in a line of code or sum
You are welcome. The community is meant for helping people.
- Skript heroes.
ty man this helps hella
o
bru can u resend that i wasnt done reading ๐ญ
Sorry, I forgot i was editing the text
on load:
broadcast "&a[ParseExample] Skript loaded successfully!"
command /parse <text>:
description: Parses the first number in the text and adds 5 to it.
usage: /parse <text>
permission: parseexample.use
permission message: "&cYou don't have permission to use this command."
trigger:
# Store the input text
set {_input} to arg-1
# Find all numbers in the text
set {_numbers::*} to regex all matches of "[0-9]+" in {_input}
# Check if any number was found
if size of {_numbers::*} is 0:
send "&cNo numbers found in your input."
stop
# Convert the first number found into an integer
set {_num} to integer({_numbers::1})
# Add 5 to the parsed number
set {_sum} to {_num} + 5
# Show the results
send "&aOriginal text: &f%{_input}%"
send "&aParsed number: &f%{_num}%"
send "&aAfter adding 5: &f%{_sum}%"
Here is the code, sorry
AI again?
cmon man
??
buddy thats AI-generated
Why do you say that?
spoon-feeding AI code doesnt make you look smart
??? What
remember your "best among the forum" chess script from yesterday that was AI
What script?
You think it is ai just because it os well written?
I have no chess system or such a thing
It's obvious
??
suuuure bud
Why do you say so?
The AI always explains the generated code to the user, so you often get useless comments like this that anyone with >5 brain cells can understand
Because he asked an explanation
there's also use of non-existant syntax (like your chess script yesterday)
and it also assigns local variables to everything even when its not needed
And I told him that it was going to be inside the code
thas cool n all but
how would i do sum like this -_-
We can argue on this all you like, it's obvious that it's AI code, it wouldn't even parse
SEE
!!
perfect timing
Non existant? You are saying that my code is ia made because it is well written?
Thats the code this fool has given you, its not even close to functional let alone quality. As I said earlier, you use something like "1" parsed as integer or maybe even set {_x} to 10 then "%{_x}%" parsed as integer.
If you're having trouble applying this in your script, maybe send the script and explain what you're trying to do with it
I dont understand yet why do you say it is ai
AI-generated code has many signs, this one checks like 7 seperate things off the list lol
I will dm buddy, it is getting weird
- comments
- overusing locals
- made up syntax
- doesn't parse
"I will DM people code that isnt mine to feel fullfilment because people are calling me out"
and the code doesnt work
I wouldn't be surprised if he suddenly deleted all his messages here too
They called me out because i tried to help someone in another post sending a full code, eight said it was spoon feeding. They dont like if Skript heroes hrlp or something
You're not a hero, you're giving people bad, non-functional AI code
just trying to mess around with parses to make custom enchants on rightclick with a iron sword: if lore of player's tool contains "windcharge": set lore of item to {_input} set {_numbers} to regex all matches of "[0-9]+" in {_input} if size of {_numbers} is 1: broadcast "1" but no clue how too
Use NBT
Yea idk how to do that at all ๐ญ theres a couple things i never even knew about until recently
please refrain from posting ai code
it is clearly against the rules you agreed to when joining this server
set int tag "enchants:windcharge" of custom nbt of ... to ...
#getting
set {_windchargeLevel} to int tag "enchants:windcharge" of custom nbt of ...``` etc ๐
You shouldn't really be using lore to store data, as it gets messy real quick, you can use it to show the enchants but I wouldn't use it to detect them
thats confusing ash
this is skbee yea?
What part of it
Yes
jus aboutt all of the above
- You literally made-up this "skript-heroes" term a few hours ago.
- Yes, it was spoon-feeding. It's literally defined as giving a full solution and telling them to copy and paste it.
- Both using AI and spoon-feeding are not beneficial and are against the rules in this discord and heavily discouraged.
- relying on AI or someone else for code prevents someone from practising/learning & growing
- this server is for providing guidance so people can figure out issues on their own and then fix future ones. This is not a place to 'show off' by solving others issues for them, especially with (broken) AI code
- another rule of this server is staying on-topic, any messages in a thread should relate to explaining an issue to the poster
- and now a mod with the authourity to have final say is here and i wasted my time typing this.
- if you continue to send AI code you will probably get muted
int = data type (integer)
tag = just a required part of the syntax
"enchants:windcharge" = the name of tag, also needed to get it later
of custom nbt of = tells skript it needs to read from something's custom nbt
... = whatever item you want to set it on/get it from, i.e. player's tool
SkBee allows you to change/get the NBT of things. You can check out the skbee wiki, theres an "NBT intro" page there.
Its just like variables, metadata, or anything else you can set or get.
set (int tag "name" of custom NBT of player) to 10
# both follow a `set X to Y` pattern```
wait i think i understand a bit more now
how would i use nbts in the 1st place i messed around with it once but whatever i did never worked
https://skripthub.net/docs/?id=10691 i use this right?
This expression allows you to grab an item from NBT compounds.
This can be useful when wanting to grab items from file nbt, or nbt of an entity or an inventory holding block (like a chest or furnace).
It can also be useful for creating your own serializing system.
NOTE: Items previously serialized in MC versions 1.20.4 and below, will properly u...
The same way you'd use variables, the only difference is, NBT requires a holder, like an item or entity
No that's something different
take a look here
and here
ill do some messing around ill ping u if i need anything if u dont mind
I don't mind ๐
@shut quail could you figure out a solution?
i lowk took a break
they are working on it, and will come back if they need more guidance... please read
ill be back at it in like 1h
Ok!! I hope you find a solution