Advertisement
CameronFitzy

CYOA Main

Oct 31st, 2021 (edited)
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. if(!D.toLowerCase().includes(`error`))
  2. {Fi=I.toUpperCase();
  3. Dl=D.split(`,`);
  4. Ul=Dl.filter(x=>x==U+x.slice(U.length));
  5. Iq=``;
  6. Kl=[];
  7.  
  8. if(Ul.length==0)
  9. {Pc=1;
  10. Pl=1;
  11. Q=`add`}
  12. else
  13. {Pc=parseInt(Ul[0].split(` `)[1]);
  14. Pl=parseInt(Ul[0].split(` `)[2]);
  15. Q=`edit`;
  16. Iq=Dl.indexOf(Ul[0])};
  17.  
  18. Np=Pc;
  19. Pp=Pl;
  20.  
  21. for(key in S[Pc])
  22. {if(key!=`Prompt`)
  23. {Kl.push(key)}};
  24.  
  25. if(Kl.includes(Fi))
  26. {Np=S[Pc][Fi];
  27. Pp=Pc;
  28. M=`Read`}
  29. else
  30. {if(Fi.length>0)
  31. {M=`Wrong`}
  32. else
  33. {M=`Read`}};
  34.  
  35. if(S.Back)
  36. {if((I.split(` `)[0].toLowerCase()==`go`&&I.split(` `)[1]?.toLowerCase()==`back`)||I.split(` `)[0].toLowerCase()==`back`)
  37. {M=`Back`;
  38. Np=Pl;
  39. Pp=Pc}};
  40.  
  41. if(S.Reset)
  42. {if(I.split(` `)[0].toLowerCase()==`reset`)
  43. {M=`Reset`;
  44. Np=1;
  45. Pp=1}};
  46.  
  47. if(I.split(` `)[0].toLowerCase()==`rules`)
  48. {M=`Rules`}
  49.  
  50. `${Q}quote?token=${T}&data=${Q==`edit`?`${Iq}%20,${U}%20${Np}%20${Pp}`:`,${U}%20${Np}%20${Pp}`} ${Np} ${Pp} ${M}`}
  51. else
  52. {`Nope 0 0 Error`}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement