how to make : on skript event ?

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

aeim

Member
Feb 21, 2017
38
5
8
27
Hey, it's possible to know when an Event is executed (events from .sk) and get the name of this event ?

Skript-mirror :

code_language.skript:
on "ch.njol.skript.events.bukkit.SkriptStartEvent":
    broadcast "1) an event started" #No broadcast
    set {_e} to event
    broadcast "%{_e}%"

on "ch.njol.skript.events.bukkit.ScriptEvent":
    broadcast "2) an event started" #No broadcast



I try to have the equivalent of this for events (ONLY .sk event, addon include) :
code_language.skript:
on command:
    command is not "execute" or "particle" or "tp" or "testfor" or "effect" or "weather"
    broadcast "%command%"
 
Just wondering, for what would you use something like this?
 
In real life, I'm graduate of video making , I work with Adobe After Effect.
I would like to try something with the last version of AE which allow to use .json files for coding something very special (coding in AE).

I would like to know how to make : on skript event (and get the name of the event)
for making my special .json and import him in AE.

At the end, it will be an abstract representation of my server inside AE.

I have 10140 lines of skript .sk, I will export them into AE
 
Last edited:
I have completely no idea, but maybe something like this will work:
code_language.skript:
set {_e} to event.getSimpleName()
 
I have completely no idea, but maybe something like this will work:
code_language.skript:
set {_e} to event.getSimpleName()
code_language.skript:
on "ch.njol.skript.events.bukkit.SkriptStartEvent":
    broadcast "1) an event started" #IS NEVER BROADCAST

The broadcast never appear so I can't do anything ...
Note : (skript-mirror/console does not show any error)
 
You cannot listen to the SkriptStartEvent because Skript does not pass it through Bukkit's event manager. Use "on script load" instead.

There is no way to listen to all events.
 
Arf :emoji_frowning: it's too bad ...

So ... I will use another method

Is it possible to get more informations about the event ? :

code_language.skript:
effect AEskript [%-object%]:
    trigger:
        broadcast "%event.getClass()%"
        broadcast "%event.getHandlers()%"
       
command /ttt:
    trigger:
        AEskript
every 5 second:
    AEskript
    execute console command "/ttt"
every 1 second:
    AEskript

This code work, %event.getHandlers()% give me an ID for each class but not each event (= 2 events with the same class give the same ID)

It's possible to get a very Unique ID for each event ? (or I have to do it by using [%-object%] but it will be very long to do with my 177 triggers)

EDIT:
It could be helpfull to add this event into SkriptLang ^^
Event : on Skript event: (An event called every time when an event from .sk is executed, but not for bukkit/no-skript event, ONLY SKRIPT AND HIS ADDONS)
with expressions :
event-[full ](syntax|pattern) exemple return : "[(right|left)[( |-)]][mouse[( |-)]]click[ing] [on %entity type/item type%] [(with|using|holding) %item type%]"
event-name exemple return : "on rightclick holding a fishing rod"
event-class exemple return : "org.bukkit.event.player.PlayerInteractAtEntityEvent"
event-UID exemple return : "main_287" if the event is in the file main.sk at the line 287 (this allow to make a difference between multi same event)
event-plugin exemple return : "skript"
 
Last edited:
Status
Not open for further replies.