CameronFitzy

Attacc Racc Wiki 2

Jul 19th, 2021 (edited)
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Message=Query.split(` `)[1];
  2. MessageSub=Query.split(` `)[2];
  3. MessageSubExtra= Query.split(` `)[3];
  4.  
  5. R=`You probably shouldn’t be seeing this`;
  6.  
  7. if(Message==`Success`||Message==`Success1`)
  8. {if(MessageSub==`Data`)
  9. {Number=Data.query.pageids[0];
  10. Info=Data.query.pages[Number].revisions[0].slots.main[`*`];
  11. InfoWords=Info.split(`}}`)[1].split(`[[`)[0].replace(/=+.+=+/g,``).replace(/<.+>/g,``).replace(/(\s+|)\.(\s+|)/g,`. `);
  12. InfoAbout=Info.split(`}}`)[0].replace(/(appearance=|artlocke_run=|1=)/g,``).split(/(\s|)+\|(\s|)+/g).filter(x=>x.includes(`=`));
  13. InfoCheck=0;
  14. InfoAboutFinal=``;
  15. for(x=0;x<InfoAbout.length;x++)
  16. {Temp=InfoAbout[x].split(`=`);
  17. InfoCap=InfoAbout[x].split(`=`)[0].replace(/\s+/g,``).split(`_`);
  18. TempCap=``;
  19. for(y=0;y<InfoCap.length;y++)
  20. {TempOut=InfoCap[y].charAt(0).toUpperCase()+InfoCap[y].slice(1).toLowerCase();
  21. if(y==0)
  22. {TempCap+=TempOut}
  23. else
  24. {TempCap+=` `+TempOut}};
  25. if(Temp[1].replace(/\s+/g,``)==``)
  26. {}
  27. else
  28. {if(InfoCheck==0)
  29. {InfoAboutFinal+=TempCap+`=`+Temp[1];
  30. InfoCheck++}
  31. else
  32. {InfoAboutFinal+=`,`+TempCap+`=`+Temp[1]}}}
  33. InfoList=InfoAboutFinal.split(`,`);
  34. Pages=Math.ceil(InfoList.length/10);
  35. Page=parseInt(MessageSubExtra);
  36. if(Page>Pages)
  37. {R=`Sorry there is only ${Pages} page(s) of data for this entry.`}
  38. else
  39. {R=`${InfoList.slice((Page-1)*10,Page*10).join(`, `)} || Page:${Page}/${Pages}`}}
  40. else
  41. if(MessageSub==`Info`)
  42. {Number=Data.query.pageids[0];
  43. Info=Data.query.pages[Number].revisions[0].slots.main[`*`];
  44. InfoWords=Info.split(`}}`)[1].split(`[[`)[0].replace(/=+.+=+/g,``).replace(/<.+>/g,``).replace(/(\s+|)\.(\s+|)/g,`. `).split(` `); Pages=Math.ceil(InfoWords.length/50);
  45. Page=parseInt(MessageSubExtra);
  46. if(Page>Pages)
  47. {R=`Sorry there is only ${Pages} page(s) of info for this entry.`}
  48. else
  49. {R=`${InfoWords.slice((Page-1)*50,Page*50).join(` `)} || Page:${Page}/${Pages}`}}}
  50. else
  51. if(Message==`Fail`)
  52. {Info=Data.query.allpages;
  53. Titles=``;
  54. for(x=0;x<Info.length;x++)
  55. {if(x==0)
  56. {Titles+=Info[x].title+`:`+Info[x].pageid}
  57. else
  58. {Titles+=`,`+Info[x].title+`:`+Info[x].pageid}}
  59. T=Titles.split(`,`);
  60. R=`Sorry we couldn’t find what you were looking is it one of these -> ${T.slice(0,5).join(`, `)}`}
  61. else
  62. if(Message==`Fail1`)
  63. {R=`Sorry we couldn’t find what you were looking for`}
  64. else
  65. if(Message==`List`)
  66. {ListNames=``;
  67. x=1;
  68. for(int in Data.query.pages)
  69. {if(x==1)
  70. {ListNames+=Data.query.pages[int].title+`:`+Data.query.pages[int].pageid;
  71. x=0}
  72. else
  73. {ListNames+=`,`+Data.query.pages[int].title+`:`+Data.query.pages[int].pageid}};
  74. L=ListNames.split(`,`);
  75. Pages=Math.ceil(L.length/15);
  76. Page=parseInt(MessageSub);
  77. if(Page>Pages)
  78. {R=`Sorry there is only ${Pages} pages of entries.`}
  79. else
  80. {R=`${L.slice((Page-1)*15,Page*15).join(`, `)} || Page:${Page}/${Pages}`}}
  81. else
  82. if(Message=`Help`)
  83. {R=`For a list of possible entries type “list”. To look at data/facts type “data/fact(s)” after the entry. To go to a specific page type the page number at the end of the entry.`};
  84.  
  85. R
Add Comment
Please, Sign In to add comment