Nick Alert Dialog

By rhasttaff on Aug 17, 2008

hello!!
this is myself Nick alert dialog

when someone sayd your nick on a channel this will alert you and play a sound

you can configure the "echo" message.
all that you need is set a directory sound something like: wavs/call-me.wav or .mp3 (for the path Wavs on mirc directory.

to load: paste in Alt+R file/new
to open dialog: type /nalert

Image

p.s. This is a English version without that icons and translated to english.

Edit: to easely i did a few modifycation the Code will now ask for a directory of sound through the selection file dialog when you load the Code.

;#######################################################
;### Nick Alert by rhasttaff ###########################
;############################ preview model: xKuRt #####
;#######################################################
menu menubar,status {
  Nick-Alert /nalert $+ :/dialog -m nalert nalert
}

alias nalert {
  dialog -m nalert nalert
}

dialog nalert {
  title "Nick Alert"
  size -1 -1 219 84
  option dbu
  box "ALert Text", 1, 2 2 198 30
  edit "", 2, 4 18 169 11, autohs
  text "$nick sayd your nick on $chan at $time(HH:nn:ss)", 3, 33 9 126 8, disable center
  button "example", 4, 174 6 24 11
  text "Basic:", 5, 5 9 18 8
  check "Activ PopUps", 9, 7 45 45 8
  edit "", 13, 4 67 133 10, autohs
  check "Register text", 14, 70 44 46 9
  check "Notices too", 16, 137 44 47 8
  button "Preview", 17, 174 18 24 11
  box "msgs-window", 18, 61 35 139 23
  box "play this sound:", 19, 2 59 137 21
  box "Extras", 20, 2 35 53 23
  button "Ok", 21, 178 61 22 19, ok
}

dialog alert-ex {
  title "alert-example"
  size -1 -1 202 113
  option dbu
  text "$nick = people that has called your nick", 1, 4 9 82 8
  text "$chan = Channel of event", 2, 126 9 71 8
  text "$time(HH:nn:ss) = time of event", 3, 63 17 87 8
  text " *~> $nick <~* sayd your nick on *~> $chan <~* at  *~> $time(HH:nn:ss) <~* ", 4, 2 36 196 9
  text " -=[ $time(HH:nn:ss) ]=- alert! your nick on -=[ $chan ]=-  by  -=[ $nick ]=-", 5, 2 47 198 9
  text "( $time(HH:nn:ss) ) Alert!!! >>> $nick <<< call you  on >>> $chan <<< ", 6, 2 57 198 8
  box "Identifiers", 7, 1 1 199 26
  box "done examples", 8, 1 27 199 42
  text "wrong: *~>$nick<~*  -=[$nick ]=- >>> $nick<<<  ]$chan [", 9, 4 77 155 9
  text "right: *~> $nick <~* -=[ $nick ]=- >>> $nick <<< ] $chan [", 10, 4 86 158 8
  box "Atention on spaces", 11, 1 70 199 26
  text "do not let anything together the identifiers", 12, 162 75 37 20, center
  button "OK", 13, 79 98 37 14, ok
}
dialog alert-pop {
  title "Nick-alert"
  size -1 -1 184 65
  option dbu
  text "", 1, 1 7 180 6, center
  text "", 2, 3 22 178 28
  button "OK", 3, 72 52 37 12, ok
  box "Sayd Your nick", 5, 1 1 182 15
  box "Text-sayd", 6, 1 16 182 36
}
dialog alert-prev {
  title "Prev-Alert"
  size -1 -1 900 50
  button "ok", 1, 0 0 0 0, ok cancel hide
  icon 2, 0 0 900 50, alert.prev.bmp, noborder
}

on 1:dialog:nalert:init:0: {
  if (!%alert.tipoecho) { did -a nalert 2 9*7[ $ $+ nick 7]9* 12say13d 4Y6our 12nick 3o4n 9*7[ $ $+ chan 7]9* 3a4t 13*12( $ $+ time(HH:nn:ss) 12)13* }
  if (%alert.pops.state = 1) { did -c nalert 9 } 
  if (%alert.gravat.state = 1) { did -c nalert 14 } 
  if (%alert.gravan.state = 1) { did -c nalert 16 }
  if (%diretorio.do.som) { did -a $dname 13 %diretorio.do.som }
  if (%alert.tipoecho) { did -a $dname 2 %alert.tipoecho }
}
on 1:dialog:alert-pop:init:0: {
  did -a $dname 1 %al.pop.nome disse no %al.pop.canal $+ :
  did -a $dname 2 %al.pop.texto
}

on 1:dialog:nalert:sclick:4: {
  /dialog -m alert-ex alert-ex
}

on *:dialog:nalert:close:*: {
  if ($did(nalert,13)) { set %diretorio.do.som $did(nalert,13) }
  if ($did(nalert,2)) { set %alert.tipoecho $did(nalert,2) }
}
on 1:dialog:nalert:sclick:17: {
  /prever
}

on 1:dialog:nalert:sclick:9: {
  if (%alert.pops.state = 0) { set %alert.pops.state 1 } | else { set %alert.pops.state 0  } 
}
on 1:dialog:nalert:sclick:14: {
  if (%alert.gravat.state = 0) { set %alert.gravat.state 1 } | else { set %alert.gravat.state 0  } 
}
on 1:dialog:nalert:sclick:16: {
  if (%alert.gravan.state = 0) { set %alert.gravan.state 1 } | else { set %alert.gravan.state 0  } 
}

on *:TEXT:*:#: {
  if ($me isin $1-) && ($chan != $active) && (%alert.gravat.state = 1) && (%alert.pops.state = 0) { /window -g2 $chan  | echo -alfmi2 $eval(%alert.tipoecho,2)  | echo -@dito -[Text]- on -=[ $chan ]=- sayd by 4-=[ $nick ]=- = $1- | /splay -wp %diretorio.do.som | /editbox $chan $nick |  halt } 
  if ($me isin $1-) && ($chan != $active) && (%alert.gravat.state != 1) && (%alert.pops.state = 0) { /window -g2 $chan | echo -alfmi2 $eval(%alert.tipoecho,2) | /splay -wp %diretorio.do.som | /editbox $chan $nick | halt } 
  if ($chan = $active) && ($me isin $1-) && (%alert.gravat.state = 1) && (%alert.pops.state = 0) { /window -g2 $chan | echo -@dito -[Text]- on -=[ $chan ]=- sayd by 4-=[ $nick ]=- = $1- | /splay -wp %diretorio.do.som | halt }
  if ($chan = $active) && ($me isin $1-) && (%alert.gravat.state != 1) && (%alert.pops.state = 0) {  /window -g2 $chan | /splay -wp %diretorio.do.som | halt }
  if ($me isin $1-) && ($chan != $active) && (%alert.gravat.state = 1) && (%alert.pops.state = 1) { /window -g2 $chan | set %al.pop.nome $nick | set %al.pop.canal $chan | set %al.pop.texto $1- | echo -alfmi2 $eval(%alert.tipoecho,2)  | echo -@dito -[Text]- on -=[ $chan ]=- by 4-=[ $nick ]=- = $1- | /splay -wp %diretorio.do.som | /editbox $chan $nick | /dialog -m alert-pop alert-pop | halt } 
  if ($me isin $1-) && ($chan != $active) && (%alert.gravat.state != 1) && (%alert.pops.state = 1) { /window -g2 $chan | set %al.pop.nome $nick | set %al.pop.canal $chan | set %al.pop.texto $1- | echo -alfmi2 $eval(%alert.tipoecho,2) | /splay -wp %diretorio.do.som | /editbox $chan $nick | /dialog -m alert-pop alert-pop | halt } 
  if ($chan = $active) && ($me isin $1-) && (%alert.gravat.state = 1) && (%alert.pops.state = 1) { echo -@dito -[Text]- on -=[ $chan ]=- sayd by 4-=[ $nick ]=- = $1- | /splay -wp %diretorio.do.som | halt }
  if ($chan = $active) && ($me isin $1-) && (%alert.gravat.state != 1) && (%alert.pops.state = 1) {  /splay -wp %diretorio.do.som | halt }

}
on *:action:*:#: {
  if ($me isin $1-) && ($chan != $active) && (%alert.gravat.state = 1) && (%alert.pops.state = 0) { echo -alfmi2 $eval(%alert.tipoecho,2) 9(/me) | echo -@dito -[/me]- on -=[ $chan ]=- sayd by 4-=[ $nick ]=- = $1- | /splay -wp %diretorio.do.som | /editbox $chan $nick | halt } 
  if ($me isin $1-) && ($chan != $active) && (%alert.gravat.state != 1) && (%alert.pops.state = 0) { echo -alfmi2 $eval(%alert.tipoecho,2) 9(/me) | /splay -wp %diretorio.do.som | /editbox $chan $nick | halt } 
  if ($chan = $active) && ($me isin $1-) && (%alert.gravat.state = 1) && (%alert.pops.state = 0) { echo -@dito -[/me]- on -=[ $chan ]=- sayd by -=[ $nick ]=- = $1- | /splay -wp %diretorio.do.som | halt }
  if ($chan = $active) && ($me isin $1-) && (%alert.gravat.state != 1) && (%alert.pops.state = 0) {  /splay -wp %diretorio.do.som | halt }
  if ($me isin $1-) && ($chan != $active) && (%alert.gravat.state = 1) && (%alert.pops.state = 1) { set %al.pop.nome $nick | set %al.pop.canal $chan | set %al.pop.texto $1- | echo -alfmi2 $eval(%alert.tipoecho,2) 9(/me) | echo -@dito -[/me]- on -=[ $chan ]=- sayd by 4-=[ $nick ]=- = $1- | /splay -wp %diretorio.do.som | /editbox $chan $nick | /dialog -m alert-pop alert-pop | halt } 
  if ($me isin $1-) && ($chan != $active) && (%alert.gravat.state != 1) && (%alert.pops.state = 1) { set %al.pop.nome $nick | set %al.pop.canal $chan | set %al.pop.texto $1- | echo -alfmi2 $eval(%alert.tipoecho,2) 9(/me) | /splay -wp %diretorio.do.som | /editbox $chan $nick | /dialog -m alert-pop alert-pop | halt } 
  if ($chan = $active) && ($me isin $1-) && (%alert.gravat.state = 1) && (%alert.pops.state = 1) { echo -@dito -[/me]- on -=[ $chan ]=- sayd by -=[ $nick ]=- = $1- | /splay -wp %diretorio.do.som | halt }
  if ($chan = $active) && ($me isin $1-) && (%alert.gravat.state != 1) && (%alert.pops.state = 1) {  /splay -wp %diretorio.do.som | halt }

}

on *:NOTICE:*:*: {
  if (%svice-stop = off) && (%alert.gravan.state = 1) { echo -@dito -[Notice]- from  7-=[ $nick ]=- = $1- }
}

on 1:load: {
  set %alert.pops.state 0
  set %alert.gravat.state 0
  set  %alert.gravan.state 0
  set %diretorio.do.som $sfile($mircdir,Alert Sound .wav .mp3,select)
  echo -as 3C4a8R9r5E7g3A4d8O 9A5D7D9O7N 2N3I4C6K7A8L9E3R4T8A 3C4a8R9r5E7g3A4d8O
  echo -as By ->@rhasttaff@<-
}
alias prever {
  var %prever.texto = $did(nalert,2).text
  window -c @prev
  window -ph +d @prev 0 0 900 50
  drawfill @prev $colour(background) $colour(background) 1 1
  drawtext -pb @prev $colour(normal text) $colour(background) Fixedsys 11 $calc((1120 - $width(%prever.texto,Fixedsys,11)) / 2) $calc((50 - $height(%prever.texto,Fixedsys,11)) / 2) %prever.texto
  drawsave @prev alert.prev.bmp
  window -c @prev
  if ($dialog(alert-prev)) { dialog -m alert-prev alert-prev }
}

Comments

Sign in to comment.
rhasttaff   -  Aug 22, 2008

lol
yeah i guess he was half illiterate. so like my english

 Respond  
Eugenio   -  Aug 22, 2008

rofl
I would loose my english if I learnt from bob marley!

 Respond  
rhasttaff   -  Aug 22, 2008

lol my english comes from mIRC HelpFile and Bob Marley's Songs hehehe
just the low basic of the basic

 Respond  
napa182   -  Aug 18, 2008

but my English to resolv only a teacher beautiful and blonde culd help me with this way ;)

LMAO well put

 Respond  
rhasttaff   -  Aug 18, 2008

hey Thanks for all Eugenio :)

I think the part of the directory sound is resolved.
i just add on event "on load":
set %diretorio.do.som $sfile($mircdir,Alert Sound .wav .mp3,select)

but my English to resolv only a teacher beautiful and blonde culd help me with this way ;)

thanks again!

 Respond  
Eugenio   -  Aug 18, 2008

Make it

Menu * {   
Nick-Alert /nalert $+ :/dialog -m nalert nalert
}

Maybe make it let you search for the sound you want to play, if there is no sound or the .wav cant be found then halt it.
a few English errors that I dont think you did on purpose....apart form that nice code xD
/me rates 7

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.