Advertisement
Guest User

Untitled

a guest
Jun 2nd, 2017
217
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. on $*:TEXT:/^[.!](del|view|add)(rsn|notes)/Si:#celestial_skillers_staff: {
  2.   if ($regml(1) == add) {
  3.     var %x 1
  4.     while ($readini(notes.ini,n,$2,n $+ %x)) inc %x
  5.     writeini -n notes.ini $2 $+(n,%x) $c1($nick,Note: $3-) $c1($nick,Note By $nick $date $time GMT)
  6.     notice $nick $c1($nick,Notes) $+ 1 %x $c1($nick,For) $c2($nick,$2) $c1($nick,has been saved.)
  7.   }
  8.   elseif ($regml(1) == del) {
  9.     if ($remove($3,-) !isnum) {
  10.       if ($readini(notes.ini,n,$2,n1)) {
  11.         remini -n notes.ini $2
  12.         notice $nick $c1($nick,Notes for) $c2($nick,$2) $c1($nick,Deleted.)
  13.       }
  14.       else {
  15.         notice $nick $2 has no notes.
  16.       }
  17.     }
  18.     else {
  19.       var %x 1
  20.       while ($readini(notes.ini,n,$2,n $+ %x)) {
  21.         if (%x isnum $3) {
  22.           remini -n notes.ini $2 $+(n,%x)
  23.           notice $nick $c1($nick,Note) $+ 1 %x $c1($nickFor) $c2($nick,$2) $c1($nick,Deleted.)
  24.         }
  25.         inc %x
  26.       }
  27.       ncleanup $2
  28.     }
  29.   }
  30.   elseif ($regml(1) == view) {
  31.     if ($readini(notes.ini,n,$2,n1)) {
  32.       notice $nick $c1($nick,Notes For) $c2($nick,$2) $+ $c1($nick,:)
  33.       var %x 1
  34.       while ($readini(notes.ini,n,$2,n $+ %x)) {
  35.         notice $nick 1 %x $+ : $c1($nick,$v1)
  36.         inc %x
  37.       }
  38.     }
  39.     else {
  40.       notice $nick $c1($nick,$2) $c2($nick,Has No Notes.)
  41.     }
  42.   }
  43. }
  44. alias -l ncleanup {
  45.   var %x 1
  46.   while ($ini(notes.ini,$1,%x)) {
  47.     hadd -m $+(notes.,$1) %x $readini(notes.ini,n,$1,$v1)
  48.     inc %x
  49.   }
  50.   remini notes.ini $1
  51.   var %x 1
  52.   while ($hget($+(notes.,$1), %x)) {
  53.     writeini notes.ini $1 $+(n,%x) $v1
  54.     inc %x
  55.   }
  56.   hfree $+(notes.,$1)
  57. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement