Generic Effects
Common effects included in Skript with simple behaviour.

Print

1
print %Object%
2
print "hello"
3
print 6 + 5
4
print {var}
Copied!
This prints a value to the System.out print stream, seen by the system console. This is useful for command-line applications or for checking what the value of something is during testing.
When using ByteSkript as a DSL, there might be a better method of giving information to the user.

Wait For

1
wait [for] %Duration%
2
wait 1 second
3
wait for 50 milliseconds
Copied!
This causes the executor to wait for the given duration before continuing. Code will continue running after the wait is completed.
In some executor models, timing control might be unavailable. For example, waits are not supported when running the verifier entry.

Sleep

1
(sleep|wait|pause)
2
wait
3
sleep
Copied!
This causes the current executor to sleep indefinitely. This is a dangerous effect, since it requires another process to wake it up.
Another background process may wake the executor using the wake effect.
The process may occasionally wake without warning due to system upset, but this is a rare occurrence.
In some executor models, timing control might be unavailable. For example, sleeping is not supported when running the verifier entry.

Wake

1
wake %Thread%
2
wake {process}
Copied!
This attempts to wake the executor of the provided process if it is currently sleeping.
This cannot be used to wake the current process - if it were sleeping the instruction would not run.
This will generally be used to wake up background processes, or in conjunction with the sleep effect to pause execution until something happens.
1
set {thread} to the current process
2
set {var} to a new runnable:
3
print "doing something in the background"
4
wait 10 seconds
5
print "waking up the executor"
6
wake {thread}
7
run {var} in the background // this runs in the background so it won't sleep
8
print "going to sleep"
9
sleep // halts until the wake instruction is called
10
print "somebody woke me up"
Copied!
Copy link