Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Suggestion] Loaded add-on conditional syntax #1449

Closed
ShaneBeee opened this issue Aug 7, 2018 · 5 comments
Closed

[Suggestion] Loaded add-on conditional syntax #1449

ShaneBeee opened this issue Aug 7, 2018 · 5 comments
Labels
completed The issue has been fully resolved and the change will be in the next Skript update. enhancement Feature request, an issue about something that could be improved, or a PR improving something. priority: lowest "Nice to have" updates that are not required (tiny low impact bug fixes or QoL enhancements).

Comments

@ShaneBeee
Copy link
Contributor

Idea:

I was thinking it would be cool, if there was a condition, that could tell if a certain add-on was loaded, and if it wasn't, it would ignore all syntax written after that condition.

Reason behind this:

A few times, I have written Skripts to post publicly, but though, hey, what if the person downloading doesn't like this add-on, and doesn't want to use this portion of my Skript. (ex. My FlyCard Skript has a scoreboard... one user may not care about the scoreboard, and prefer to not use the Skellett add-on) Well rather than them having to manually delete this section of the Skript, it would just ignore it if the add-on wasn't loaded. As of right now if I have written code, and the add-on isn't there/loaded, then clearly it'll run a ton of errors in the console saying that expression does not exist.

Example:

If addon named "skellett.jar" is loaded:
    #do something
else:
    #do something else
    send "You need Skellett for this Skript to function properly" to console

or

if addon "skellett" is loaded:
    #do something

In the first example if the add-on isn't loaded, it would run something else.
In the second example, it would just ignore the code if Skellett wasn't loaded.

Other Info:

I know that certain add-ons have version numbers, etc in their file names, which could make this harder to make. Maybe rather than just looking for the exact name, maybe look for what's in the quotes (ex: "skellett") would be contained in the name, not just the full name itself.

ex:

if addon with name containing "skellett" is loaded:
    #do something

Just a few ideas of how it could be done.
Thank you for reading :)

@TPGamesNL
Copy link
Member

I think it's possible to get the addon's name without using it's file name (the name is coded in the plugin)

@ShaneBeee
Copy link
Contributor Author

ShaneBeee commented Aug 7, 2018

Ah right duh... that makes sense
EDIT: To add to that, i'm just throwing out some ideas here :)

@Nicofisi
Copy link
Member

Nicofisi commented Aug 7, 2018

Already mentioned in #1291

Not sure if I should close this or rather remove it from that list

@TheBentoBox
Copy link
Member

TheBentoBox commented Aug 7, 2018

I personally think removing from the other list makes more sense @Nicofisi, it's easier at a glance to see specific suggestions when they're separated instead of in some list within a specific issue, and it'll also generally have more detail on its own post 👍

@TheBentoBox TheBentoBox added enhancement Feature request, an issue about something that could be improved, or a PR improving something. priority: lowest "Nice to have" updates that are not required (tiny low impact bug fixes or QoL enhancements). labels Aug 7, 2018
@ShaneBeee
Copy link
Contributor Author

ShaneBeee commented Aug 7, 2018

Nico when you said its a duplicate, I guess it half is... See what Im proposing is not just a loaded addon condition, but.... that PLUS skript ignoring the code written after it, if it's not loaded.
Because right now for example, lets say I write

on break:
    #skellett code here

If skellett isnt loaded, it'll give me an error saying that expression isnt recognized.
So my proposal is that Skript would simply ignore the syntax if it the condition was checking for skellett being loaded, and if skellett wasnt loaded, it would ignore the code, and not run error in the console
something like:

on break:
    if addon "skellett" is loaded:
        #Skellett code here

@TPGamesNL TPGamesNL added the PR available Issues which have a yet-to-be merged PR resolving it label Mar 23, 2021
This was referenced May 23, 2021
@APickledWalrus APickledWalrus added completed The issue has been fully resolved and the change will be in the next Skript update. and removed PR available Issues which have a yet-to-be merged PR resolving it labels Jun 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
completed The issue has been fully resolved and the change will be in the next Skript update. enhancement Feature request, an issue about something that could be improved, or a PR improving something. priority: lowest "Nice to have" updates that are not required (tiny low impact bug fixes or QoL enhancements).
Projects
None yet
Development

No branches or pull requests

5 participants