AlferZep

Untitled

Apr 13th, 2024
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.07 KB | None | 0 0
  1. $nomention
  2. $onlyIf[$and[$checkContains[$customID;novel]==true;$checkContains[$customID;$authorID]==true]==true;]
  3.  
  4. $jsonParse[
  5. {
  6. "novel":$getVar[novel;$authorID]
  7. }
  8. ]
  9.  
  10. $httpGet[$json[novel;link]]
  11.  
  12. $jsonParse[
  13. {
  14. "novel":$getVar[novel;$authorID],
  15. "link":$httpResult
  16. }
  17. ]
  18.  
  19. $var[page;$json[novel;page]]
  20. $var[chapter;$json[novel;chapter]]
  21.  
  22. $if[$customID==novel read $authorID]
  23. $removeButtons
  24.  
  25. $jsonSet[novel;chapter;0]
  26.  
  27. $jsonSet[novel;page;0]
  28.  
  29. $setVar[novel;$json[novel];$authorID]
  30.  
  31. $addButton[no;novel prev $authorID;Prev;secondary]
  32. $addButton[no;novel next $authorID;Next;secondary]
  33. $addButton[no;novel jump $authorID;Jump to;secondary]
  34.  
  35. $elseif[$customID==novel next $authorID]
  36.  
  37. $if[$sum[1;$json[novel;page]]>=$jsonArrayCount[link;chapter;$json[novel;chapter];page]]
  38. $jsonSet[novel;page;0]
  39. $jsonSet[novel;chapter;$sum[$var[chapter];1]]
  40. $else
  41. $jsonSet[novel;page;$sum[$var[page];1]]
  42. $endif
  43.  
  44. $setVar[novel;$json[novel];$authorID]
  45.  
  46. $elseif[$customID==novel prev $authorID]
  47.  
  48. $if[$and[$sum[$var[chapter];1]>1;$sum[1;$var[page]]<=1]==true]
  49. $jsonSet[novel;chapter;$sub[$var[chapter];1]]
  50. $jsonSet[novel;page;$sub[$jsonArrayCount[link;chapter;$json[novel;chapter];page];1]]
  51. $else
  52. $jsonSet[novel;page;$sub[$var[page];1]]
  53. $endif
  54.  
  55. $setVar[novel;$json[novel];$authorID]
  56.  
  57. $elseif[$customID==novel jump $authorID]
  58.  
  59. $newModal[novel mjump $authorID;Jump to]
  60. $addTextInput[chapter;short;Chapter;1;4;yes;;Current: $var[chapter] of $json[link;chapters]]
  61. $addTextInput[page;short;Page;1;4;yes;;Current: $sum[$var[page];1] of $jsonArrayCount[link;chapter;$json[novel;chapter];page]]
  62.  
  63. $elseif[$customID==novel mjump $authorID]
  64.  
  65. $if[$and[$input[page]<=$jsonArrayCount[link;chapter;$input[chapter];page];$input[page]>=1]==true]
  66. $if[$and[$input[chapter]<=$json[link;chapters];$input[chapter]>=1]==true]
  67. $deleteMessage[$channelID;$messageID]
  68. $jsonSet[novel;chapter;$sub[$input[chapter];1]]
  69. $jsonSet[novel;page;$sub[$input[page];1]]
  70.  
  71. $addButton[no;novel prev $authorID;Prev;secondary]
  72. $addButton[no;novel next $authorID;Next;secondary]
  73. $addButton[no;novel jump $authorID;Jump to;secondary]
  74. $else
  75. $var[error;true]
  76. $ephemeral
  77. There is only $json[link;chapters] chapters in this novel.
  78. $endif
  79. $else
  80. $var[error;true]
  81. $ephemeral
  82. There is only $jsonArrayCount[link;chapter;$input[chapter];page] pages in chapter $input[chapter].
  83. $endif
  84.  
  85. $setVar[novel;$json[novel];$authorID]
  86.  
  87. $endif
  88.  
  89. $if[$and[$sum[$json[novel;chapter];1]>1;$sum[1;$json[novel;page]]<=1]==true]
  90. $editButton[novel prev $authorID;Prev Ch;secondary;no]
  91. $elseif[$sum[1;$json[novel;page]]<=1]
  92. $editButton[novel prev $authorID;Prev;secondary;yes]
  93. $else
  94. $editButton[novel prev $authorID;Prev;secondary;no]
  95. $endif
  96.  
  97. $if[$and[$sum[1;$json[novel;page]]>=$jsonArrayCount[link;chapter;$json[novel;chapter];page];$json[link;chapters]>$sum[$json[novel;chapter];1]]==true]
  98. $editButton[novel next $authorID;Next Chapter;secondary;no]
  99. $elseif[$and[$sum[1;$json[novel;page]]>=$jsonArrayCount[link;chapter;$json[novel;chapter];page];$json[link;chapters]<=$sum[$json[novel;chapter];1]]==true]
  100. $editButton[novel next $authorID;End;secondary;yes]
  101. $else
  102. $editButton[novel next $authorID;Next;secondary;no]
  103. $endif
  104.  
  105. $if[$var[error]!=true]
  106. $author[$username]
  107. $authorIcon[$authorAvatar]
  108. $title[Chapter $sum[$json[novel;chapter];1] of $json[link;chapters] - $json[link;chapter;$json[novel;chapter];title]]
  109. $description[$json[link;chapter;$json[novel;chapter];page;$json[novel;page]]]
  110. $if[$sum[1;$json[novel;page]]>=$jsonArrayCount[link;chapter;$json[novel;chapter];page]]
  111. $footer[Page $sum[1;$json[novel;page]] of $jsonArrayCount[link;chapter;$json[novel;chapter];page] - End of Chapter $sum[$json[novel;chapter];1]]
  112. $else
  113. $footer[Page $sum[1;$json[novel;page]] of $jsonArrayCount[link;chapter;$json[novel;chapter];page]]
  114. $endif
  115.  
  116. $if[$json[link;chapter;$json[novel;chapter];notes;$json[novel;page]]!=]
  117.  
  118. $jsonParse[
  119. $json[link;chapter;$json[novel;chapter];notes;$json[novel;page]]
  120. ]
  121.  
  122. $title[$json[title];2]
  123. $description[$json[description];2]
  124. $thumbnail[$json[thumbnail];2]
  125. $color[#c9c7c7;2]
  126. $endif
  127.  
  128. $endif
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.  
  137.  
  138.  
  139.  
  140.  
  141.  
  142.  
Advertisement
Add Comment
Please, Sign In to add comment