Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Message=Query.split(` `)[1];
- MessageSub=Query.split(` `)[2];
- MessageSubExtra= Query.split(` `)[3];
- R=`You probably shouldn’t be seeing this`;
- if(Message==`Success`||Message==`Success1`)
- {if(MessageSub==`Data`)
- {Number=Data.query.pageids[0];
- Info=Data.query.pages[Number].revisions[0].slots.main[`*`];
- InfoWords=Info.split(`}}`)[1].split(`[[`)[0].replace(/=+.+=+/g,``).replace(/<.+>/g,``).replace(/(\s+|)\.(\s+|)/g,`. `);
- InfoAbout=Info.split(`}}`)[0].replace(/(appearance=|artlocke_run=|1=)/g,``).split(/(\s|)+\|(\s|)+/g).filter(x=>x.includes(`=`));
- InfoCheck=0;
- InfoAboutFinal=``;
- for(x=0;x<InfoAbout.length;x++)
- {Temp=InfoAbout[x].split(`=`);
- InfoCap=InfoAbout[x].split(`=`)[0].replace(/\s+/g,``).split(`_`);
- TempCap=``;
- for(y=0;y<InfoCap.length;y++)
- {TempOut=InfoCap[y].charAt(0).toUpperCase()+InfoCap[y].slice(1).toLowerCase();
- if(y==0)
- {TempCap+=TempOut}
- else
- {TempCap+=` `+TempOut}};
- if(Temp[1].replace(/\s+/g,``)==``)
- {}
- else
- {if(InfoCheck==0)
- {InfoAboutFinal+=TempCap+`=`+Temp[1];
- InfoCheck++}
- else
- {InfoAboutFinal+=`,`+TempCap+`=`+Temp[1]}}}
- InfoList=InfoAboutFinal.split(`,`);
- Pages=Math.ceil(InfoList.length/10);
- Page=parseInt(MessageSubExtra);
- if(Page>Pages)
- {R=`Sorry there is only ${Pages} page(s) of data for this entry.`}
- else
- {R=`${InfoList.slice((Page-1)*10,Page*10).join(`, `)} || Page:${Page}/${Pages}`}}
- else
- if(MessageSub==`Info`)
- {Number=Data.query.pageids[0];
- Info=Data.query.pages[Number].revisions[0].slots.main[`*`];
- InfoWords=Info.split(`}}`)[1].split(`[[`)[0].replace(/=+.+=+/g,``).replace(/<.+>/g,``).replace(/(\s+|)\.(\s+|)/g,`. `).split(` `); Pages=Math.ceil(InfoWords.length/50);
- Page=parseInt(MessageSubExtra);
- if(Page>Pages)
- {R=`Sorry there is only ${Pages} page(s) of info for this entry.`}
- else
- {R=`${InfoWords.slice((Page-1)*50,Page*50).join(` `)} || Page:${Page}/${Pages}`}}}
- else
- if(Message==`Fail`)
- {Info=Data.query.allpages;
- Titles=``;
- for(x=0;x<Info.length;x++)
- {if(x==0)
- {Titles+=Info[x].title+`:`+Info[x].pageid}
- else
- {Titles+=`,`+Info[x].title+`:`+Info[x].pageid}}
- T=Titles.split(`,`);
- R=`Sorry we couldn’t find what you were looking is it one of these -> ${T.slice(0,5).join(`, `)}`}
- else
- if(Message==`Fail1`)
- {R=`Sorry we couldn’t find what you were looking for`}
- else
- if(Message==`List`)
- {ListNames=``;
- x=1;
- for(int in Data.query.pages)
- {if(x==1)
- {ListNames+=Data.query.pages[int].title+`:`+Data.query.pages[int].pageid;
- x=0}
- else
- {ListNames+=`,`+Data.query.pages[int].title+`:`+Data.query.pages[int].pageid}};
- L=ListNames.split(`,`);
- Pages=Math.ceil(L.length/15);
- Page=parseInt(MessageSub);
- if(Page>Pages)
- {R=`Sorry there is only ${Pages} pages of entries.`}
- else
- {R=`${L.slice((Page-1)*15,Page*15).join(`, `)} || Page:${Page}/${Pages}`}}
- else
- if(Message=`Help`)
- {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.`};
- R
Add Comment
Please, Sign In to add comment