Notice Me

By Aucun50 on Feb 26, 2009

I haven't posted anything in a long time so this is my notice me, when someone says your name in a channel it will pm you notice you and beep you depending on the options you set in the dialog.

It come with an ignore list, you can add people to it are delete them (Names stored in a txt file)

dialog Dall {
  Title Delete All
  Size -1 -1 300 125
  Text "Are you sure you want continue?" 1, 70 10 200 30
  Button "Yes" 2, 67 35 70 20
  Button "No" 3, 160 35 70 20, ok
  Text "Warning! Deleting all will detele all names in your ignore file, there is no way to get this infomation back." 4, 30 65 250 50
}
on *:dialog:Dall:*:*: {
  if ($devent == sclick) { 
    if ($did == 2) { write -dc Notmsg.txt | did -ra NoticeMe 16 The file is called Notmsg.txt, you can delete it if your done using this script | did -ra NoticeMe 15 There are $lines(Notmsg.txt) Nick(s) in your ignore file | dialog -c Dall Dall }
  }
}
dialog NoticeMe {
  Title "Notice Setup"
  Size -1 -1 400 190
  option dpu
  Box "Main Options" 1, 5 5 190 180
  Check "Notice" 2, 15 25 60 20
  Check "Prive Message" 3, 15 50 90 20
  Check "Beep" 4, 15 75 60 20
  Button "Set" 5, 15 100 80 20
  Button "Unset" 6, 100 100 80 20
  Button "On" 7, 15 125 80 20
  Button "Off" 8, 100 125 80 20
  Edit "" 9, 15 155 165 20, read
  Box "Ignore Options" 10, 205 5 190 180 
  Edit "" 11, 215 25 150 20
  Button "Add" 12, 215 50 50 20
  Button "Del" 13, 265 50 50 20
  Button "Clear" 14, 315 50 50 20
  Text "" 15, 215 75 100 35
  Text "" 16, 215 110 137 45
  Button "Delete all" 17, 220 155 80 20
  Button "View" 18, 300 155 80 20
}
on *:dialog:NoticeMe:*:*: {
  if ($devent == sclick) { 
    if ($did == 5) { 
      if ($did(NoticeMe,2).state == 1) { set %notice on }
      elseif ($did(NoticeMe,2).state == 0) { set %notice off }
      if ($did(NoticeMe,3).state == 1) { set %pm on }
      elseif ($did(NoticeMe,3).state == 0) { set %pm off }
      if ($did(NoticeMe,4).state == 1) { set %beep on } 
      elseif ($did(NoticeMe,4).state == 0) { set %beep off } 
    }
    if ($did == 18) { run Notmsg.txt }
    elseif ($did == 17) { dialog -m Dall Dall }
    elseif ($did == 14) { did -ra NoticeMe 11 }
    elseif ($did == 13) { write -ds $+ $did(11) Notmsg.txt | did -ra NoticeMe 11 | did -ra NoticeMe 15 There are $lines(Notmsg.txt) Nick(s) in your ignore file | did -ra NoticeMe 16 The file is called Notmsg.txt, you can delete it if your done using this script }
    elseif ($did == 12) { write Notmsg.txt $did(11) | did -ra NoticeMe 11 | did -ra NoticeMe 15 There are $lines(Notmsg.txt) Nick(s) in your ignore file | did -ra NoticeMe 16 The file is called Notmsg.txt, you can delete it if your done using this script } 
    elseif ($did == 6) { unset %meon %pm %beep %notice | did -u NoticeMe 2,3,4 }
    elseif ($did == 7) { unset %meon | did -ra NoticeMe 9 Status: On }
    elseif ($did == 8) { set %meon 1 | did -ra NoticeMe 9 Status: Off }
  }
  if ($devent == init) {
    did -ra NoticeMe 16 The file is called Notmsg.txt, you can delete it if your done using this script
    did -ra NoticeMe 15 There are $lines(Notmsg.txt) Nick(s) in your ignore file
    if (%notice == on) { did -c NoticeMe 2 }
    if (%pm == on) { did -c NoticeMe 3 }
    if (%beep == on) { did -c NoticeMe 4 }
    if (!%meon) { did -ra NoticeMe 9 Status: On }
    elseif (%meon == 1) { did -ra NoticeMe 9 Status: Off }
  }
}
menu * {
  Notice Setup: dialog $iif($dialog(NoticeMe),-v,-m) NoticeMe NoticeMe
}
on *:TEXT:*:#: {
  if ($read(notmsg.txt,w,* $+ $nick $+ *)) { halt }  
  if ($me isin $1-) {
    if (!%meon) {
      if (%notice == on) { .notice $me $nick said: $1-  }
      if (%beep == on) { beep 2 }
      if (%pm == on) { query $me | echo $me $nick said: $1- | haltdef }
      elseif (!%beep) && (!%notice) && (!%pm) { }
    }
    elseif (%meon == 1) { }
  }
}

Comments

Sign in to comment.
Aucun50   -  Feb 27, 2009

All put that in the update, thanks for the help.

 Respond  
Jonesy44   -  Feb 27, 2009

if ($read(notmsg.txt,w, $+ $nick $+ )) { halt }

the w paramater specifies wildcard values for the next paramater, there is no need for the *'s and $+'s
Also, rather than halting if it matches, try continuing if it doesn't match. saves time in the total process.

if (!$read(notmsg.txt,w,$nick)) {
 Respond  
Aucun50   -  Feb 27, 2009

I'll add so you can ignore address' how does that sound?

 Respond  
Kirby   -  Feb 27, 2009

This is quite nice.
I haven't tested it but for the "Notmsg.txt", the ignore list, I heard you can edit an .ini file in your $mircdir which contains an Address book where you can control ignoring nicks by text events in channels, queries, and notices. (do Alt + B to see what I'm talking about).
From there, you can take the lines from the .ini file and then /did them into your dialog.
Just thought that since it's built-in, it would be easier.

Edit: Never mind, I was thinking of something else.

 Respond  
Aucun50   -  Feb 27, 2009

What kind slacker?

 Respond  
slacker   -  Feb 27, 2009

you may want to add some error checks to this

 Respond  
Reezy   -  Feb 27, 2009

Nice..

 Respond  
PuNkTuReD   -  Feb 27, 2009

nice update

 Respond  
Aucun50   -  Feb 27, 2009

Updated added a warning screen on delete all and you can view the file now

 Respond  
Aucun50   -  Feb 27, 2009

Good idea all get on it

 Respond  
PuNkTuReD   -  Feb 26, 2009

you should make a menu, and in the menu have the option to open the txt file being used, so if you add alot of nicks to it, you can go have a look at the nicks added.

 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.