i don't understand why it gives me an error

  • 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!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

Duoquote

Member
May 26, 2018
3
0
0
23
I am trying to put this text file:

code_language.skript:
hello
this
is
---
a
test

into pages::%pagecount% variable where "---" means a new page but it's not working. I am curious about whether we can put %variable% in another {variable::%variable%} or not.

code_language.skript:
on load:
    set {text::*} to file contents of "help/texts.txt"
    set {pagecount} to 1
    loop {text::*}:
        if {text::%loop-index%} is "---":
            set {page::%pagecount%} to join {thiss::*} with "%newline%"
            set {thiss::*} to ""
            add 1 to {pagecount}
        else:
            add {text::%loop-index%} to {thiss::*}
 
This is the last state of the code:
code_language.skript:
on load:
    set {text::*} to file contents of "help/texts.txt"
    set {pagecount} to 1
    loop {text::*}:
        if loop-value is "---":
            set {page::%pagecount%} to join {thiss::*} with "%newline%"
            set {thiss::*} to ""
            add 1 to {pagecount}
        else:
            add loop-value to {thiss::*}
I am getting this error:
upload_2018-5-27_2-7-32.png
 
;_; That fixed it but got another problem:
upload_2018-5-27_2-27-6.png

code_language.skript:
on load:
    set {text::*} to file contents of "help/texts.txt"
    set {pagecount} to 0
    loop {text::*}:
        if loop-value is "---":
            set {page::%{pagecount}%} to join {thiss::*} with "%newline%"
            set {thiss::*} to ""
            add 1 to {pagecount}
        else:
            add loop-value to {thiss::*}
 
Status
Not open for further replies.