Un-expand sidebar

AmazinAxel

Upcoming vim user

🚧 Under construction 🚧

Please revisit later when this website is completed. In the meantime, visit my Journal site for up-to-date information.
Expect some site features to be missing or broken.



What I'm writing about

Passing variable indices from Skript functions

When setting custom index values on a list in Skript, one may encounter that you cannot pass custom indices by default. When using a Skript function, all indices are defaulted back to '1, 2, 3 ...'. Remapping indices back into a list w/ Skript Functions may only pass one list, so the indices and the list content must be combined into one. You can use use a string seperator to differentiate between indices and values. Here's an approximation of this concept: # A function can only return one list, and it doesn't retain indices function returnIntValues() :: objects: set {_list::200} to andquot;custom value 1andquot; set {_list::400} to andquot;custom value 2andquot; # Returned as one concatenated object return indices of {_list::*}, andquot;seperatorandquot;, and {_list::*} function test(): loop returnIntValues(): # Differentiate between list element type if loop-value is andquot;seperatorandquot;: set {_getElements} to true continue 1st loop if {_getElements} is true: add loop-value to {_items::*} else: add loop-value to {_indices::*} loop {_indices::*}: # Combine elements into list w/ retained indices set {_finalList::%loop-value%} to {_items::%loop-iteration%} loop {_list::*}: set {_finalList::%{_indices::%loop-iteration%}%} to loop-value # {_finalList::*} is now the original list with indices broadcast {_finalList::200} # Expected output: 'custom value 1' # Expected output: indices: '200 and 400 -- items: custom value 1 and custom value 2' broadcast andquot;indices: %indices of {_finalList::*}% -- items: %{_finalList::*}%andquot;...

GitHub Repos

dead-link-detector

Workers script to periodically check a website for dead links

Git icon

0

Git icon

0

Git icon

0

discord-message-formatter

📒 Simple Workers script to format Discord messages as embeds

Git icon

0

Git icon

0

Git icon

0

mk-help-bot

Git icon

0

Git icon

0

Git icon

0

Shootout

🔫Gunslinger dueling server featuring custom guns, 1v1 & 2v2 duels and FFA

Git icon

0

Git icon

0

Git icon

0

©2016-2024 AmazinAxel (Alec) • All Rights Reserved

You aren't tracked here - have a nice day