Advertisement
Guest User

Untitled

a guest
Sep 19th, 2017
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.77 KB | None | 0 0
  1. def implode($vector, $adder)
  2. {
  3. $returnString = "";
  4. $index = 1;
  5.  
  6. while($index <= length($vector))
  7. {
  8. $at = at($vector, $index);
  9. $toAdd = $adder;
  10. if($index == 1)
  11. {
  12. $toAdd = "";
  13. }
  14. $returnString = $returnString + $toAdd + $at;
  15. $index += 1;
  16. }
  17. return $returnString;
  18. }
  19.  
  20. def makebig()
  21. {
  22. content_e = explode($content);
  23. big_font = "<font style=font-weight:bold >";
  24. big_font_end = "</font>";
  25. content = big_font + $content + big_font_end;
  26. return content;
  27. }
  28.  
  29. def makeverybig()
  30. {
  31. content_e = explode($content);
  32. big_font = "<font size=20>";
  33. big_font_end = "</font>";
  34. content = big_font + $content + big_font_end;
  35. return content;
  36. }
  37.  
  38. def checkforadmin() {
  39. admin = vector("your damm name here");
  40. if(find(admin,$source)) {
  41. return 1;
  42. }
  43. }
  44.  
  45. def checkforai() {
  46. if (find(explode($content," "),"ai")) {
  47. return 1;
  48. }
  49.  
  50. if (find(explode($content," "),"Ai")) {
  51. return 1;
  52. }
  53.  
  54. if (find(explode($content," "),"AI")) {
  55. return 1;
  56. }
  57. }
  58.  
  59. def checkforcommand() {
  60. command = vector("Cyborg","AI","Captain","Chief Medical Officer","Research Director","Chief Engineer","Head of Personnel","Head of Security");
  61. if (find(command,$job)) {
  62. return 1;
  63. }
  64. }
  65.  
  66. def handlebroadcast() {
  67. if(checkforcommand()) {
  68. if (at(explode($content, " "),1) == "/comm") {
  69. $pass = 0;
  70. if (at(explode($content, " "),2) == "all") {
  71. var = vector(explode($content, " "));
  72. cut(var, 0,3);
  73. mess = implode(var, " ");
  74. broadcast(mess, 1353, $source);
  75. broadcast(mess, 1359, $source);
  76. broadcast(mess, 1357, $source);
  77. broadcast(mess, 1355, $source);
  78. broadcast(mess, 1351, $source);
  79. broadcast(mess, 1349, $source);
  80. broadcast(mess, 1347, $source);
  81. broadcast(mess, 1459, $source);
  82. broadcast("Message Transmitted", 1353, "Script");
  83. }
  84. if (at(explode($content, " "),2) == "com") {
  85. var = vector(explode($content, " "));
  86. cut(var, 0,3);
  87. mess = implode(var, " ");
  88. broadcast(mess, 1353, $source);
  89. broadcast("Message Transmitted", 1353, "Script");
  90. }
  91. if (at(explode($content, " "),2) == "sec") {
  92. var = vector(explode($content, " "));
  93. cut(var, 0,3);
  94. mess = implode(var, " ");
  95. broadcast(mess, 1359, $source);
  96. broadcast("Message Transmitted", 1353, "Script");
  97. }
  98. if (at(explode($content, " "),2) == "eng") {
  99. var = vector(explode($content, " "));
  100. cut(var, 0,3);
  101. mess = implode(var, " ");
  102. broadcast(mess, 1357, $source);
  103. broadcast("Message Transmitted", 1353, "Script");
  104. }
  105. if (at(explode($content, " "),2) == "med") {
  106. var = vector(explode($content, " "));
  107. cut(var, 0,3);
  108. mess = implode(var, " ");
  109. broadcast(mess, 1355, $source);
  110. broadcast("Message Transmitted", 1353, "Script");
  111. }
  112. if (at(explode($content, " "),2) == "sci") {
  113. var = vector(explode($content, " "));
  114. cut(var, 0,3);
  115. mess = implode(var, " ");
  116. broadcast(mess, 1351, $source);
  117. broadcast("Message Transmitted", 1353, "Script");
  118. }
  119. if (at(explode($content, " "),2) == "ser") {
  120. var = vector(explode($content, " "));
  121. cut(var, 0,3);
  122. mess = implode(var, " ");
  123. broadcast(mess, 1349, $source);
  124. broadcast("Message Transmitted", 1353, "Script");
  125. }
  126. if (at(explode($content, " "),2) == "sup") {
  127. var = vector(explode($content, " "));
  128. cut(var, 0,3);
  129. mess = implode(var, " ");
  130. broadcast(mess, 1347, $source);
  131. broadcast("Message Transmitted", 1353, "Script");
  132. }
  133. }
  134. }
  135. }
  136.  
  137. //if(checkforadmin()) {
  138. // muted = mem(muted);
  139. // broadcast(muted, 1353, "Script");
  140. // ex = explode($content,"_");
  141. // if(at(ex,1) == "mute") {
  142. // name = at(ex,2);
  143. // mem(muted,name);
  144. //broadcast($source + " muted " + name, 1353, "Script");
  145. // }
  146. //}
  147.  
  148. //if($source == mem(muted)) {
  149. // $pass = 0;
  150. //}
  151.  
  152.  
  153.  
  154.  
  155.  
  156.  
  157.  
  158. if(checkforadmin()) {
  159. if ($content == "restore comms") {
  160. mem("kill",0);
  161. $pass = 0;
  162. }
  163. if ($content == "kill comms") {
  164. mem("kill",1);
  165. $pass = 0;
  166. }
  167. }
  168.  
  169. if (mem("kill") == 1) {
  170. $pass = 0;
  171. }
  172.  
  173. handlebroadcast();
  174.  
  175. if(checkforai()) {
  176. big_text = makebig();
  177. broadcast(big_text,134.3,$source,$job);
  178. }
  179.  
  180.  
  181.  
  182. // English To Pirate Translator Script - By Giacom
  183.  
  184. // Helper Functions
  185.  
  186. def implode($vector, $adder)
  187. {
  188. $returnString = "";
  189. $index = 1;
  190.  
  191. while($index <= length($vector))
  192. {
  193. $at = at($vector, $index);
  194. $toAdd = $adder;
  195. if($index == 1)
  196. {
  197. $toAdd = "";
  198. }
  199. $returnString = $returnString + $toAdd + $at;
  200. $index += 1;
  201. }
  202. return $returnString;
  203. }
  204.  
  205. def Initialize()
  206. {
  207.  
  208. // Our words! Format: real word / pirate word
  209. $words = vector("gun", "cannon",
  210. "heaven", "davy jones' locker",
  211. "I", "aye",
  212. "my", "meh",
  213. "yes", "aye",
  214. "are", "argh",
  215. "yeah", "yarh",
  216. "captain", "Cap'n",
  217. "hos", "First Mate",
  218. "hop", "Crewmaster",
  219. "ai", "Navigator",
  220. "money", "treasure",
  221. "friend", "matey",
  222. "station", "vessel",
  223. "shuttle", "rowboat",
  224. "engine", "sails",
  225. "space", "sea");
  226.  
  227. //broadcast("Starting Initialization...");
  228.  
  229. $index = 1;
  230. while($index <= length($words))
  231. {
  232. $key = at($words, $index);
  233. $key = lower($key);
  234. $value = at($words, $index+1);
  235. mem($key, $value);
  236. $index += 2;
  237. }
  238. //broadcast("Initialization Complete!");
  239. }
  240.  
  241. // Script Begin
  242.  
  243. if(mem("initialized") != 1)
  244. {
  245. Initialize();
  246. mem("initialized", 1);
  247. }
  248.  
  249. $newContent = explode($content, " ");
  250. $index = 1;
  251. while($index <= length($newContent))
  252. {
  253.  
  254. $entry = at($newContent, $index);
  255. $value = mem(lower($entry));
  256.  
  257. if($value)
  258. {
  259. at($newContent, $index, $value);
  260. }
  261.  
  262. $index += 1;
  263. }
  264.  
  265. $content = implode($newContent, " ");
  266.  
  267. // Script End
  268. if(checkforcommand()) {
  269. $content = makebig();
  270. }
  271.  
  272. if ($job != "No id") {
  273. $source = $job + " " + $source;
  274. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement