Advertisement
Sanwi

OJD speak

Oct 22nd, 2014
602
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.05 KB | None | 0 0
  1. $${
  2. UNSAFE(0);
  3.  
  4. // List of characters to uppercase
  5. &ucase_list[] = split(" ","B C D F G H J K L M N P Q R S T V W X Z");
  6.  
  7. // List of characters to lowercase
  8. &lcase_list[] = split(" ","A E I O U Y");
  9.  
  10. // Prompt for input
  11. PROMPT(&ojd_input,"$$?","Input chat message to convert to OJD",true,"")
  12.  
  13. // Split input into individual characters
  14. &ojd_parse[] = split("","%&ojd_input%")
  15.  
  16. // For each input character...
  17. #forojd = 0
  18. foreach(&ojd_parse,&cparse);
  19. // Check uppercase list...
  20. foreach(&ucase_list,&cucase);
  21. // If character on uppercase list, replace with uppercase
  22. ifmatches("%&cparse%","%&cucase%");
  23. ucase(%&cparse%,&ojd_parse[%#forojd%])
  24. endif;
  25. next;
  26. // Check lowercase list...
  27. foreach(&lcase_list,&clcase);
  28. // If character on lowercase list, replace with lowercase
  29. ifmatches("%&cparse%","%&clcase%");
  30. lcase(%&cparse%,&ojd_parse[%#forojd%])
  31. endif;
  32. next;
  33. inc(#forojd,1);
  34. next;
  35.  
  36. // Rejoin processed string
  37. join("",&ojd_parse,&ojd_output);
  38.  
  39. // Echo string into chat
  40. echo("%&ojd_output%");
  41.  
  42. ENDUNSAFE;
  43. stop();
  44. }$$
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement