CameronFitzy

Attac Racc wiki

Jul 18th, 2021 (edited)
187
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Link=`Null`;
  2.  
  3. Message=`PlaceHolder`;
  4. MessageSub=`Placeholder`;
  5.  
  6. if(Query.split(` `)[0].toLowerCase()==`list`)
  7. {Message=`List`;
  8. Link=`https://attacracc.fandom.com/api.php?action=query&generator=allpages&gaplimit=500&indexpageids&format=json`;
  9. if(Query.split(` `).length>1)
  10. {MessageSub=Query.split(` `)[1]}
  11. else
  12. {MessageSub=`1`}}
  13. else
  14. {InfoCheck=0;
  15. NumberCheck=0;
  16. QueryTemp=Query.split(` `);
  17. if(Query.toLowerCase().split(` `).indexOf(`facts`)!=-1)
  18. {NumTemp=Query.toLowerCase().split(` `).indexOf(`facts`)}
  19. else
  20. if(Query.toLowerCase().split(` `).indexOf(`fact`)!=-1)
  21. {NumTemp=Query.toLowerCase().split(` `).indexOf(`fact`)}
  22. else
  23. if(Query.toLowerCase().split(` `).indexOf(`data`)!=-1)
  24. {NumTemp=Query.toLowerCase().split(` `).indexOf(`data`)}
  25. else
  26. if(Query.toLowerCase().split(` `).indexOf(`info`)!=-1)
  27. {NumTemp=Query.toLowerCase().split(` `).indexOf(`info`);
  28. InfoCheck=1}
  29. else
  30. {NumTemp=10};
  31. if(NumTemp==10&&QueryTemp.length>1&&parseInt(QueryTemp[QueryTemp.length-1])+0==parseInt(QueryTemp[QueryTemp.length-1]))
  32. {NumTemp=QueryTemp.length-1;
  33. InfoCheck=1}
  34. if(NumTemp!=10&&InfoCheck!=1)
  35. {if(parseInt(QueryTemp[NumTemp+1])+0==parseInt(QueryTemp[NumTemp+1]))
  36. {MessageSub=`Data `+parseInt(QueryTemp[NumTemp+1])}
  37. else
  38. {MessageSub=`Data 1`}}
  39. else
  40. if((InfoCheck==1&&parseInt(QueryTemp[QueryTemp.length-1])+0==parseInt(QueryTemp[QueryTemp.length-1]))||parseInt(QueryTemp[QueryTemp.length-1])+0==parseInt(QueryTemp[QueryTemp.length-1])&&QueryTemp.length>1)
  41. {MessageSub=`Info `+parseInt(QueryTemp[QueryTemp.length-1])}
  42. else
  43. {MessageSub=`Info 1`};
  44. if(NumTemp!=0)
  45. {QueryFinal=``;
  46. for(x=0;x<NumTemp;x++)
  47. {if(Query.toLowerCase().split(` `).includes(`fact`)||Query.toLowerCase().split(` `).includes(`facts`)||Query.toLowerCase().split(` `).includes(`data`)||Query.toLowerCase().split(` `).includes(`info`)||InfoCheck==1)
  48. {if(x==0)
  49. {QueryFinal+=QueryTemp[x].toLowerCase()}
  50. else
  51. {QueryFinal+=` `+QueryTemp[x].toLowerCase()}}
  52. else
  53. {QueryFinal=Query.toLowerCase()}};
  54. if(parseInt(Query.split(` `)[0])+0==parseInt(Query.split(` `)[0]))
  55. {QueryFinal=Query.split(` `)[0];
  56. NumberCheck=1};
  57. ListIDs=Data.query.pageids;
  58. ListNames=``;
  59. x=1;
  60. for(int in Data.query.pages)
  61. {if(x==1)
  62. {ListNames+=Data.query.pages[int].title.toLowerCase();
  63. x=0}
  64. else
  65. {ListNames+=`,`+Data.query.pages[int].title.toLowerCase()}};
  66. ListNamesFinal=ListNames.split(`,`);
  67. Q=QueryFinal.split(` `);
  68. QueryOutput=``;
  69. for(c=0;c<Q.length;c++)
  70. {if(c==0)
  71. {QueryOutput+=Q[c].charAt(0).toUpperCase()+Q[c].slice(1)}
  72. else
  73. {QueryOutput+=` `+Q[c].charAt(0).toUpperCase()+Q[c].slice(1)}};
  74. if(NumberCheck==1)
  75. {if(ListIDs.includes(QueryFinal))
  76. {Message=`Success1`;
  77. Link=`https://attacracc.fandom.com/api.php?action=query&list=allpages&pageids=${QueryFinal}&prop=revisions&rvprop=content&rvslots=main&indexpageids&format=json`}
  78. else
  79. {Message=`Fail1`;
  80. Link=`https://attacracc.fandom.com/api.php?action=query&list=allpages&pageids=${QueryFinal}&prop=revisions&rvprop=content&rvslots=main&indexpageids&format=json`}}
  81. else
  82. {if(ListNamesFinal.includes(QueryFinal))
  83. {Message=`Success`;
  84. Link=`https://attacracc.fandom.com/api.php?action=query&list=allpages&titles=${QueryOutput.replace(` `,`%20`)}&apprefix=${QueryOutput.slice(0,1)}&aplimit=500&prop=revisions&rvprop=content&rvslots=main&indexpageids&format=json`}
  85. else
  86. {Message=`Fail`;
  87. Link=`https://attacracc.fandom.com/api.php?action=query&list=allpages&titles=${QueryOutput.replace(` `,`%20`)}&apprefix=${QueryOutput.slice(0,1)}&aplimit=500&prop=revisions&rvprop=content&rvslots=main&indexpageids&format=json`}}}
  88. else
  89. {Message=`DataEarly`}};
  90.  
  91. if(Query.toLowerCase().split(` `)[0]==`help`||Query.length==0)
  92. {Message=`Help`};
  93.  
  94. `${Link} ${Message} ${MessageSub}`
  95.  
  96.  
  97.  
Add Comment
Please, Sign In to add comment