Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ON *:TEXT:*:#: {
- if ($1 == !report) {
- if ($areport($nick) == $null) {
- if ($clreport($nick)) { hdel reportscl $nick }
- hadd -m reports $nick $time $date $ctime $2-
- hsave reports reports.hsh
- .timer 1 1 msg $chan $nick Your report has been sent. OPS will reply a.s.a.p.
- var %x = 1
- var %y = $nick($chan,0)
- while (%x <= %y) {
- var %z = $left($nick($chan,%x).pnick,1)
- var %o = $nick($chan,%x)
- if (%z == @) {
- .notice %o $nick made a report at $date $time $+(",$2-,")
- }
- inc %x
- }
- }
- elseif ($areport($nick)) {
- .timer 1 2 .notice $nick You already have an active report. Please wait till it's reviewed by the ops.
- }
- }
- if ($1 == !close) {
- if ($nick isop $chan) {
- if ($areport($2)) {
- if ($2 ison $chan) { msg $chan $nick Closed $+($2,'s) report $+(",$greport($2),") $iif($3-, Reason: $v1, No Reason Stated.) }
- hdel reports $2
- hsave reports reports.hsh
- hadd reportscl $2 $time $date $nick $3-
- hsave reportscl reportscl.hsh
- }
- elseif (!$areport($2)) { msg $chan No such active report found. }
- }
- }
- if ($1 == !cancel) {
- if ($nick isop $chan) {
- if ($areport($2)) {
- if ($2 ison $chan) { msg $chan $nick canceled $+($2,'s) report $+(",$greport($nick),") $iif($3-, Reason: $v1, No Reason Stated.) }
- hdel reports $nick
- hsave reports reports.hsh
- hadd reportscl $2 $time $date $nick $3-
- hsave reportscl reportscl.hsh
- }
- elseif (!$areport($2)) { msg $chan No such active report found. }
- }
- }
- if ($1 == !listreports) {
- if ($hget(reports,0).data) {
- if ($nick isop $chan) {
- var %x = 1
- var %y = $hget(reports,0).data
- while (%x <= %y) {
- tokenize 32 $hget(reports,%x).data
- .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-
- inc %x
- }
- }
- }
- elseif (!$hget(reports,0).data) { .timer 1 1 msg $chan No Active Reports Found. }
- }
- if ($1 == !check) {
- if ($nick isop $chan) {
- if ($hget(reports,$2)) {
- tokenize 32 $v1
- .timer 1 1 msg $chan [Seen] Date: $2 Time: $1 $+($chr(40),$duration($calc($ctime - $3)),$chr(32),ago,$chr(41)) Text: $4-
- }
- elseif (!$hget(reports,$2)) {
- if ($clreport($nick)) { msg $chan [Closed/Canceled] By: $gettok($v1,3,32) At: $gettok($v1,1-2,32) Reason: $gettok($v1,4-,32) }
- else {
- .timer 1 1 msg $chan No open/closed report in the list.
- }
- }
- }
- }
- }
- alias areport { return $hget(reports,$1) }
- alias greport { return $gettok($hget(reports,$1),4-,32) }
- alias clreport { return $hget(reportscl,$1) }
- ON *:START: {
- hmake reports
- hmake reportscl
- hload reports reports.hsh
- hload reportscl reportscl.hsh
- echo -at Reports Data Loaded!
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement