Seen-Memory — File Browser

Seen-Memoryv1.3 / Seen-Memoryv1.3 / Seen-Memory.mrc

Seen-Memory.mrc — 47.75 KB — Download this file

;---------------------------------------------------------------------------------------------------------------------------------------------------------------
;
;                                          Seen-Memory ( For mIRC >= 5.8 :) )
;                                       2000 - eViL_dEaD Scripts, All Rights Reserved.
;
;---------------------------------------------------------------------------------------------------------------------------------------------------------------

; ###### Dialog ######

dialog smemory {
  title "That which dreams eternally cannot die..."
  size 100 100 250 280
  option dbu
  button "Quit" , 1 , 5 265 240 10 , ok 
  icon 2 , 45 0 250 100 
  list 3 , 5 205 240 60 , multi , vsbar , read
  tab "Options I" , 4 , 5 5 240 195
  tab "Options II" , 5 
  tab "Manager" , 6
  tab "Seek a nick" , 7
  tab "Miscellaneous research" , 8

  box "Activate Seen Memory..." , 45 , 10 80 230 25 , tab 4
  button "?" , 46 , 15 89 7 10 , tab 4
  radio "Yes" , 47 , 25 90 30 10 , group , tab 4
  radio "No" , 48, 215 90 20 10 , tab 4
  text "<----------------------------------------------- Ou ------------------------------------------------------>" , 49 , 45 91 170 10 , tab 4
  box "Status of the database..." , 50 , 10 110 230 45 , tab 4
  button "?" , 51 , 15 119 7 10 , tab 4
  text "0% " , 52 , 25 121 20 10 , tab 4 
  text "" , 53 , 36 121 182 10 , tab 4 
  text "100% " , 54 , 218 121 20 10 , tab 4 
  button "?" , 55 , 15 135 7 10 , tab 4
  text "Maximum entry in the database ==>  Min ( 100 ) " , 56 , 25 137 150 10 , tab 4
  edit "" , 57 , 165 135 17 10 , tab 4
  text "Max ( 10000 )" , 58 , 185 137 35 10 , tab 4
  button "OK" , 59 , 220 135 15 10 , tab 4
  box "Options of Seen Memory..." , 60 , 10 160 230 35 , tab 4
  button "?" , 61 , 15 169 7 10 , tab 4
  text "Activation command => " , 62 , 25 170 70 10 , tab 4
  edit "" , 63 , 90 169 30 10 , autohs , tab 4
  check "Indicate search time" , 64 , 150 169 90 10 , tab 4
  button "?" , 65 , 15 182 7 10 , tab 4
  text "Channel reply by => " , 66 , 25 183 70 10 , tab 4
  radio "Channel message" , 67 , 90 182 60 10 , group , tab 4
  radio "Private" , 68, 167 182 30 10 , tab 4
  radio "Notice" , 69 , 207 182 30 10 , group , tab 4

  box "Options of Seen Memory...( next )" , 100 , 10 25 230 170 , tab 5
  button "?" , 101 , 15 34 7 10 , tab 5
  check "Private reply ?" , 102 , 30 34 120 10 , tab 5
  button "?" , 103 , 15 49 7 10 , tab 5
  check "Dcc Chat reply ?" , 104 , 30 49 120 10 , tab 5
  button "?" , 105 , 15 79 7 10 , tab 5
  check "Seen Flood Protection ?" , 106 , 30 79 120 10 , tab 5
  text "Max of " , 107 , 15 94 40 10 , tab 5
  edit "" , 108 , 50 93 20 10 , tab 5
  text "request per address in " , 109 , 75 94 60 10 , tab 5
  edit "" , 110 , 140 93 20 10 , tab 5
  text "seconds." , 111 , 170 94 40 10 , tab 5
  button "?" , 112 , 15 64 7 10 , tab 5
  check "Show seen request in the status ?" , 113 , 30 64 150 10 , tab 5
  button "?" , 114 , 15 109 7 10 , tab 5
  text "Channels not to log..." , 115 , 30 110 110 10 , tab 5
  edit "" , 116, 15 122 90 10 , tab 5
  button "Add" , 117 , 15 137 40 10 , tab 5
  button "Erase" , 118 , 65 137 40 10 , tab 5
  list 119 , 120 113 115 42 , multi , vsbar , hsbar, read , sort , tab 5
  button "?" , 120 , 15 152 7 10 , tab 5
  text "Channels where seen request will not be treated..." , 121 , 30 151 80 12 , tab 5
  edit "" , 122, 15 167 90 10 , tab 5
  button "Add" , 123 , 15 182 40 10 , tab 5
  button "Erase" , 124 , 65 182 40 10 , tab 5
  list 125 , 120 156 115 42 , multi , vsbar , hsbar, read , sort , tab 5

  box "Backup the database on your HD..." , 200 , 10 25 230 40 , tab 6
  button "?" , 201 , 15 34 7 10 , tab 6
  radio "Every deconnections ( Recommended )" , 202 , 30 34 120 10 , group , tab 6
  button "?" , 203 , 15 49 7 10 , tab 6
  radio "Every hours and deconnections ( Not recommended )" , 204 , 30 49 180 10 , tab 6
  box "Database filtering..." , 205 , 10 70 230 70 , tab 6
  button "?" , 206 , 15 79 7 10 , tab 6
  text "Filter entries of more than:" , 207 , 30 80 100 10 , tab 6
  edit "" , 208 , 130 79 20 10 , tab 6
  text "days..." , 209 , 160 80 20 10 , tab 6
  check "Every mIRC starting..." , 210 , 15 95 120 10 , tab 6
  button "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!        NOW        !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" , 211 , 15 110 220 10 , tab 6
  button "/_!_\   ERASE ALL THE DATABASE   /_!_\" , 212 , 15 125 220 10 , tab 6

  box "Seek a nick in the database..." , 300 , 10 25 230 170 , tab 7
  button "?" , 301 , 15 34 7 10 , tab 7
  text "Research of: " , 302 , 30 35 40 10 , tab 7
  edit "" , 303 , 70 34 80 10 , tab 7
  button "Launch the research" , 304 , 155 34 80 10 , tab 7
  box "Résults of the research..." , 305 , 20 55 210 130 , tab 7
  text "Nick:" , 306 , 30 65 180 15 , tab 7
  text "Address:" , 307 , 30 80 180 15 , tab 7
  text "Action:" , 308 , 30 95 180 15 , tab 7
  text "Message:" , 309 , 30 125 180 15 , tab 7 
  text "Date:" , 310 , 30 140 180 15 , tab 7
  text "Actual state:" , 311 , 30 155 180 15 , tab 7
  text "Research time:" , 312 , 30 170 180 15 , tab 7
  text "Channel:" , 313 , 30 110 180 15 , tab 7

  box "Miscellaneous research..." , 400 , 10 25 230 170 , tab 8
  button "?" , 401 , 15 34 7 10 , tab 8
  text "Seek the entries of the database of less than" , 402 , 30 35 150 10 , tab 8
  edit "" , 403 , 175 34 13 10 , tab 8
  text "day(s)." , 404 , 195 35 20 10 , tab 8
  button "Launch the research" , 405 , 15 50 220 10 , tab 8
  button "?" , 406 , 15 64 7 10 , tab 8
  text "Seek the entries of the database of more than" , 407 , 30 65 150 10 , tab 8
  edit "" , 408 , 175 64 13 10 , tab 8
  text "day(s)." , 409 , 195 65 20 10 , tab 8
  button "Launch the research" , 410 , 15 80 220 10 , tab 8
  button "?" , 411 , 15 94 7 10 , tab 8
  text "Seek an address:" , 412 , 30 95 60 10 , tab 8
  edit "" , 413 , 90 94 145 10 , tab 8
  button "Launch the research" , 414 , 15 110 220 10 , tab 8
  text "Results of the research..." , 415 , 15 125 220 10 , center , tab 8
  list 416 , 15 135 220 60 , multi , vsbar , hsbar, read , tab 8
}

dialog smemory-chargement {
  title ""
  size -1 -1 500 100
  button "Ok :) " , 1 , 50 70 400 20 , ok
  text "" , 2 , 10 5 480 20 , center
  text "" , 3 , 10 45 480 20 , center
  text "" , 4 , 10 25 480 20 , center
}

dialog mess-smemory {
  title "That which dreams eternally cannot die..."
  size -1 -1 400 60
  button "I understand all the word :p" , 1 , 100 30 200 20 , ok
  text "" , 2 , 5 10 390 15 , center
}

; ###### Evenements Dialog ######

on *:dialog:smemory:sclick:4:{ set %smemory.check 1 | did -v smemory 2 | smaide 7 | verif-smemory }
on *:dialog:smemory:sclick:5:{ set %smemory.check 0 | did -h smemory 2 | smaide 66 }
on *:dialog:smemory:sclick:6:{ set %smemory.check 0 | did -h smemory 2 | smaide 113 }
on *:dialog:smemory:sclick:7:{ set %smemory.check 0 | did -h smemory 2 | smaide 150 }
on *:dialog:smemory:sclick:8:{ set %smemory.check 0 | did -h smemory 2 | smaide 161 }
on *:dialog:smemory:sclick:46:{ smaide 26 }
on *:dialog:smemory:sclick:47:{ set %smemory-seen oui | .enable #Seen-Memory | if ( $hget(seen).size == 0 ) { sm-aff-seen } | sm-status-seen | if ( %smemory-sauvegarde == horaire ) { .timersmsauvegarde -o 0 3600 /sm-sauvegarde-donnée } }
on *:dialog:smemory:sclick:48:{ set %smemory-seen non | .disable #Seen-Memory | .timersmsauvegarde off | sm-sauvegarde-seen }
on *:dialog:smemory:sclick:51:{ smaide 33 }
on *:dialog:smemory:sclick:55:{ smaide 38 }
on *:dialog:smemory:sclick:59:{ if ( $did(smemory,57) == $null ) { set %smemory-max-seen 4000 | verif-smemory | halt } 
  if ( $did(smemory,57) > 10000 ) { set %smemory-max-seen 10000 | verif-smemory | halt } 
  if ( $did(smemory,57) < 100 ) { set %smemory-max-seen 100 | verif-smemory | halt }
set %smemory-max-seen $did(smemory,57) | verif-smemory }
on *:dialog:smemory:sclick:61:{ smaide 49 }
on *:dialog:smemory:edit:63:{ if ( $did(smemory,63) == $null ) { set %smemory-commande seen | verif-smemory | halt }
set %smemory-commande $did(smemory,63) }
on *:dialog:smemory:sclick:64:{ if ( %smemory-temps == oui ) { set %smemory-temps non | halt } | if ( %smemory-temps == non ) { set %smemory-temps oui } }
on *:dialog:smemory:sclick:65:{ smaide 60 }
on *:dialog:smemory:sclick:67:{ set %smemory-type-reponse channel }
on *:dialog:smemory:sclick:68:{ set %smemory-type-reponse message }
on *:dialog:smemory:sclick:69:{ set %smemory-type-reponse notice }

on *:dialog:smemory:sclick:101:{ smaide 76 }
on *:dialog:smemory:sclick:102:{ if ( %smemory-prive == oui ) { set %smemory-prive non | halt } | if ( %smemory-prive == non ) { set %smemory-prive oui } }
on *:dialog:smemory:sclick:103:{ smaide 81 }
on *:dialog:smemory:sclick:104:{ if ( %smemory-dcc == oui ) { set %smemory-dcc non | halt } | if ( %smemory-dcc == non ) { set %smemory-dcc oui } }
on *:dialog:smemory:sclick:105:{ smaide 92 }
on *:dialog:smemory:sclick:106:{ if ( %smemory-protection == oui ) { set %smemory-protection non | verif-smemory | halt } | if ( %smemory-protection == non ) { set %smemory-protection oui | verif-smemory } }
on *:dialog:smemory:edit:108:{ if ( $did(smemory,108) == $null ) { set %smemory-max 5 | verif-smemory | halt } | if ( $did(smemory,108) < 1 ) { set %smemory-max 5 | verif-smemory | halt }
set %smemory-max $did(smemory,108) }
on *:dialog:smemory:edit:110:{ if ( $did(smemory,110) == $null ) { set %smemory-protection-temps 10 | verif-smemory | halt } | if ( $did(smemory,110) < 11 ) { set %smemory-protection-temps 10 | verif-smemory | halt }
set %smemory-protection-temps $did(smemory,110) }
on *:dialog:smemory:sclick:112:{ smaide 86 }
on *:dialog:smemory:sclick:113:{ if ( %smemory-log == oui ) { set %smemory-log non | halt } | if ( %smemory-log == non ) { set %smemory-log oui } }
on *:dialog:smemory:sclick:114:{ smaide 98 }
on *:dialog:smemory:sclick:117:{ if ( $did(smemory,116) == $null ) { halt } | if ( $chr(35) !isin $did(smemory,116) ) { mess_sm Invalid data... | halt }
  if ( $istok(%smemory-channel-non-log,$did(smemory,116),32)  == $true ) { mess_sm This channel is already in my database :p | halt }
set %smemory-channel-non-log %smemory-channel-non-log $did(smemory,116) | verif-smemory }
on *:dialog:smemory:sclick:118:{ if ( $did(smemory,119).sel == $null ) { mess_sm No selected channel :) | halt }
set %smemory-channel-non-log $remtok(%smemory-channel-non-log,$did(smemory,119,$did(smemory,119).sel).text,32) | verif-smemory }
on *:dialog:smemory:sclick:120:{ smaide 106 }
on *:dialog:smemory:sclick:123:{ if ( $did(smemory,122) == $null ) { halt } | if ( $chr(35) !isin $did(smemory,122) ) { mess_sm Invalid data... | halt }
  if ( $istok(%smemory-channel-non-rep,$did(smemory,122),32)  == $true ) { mess_sm This channel is already in my database :p | halt }
set %smemory-channel-non-rep %smemory-channel-non-rep $did(smemory,122) | verif-smemory }
on *:dialog:smemory:sclick:124:{ if ( $did(smemory,125).sel == $null ) { mess_sm No selected channel :) | halt }
set %smemory-channel-non-rep $remtok(%smemory-channel-non-rep,$did(smemory,125,$did(smemory,125).sel).text,32) | verif-smemory }

on *:dialog:smemory:sclick:201:{ smaide 119 }
on *:dialog:smemory:sclick:202:{ set %smemory-sauvegarde deconnection | .timersmsauvegarde off }
on *:dialog:smemory:sclick:203:{ smaide 129 }
on *:dialog:smemory:sclick:204:{ set %smemory-sauvegarde horaire | if ( $server != $null ) { .timersmsauvegarde -o 0 3600 /sm-sauvegarde-donnée } }
on *:dialog:smemory:sclick:206:{ smaide 138 }
on *:dialog:smemory:edit:208:{ if ( $did(smemory,208) == $null ) { set %smemory-epuration-temps 60 | verif-smemory | halt } | if ( $did(smemory,208) < 1 ) { set %smemory-epuration-temps 15 | verif-smemory | halt }
set %smemory-epuration-temps $did(smemory,208) }
on *:dialog:smemory:sclick:210:{ if ( %smemory-epuration == oui ) { set %smemory-epuration non | halt } | if ( %smemory-epuration == non ) { set %smemory-epuration oui } }
on *:dialog:smemory:sclick:211:{ seen_connection
  verif_dialog Laisser smemory-chargement | dialog -m smemory-chargement smemory-chargement | dialog -t smemory-chargement Seen Memory v1.3 => Data filtering... Please wait... 
  var %filtre = 0 | var %seen = $hget(seen,0).item | if ( %seen == 0 ) { goto fin } 
  var %temps = $ticks |  var %i = 1 | var %lig = $hget(seen,$hget(seen,%i).item) | var %i = 0
  while ( %lig != $null ) {
    did -ra smemory-chargement 3 Filtering time: $calc( ( $ticks - %temps ) / 1000 ) second(s) )
    if ( %i < 0 ) { /break } | inc %i | var %lig = $hget(seen,$hget(seen,%i).item) | if ( %lig == $null ) { /break }
  var %filtrage = $calc( $ctime - $gettok(%lig,4,32) ) | var %temps2 = $calc( 86400 * %smemory-epuration-temps ) | if ( %filtrage > %temps2 ) { .hdel seen $hget(seen,%i).item | inc %filtre | did -ra smemory-chargement 4 Filtered entry(s): %filtre ( Total: %seen entry(s) ). | dec %i | /continue } }
  var %fin = $ticks | :fin
  if ( %filtre != 0 ) { did -ra smemory-chargement 4 All in all: %filtre entry(s) filtered... | did -ra smemory-chargement 3 Filtering time: $calc( ( %fin - %temps ) / 1000 ) second(s) ) | sm-sauvegarde-seen }
if ( %filtre == 0 ) { did -ra smemory-chargement 4 All in all: no entry filtered... } }
on *:dialog:smemory:sclick:212:{ seen_connection
.hfree seen | .hmake seen 600 | sm-sauvegarde-seen | mess_sm The database was totally erased :) }

on *:dialog:smemory:sclick:301:{ smaide 155 }
on *:dialog:smemory:sclick:304:{ seen_connection
  var %nick = $did(smemory,303) | if ( %nick == $null ) { mess_sm No nick to seek :p | halt }
  did -ra smemory 307 Address: | did -ra smemory 308 Action: | did -ra smemory 309 Message:
  did -ra smemory 310 Date: | did -ra smemory 313 Channel:
  did -ra smemory 305 Results of the research... Search in progress... Please wait...
  var %temp = $ticks | var %recherche = $hget(seen,%nick)
  var %temps-recherche = $calc( ( $ticks - %temp ) / 1000 ) second(s)
  if ( %recherche == $null ) { did -ra smemory 306 Nick: no matches were found :p | goto fin }
  did -ra smemory 306 Nick: %nick
  did -ra smemory 307 Address: $replace($gettok(%recherche,3,32),inconnu,unknown)
  if ( $gettok(%recherche,2,32) == Nick ) { did -ra smemory 308 Action: changing nicks from $gettok(%recherche,5,32) }
  if ( $gettok(%recherche,2,32) != Nick ) { did -ra smemory 308 Action: $replace( $gettok(%recherche,1,32),join,joining a channel,kick,beeing kicked from a channel,part,parting a channel,quit,quitting) }
  did -ra smemory 313 Channel: $replace($gettok(%recherche,2,32),@,N/A)
  did -ra smemory 310 Date: $replace($duration($calc( $ctime - $gettok(%recherche,4,32))),wk,$tps(week),day,$tps(day),hr,$tps(hour),min,$tps(minute),sec,$tps(second)))
  if ( $gettok(%recherche,2,32) == Nick ) { did -ra smemory 309 Message: N/A | goto fin }
  if ( $gettok(%recherche,6,32) == $null ) { did -ra smemory 309 Message: N/A | goto fin }
  did -ra smemory 309 Message: " $strip($gettok(%recherche,5-,32)) "
  :fin
  if ( $server == $null ) { did -ra smemory 311 Actual state: you are not connected... | goto fini }
  if ( $comchan($did(smemory,303),1) != $null ) { 
    var %i = 1 | var %liste_channel = on | :debchan
    if ( $comchan($did(smemory,303),%i) == $null ) { goto finchan }
    var %liste_channel = %liste_channel $comchan($did(smemory,303),%i)
  inc %i | goto debchan | :finchan }
  if ( %liste_channel == $null ) { did -ra smemory 311 Actual state: no commom channel with $did(smemory,303) ... | goto fini }
  did -ra smemory 311 Actual state: %liste_channel 
:fini | did -ra smemory 312 Search time: %temps-recherche | did -ra smemory 305 Results of the research... }

on *:dialog:smemory:sclick:401:{ smaide 167 }
on *:dialog:smemory:sclick:405:{ seen_connection
  var %temps = $did(smemory,403) | if ( %temps == $null ) { mess_sm No defined time :p | halt } | if ( %temps <= 0 ) { mess_sm No time or negative time :p | halt }
  var %temps = $calc( %temps * 86400 ) | did -ra smemory 415 Search in progress... Please wait... | did -r smemory 416
  var %debut = $ticks | var %i = 1 | var %ligne = 1 | var %lig = $hget(seen,%i).item $hget(seen,$hget(seen,%i).item)
  while ( %lig != $null ) {
    if ( $calc( $ctime - $gettok(%lig,5,32) ) < %temps ) { did -i smemory 416 %ligne $strip( $sm-format-reponse( %lig ) ) | inc %ligne }
  inc %i | var %lig = $hget(seen,%i).item $hget(seen,$hget(seen,%i).item) }
  dec %ligne | var %fin = $ticks
  if ( %ligne == 0 ) { did -ra smemory 415 No matches were found... / $calc( ( %fin - %debut ) / 1000 ) second(s). }
  if ( %ligne > 0 ) { did -ra smemory 415 %ligne entries match your standards... / $calc( ( %fin - %debut ) / 1000 ) second(s). }
did -z smemory 416 }
on *:dialog:smemory:sclick:406:{ smaide 173 }
on *:dialog:smemory:sclick:410:{ seen_connection
  var %temps = $did(smemory,408) | if ( %temps == $null ) { mess_sm No defined time :p | halt } | if ( %temps <= 0 ) { mess_sm No time or negative time :p | halt }
  var %temps = $calc( %temps * 86400 ) | did -ra smemory 415 Search in progress... Please wait... | did -r smemory 416
  var %debut = $ticks | var %i = 1 | var %ligne = 1 | var %lig = $hget(seen,%i).item $hget(seen,$hget(seen,%i).item)
  while ( %lig != $null ) {
    if ( $calc( $ctime - $gettok(%lig,5,32) ) > %temps ) { did -i smemory 416 %ligne $strip( $sm-format-reponse( %lig ) ) | inc %ligne }
  inc %i | var %lig = $hget(seen,%i).item $hget(seen,$hget(seen,%i).item) }
  dec %ligne | var %fin = $ticks
  if ( %ligne == 0 ) { did -ra smemory 415 No matches were found... / $calc( ( %fin - %debut ) / 1000 ) second(s). }
  if ( %ligne > 0 ) { did -ra smemory 415 %ligne entries match your standards... / $calc( ( %fin - %debut ) / 1000 ) second(s). }
did -z smemory 416 }
on *:dialog:smemory:sclick:411:{ smaide 179 }
on *:dialog:smemory:sclick:414:{ seen_connection
  var %temps = $did(smemory,413) | if ( %temps == $null ) { mess_sm No defined address :p | halt } | if ( @ !isin %temps ) { mess_sm Invalid address | halt }
  did -ra smemory 415 Search in progress... Please wait... | did -r smemory 416
  var %debut = $ticks | var %i = 1 | var %ligne = 1 | var %lig = $hget(seen,%i).item $hget(seen,$hget(seen,%i).item)
  while ( %lig != $null ) {
    if ( %temps iswm $gettok(%lig,4,32) ) { did -i smemory 416 %ligne $strip( $sm-format-reponse ( %lig ) ) | inc %ligne }
  inc %i | var %lig = $hget(seen,%i).item $hget(seen,$hget(seen,%i).item) }
  dec %ligne | var %fin = $ticks
  if ( %ligne == 0 ) { did -ra smemory 415 No matches were found... / $calc( ( %fin - %debut ) / 1000 ) second(s). }
  if ( %ligne > 0 ) { did -ra smemory 415 %ligne entries match your standards... / $calc( ( %fin - %debut ) / 1000 ) second(s). }
did -z smemory 416 }

; ###### Alias ######

alias e-sm { echo $colour(Info Text) -s $timestamp $1- }

alias clean_smemory {
  if ( $dialog(smemory).title != $null ) { dialog -x smemory }
  unset %smemory*
  linesep | e-sm Uninstall Seen Memory 1.3
  e-sm Data erased...
  run -n deltree /y $shortfn($mircdirSeen-Memory)
  e-sm Directory erased...
  e-sm Seen-Memory.mrc unloaded and erased...
  e-sm Uninstall terminated...
  .timer 1 3 /.unload -rs $mircdirSeen-Memory.mrc
  .timer 1 5 /.remove $shortfn($mircdirSeen-Memory.mrc)
}

alias decrypt-sm {
  if ($2) {
    %crypt.i = 0 | %crypt.keynum = 0 | %crypt.keylen = $len($1) | %crypt.textlen = $len($2-) | unset %crypt.result
    :start
    inc %crypt.i
    if (%crypt.keynum >= %crypt.keylen) { %crypt.keynum = 1 } | else { inc %crypt.keynum }
    %crypt.decrypt = $calc($asc($mid($2-, %crypt.i, 1)) - $asc($mid($1, %crypt.keynum, 1)))
    if (%crypt.decrypt != 32) { %crypt.result = %crypt.result $+ $chr(%crypt.decrypt) }
    else { %crypt.result = %crypt.result $+ [ $chr(32) ] $+ $chr(%crypt.decrypt) }
    if (%crypt.i < %crypt.textlen) { goto start }
    unset %crypt.i | unset %crypt.keynum | unset %crypt.keylen | unset %key.textlen | unset %crypt.decrypt | unset %crypt.textlen | var %ligne = %crypt.result | unset %crypt.result 
return %ligne } }

alias seen_connection { if ( $server == $null ) { mess_sm Not avalaible when you are not connected to Irc :p | halt } 
if ( $hget(seen).size == 0 ) { mess_sm Seen server not actived. Activate it first :) | halt } }

alias smaide {
  if ( $1 == $null ) { halt }
  did -r smemory 3
  var %i = $1 | var %x = 1
  :deb
  var %lig = $read -nl $+ %i $shortfn($mircdirSeen-Memory\Aide._A_) 
  if ( %lig == $chr(160) ) { goto fin }
  if ( %lig == $null ) { goto fin }
  did -i smemory 3 %x $decrypt-sm(%auteur2,%lig)
  inc %i | inc %x
  goto deb
:fin }

alias sm-aff-seen {
  if ( $server == $null ) { halt }
  e-sm Loading Seen-Memory database... Please wait...
  var %network = $network | if ( %network == $null ) { var %network = inconnu } | set %smemory-serveur %network
  var %fic = " $+ $mircdirSeen-Memory\Database\ $+ %network $+ .ash $+ "
  if ( $hget(seen,0).item >= 0 ) { .hfree seen } | .hmake seen 600 | if ( $isfile(%fic) == $true ) { .hload seen %fic }
  var %nomb = 0 | var %filtre = 0 | if ( $hget(seen,0).item == 0 ) { goto fin } | var %temps = $ticks | var %i = 1 | var %lig = $hget(seen,$hget(seen,%i).item) | var %i = 0
  while ( %lig != $null ) {
    inc %i | var %lig = $hget(seen,$hget(seen,%i).item) | if ( %lig == $null ) { /break }
    if ( %smemory-epuration == oui ) { var %filtrage = $calc( $ctime - $gettok(%lig,4,32) ) | var %temps2 = $calc( 86400 * %smemory-epuration-temps ) | if ( %filtrage > %temps2 ) { inc %filtre | .hdel seen $hget(seen,%i).item | /continue } }
  inc %nomb }
  :fin
  if ( %nomb != 0 ) { e-sm => %nomb entries were loaded in $calc( ( $ticks - %temps ) / 1000 ) second(s) 
  if ( %filtre != 0 ) { e-sm => %filtre entries were filtered. } }
  if ( %nomb == 0 ) { e-sm => no entry loaded... Empty database... } 
}  

alias sm-check {  var %i = 1 | var %rep = $hget(seen,$1)
if ( %rep != $null ) { .hadd seen $1 $2- | halt } | if ( $hget(seen,0).item < %smemory-max-seen ) { .hadd seen $1 $2- | sm-status-seen } }

alias sm-format-reponse {
  if ( $gettok($1-,2,32) == Join ) { return $gettok($1-,1,32) ( $gettok($1-,4,32) ) was last seen joining $gettok($1-,3,32) $replace($duration($calc( $ctime - $gettok($1-,5,32))),wk,$tps(week),day,$tps(day),hr,$tps(hour),min,$tps(minute),sec,$tps(second))) ago. }
  if ( $gettok($1-,2,32) == Kick ) { 
    if ( $gettok($1-,7,32) == $null ) { return $gettok($1-,1,32) ( $gettok($1-,4,32) ) was last seen being kicked from $gettok($1-,3,32) by $gettok($1-,6,32) $replace($duration($calc( $ctime - $gettok($1-,5,32))),wk,$tps(week),day,$tps(day),hr,$tps(hour),min,$tps(minute),sec,$tps(second))) ago. }
  if ( $gettok($1-,7,32) != $null ) { return $gettok($1-,1,32) ( $gettok($1-,4,32) ) was last seen being kicked from $gettok($1-,3,32) par $gettok($1-,6,32) $replace($duration($calc( $ctime - $gettok($1-,5,32))),wk,$tps(week),day,$tps(day),hr,$tps(hour),min,$tps(minute),sec,$tps(second))) ago. Reason: $gettok($1-,7-,32) } }
  if ( $gettok($1-,2,32) == Nick ) { 
    if ( $comchan($gettok($1-,6,32),1) != $null ) { 
      var %i = 1 | var %liste_channel = on | :debchan
      if ( $comchan($gettok($1-,6,32),%i) == $null ) { goto finchan }
      var %liste_channel = %liste_channel $comchan($gettok($1-,6,32),%i) | inc %i | goto debchan | :finchan 
    return $gettok($1-,1,32) ( $gettok($1-,4,32) ) was last seen changing nicks from $gettok($1-,6,32) $replace($duration($calc( $ctime - $gettok($1-,5,32))),wk,$tps(week),day,$tps(day),hr,$tps(hour),min,$tps(minute),sec,$tps(second))) ago . $gettok($1-,6,32), is actually %liste_channel $+ . }
  return $gettok($1-,1,32) ( $gettok($1-,4,32) ) was last seen changing nicks from $gettok($1-,6,32) $replace($duration($calc( $ctime - $gettok($1-,5,32))),wk,$tps(week),day,$tps(day),hr,$tps(hour),min,$tps(minute),sec,$tps(second))) ago. }
  if ( $gettok($1-,2,32) == Part ) { 
    if ( $gettok($1-,6,32) == $null ) { return $gettok($1-,1,32) ( $gettok($1-,4,32) ) was last seen parting $gettok($1-,3,32) $replace($duration($calc( $ctime - $gettok($1-,5,32))),wk,$tps(week),day,$tps(day),hr,$tps(hour),min,$tps(minute),sec,$tps(second))) ago. }
  if ( $gettok($1-,6,32) != $null ) { return $gettok($1-,1,32) ( $gettok($1-,4,32) ) was last seen parting $gettok($1-,3,32) $replace($duration($calc( $ctime - $gettok($1-,5,32))),wk,$tps(week),day,$tps(day),hr,$tps(hour),min,$tps(minute),sec,$tps(second))) ago. Reason: $gettok($1-,6-,32) } }
  if ( $gettok($1-,2,32) == Quit ) { 
    if ( $gettok($1-,6,32) == $null ) { return $gettok($1-,1,32) ( $gettok($1-,4,32) ) was last seen quitting $replace($duration($calc( $ctime - $gettok($1-,5,32))),wk,$tps(week),day,$tps(day),hr,$tps(hour),min,$tps(minute),sec,$tps(second))) ago. } 
if ( $gettok($1-,6,32) != $null ) { return $gettok($1-,1,32) ( $gettok($1-,4,32) ) was last seen quitting $replace($duration($calc( $ctime - $gettok($1-,5,32))),wk,$tps(week),day,$tps(day),hr,$tps(hour),min,$tps(minute),sec,$tps(second))) ago. Reason: $gettok($1-,6-,32) } } } 

alias smemory {                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         if ( $crc($shortfn($mircdirSeen-Memory\Seen-Memory.bmp)) != C66A2E95 ) { halt }
  var %lig = $read -l2 $shortfn($mircdirSeen-Memory\Aide._A_)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     | if ( $crc($shortfn($mircdirSeen-Memory\Ash.bmp)) != 96AE9364 ) { halt }
  var %lig2 = $read -l346 $shortfn($mircdirSeen-Memory\Aide._A_)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               | if ( $crc($shortfn($mircdirSeen-Memory\Aide._A_)) != 812B932E ) { halt }
  verif_dialog Laisser smemory | dialog -m smemory smemory
  did -g smemory 2 $shortfn($mircdirSeen-Memory\Seen-Memory.bmp)
  dialog -t smemory $decrypt-sm(%auteur2,%lig)
  set %auteurrr $read -l3 $shortfn($mircdirSeen-Memory\Aide._A_) | set %auteurrr $decrypt-sm(%auteur2,%auteurrr)
  verif-smemory | smaide 7
  window -hodp +Lfd @smemory 140 185 150 80 | window -a @smemory
  drawfill -r @smemory $rgb(191,191,191) $rgb(191,191,191) 10 10
  .timersmemory -mo 0 100 /smemory2
  unset %smemory.* | set %smemory.x 100 | set %smemory.y 100 | set %smemory.scroll 1 | set %smemory.temps $time | set %smemory.check 1
} 

alias smemory2 {
  if ( $dialog(smemory).title == $null ) { .timersmemory off | window -c @smemory | unset %smemory.* %auteurrr | halt }
  if ( eViL_d !isin %auteurrr ) { dialog -x smemory }
  if ( $appactive == $false ) { window -c @smemory | inc %smemory.scroll 1 | halt }
  if ( $appstate == minimized || $appstate == hidden ) { window -c @smemory | inc %smemory.scroll 1 | halt } 
  if ( $appactive == $true ) {
    inc %smemory.scroll 1
    if ( %smemory.check == 0 ) { window -c @smemory | halt }
    if ( %smemory.check == 1 ) { if ( $window(@smemory) == $null ) { unset %smemory.smemory | window -hodp +Lfd @smemory $calc( $dialog(smemory).x + 40 ) $calc( $dialog(smemory).y + 85 ) 150 80 | window -a @smemory | drawfill -r @smemory $rgb(191,191,191) $rgb(191,191,191) 10 10 } }
    if ( ( $dialog(smemory).title != $null ) && ( $dialog(smemory).x != %smemory.x || $dialog(smemory).y != %smemory.y ) ) { 
    set %smemory.x $dialog(smemory).x | set %smemory.y $dialog(smemory).y | window -c @smemory | window -hodp +Lfd @smemory $calc( $dialog(smemory).x + 40 ) $calc( $dialog(smemory).y + 85 ) 150 80 | window -a @smemory | drawfill -r @smemory $rgb(191,191,191) $rgb(191,191,191) 10 10 }
    if ( $dialog(smemory).title != $null ) { 
      if ( %smemory.scroll >= 248 ) { set %smemory.scroll 1 } | if ( eViL_d !isin %auteur2 ) { dialog -x smemory }
      drawtext -rc @smemory  $rgb(191,191,191) Tahoma 12 5 $calc( 90 - %smemory.scroll + 1 ) 500 200 $str($chr(160),3) < Seen-Memory v1.3 >   
      drawtext -rc @smemory  $rgb(191,191,191) Tahoma 12 5 $calc( 102 - %smemory.scroll + 1 ) 500 200 $str($chr(160),6) %auteurrr  
      drawtext -rc @smemory  $rgb(191,191,191) Tahoma 12 5 $calc( 114 - %smemory.scroll + 1 ) 500 200 $str($chr(160),7) for mIRC >= 5.8
      drawtext -rc @smemory  $rgb(191,191,191) Tahoma 12 5 $calc( 126 - %smemory.scroll + 1 ) 500 200 $str($chr(160),10) It's %smemory.temps
      drawtext -rc @smemory  $rgb(191,191,191) Tahoma 12 5 $calc( 138 - %smemory.scroll + 1 ) 500 200 $chr(160)
      drawtext -rc @smemory  $rgb(191,191,191) Tahoma 12 5 $calc( 235 - %smemory.scroll + 1 ) 500 200 $str($chr(160),3) (c)2000 :: [ Ash Project ] ::
      drawtext -c @smemory  1 Tahoma 12 5 $calc( 90 - %smemory.scroll ) 500 200  $str($chr(160),3) < Seen-Memory v1.3 >    
      drawtext -c @smemory  1 Tahoma 12 5 $calc( 102 - %smemory.scroll ) 500 200 $str($chr(160),6) %auteurrr
      drawtext -c @smemory  1 Tahoma 12 5 $calc( 114 - %smemory.scroll ) 500 200 $str($chr(160),7) for mIRC >= 5.8
      drawtext -c @smemory  1 Tahoma 12 5 $calc( 126 - %smemory.scroll ) 500 200 $str($chr(160),10) It's $time
      drawtext -c @smemory  1 Tahoma 12 5 $calc( 138 - %smemory.scroll ) 500 200 $chr(160)
      drawpic -c @smemory 2 $calc( 150 - %smemory.scroll ) $shortfn($mircdirSeen-Memory\Ash.bmp)
      drawline -r @smemory $rgb(191,191,191) 1 0 $calc( 222 - %smemory.scroll ) 150 $calc( 222 - %smemory.scroll ) 
      drawtext -c @smemory  1 Tahoma 12 5 $calc( 235 - %smemory.scroll ) 500 200 $str($chr(160),3) (c)2000 :: [ Ash Project ] ::
set %smemory.temps $time } } }

alias mess_sm {
  verif_dialog mess-smemory
  var %lig = $read -l4 $shortfn($mircdirSeen-Memory\Aide._A_) 
  dialog -mo mess-smemory mess-smemory
  dialog -t mess-smemory $decrypt-sm(%auteur2,%lig)
  did -ra mess-smemory 2 $1-
}

alias sm-recherche {
  if ( $2 == @ ) { if ( $1 == channel ) { /msg $3 $5- } | if ( $1 == message ) { .msg $4 $5- } | if ( $1 == notice ) { .notice $4 $5- } | halt }
  var %temps = $ticks | var %i = 1 | :deb | var %rep = $hget(seen,$4) | if ( %rep == $null ) { goto fin } | var %temps2 = $ticks
  var %rep = $4 $hget(seen,$4)
  if ( %smemory-temps == non ) {
    if ( $1 == channel ) { /msg $2 $3 $+ , $sm-format-reponse( %rep ) }
    if ( $1 == dcc ) { msg = $+ $3 $sm-format-reponse( %rep ) }
    if ( $1 == message ) { .msg $3 $sm-format-reponse( %rep ) }
    if ( $1 == notice ) { .notice $3 $sm-format-reponse( %rep ) }
  halt }
  if ( $1 == channel ) { /msg $2 $3 $+ , $sm-format-reponse( %rep ) ( Search time: $calc( ( %temps2 - %temps ) / 1000 ) second(s) ) }
  if ( $1 == dcc ) { msg = $+ $3 $3 $+ , $sm-format-reponse( %rep ) ( Search time: $calc( ( %temps2 - %temps ) / 1000 ) second(s) ) }
  if ( $1 == message ) { .msg $3 $sm-format-reponse( %rep ) ( Search time: $calc( ( %temps2 - %temps ) / 1000 ) second(s) ) }
  if ( $1 == notice ) { .notice $3 $sm-format-reponse( %rep ) ( Search time: $calc( ( %temps2 - %temps ) / 1000 ) second(s) ) }
  halt
  :fin 
  if ( $1 == channel ) { /msg $2 Sorry $3 I don't remember seeing $4 ... }
  if ( $1 == dcc ) { msg = $+ $3 Sorry $3 I don't remember seeing $4 ... }
  if ( $1 == message ) { .msg $3 Sorry $3 I don't remember seeing $4 ... }
  if ( $1 == notice ) { .notice $3 Sorry $3 I don't remember seeing $4 ... }
}

alias sm-sauvegarde-seen {  if ( $hget(seen).size == 0 ) { halt }
  if ( $1 = 1 ) { e-sm Backing Up the Seen Memory database... Please wait... } | var %temps = $ticks
  if ( %smemory-serveur == $null ) { set %smemory-serveur inconnu }
  var %fic = " $+ $mircdirSeen-Memory\Database\ $+ %smemory-serveur $+ .ash $+ " | var %fic = $shortfn(%fic)
  .hsave -o seen %fic | var %temps2 = $ticks
  if ( $1 = 1 ) { if ( $hget(seen,0).item != 0 ) { e-sm => $hget(seen,0).item entries saved in $calc( ( %temps2 - %temps ) / 1000 ) second(s) }
if ( $hget(seen,0).item == 0 ) { e-sm => No entry to save... } | .hfree seen } | :fini }

alias sm-sauvegarde-donnée { if ( $server == $null ) { .timersmsauvegarde off | halt } | sm-sauvegarde-seen 1 }

alias sm-status-seen {  if ( $dialog(smemory).title == $null ) { halt } |  var %rep = $hget(seen,0).item
  if ( %rep == 0 ) { did -ra smemory 52 >0%< } | if ( %rep != 0 ) { did -ra smemory 52 0% }
  if ( %rep == %smemory-max-seen ) { did -ra smemory 54 >100%< } | if ( %rep != %smemory-max-seen ) { did -ra smemory 54 100% }
  did -ra smemory 50 Status of the database... ( %rep entries / $calc( %rep / %smemory-max-seen * 100 ) $+ % Full )
did -ra smemory 53 $str($chr(1),$int( $calc( %rep / %smemory-max-seen * 120 ) ) ) }

alias tps { return $chr(160) $+ $1- }

alias verif_dialog { if ( $dialog($1).title != $null ) { dialog -v $1 | halt } }

alias verif-smemory { var %rep = $hget(seen,0).item | did -b smemory 108,110
  if ( %smemory-seen == oui ) { did -c smemory 47 | .enable #Seen-Memory | if ( %smemory-sauvegarde == horaire ) { .timersmsauvegarde -o 0 3600 /sm-sauvegarde-donnée } }
  if ( %smemory-seen == non ) { did -c smemory 48 | .disable #Seen-Memory | .timersmsauvegarde off } 
  did -ra smemory 57 %smemory-max-seen
  if ( %rep > %smemory-max-seen ) { if ( $hget(seen).size == 0 ) { goto suitemax }
    var %i = $calc( %rep - %smemory-max-seen ) 
    var %x = $calc( %smemory-max-seen + 1 ) | var %temp = $hget(seen,%x).item
    while ( %temp != $null ) { .hdel seen %temp | var %temp = $hget(seen,%x).item }
  mess_sm %i entries were erased from the database... | var %rep = $hget(seen,0).item }
  :suitemax | did -ra smemory 50 Status of the database... ( %rep entries / $calc( %rep / %smemory-max-seen * 100 ) $+ % Full )
  if ( %rep == 0 ) { did -ra smemory 52 [0%] } | if ( %rep != 0 ) { did -ra smemory 52 0% }
  if ( %rep == %smemory-max-seen ) { did -ra smemory 54 [100%] } | if ( %rep != %smemory-max-seen ) { did -ra smemory 54 100% } 
  did -ra smemory 53 $str($chr(1),$int( $calc( %rep / %smemory-max-seen * 120 ) ) )
  did -ra smemory 63 %smemory-commande
  if ( %smemory-type-reponse == channel ) { did -c smemory 67 }
  if ( %smemory-type-reponse == message ) { did -c smemory 68 }
  if ( %smemory-type-reponse == notice ) { did -c smemory 69 }
  if ( %smemory-temps == oui ) { did -c smemory 64 }
  if ( %smemory-prive  == oui ) { did -c smemory 102 }
  if ( %smemory-dcc  == oui ) { did -c smemory 104 }
  if ( %smemory-protection  == oui ) { did -c smemory 106 | did -e smemory 108,110 }
  did -ra smemory 108 %smemory-max
  did -ra smemory 110 %smemory-protection-temps
  if ( %smemory-log == oui ) { did -c smemory 113 }
  did -r smemory 119,125
  var %i = 1 | var %lig = $gettok(%smemory-channel-non-log,%i,32)
  while ( %lig != $null ) { did -a smemory 119 %lig | inc %i | var %lig = $gettok(%smemory-channel-non-log,%i,32) }
  var %i = 1 | var %lig = $gettok(%smemory-channel-non-rep,%i,32)
  while ( %lig != $null ) { did -a smemory 125 %lig | inc %i | var %lig = $gettok(%smemory-channel-non-rep,%i,32) }
  did -z smemory 119,125
  if ( %smemory-sauvegarde == deconnection ) { did -c smemory 202 }
  if ( %smemory-sauvegarde == horaire ) { did -c smemory 204 }
  did -ra smemory 208 %smemory-epuration-temps
  if ( %smemory-epuration == oui ) { did -c smemory 210 }
}

; ###### Core ######

on 1:CHAT:*: {  if ( %smemory-seen == non ) { goto fin } |  if ( %smemory-dcc == non ) { goto fin }

  if ( ( $1 == %smemory-commande ) && ( $2 != $null ) ) { 
    if ( %smemory-protection == non ) { goto nonmais }
    if ([ %smemory-temp.dcc. [ $+ [ $chat($nick).ip ] ] ] != $null ) { goto fin }

    if ([ %smemory-temp. [ $+ [ $chat($nick).ip ] ] ] == $null) { set  %smemory-temp. [ $+ [ $chat($nick).ip ] ] 1 | .timer 1 %smemory-protection-temps /unset %smemory-temp. [ $+ [ $chat($nick).ip ] ] | goto nonmais }
    if ([ %smemory-temp. [ $+ [ $chat($nick).ip ] ] ] >= %smemory-max ) { 
      e-sm Seen Flood from $nick ( $chat($nick).ip ) => more than %smemory-max seen request(s) seen in %smemory-protection-temps seconds : flooder will be ignore for 5 minutes...
      set %smemory-temp.dcc. [ $+ [ $chat($nick).ip ] ] 1 | .ignore -ncpku300 $nick | .unset %smemory-temp. [ $+ [ $chat($nick).ip ] ]  
    .timer 1 300 /unset %smemory-temp.dcc [ $+ [ $chat($nick).ip ] ] | goto fin }
    inc %smemory-temp. [ $+ [ $chat($nick).ip ] ]
    :nonmais 

    if ( %smemory-log == oui ) { e-sm $nick ( $chat($nick).ip ) requested the server seen on a Dcc Chat ( resarch of $2 ) ... }
    if ($2 == $me) { sm-recherche dcc @ $nick $nick I'm here $nick $+ !!! Quit wasting my precious time... | goto fin }
    if ($2 == $nick) { sm-recherche dcc @ $nick $nick $+ , go look in a mirror!!!. | goto fin }
    if ( $comchan($2,1) != $null ) { 
      var %i = 1 | var %liste_channel = on
      :debchan
      if ( $comchan($2,%i) == $null ) { goto finchan }
      var %liste_channel = %liste_channel $comchan($2,%i)
      inc %i
      goto debchan
      :finchan
    sm-recherche dcc @ $nick $nick $2 is %liste_channel :+) | goto fin } 
  sm-recherche dcc $nick $nick $2 } 
:fin  }

on 1:CONNECT: { .ial on | unset %smemory-temp.*
if ( %smemory-seen == oui ) { .enable #Seen-Memory | if ( %smemory-sauvegarde == horaire ) { .timersmsauvegarde -o 0 3600 /sm-sauvegarde-donnée } } | if ( %smemory-seen == non ) { .disable #Seen-Memory } }

on 1:DISCONNECT: { sm-sauvegarde-seen 1 | unset %smemory-temp.* | .timersmsauvegarde off | .timer 1 3 /unset %smemory-serveur
if ( %smemory-seen == oui ) { .enable #Seen-Memory } | if ( %smemory-seen == non ) { .disable #Seen-Memory } }

on 1:START: { unset %smemory-temp.* %smemory-serveur
if ( %smemory-seen == oui ) { .enable #Seen-Memory } | if ( %smemory-seen == non ) { .disable #Seen-Memory } }

on 1:TEXT:*:#:{ 

  if ( %smemory-seen == non ) { goto fin }
  if ( $istok(%smemory-channel-non-rep,$chan,32) == $true ) { goto fin }

  if ( ( $1 == %smemory-commande ) && ( $2 != $null ) ) { 
    if ( %smemory-protection == non ) { goto nonmais }

    var %site = *!*@ $+ $site | if ( $fulladdress != $null ) { var %site = $fulladdress }

    if ([ %smemory-temp. [ $+ [ $site ] ] ] == $null) { set  %smemory-temp. [ $+ [ $site ] ] 1 | .timer 1 %smemory-protection-temps /unset %smemory-temp. [ $+ [ $site ] ] | goto nonmais }
    if ([ %smemory-temp. [ $+ [ $site ] ] ] >= %smemory-max ) { 
      e-sm Seen Flood from $nick ( %site ) => more than %smemory-max seen request(s) in %smemory-protection-temps seconds : flooder will be ignore for 5 minutes...
    .ignore -ncpku300 *!*@ $+ $site | .unset %smemory-temp. [ $+ [ $site ] ]  | goto fin }
    inc %smemory-temp. [ $+ [ $site ] ]
    :nonmais 

    if ( %smemory-log == oui ) { e-sm $nick ( %site ) requested the server seen on $chan ( research of $2 ) ... }
    if ($2 == $me) { sm-recherche %smemory-type-reponse @ $chan $nick I'm here $nick $+ !!! Quit wasting my precious time... | goto fin }
    if ($2 == $nick) { sm-recherche %smemory-type-reponse @ $chan $nick $+ , go look in a mirror!!!. | goto fin }
    if ($2 ison $chan) { sm-recherche %smemory-type-reponse @ $chan $nick $2 is right here on $chan !!! I think it's time for you to go to an optician... | goto fin } 
    if ( $comchan($2,1) != $null ) { 
      var %i = 1 | var %liste_channel = on
      :debchan
      if ( $comchan($2,%i) == $null ) { goto finchan }
      var %liste_channel = %liste_channel $comchan($2,%i)
      inc %i
      goto debchan
      :finchan
    sm-recherche %smemory-type-reponse @ $chan $nick $2 is %liste_channel :+) | goto fin } 
  sm-recherche %smemory-type-reponse $chan $nick $2 } 
:fin } 

on 1:TEXT:*:?:{ 
  if ( %smemory-seen == non ) { goto fin }
  if ( %smemory-prive == non ) { goto fin }

  if ( ( $1 == %smemory-commande ) && ( $2 != $null ) ) { 
    if ( %smemory-protection == non ) { goto nonmais }

    var %site = *!*@ $+ $site | if ( $fulladdress != $null ) { var %site = $fulladdress }

    if ([ %smemory-temp. [ $+ [ $site ] ] ] == $null) { set  %smemory-temp. [ $+ [ $site ] ] 1 | .timer 1 %smemory-protection-temps /unset %smemory-temp. [ $+ [ $site ] ] | goto nonmais }
    if ([ %smemory-temp. [ $+ [ $site ] ] ] >= %smemory-max ) { 
      e-sm Seen Flood de $nick ( %site ) => more than %smemory-max seen request(s) in %smemory-protection-temps seconds : flooder will be ignore for 5 minutes...
    .ignore -ncpku300 *!*@ $+ $site | .unset %smemory-temp. [ $+ [ $site ] ]  | goto fin }
    inc %smemory-temp. [ $+ [ $site ] ]
    :nonmais 

    if ( %smemory-log == oui ) { e-sm $nick ( %site ) requested the server seen in private( research of $2 ) ... }
    if ($2 == $me) { sm-recherche message @ $nick $nick I'm here $nick $+ !!! Quit wasting my precioustime... | goto fin }
    if ($2 == $nick) { sm-recherche message @ $nick $nick $nick $+ , go look in a mirror!!!. | goto fin }
    if ( $comchan($2,1) != $null ) { 
      var %i = 1 | var %liste_channel = on
      :debchan
      if ( $comchan($2,%i) == $null ) { goto finchan }
      var %liste_channel = %liste_channel $comchan($2,%i)
      inc %i
      goto debchan
      :finchan
    sm-recherche message @ $nick $nick $2 is %liste_channel :+) | goto fin } 
  sm-recherche message $nick $nick $2 } 
:fin }

#Seen-Memory on

on 1:JOIN:#:{ if ( $nick == $me ) { goto fin }
  if ( $istok(%smemory-channel-non-log,$chan,32) == $true ) { goto fin }
  if ( $fulladdress != $null ) { sm-check $nick Join $chan $fulladdress $ctime | goto fin }
  sm-check $nick Join $chan $address($nick,5) $ctime
:fin }

on 1:KICK:#:{ if ( ( $nick == $me ) || ( $knick == $me ) ) { goto fin }
  if ( $istok(%smemory-channel-non-log,$chan,32) == $true ) { goto fin }
  if ( $address($knick,5) == $null ) { sm-check $knick Kick $chan Inconnu $ctime $nick $1- | goto fin }
  if ( $address($knick,5) != $null ) { sm-check $knick Kick $chan $address($knick,5) $ctime $nick $1- }
:fin }

on 1:NICK:{ if ( $nick == $me ) { goto fin }
  if ( $fulladdress != $null ) { sm-check $nick Nick @ $fulladdress $ctime $newnick | goto fin }
  if ( $address($nick,5) == $null ) { sm-check $nick Nick @ *!*@ $+ $site $ctime $newnick | goto fin }
  if ( $address($nick,5) != $null ) { sm-check $nick Nick @ $address($nick,5) $ctime $newnick }
:fin }

on 1:PART:#:{ if ( $nick == $me ) { goto fin }
  if ( $istok(%smemory-channel-non-log,$chan,32) == $true ) { goto fin }
  if ( $fulladdress != $null ) { sm-check $nick Part $chan $fulladdress $ctime $1- | goto fin }
  if ( $address($nick,5) == $null ) { sm-check $nick Part $chan *!*@ $+ $site $ctime $1- | goto fin }
  if ( $address($nick,5) != $null ) { sm-check $nick Part $chan $address($nick,5) $ctime $1- }
:fin }

on 1:QUIT: { if ( $nick == $me ) { goto fin }
  if ( $fulladdress != $null ) { sm-check $nick Quit @ $fulladdress $ctime $1- | goto fin }
  if ( $site == $null ) { sm-check $nick Quit @ Inconnu $ctime $1- | goto fin }
  if ( $site != $null ) { sm-check $nick Quit @ *!*@ $+ $site $ctime $1- }
:fin }

#Seen-Memory end

raw 001:*: { if ( %smemory-seen == oui ) { sm-aff-seen } }

; ###### Menu ######

menu @eViL_dEaD {
  sclick { if ( %evil_dead == 1 ) { window -c @eViL_dEaD | unset %evil_dead %coul_smemory } }
}

menu menubar,status,channel { 
  -
  Seen-Memory v1.3
  .Launch:/smemory
  .Mail me:/run mailto:ash@enjoy-unix.org?Subject=Seen Memory 1.3
  .-
  .Uninstall:/clean_smemory
}

; ###### Initialisation ######

on 1:LOAD: {
  if ( $version < 5.8 ) { linesep | e-sm Loading canceled... Please install a version of mIRC >= 5.8 ... | .unload -rs Seen-Memory.mrc | halt }
  if ( ( $window(-1).h < 768 ) && ( $window(-1).w < 1024 ) ) { linesep | e-sm Your screen resolution is not appropriate ( < 1024*768 ) , display may not be correct... }
  .ial on | set %test ok | window -hl @seen 50 50 200 200
  unset %evil_dead | set %auteur2 eViL_dEaD
  set %smemory-channel-non-log #montreal
  set %smemory-channel-non-rep ""
  set %smemory-commande !seen
  set %smemory-dcc oui
  set %smemory-epuration oui
  set %smemory-epuration-temps 60
  set %smemory-log oui
  set %smemory-max 4
  set %smemory-max-seen 2000
  set %smemory-prive oui
  set %smemory-protection oui
  set %smemory-protection-temps 30
  set %smemory-sauvegarde deconnection
  set %smemory-seen oui
  set %smemory-temps oui
  set %smemory-type-reponse channel
  unset %evil_dead
  window -aohdp +f  @eViL_dEaD $calc( ( $window(-1).w - 300 ) / 2 )  $calc( ( $window(-1).h - 200 ) / 2 ) 300 200 @eViL_dEaD
  drawfill @eViL_dEaD 1 1 1 1 
  set %coul_smemory 255 
  .timerdem -m 26 10 /aff_deb_smemory 
}

alias aff_deb_smemory {
  drawtext -rc @eViL_dEaD $rgb(%coul_smemory,%coul_smemory,%coul_smemory) Tahoma 50 50 65 500 500 eViL_dEaD
  dec %coul_smemory 10
  if ( %coul_smemory < 0 )  { .timerdem off | set %coul_smemory 255 | .timerdem -m 26 10 /aff_deb_smemory2 }
}

alias aff_deb_smemory2 {
  drawtext -rc @eViL_dEaD $rgb(%coul_smemory,%coul_smemory,%coul_smemory) Tahoma 60 50 65 500 500 présents
  dec %coul_smemory 10
  if ( %coul_smemory < 0 )  { .timerdem off |  set %coul_smemory 255 | .timerdem -m 26 1 /aff_deb_smemory3 }
}

alias aff_deb_smemory3 {
  drawtext -rc @eViL_dEaD $rgb(%coul_smemory,%coul_smemory,%coul_smemory) Tahoma 60 10 65 500 500 Seen-
  dec %coul_smemory 10
  if ( %coul_smemory < 0 )  { .timerdem off |  set %coul_smemory 255 | .timerdem -m 26 1 /aff_deb_smemory4 }
}

alias aff_deb_smemory4 {
  drawtext -rc @eViL_dEaD $rgb(%coul_smemory,%coul_smemory,%coul_smemory) Tahoma 60 100 65 500 500 Memory
  dec %coul_smemory 10
  if ( %coul_smemory < 0 )  { .timerdem off |  set %coul_smemory 255 | .timerdem -m 26 1 /aff_deb_smemory5 }
}

alias aff_deb_smemory5 {
  drawtext -rc @eViL_dEaD $rgb(%coul_smemory,%coul_smemory,%coul_smemory) Tahoma 60 30 65 500 500 version 1.3
  dec %coul_smemory 10
  if ( %coul_smemory < 0 )  { .timerdem off |  unset %coul_smemory | aff_deb_smemoryfin }
}

alias aff_deb_smemoryfin {
  set %evil_dead 1  
  .timerdem -m 0 100 /aff_deb_smemorynj
  drawtext -c @eViL_dEaD 0 Tahoma 14 80 5 500 500 Seen-Memory v1.3
  drawtext -c @eViL_dEaD 0 Tahoma 12 5 45 500 500 This addon allow you to have a seen server :pppp
  drawtext -c @eViL_dEaD 0 Tahoma 12 5 65 500 500 That was not difficult to guess ;)
  drawtext -c @eViL_dEaD 0 Tahoma 11 45 180 500 500  (c)2000 :: [ eViL_dEaD ] Scripts :: Ash Project ::
  drawtext -c @eViL_dEaD 0 Tahoma 11 60 155 500 500 ( Click in the window to close it ! )
}

alias aff_deb_smemorynj { if ( $window(@eViL_dEaD) == $null ) { .timerdem off | halt } | drawtext -rc @eViL_dEaD $rgb($rand(0,255),$rand(0,255),$rand(0,255)) Tahoma 18 15 105 500 500 <<<<<< Klatu Verata Nectu >>>>>>  }