Search and retrieve keyword to retrieve from list

  • 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.

JJKing42

Member
Jun 5, 2022
2
0
1
30
PLEASE DO NOT REACT TO ANYTHING BUT THE FINAL QUESTION
Don't get confused by the long intro, i'm simply attempting to describe my idea, current problem and thought process. Before finally asking the one question i have deduced will allow me to succeed.
INTRO BELOW



Basicly what i'm imagining is:

First i create a list of discord members nicknames (their IGN) and their discord mention tags (using DiSky, wich isn't relevant to my question though.)
{mention::<name>}
{mention::<name>::tag}

on chat:
loop all players: *1
if message contains "@":
if message contains loop-player:
post {mention::<loop-player>::tag} in discord channel

*1 at this point any player should relate to a specific entry on my mention list

I'm failing at retrieving the name of the player from the loop. And i barely grasp the idea of looping in the first place. The curse of learning by trial and error i guess. But searching docs for ''looping'' isn't very helpful either. i see a alot of uses in examples where a loop-player is recalled as an expression, but never one that is able to compare a loop value to a player name, and then print that players name as good old text and use it to recall a certain value.

My inspiration for a similar system is my advancement announcement script.
It uses advancementsaddon, and skript-yaml, (yaml because i had to manually enter the simple name of every advancement)
to get the namespaced key
> store it as variable1
> set variable2 to the value of variable1 within .yaml
if variable2 is set (because recipes aren't on there and don't need announcement)
> post "%player% has completed the advancement %variable2%" in discord channel

-And considering that it works, and skript-reflect was unable to obtain the names, because they are not stored in bukkit. This is a massive success.


FINAL QUESTION:
- But how would i set my mentionvariable1 to the name of the loop-player that [message] contained?
 
Last edited:
Status
Not open for further replies.