Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; ------- Settings --------
- alias seen_dir { return $mircdir $+ seen } ; = 'seen' is the folder database under '$mircdir' path e.g: //run $mircdir
- alias seen_excepts { return network1~nickname1~#channel1 network2~nickname2~#channel2 } ; = format is NETWORK~NICKAME~#CHANNEL so e.g ChatHUB~westor~#mSL
- ; ------- Settings --------
- ON *:START: {
- if (!$isdir($seen_dir)) { mkdir $qt($seen_dir) }
- }
- ON *:TEXT:*:#: {
- tokenize 32 $strip($1-)
- var %nc = $+($network,~,$nick,~,$chan)
- if (!$istok($seen_excepts,%nc,32)) {
- seen_clear $network $nick $chan
- seen_write $network $nick $chan event $event
- seen_write $network $nick $chan time $ctime
- seen_write $network $nick $chan host $site
- seen_write $network $nick $chan message $iif($1-,$v1,0)
- }
- if ($1 == !seen) {
- if (!$2) {
- var %t = $findfile($seen_dir,*,0)
- msg $chan ( $+ $nick $+ ): There $iif(%t == 1,is $bold(%t) total seen record,are $bold(%t) total seen records) in my database. Please define your search!
- return
- }
- if ($2 == $me) || ($2 == $nick) { msg $chan ( $+ $nick $+ ): Incorrect target! | return }
- if ($chr(42) isin $2) {
- var %t = $findfile($seen_dir,$2-,0)
- msg $chan ( $+ $nick $+ ): There $iif(%t == 1,is $bold(%t) matching record,are $bold(%t) matching records) in my database.
- if (%t < 20) {
- var %i = 1
- while (%i <= %t) { var %m = $mid($nopath($findfile($seen_dir,$2-,%i)),0,-4) | var %tot = $addtok(%tot,%m,32) | inc %i }
- if (%tot) { msg $chan ( $+ $nick $+ ): %tot }
- }
- return
- }
- var %a = $seen_read($network,$2,$chan,event)
- if (!%a) { msg $chan ( $+ $nick $+ ): Sorry! I haven't seen $bold($2) on $bold($chan) yet! | return }
- if (%a == join) {
- var %o = $seen_read($network,$2,$chan,time)
- var %h = $seen_read($network,$2,$chan,host)
- msg $chan ( $+ $nick $+ ): $underline($2) $+([,$bold(%h),]) joined on $bold($chan) at $bold($asctime(%o)) ( $+ $italic($duration($calc($ctime - %o))) ago $+ )
- }
- if (%a == part) {
- var %o = $seen_read($network,$2,$chan,time)
- var %h = $seen_read($network,$2,$chan,host)
- var %m = $seen_read($network,$2,$chan,message)
- msg $chan ( $+ $nick $+ ): $underline($2) $+([,$bold(%h),]) parted from $bold($chan) at $bold($asctime(%o)) ( $+ $italic($duration($calc($ctime - %o))) ago $+ ) $iif(%m,with message $bold(%m))
- }
- if (%a == text) || (%a == action) || (%a == notice) {
- var %h = $seen_read($network,$2,$chan,host)
- var %o = $seen_read($network,$2,$chan,time)
- var %m = $seen_read($network,$2,$chan,message)
- msg $chan ( $+ $nick $+ ): $underline($2) $+([,$bold(%h),]) said something on $bold($chan) at $bold($asctime(%o)) ( $+ $italic($duration($calc($ctime - %o))) ago $+ ) $iif(%m,with message $bold(%m))
- }
- if (%a == kick) {
- var %o = $seen_read($network,$2,$chan,time)
- var %h = $seen_read($network,$2,$chan,host)
- var %b = $seen_read($network,$2,$chan,by)
- var %m = $seen_read($network,$2,$chan,message)
- msg $chan ( $+ $nick $+ ): $underline($2) $+([,$bold(%h),]) kicked from $bold($chan) by $bold(%b) at $bold($asctime(%o)) ( $+ $italic($duration($calc($ctime - %o))) ago $+ ) $iif(%m,with message $bold(%m))
- }
- if (%a == quit) {
- var %h = $seen_read($network,$2,$chan,host)
- var %o = $seen_read($network,$2,$chan,time)
- var %m = $seen_read($network,$2,$chan,message)
- msg $chan ( $+ $nick $+ ): $underline($2) $+([,$bold(%h),]) quits from $bold($chan) at $bold($asctime(%o)) ( $+ $italic($duration($calc($ctime - %o))) ago $+ ) $iif(%m,with message $bold(%m))
- }
- if (%a == nick) {
- var %h = $seen_read($network,$2,$chan,host)
- var %o = $seen_read($network,$2,$chan,time)
- var %n = $seen_read($network,$2,$chan,newnick)
- msg $chan ( $+ $nick $+ ): $underline($2) $+([,$bold(%h),]) changed nick on $bold($chan) to $bold(%n) at $bold($asctime(%o)) ( $+ $italic($duration($calc($ctime - %o))) ago $+ )
- }
- }
- }
- ON !*:JOIN:#: {
- var %nc = $+($network,~,$nick,~,$chan)
- if ($istok($seen_excepts,%nc,32)) { return }
- seen_clear $network $nick $chan
- seen_write $network $nick $chan event $event
- seen_write $network $nick $chan time $ctime
- seen_write $network $nick $chan host $site
- }
- ON !*:PART:#: {
- var %nc = $+($network,~,$nick,~,$chan)
- if ($istok($seen_excepts,%nc,32)) { return }
- tokenize 32 $strip($1-)
- seen_clear $network $nick $chan
- seen_write $network $nick $chan event $event
- seen_write $network $nick $chan time $ctime
- seen_write $network $nick $chan host $site
- seen_write $network $nick $chan message $iif($1-,$v1,0)
- }
- ON !*:KICK:#: {
- var %nc = $+($network,~,$nick,~,$chan)
- if ($istok($seen_excepts,%nc,32)) { return }
- tokenize 32 $strip($1-)
- seen_clear $network $knick $chan
- seen_write $network $knick $chan event $event
- seen_write $network $knick $chan time $ctime
- seen_write $network $knick $chan host $site
- seen_write $network $knick $chan by $nick
- seen_write $network $knick $chan message $iif($1-,$v1,0)
- }
- ON !*:ACTION:*:#: {
- var %nc = $+($network,~,$nick,~,$chan)
- if ($istok($seen_excepts,%nc,32)) { return }
- tokenize 32 $strip($1-)
- seen_clear $network $nick $chan
- seen_write $network $nick $chan event $event
- seen_write $network $nick $chan time $ctime
- seen_write $network $nick $chan host $site
- seen_write $network $nick $chan message $iif($1-,$v1,0)
- }
- ON !*:NOTICE:*:#: {
- var %nc = $+($network,~,$nick,~,$chan)
- if ($istok($seen_excepts,%nc,32)) { return }
- tokenize 32 $strip($1-)
- seen_clear $network $nick $chan
- seen_write $network $nick $chan event $event
- seen_write $network $nick $chan time $ctime
- seen_write $network $nick $chan host $site
- seen_write $network $nick $chan message $iif($1-,$v1,0)
- }
- ON !*:QUIT: {
- tokenize 32 $strip($1-)
- var %t = $comchan($nick,0)
- var %i = 1
- while (%i <= %t) {
- var %c = $comchan($nick,%i)
- var %nc = $+($network,~,$nick,~,%c)
- if (%c) && (!$istok($seen_excepts,%nc,32)) {
- seen_clear $network $nick %c
- seen_write $network $nick %c event $event
- seen_write $network $nick %c time $ctime
- seen_write $network $nick %c host $site
- seen_write $network $nick %c message $iif($1-,$v1,0)
- }
- inc %i
- }
- }
- ON !*:NICK: {
- var %t = $comchan($newnick,0)
- var %i = 1
- while (%i <= %t) {
- var %c = $comchan($newnick,%i)
- var %nc1 = $+($network,~,$newnick,~,%c)
- var %nc2 = $+($network,~,$nick,~,%c)
- if (%c) && (!$istok($seen_excepts,%nc1,32)) && (!$istok($seen_excepts,%nc2,32)) {
- seen_clear $network $nick %c
- seen_write $network $nick %c event $event
- seen_write $network $nick %c time $ctime
- seen_write $network $nick %c host $site
- seen_write $network $nick %c newnick $newnick
- }
- inc %i
- }
- }
- alias -l seen_clear {
- ; /seen_clear <network> <nickname> <#channel>
- if (!$1) && (!$2) && (!$3) { return }
- var %f = $seen_dir $+ \ $+ $mkfn($2) $+ .ini
- var %nc = $+($1,~,$3)
- var %r = $ini(%f,%nc)
- if (%r) { remini $qt(%f) %nc }
- var %l = $lines(%f)
- if (!%l) { .remove $qt(%f) }
- }
- alias -l seen_write {
- ; /seen_write <network> <nickname> <#channel> <item> <value>
- if (!$1) && (!$2) && (!$3) && (!$4) && (!$5) { return }
- if (!$isdir($seen_dir)) { mkdir $qt($seen_dir) }
- var %f = $seen_dir $+ \ $+ $mkfn($2) $+ .ini
- var %nc = $+($1,~,$3)
- writeini -n $qt(%f) %nc $4 $5-
- }
- alias -l seen_read {
- ; $seen_read(<network>,<nickname>,<#channel>,<item>)
- if (!$1) && (!$2) && (!$3) && (!$4) { return }
- var %f = $seen_dir $+ \ $+ $mkfn($2) $+ .ini
- var %nc = $+($1,~,$3)
- var %r = $readini(%f,n,%nc,$4)
- return $iif(%r,$v1,0)
- }
- alias -l bold { return $+($chr(2),$1-,$chr(2)) }
- alias -l underline { return $+($chr(31),$1-,$chr(31)) }
- alias -l italic { return $+($chr(29),$1-,$chr(29)) }
- alias -l reverse { return $+($chr(22),$1-,$chr(22)) }
- alias -l col {
- ; $col(N1-N2,TEXT)
- if ($1 == $null) { return }
- var %n0 = $gettok($1,1-2,45)
- var %n1 = $gettok(%n0,1,45)
- var %n2 = $gettok(%n0,2,45)
- if (%n1 !== $null) && (%n1 isnum 0-9) { var %n1 = 0 $+ %n1 }
- if (%n2 !== $null) && (%n2 isnum 0-9) { var %n2 = 0 $+ %n2 }
- if (%n1 !== $null) && (%n1 !isnum 0-98) { return }
- if (%n2 !== $null) && (%n2 !isnum 0-98) { return }
- if (%n1 !== $null) && (%n2 == $null) { var %t = %n1 }
- if (%n1 !== $null) && (%n2 !== $null) { var %t = $+(%n1,$chr(44),%n2)) }
- return $+($chr(3),%t,$2-,$chr(3))
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement