Solved Lore Help Request

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

jackass

Member
Nov 8, 2017
16
0
0
23
Hello! I was making a skript and I have come across one fairly awkward problem.

I have an event such as

On right click:
if name of held item is "placeholder" Example skript, not correctly spaced.
set {example.place} to the number in the lore of held item.

But I could not set {example.place} to the number because I did not know how. What I want {example.place} to be https://gyazo.com/ef264119a7340aee83e11f199361eab1.

I also was wondering If I could change this number such as

replace {example.place} in the lore of held item to "placeholder number or word"
 
I would recommend parsing the lore in the following way:

code_language.skript:
on rightclick on red dye:

  if display name of event-item is "<bold><light red>TNT Pounch":

    set {_lore::*} to event-item's lore # use `event-item's lore split by "||"' if you're using skQuery

    loop {_lore::*}:
   
      set {_value} to uncolored loop-value parsed as "Contains: %number%/Unlimited"
      if {_value} is set:
        exit loop
# Now, {_value} contains that number

# By the way, if you know that it is always going to be the first line of the lore, you can skip the loop and do it this way

set {_line} to 1st line of event-item's lore
set {_value} to uncolored {_line} parsed as "Contains: %number%/Unlimited"
 
Thanks a bunch
[doublepost=1529627008,1529626767][/doublepost]
I would recommend parsing the lore in the following way:

code_language.skript:
on rightclick on red dye:

  if display name of event-item is "<bold><light red>TNT Pounch":

    set {_lore::*} to event-item's lore # use `event-item's lore split by "||"' if you're using skQuery

    loop {_lore::*}:
  
      set {_value} to uncolored loop-value parsed as "Contains: %number%/Unlimited"
      if {_value} is set:
        exit loop
# Now, {_value} contains that number

# By the way, if you know that it is always going to be the first line of the lore, you can skip the loop and do it this way

set {_line} to 1st line of event-item's lore
set {_value} to uncolored {_line} parsed as "Contains: %number%/Unlimited"
I'm fairly new to skript/skq. What does the uncolored loop-value, or just uncolored mean?
 
Thanks a bunch
[doublepost=1529627008,1529626767][/doublepost]
I'm fairly new to skript/skq. What does the uncolored loop-value, or just uncolored mean?
Since the lore has colors, and the parse format has to be exact, I just remove them from the text so I don't have to specify any colors anywhere.
 
Status
Not open for further replies.