Events
Last updated
Last updated
Since 3.0 version all events are fully (almost) compatible. To use them in your script, simply do this trick:
Get the name of event from the API. Let's say DisbandClanEvent
.
Then, separate it and write on lower case like so: disband clan
(don't add event
word!)
That's it! Now you can use it in your script.
This trick works with each event in the API. Let me show one more examples:
HomeRegroupEvent -> on home regroup
PlayerHomeClearEvent -> on player home clear
PreCreateClanEvent -> on pre create clan
etc.
One exception here is ChatEvent. The right format is on clan player chats
(to not confuse with denizen one)
It's actually almost the same trick as it was with the events:
Look for the event's method from the API. Let's take ClanBalanceUpdateEvent#getBalance.
Just remove get
and you're ready!
And from now I should disappoint you a bit: it's not fully compatible with some contexts. Look at the following table:
Context | Value from API | SCDenizenBridge return |
---|---|---|
Don't forget that SCDenizenBridge 3.0.1 doesn't support events from 2.1! If you used 2.1 you will be forced to rewrite all your scripts to the latest format.
Event | Contexts |
---|---|
clan ally add
first_clan, second_clan
clan ally remove
first_clan, second_clan
clan balance update
clan, clan_balance, clan_new_balance, updater_name, updater_balance
clanplayer chat
sender, message, receivers
clan create
clan
clan disband
clan
clanplayer home regroup
clan, issuer
clanplayer home set
location, clan, clanplayer
clanplayer demote
clan, clanplayer
clanplayer join
clan, clanplayer
clanplayer kick
clan, clanplayer
clanplayer kill
attacker, victim
clanplayer promote
clan, clanplayer
clanplayer teleport
clanplayer, origin, destination
pre clan create
tag, name
pre rank create
clan, rank_name
clan rival add
first_clan, second_clan
clan rival remove
first_clan, second_clan
clan tag change
tag, clan
clan war end
first_clan, second_clan, reason
frame (<frame>) open
frame