Olyno/skent

Content of file giving an error

Closed this issue · 2 comments

Describe your problem

When getting the content of a file, an error is sent in the console.
When a line is empty, it returns <none> and gives an error.

Versions

Skript: 2.5.3
Server: git-Paper-534 (1.16.5)
Skent: 3.0.0

Code

    loop (content of file path loop-value):
      add 1 to {_Fi}
      if {_Fi} is 6:
        stop loop
      if length of loop-value-2 is more than 32:
        add "&7[%{_Fi}%] %first 32 characters of loop-value-2%..." to {_content::*}
      else:
        add "&7[%{_Fi}%] %first 32 characters of loop-value-2%" to {_content::*}

Error

https://pastebin.com/JrpyW1j3

After a bit more testing, I've realized that looping the content gives an error.
Specifically .jar.

Olyno commented

You can't loop the content of a file, because it gives you the content, so a string. You can't loop a string. If you want to loop each line of a file, simply loop all lines of file path loop-value