Advertisement
OrFeAsGr

Report System for St3List v4

Mar 10th, 2017
332
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
mIRC 3.00 KB | None | 0 0
  1. ON *:TEXT:*:#: {
  2.   if ($1 == !report) {
  3.     if ($areport($nick) == $null) {
  4.       if ($clreport($nick)) { hdel reportscl $nick }
  5.       hadd -m reports $nick $time $date $ctime $2-
  6.       hsave reports reports.hsh
  7.       .timer 1 1 msg $chan $nick Your report has been sent. OPS will reply a.s.a.p.
  8.       var %x = 1
  9.       var %y = $nick($chan,0)
  10.       while (%x <= %y) {
  11.         var %z = $left($nick($chan,%x).pnick,1)
  12.         var %o = $nick($chan,%x)
  13.         if (%z == @) {
  14.           .notice %o $nick made a report at $date $time $+(",$2-,")
  15.         }
  16.         inc %x
  17.       }
  18.     }
  19.     elseif ($areport($nick)) {
  20.       .timer 1 2 .notice $nick You already have an active report. Please wait till it's reviewed by the ops.
  21.     }
  22.   }
  23.   if ($1 == !close) {
  24.     if ($nick isop $chan) {
  25.       if ($areport($2)) {
  26.         if ($2 ison $chan) { msg $chan $nick Closed $+($2,'s) report $+(",$greport($2),") $iif($3-, Reason: $v1, No Reason Stated.) }
  27.         hdel reports $2
  28.         hsave reports reports.hsh
  29.         hadd reportscl $2 $time $date $nick $3-
  30.         hsave reportscl reportscl.hsh
  31.       }
  32.       elseif (!$areport($2)) { msg $chan No such active report found. }
  33.     }
  34.   }
  35.   if ($1 == !cancel) {
  36.     if ($nick isop $chan) {
  37.       if ($areport($2)) {
  38.         if ($2 ison $chan) { msg $chan $nick canceled $+($2,'s) report $+(",$greport($nick),")  $iif($3-, Reason: $v1, No Reason Stated.) }
  39.         hdel reports $nick
  40.         hsave reports reports.hsh
  41.         hadd reportscl $2 $time $date $nick $3-
  42.         hsave reportscl reportscl.hsh
  43.       }
  44.       elseif (!$areport($2)) { msg $chan No such active report found. }
  45.     }
  46.   }
  47.   if ($1 == !listreports) {
  48.     if ($hget(reports,0).data) {
  49.       if ($nick isop $chan) {
  50.         var %x = 1
  51.         var %y = $hget(reports,0).data
  52.         while (%x <= %y) {
  53.           tokenize 32 $hget(reports,%x).data
  54.           .timer 1 $calc(%x + 1) msg $chan Report $+($chr(35),%x) by $hget(reports,%x).item at Date: $2 & Time: $1 $+($chr(40),$duration($calc($ctime - $3)),$chr(32),ago,$chr(41)) Text: $4-
  55.           inc %x
  56.         }
  57.       }
  58.     }
  59.     elseif (!$hget(reports,0).data) { .timer 1 1 msg $chan No Active Reports Found. }
  60.   }
  61.   if ($1 == !check) {
  62.     if ($nick isop $chan) {
  63.       if ($hget(reports,$2)) {
  64.         tokenize 32 $v1
  65.         .timer 1 1 msg $chan [Seen] Date: $2 Time: $1  $+($chr(40),$duration($calc($ctime - $3)),$chr(32),ago,$chr(41)) Text: $4-
  66.       }
  67.       elseif (!$hget(reports,$2)) {
  68.         if ($clreport($nick)) { msg $chan [Closed/Canceled] By: $gettok($v1,3,32) At: $gettok($v1,1-2,32) Reason: $gettok($v1,4-,32) }
  69.         else {
  70.           .timer 1 1 msg $chan No open/closed report in the list.
  71.         }
  72.       }
  73.     }
  74.   }
  75. }
  76.  
  77. alias areport { return $hget(reports,$1) }
  78. alias greport { return $gettok($hget(reports,$1),4-,32) }
  79. alias clreport { return $hget(reportscl,$1) }
  80.  
  81. ON *:START: {
  82.   hmake reports
  83.   hmake reportscl
  84.   hload reports reports.hsh
  85.   hload reportscl reportscl.hsh
  86.   echo -at Reports Data Loaded!
  87. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement