Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $${
- UNSAFE(0);
- // List of characters to uppercase
- &ucase_list[] = split(" ","B C D F G H J K L M N P Q R S T V W X Z");
- // List of characters to lowercase
- &lcase_list[] = split(" ","A E I O U Y");
- // Prompt for input
- PROMPT(&ojd_input,"$$?","Input chat message to convert to OJD",true,"")
- // Split input into individual characters
- &ojd_parse[] = split("","%&ojd_input%")
- // For each input character...
- #forojd = 0
- foreach(&ojd_parse,&cparse);
- // Check uppercase list...
- foreach(&ucase_list,&cucase);
- // If character on uppercase list, replace with uppercase
- ifmatches("%&cparse%","%&cucase%");
- ucase(%&cparse%,&ojd_parse[%#forojd%])
- endif;
- next;
- // Check lowercase list...
- foreach(&lcase_list,&clcase);
- // If character on lowercase list, replace with lowercase
- ifmatches("%&cparse%","%&clcase%");
- lcase(%&cparse%,&ojd_parse[%#forojd%])
- endif;
- next;
- inc(#forojd,1);
- next;
- // Rejoin processed string
- join("",&ojd_parse,&ojd_output);
- // Echo string into chat
- echo("%&ojd_output%");
- ENDUNSAFE;
- stop();
- }$$
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement