
skLambda
Skript addon that adds lambda functions and listeners to Skript.
Оцените первым
81
3
Список изменений
I've decided to keep working on skLambda, so I'm maintaining the project again. Here's 1.2.0.
skLambda 1.2.0
Supports: Paper 1.21.1+ · Skript 2.15+
New expressions
- Scanned:
%objects% scanned with %lambda%is likereduced, but it keeps every running result instead of only the last one. Give it3, 5, 2and an adding lambda and you get3, 8, 10. Addfrom %value%to start from a seed, which comes out first, so3, 5, 2from 100 gives100, 103, 108, 110. Handy for running balances and cumulative totals. - Zipped:
%objects% zipped with %objects% using %lambda%walks two lists side by side and combines each pair with a two-argument lambda.(1, 2, 3)zipped with(10, 20, 30)and an adding lambda gives11, 22, 33. It stops at the shorter list. - Piped:
pipe %object% through %lambdas%runs a value through a chain of one-argument lambdas, left to right, feeding each result into the next one.pipe 5 through {_inc}, {_double}is the same as calling double on the result of inc. Anything in the list that isn't a lambda is skipped. - Page / Window:
page N of %objects% by Scuts a list into chunks of S and hands you the Nth one (1-based). The last page can be shorter, and a page past the end is empty.window N of %objects% by Sslides one element at a time instead, so window 1 is items 1 to S and window 2 is items 2 to S+1. Good for paging a list into a GUI. - Page count / Window count:
page count of %objects% by Sis how many pages the list splits into, rounded up so a partial last page still counts.window count of %objects% by Sislength - S + 1. Loop over the count to fill a menu. - Listener cooldown:
cooldown of %listener%(or%listener%'s cooldown) reads thecooldown:you set on a listener, and you can change it from outside with set, add, and remove. Set it to zero to turn the cooldown off. - Listener owner:
owner of %listener%(or%listener%'s owner) gives back the owner you tied a listener to withowner:, or nothing if it has none.
New conditions
- Counting quantifiers:
at least N of,at most N of, andexactly N of %objects% passescheck how many predicates in a list pass, not just all of them or none.if at least 2 of {requirements::*} passes for {_p}:is true when two or more hold. They sit right next to the existingall of/any of/none offorms.
New effect
- Pause / resume by owner:
pause all listeners owned by %object%freezes every listener tied to that owner in one line, andresume all listeners owned by %object%brings them back. Same idea asunregister all listeners owned by, except it only pauses instead of stopping them for good.
Improvements
- Default parameters: a lambda parameter can carry a default,
lambda (n: number = 1) -> number:. When the caller leaves that argument off, the default fills in. Only trailing arguments can be skipped, socall {_f} with 10on a two-parameter lambda uses the default for the second one. - Options work inside listen entries: script
options:like{@grace}now expand inside alistensection, so you can writecountdown: {@grace}orcooldown: {@debounce}and reuse one value across listeners. They used to be left as raw text and fail to parse.
Файлы
skLambda-1.2.0.jar(174.79 KiB)
ОсновнойМетаданные
Канал релиза
Release
Номер версии
1.2.0
Загрузчики
PaperPurpur
Версии игры
1.21–26.1.2
Загрузок
23
Дата публикации
07.06.2026
