Advertisement
Guest User

Untitled

a guest
Jul 26th, 2014
205
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. var line = new Array();
  3. line[1]="a1|b1|c1|d1|e1|f1|g1|h1=r|n|b|q|k|b|n|r";
  4. line[2]="a2|b2|c2|d2|e2|f2|g2|h2=p|p|p|p|p|p|p|p";
  5. line[3]="a3|b3|c3|d3|e3|f3|g3|h3=1|1|1|1|1|1|1|1";
  6. line[4]="a4|b4|c4|d4|e4|f4|g4|h4=1|1|1|1|1|1|1|1";
  7. line[5]="a5|b5|c5|d5|e5|f5|g5|h5=1|1|1|1|1|1|1|1";
  8. line[6]="a6|b6|c6|d6|e6|f6|g6|h6=1|1|1|1|1|1|1|1";
  9. line[7]="a7|b7|c7|d7|e7|f7|g7|h7=p|p|p|p|p|p|p|p";
  10. line[8]="a8|b8|c8|d8|e8|f8|g8|h8=r|n|b|q|k|b|n|r";
  11.  
  12. var def = line;
  13.  
  14.  
  15.  
  16. function onTextAfter(u,tx){
  17.  
  18. var move = tx.split(" to ");
  19.  
  20. t1=move[0].substring(1);
  21.  
  22. if(line[t1].search(move[0])>-1){
  23.    
  24. string = line[t1];
  25.    
  26. m = string.substr(string.split(move[0])[0].length).split("|")[0];
  27.  
  28. print(string.replace(m, "\x06"+m+"\x06").split("=")[0]+" will be replaced to 1 = empty");
  29.  
  30. string = string.replace(m, 1).split("=")[0];
  31.  
  32. line[t1]= string; // update
  33.  
  34. print(line[t1].search(move[0])); // fail
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement