SkCheese

Addon SkCheese 1.3

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

erenkara

Addon Developer
Jan 4, 2022
57
4
18
18
erenkara submitted a new resource:

SkCheese - The smelliest Skript addon.

SkCheese is an addon that adds 2 new functionalities to Skript.

1) Switch Cases

A switch case is a multi-way branch statement. Based on the value of the expression given, different parts of code can be executed quickly. Unlike your average else if tree, a switch case directly jumps to the code instead of going through each condition one by one. This comes...


Read more about this resource...
 
I would like to start with thanking you for this wonderfull addon, it was something that I was looking for.

There is any chance of adding a default option to switch statement?

Code:
switch {game::state}:
    case "running":
        //code
    
    default:
        //code running in case of not meeting any case
 
I would like to start with thanking you for this wonderfull addon, it was something that I was looking for.

There is any chance of adding a default option to switch statement?

Code:
switch {game::state}:
    case "running":
        //code
   
    default:
        //code running in case of not meeting any case
hello, yes this is planned but no ETAs on when it will come out.
 
What can you do with SkCheese? You said switching but switching what?
switch is a keyword in a lot of languages that lets you run a block of code depending on the value
its like using lots of else if after one another but unlike else if it skips to that block of code instantly rather than trying each condition
they have other differences too though

Code:
set {_var} to 2
switch {_var}:
  case 1:
    broadcast "var is 1"
  case 2:
    broadcast "var is 2
  case {_a}: # wouldn't work, you can only use literals here
    broadcast "var is a"

# vs. else if

set {_var} to 2
if {_var} is 1:
  broadcast "var is 1"
else if {_var} is 2:
  broadcast "var is 2"
else if {_var} is {_a}: # unlike switch, this would work
  broadcast "var is a"
while "else if" checked if {_var} is 1 then skip to the next one, the switch section instantly skips to that part of the code without even checking if its 1
but it comes with the cost of not being able to use variables or other non-literal values
 
so SkCheese just replaces else if with case (integer)?
it doesn't exactly replace it, its just another way of doing conditions
and it doesn't have to be an integer
Code:
set {_var} to "ab"
switch {_var}:
  case "ab":
    broadcast "its ab!!"
 
it doesn't exactly replace it, its just another way of doing conditions
and it doesn't have to be an integer
Code:
set {_var} to "ab"
switch {_var}:
  case "ab":
    broadcast "its ab!!"
ah ok! So could you do
Code:
case {_var}
?
 
Also how did you get the Addon Tag and the download button on this page?
You can add the addon tag if your resource is well, an addon
for the download button you just upload the file to skunity rather than having an external download
 
ah ok! So could you do
Code:
case {_var}
?
no you cant, case only accepts literal values
{_var} could be anything when the code is ran so its a non-literal

literal examples: 5, "hello", string, 2.5
non-literal examples: {_var}, player's ping, 4 + {_var}
 
no you cant, case only accepts literal values
{_var} could be anything when the code is ran so its a non-literal

literal examples: 5, "hello", string, 2.5
non-literal examples: {_var}, player's ping, 4 + {_var}
got it
 
erenkara updated SkCheese with a new update entry:

The Cheesy Update - 1.1

- New resource page, icon, banner
- Syntaxes are now available on SkriptHub docs and the Github wiki
- Added 'variable tree' expression
- Added 'parsed as type' expression
- Added 'reverted boolean' expression
- Added 2 new effects for labels (a.k.a. goto)
- Added 2 new conditions for reverting a condition and checking if a list of booleans are all true
- The config code was rewritten, if you used SkCheese before you may need to delete your config
- Switch cases were rewritten and it is now...

Read the rest of this update entry...
 
erenkara updated SkCheese with a new update entry:

Update 1.2

- Added 'future' syntaxes. They can be used to wait for an event in the middle of your code such as waiting for a chat input.
- Added multi-line string section.
- Renamed 'reverted condition' to 'if not'.
- The 'if not' and 'all true?' conditions are now seperate in the config.

For more info, please check the GitHub wiki or SkriptHub documentation. If something is unclear or you have issues, contact me on the support Discord.

Take care!!!

Read the rest of this update entry...
 
erenkara updated SkCheese with a new update entry:

Update 1.3

- Added wrapped lists, see the documentation or the wiki to learn more.
- Fixed the Future type being registered despite being disabled.
- Now available on SkUnity docs.
- Fixed typos and a small bug related to the config.
- Slightly changed 'if not' syntax because it was misleading.
- Added update checker. (console message only)

Read the rest of this update entry...