#can someone explain to me or give me a example of how to parse from a string

1 messages ยท Page 1 of 1 (latest)

shut quail
#

pls

spark sinew
#

"whatever" parsed as DATATYPE

#

"1" parsed as integer

shut quail
honest oyster
#

You are welcome. The community is meant for helping people.

  • Skript heroes.
shut quail
#

o

#

bru can u resend that i wasnt done reading ๐Ÿ˜ญ

honest oyster
#

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

shut quail
#

all g hopefully i can figure this out within a couple tries

#

wml

honest oyster
spark sinew
#

buddy thats AI-generated

honest oyster
#

Why do you say that?

spark sinew
#

spoon-feeding AI code doesnt make you look smart

honest oyster
#

??? What

flint marlin
#

remember your "best among the forum" chess script from yesterday that was AI

honest oyster
#

What script?

flint marlin
#

It's obvious

#

Yeah yeah you deleted the post after I called you out

honest oyster
#

You think it is ai just because it os well written?

flint marlin
#

It's not

#

It's made by AI

honest oyster
#

I have no chess system or such a thing

flint marlin
#

It's obvious

honest oyster
#

??

flint marlin
honest oyster
#

Why do you say so?

spark sinew
#

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

honest oyster
#

Because he asked an explanation

flint marlin
#

there's also use of non-existant syntax (like your chess script yesterday)

spark sinew
#

and it also assigns local variables to everything even when its not needed

honest oyster
#

And I told him that it was going to be inside the code

shut quail
#

thas cool n all but
how would i do sum like this -_-

flint marlin
#

We can argue on this all you like, it's obvious that it's AI code, it wouldn't even parse

#

SEE

spark sinew
#

perfect timing

honest oyster
#

Non existant? You are saying that my code is ia made because it is well written?

flint marlin
#

lmao

#

you're a funny guy

#

Now stop, AI code is not permitted here

spark sinew
# shut quail thas cool n all but how would i do sum like this -_-

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

honest oyster
#

I dont understand yet why do you say it is ai

flint marlin
#

Because it IS

#

It's so obvious

spark sinew
honest oyster
#

I will dm buddy, it is getting weird

flint marlin
#
  1. comments
  2. overusing locals
  3. made up syntax
  4. doesn't parse
spark sinew
#

and the code doesnt work

flint marlin
#

I wouldn't be surprised if he suddenly deleted all his messages here too

honest oyster
#

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

flint marlin
#

You're not a hero, you're giving people bad, non-functional AI code

shut quail
flint marlin
#

Use NBT

shut quail
# flint marlin Use NBT

Yea idk how to do that at all ๐Ÿ˜ญ theres a couple things i never even knew about until recently

dense plover
flint marlin
#

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

shut quail
#

this is skbee yea?

flint marlin
#

What part of it

flint marlin
shut quail
spark sinew
# honest oyster They called me out because i tried to help someone in another post sending a ful...
  1. You literally made-up this "skript-heroes" term a few hours ago.
  2. Yes, it was spoon-feeding. It's literally defined as giving a full solution and telling them to copy and paste it.
  3. 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
  1. another rule of this server is staying on-topic, any messages in a thread should relate to explaining an issue to the poster
  2. 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
flint marlin
#

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

spark sinew
# shut quail jus aboutt all of the above

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```
shut quail
#

how would i use nbts in the 1st place i messed around with it once but whatever i did never worked

#
flint marlin
#

The same way you'd use variables, the only difference is, NBT requires a holder, like an item or entity

flint marlin
shut quail
#

ill do some messing around ill ping u if i need anything if u dont mind

flint marlin
#

I don't mind ๐Ÿ˜„

honest oyster
#

@shut quail could you figure out a solution?

shut quail
#

i lowk took a break

spark sinew
shut quail
#

ill be back at it in like 1h

honest oyster