Advertisement
westor

$movetok() + $movetokcs()

Feb 8th, 2021 (edited)
1,858
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
mIRC 0.84 KB | None | 0 0
  1. alias movetok {
  2.   ; $movetok(text,string,N,C)
  3.  
  4.   if ($1 == $null) || ($2 == $null) || ($3 == $null) || ($4 == $null) { return }
  5.  
  6.   var %f = $findtok($1,$2,1,$4)
  7.  
  8.   if (!%f) || ($3 !isnum) || ($3 < 1) || ($4 !isnum) { return }
  9.  
  10.   if (%f > $3) { var %n = $instok($1,$2,$3,$4) | var %r = $deltok(%n,$calc(%f + 1),$4) }
  11.   else { var %n = $instok($1,$2,$calc($3 + 1),$4) | var %r = $deltok(%n,%f,$4) }
  12.  
  13.   return %r
  14. }
  15.  
  16. alias movetokcs {
  17.   ; $movetokcs(text,string,N,C)
  18.  
  19.   if ($1 == $null) || ($2 == $null) || ($3 == $null) || ($4 == $null) { return }
  20.  
  21.   var %f = $findtokcs($1,$2,1,$4)
  22.  
  23.   if (!%f) || ($3 !isnum) || ($3 < 1) || ($4 !isnum) { return }
  24.  
  25.   if (%f > $3) { var %n = $instok($1,$2,$3,$4) | var %r = $deltok(%n,$calc(%f + 1),$4) }
  26.   else { var %n = $instok($1,$2,$calc($3 + 1),$4) | var %r = $deltok(%n,%f,$4) }
  27.  
  28.   return %r
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement