Advertisement
xloxn

Button Pages w/ Forgescript (2/2)

Sep 24th, 2023
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 2.38 KB | None | 0 0
  1. [type]
  2. interactionCreate
  3.  
  4. [code]
  5. $if[$checkContains[$customID;1first;1last;1page]==true;
  6.  
  7. $arrayLoad[customID;-;$customID]
  8. $let[nextlocation;$arrayAt[customID;1]]
  9. $let[current;$arrayAt[customID;2]]
  10. $let[pages;$arrayAt[customID;3]]
  11. $let[dataperpage;$arrayAt[customID;4]]
  12. $let[separator;$arrayAt[customID;5]]
  13. $let[data;$getVar[1data;$authorID;]]
  14.  
  15.  
  16. $arrayLoad[data;$get[separator];$get[data]]
  17.  
  18. $if[$and[$arrayAt[customID;6]!=;$arrayAt[customID;6]!=$authorID]==true;
  19. $ephemeral
  20. $description[This isn't for you]
  21. $color[#2c2d31]
  22. $stop ]
  23.  
  24.  
  25. $let[sum;$math[($get[dataperpage]*$get[nextlocation])-$get[dataperpage]]]
  26.  
  27.  
  28. $if[$checkContains[$divide[$arrayLength[data];$get[dataperpage]];.]==true;
  29. $arrayLoad[pages;.;$divide[$arrayLength[data];$get[dataperpage]]]
  30. $let[pages;$sum[$arrayAt[pages;0];1]]
  31. ;
  32. $let[pages;$divide[$arrayLength[data];$get[dataperpage]]]]
  33.  
  34.  
  35.  
  36. $interactionUpdate[
  37. $description[
  38. $trimStart[$trimEnd[
  39. $if[$get[dataperpage]>=1;
  40. $arrayAt[data;$sum[$get[sum];0]]]
  41. $if[$get[dataperpage]>=2;
  42. $arrayAt[data;$sum[$get[sum];1]]]
  43. $if[$get[dataperpage]>=3;
  44. $arrayAt[data;$sum[$get[sum];2]]]
  45. $if[$get[dataperpage]>=4;
  46. $arrayAt[data;$sum[$get[sum];3]]]
  47. $if[$get[dataperpage]>=5;
  48. $arrayAt[data;$sum[$get[sum];4]]]
  49. $if[$get[dataperpage]>=6;
  50. $arrayAt[data;$sum[$get[sum];5]]]
  51. $if[$get[dataperpage]>=7;
  52. $arrayAt[data;$sum[$get[sum];6]]]
  53. $if[$get[dataperpage]>=8;
  54. $arrayAt[data;$sum[$get[sum];7]]]
  55. $if[$get[dataperpage]>=9;
  56. $arrayAt[data;$sum[$get[sum];8]]]
  57. $if[$get[dataperpage]>=10;
  58. $arrayAt[data;$sum[$get[sum];9]]]
  59. ]]
  60. ]
  61.  
  62. $footer[Page $get[nextlocation] of $get[pages]]
  63. $color[#2c2d31]
  64.  
  65. $deleteActionRow[1]
  66. $addActionRow
  67. $if[$get[nextlocation]==1;
  68. $let[ldisabled;true];
  69. $let[ldisabled;false]]
  70.  
  71. $addButton[1first-1-$get[nextlocation]-$get[pages]-$get[dataperpage]-$get[separator]-$authorID; ;Secondary;⏪;$get[ldisabled]]
  72. $addButton[1page-$sub[$get[nextlocation];1]-$get[nextlocation]-$get[pages]-$get[dataperpage]-$get[separator]-$authorID; ;Secondary;⬅️;$get[ldisabled]]
  73.  
  74. $if[$get[nextlocation]==$get[pages];
  75. $let[rdisabled;true];
  76. $let[rdisabled;false]]
  77.  
  78. $addButton[1page-$sum[$get[nextlocation];1]-$get[nextlocation]-$get[pages]-$get[dataperpage]-$get[separator]-$authorID; ;Secondary;➡️;$get[rdisabled]]
  79. $addButton[1last-$get[pages]-$get[nextlocation]-$get[pages]-$get[dataperpage]-$get[separator]-$authorID; ;Secondary;⏩;$get[rdisabled]]
  80.  
  81. ]
  82. ]
  83.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement