Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $nomention
- $onlyIf[$and[$checkContains[$customID;novel]==true;$checkContains[$customID;$authorID]==true]==true;]
- $jsonParse[
- {
- "novel":$getVar[novel;$authorID]
- }
- ]
- $httpGet[$json[novel;link]]
- $jsonParse[
- {
- "novel":$getVar[novel;$authorID],
- "link":$httpResult
- }
- ]
- $var[page;$json[novel;page]]
- $var[chapter;$json[novel;chapter]]
- $if[$customID==novel read $authorID]
- $removeButtons
- $jsonSet[novel;chapter;0]
- $jsonSet[novel;page;0]
- $setVar[novel;$json[novel];$authorID]
- $addButton[no;novel prev $authorID;Prev;secondary]
- $addButton[no;novel next $authorID;Next;secondary]
- $addButton[no;novel jump $authorID;Jump to;secondary]
- $elseif[$customID==novel next $authorID]
- $if[$sum[1;$json[novel;page]]>=$jsonArrayCount[link;chapter;$json[novel;chapter];page]]
- $jsonSet[novel;page;0]
- $jsonSet[novel;chapter;$sum[$var[chapter];1]]
- $else
- $jsonSet[novel;page;$sum[$var[page];1]]
- $endif
- $setVar[novel;$json[novel];$authorID]
- $elseif[$customID==novel prev $authorID]
- $if[$and[$sum[$var[chapter];1]>1;$sum[1;$var[page]]<=1]==true]
- $jsonSet[novel;chapter;$sub[$var[chapter];1]]
- $jsonSet[novel;page;$sub[$jsonArrayCount[link;chapter;$json[novel;chapter];page];1]]
- $else
- $jsonSet[novel;page;$sub[$var[page];1]]
- $endif
- $setVar[novel;$json[novel];$authorID]
- $elseif[$customID==novel jump $authorID]
- $newModal[novel mjump $authorID;Jump to]
- $addTextInput[chapter;short;Chapter;1;4;yes;;Current: $var[chapter] of $json[link;chapters]]
- $addTextInput[page;short;Page;1;4;yes;;Current: $sum[$var[page];1] of $jsonArrayCount[link;chapter;$json[novel;chapter];page]]
- $elseif[$customID==novel mjump $authorID]
- $if[$and[$input[page]<=$jsonArrayCount[link;chapter;$input[chapter];page];$input[page]>=1]==true]
- $if[$and[$input[chapter]<=$json[link;chapters];$input[chapter]>=1]==true]
- $deleteMessage[$channelID;$messageID]
- $jsonSet[novel;chapter;$sub[$input[chapter];1]]
- $jsonSet[novel;page;$sub[$input[page];1]]
- $addButton[no;novel prev $authorID;Prev;secondary]
- $addButton[no;novel next $authorID;Next;secondary]
- $addButton[no;novel jump $authorID;Jump to;secondary]
- $else
- $var[error;true]
- $ephemeral
- There is only $json[link;chapters] chapters in this novel.
- $endif
- $else
- $var[error;true]
- $ephemeral
- There is only $jsonArrayCount[link;chapter;$input[chapter];page] pages in chapter $input[chapter].
- $endif
- $setVar[novel;$json[novel];$authorID]
- $endif
- $if[$and[$sum[$json[novel;chapter];1]>1;$sum[1;$json[novel;page]]<=1]==true]
- $editButton[novel prev $authorID;Prev Ch;secondary;no]
- $elseif[$sum[1;$json[novel;page]]<=1]
- $editButton[novel prev $authorID;Prev;secondary;yes]
- $else
- $editButton[novel prev $authorID;Prev;secondary;no]
- $endif
- $if[$and[$sum[1;$json[novel;page]]>=$jsonArrayCount[link;chapter;$json[novel;chapter];page];$json[link;chapters]>$sum[$json[novel;chapter];1]]==true]
- $editButton[novel next $authorID;Next Chapter;secondary;no]
- $elseif[$and[$sum[1;$json[novel;page]]>=$jsonArrayCount[link;chapter;$json[novel;chapter];page];$json[link;chapters]<=$sum[$json[novel;chapter];1]]==true]
- $editButton[novel next $authorID;End;secondary;yes]
- $else
- $editButton[novel next $authorID;Next;secondary;no]
- $endif
- $if[$var[error]!=true]
- $author[$username]
- $authorIcon[$authorAvatar]
- $title[Chapter $sum[$json[novel;chapter];1] of $json[link;chapters] - $json[link;chapter;$json[novel;chapter];title]]
- $description[$json[link;chapter;$json[novel;chapter];page;$json[novel;page]]]
- $if[$sum[1;$json[novel;page]]>=$jsonArrayCount[link;chapter;$json[novel;chapter];page]]
- $footer[Page $sum[1;$json[novel;page]] of $jsonArrayCount[link;chapter;$json[novel;chapter];page] - End of Chapter $sum[$json[novel;chapter];1]]
- $else
- $footer[Page $sum[1;$json[novel;page]] of $jsonArrayCount[link;chapter;$json[novel;chapter];page]]
- $endif
- $if[$json[link;chapter;$json[novel;chapter];notes;$json[novel;page]]!=]
- $jsonParse[
- $json[link;chapter;$json[novel;chapter];notes;$json[novel;page]]
- ]
- $title[$json[title];2]
- $description[$json[description];2]
- $thumbnail[$json[thumbnail];2]
- $color[#c9c7c7;2]
- $endif
- $endif
Advertisement
Add Comment
Please, Sign In to add comment