This tutorial is set by the author to use the CC By-NC-SA protocol.
The delay function provided by ZENUTILS gives a little more direction of the script. Since no one introduces this site, I will introduce it.
example:
Events.onplayerLoggedinVal Player as iPlayer = Event.player;
If (event.player.world.remote) Return; // No need to say)))))))
Event.player.World.cateenation () // Create a new connection
. RUN (FUNCTION (World, Context) {
Print ("The Start of Catenation");
Context.data = world.time; // Data is IDATA type. You need to convert int and long to IDATA
})
.Sleep (200) // This connection will "sleep" 200t and trigger 20t as 1S
// The method is similar to the run method
.Then (function (world, context) {
Player.SendMessage ("The MESSAGE is Shown 10 Seconds after the Player Logs In");
Player.SendMessage ("You Logged at World Time" ~ context.data.asstring ());
})
.Sleepuntil (function (world, context) {// through the conditions of if judgment to determine whether to execute the next
Return world.raining; // Judging whether it is raining
})
.Then (function (world, context) {
Player.sendmessage ("It is raining!");
})
.Stopwhen (function (world, context) {// Through the condition of if judgment to determine whether to execute the next (false)
Return! Player.alive; // Judging whether the player is alive
})
// Start this connection, of course you have to start, otherwise what do you do?
.Start ();});
function:
Use world.cateenation () Create a guide package:
mods.zenutils.icatenationBuilder
method:
iCateNationBuilder Run (iworldFunction function);
What is the function to do
iCatencebuilder Sleep (long ticks);
"Sleep" after a period of time triggers
iCateNationBuilder Sleepuntil (IWorldCondition Condition);
Never trigger the next, until the conditions are met
iCatenceBuilder Stopwhen (IWorldCondition Condition);
I will not trigger the next until the condition is not met
iCatenceBuilder then (iworldFunction function)
The same as RUN
catening start ();
Create or start
Title:
With this stuff, there are also increased places ~~~
The logic of the method in this function must be correct
for example
. RUN (FUNCTION (World, Context) {
Print ("The Start of Catenation");
Context.data = world.time;
})
.Sleep (200)
This will not play a role of delay
Before the .sleep (200) and then .Run (function (world, context) {..............}) can be delayed for 10 seconds before triggered the content in Run
I feel that I am a fool. Do not make mistakes by doing tutorials by myself. After checking the mistakes for a long time, I think of this precautions.
Brothers, do n’t learn me (cry)