Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;[Addon]
- ;Script=nickAlert
- ;Version=2.1
- ;Author=b1u3j (on Newnet)
- ;Desc=Logs channel chat containing your nick (or alternates) to a window called @nickAlerts.
- ;For=any mIRC script
- ;Date=July 17th 2003
- ;[script]
- ; to load, type: /load -rs nickAlert.mrc
- menu menubar,channel {
- nickAlert - See the chat about You. o_O:nickAlert
- }
- alias nickAlert {
- if ($dialog(nickAlert) == $null) { dialog -md nickAlert nickAlert }
- else { dialog -v nickAlert nickAlert }
- }
- on *:load: {
- echo -s 12
- echo -s 12 nickAlert 14 successfully Started.
- echo -s 12
- ;; set the defaults if not already set
- if (%nickAlert.ActiveChannel == $null) { set %nickAlert.ActiveChannel Yes }
- if (%nickAlert.PlaySound == $null) { set %nickAlert.PlaySound Yes }
- if (%nickAlert.DesktopWindow == $null) { set %nickAlert.DesktopWindow No }
- if (%nickAlert.SoundFile == $null) { set %nickAlert.SoundFile heheheh.mp3 }
- }
- on *:unload: {
- echo -s 12 nickAlert 14 successfully Unloaded.
- unset %nickAlert.Total
- }
- on *:TEXT:*:#:{
- if ($nickAlert.findMatch($strip($1-)) == $false) { return }
- if ( *WB isin $strip($1) ) { return }
- if ( $left($1,1) == ! ) { return }
- if (($chan = $active) && (%nickAlert.ActiveChannel == No)) { return }
- nickAlert.AddLine $1-
- }
- on *:ACTION:*:#:{
- if ($nickAlert.findMatch($1-) == $false) { return }
- if (($chan = $active) && (%nickAlert.ActiveChannel == No)) { return }
- nickAlert.AddLine 14says $1-
- }
- alias -l nickAlert.AddLine {
- ; add a line to the nickAlert window
- if ($1 != $null) {
- nickAlert.InitilizeWindow
- inc %nickAlert.Total
- aline -ph @nickAlerts 14 $bracket($network) $bracket($chan) $bracket($time(HH:nn)) 11 < $+ $nick $+ > $1-
- renwin @nickAlerts @nickAlerts - $bracket(Total Lines Captured: %nickAlert.Total)
- if (%nickAlert.PlaySound == Yes) { splay %nickAlert.SoundFile }
- }
- }
- alias -l nickAlert.InitilizeWindow {
- ; create a nickAlert window if it doesnt already exist
- if ($window(@nickAlerts) == $null) {
- if (%nickAlert.DesktopWindow == No) { window -nk0a @nickAlerts -1 -1 500 300 @nickAlerts }
- else { window -dnk0a @nickAlerts -1 -1 500 300 @nickAlerts }
- set %nickAlert.Total 0
- }
- }
- alias -l nickAlert.findMatch {
- ; check to see if your nick or any AlternateNicks is part of any word in the text.
- var %match = $matchtok($1-,$me,1,32)
- if ((%match != $null) && (%match != lolipop)) { return $true }
- var %i 1
- var %toks = $numtok(%nickAlert.AlternateNicks,32)
- if (%toks == $null) { return $false }
- while (%i <= %toks) {
- var %token = $gettok(%nickAlert.AlternateNicks,%i,32)
- var %match = $matchtok($1-,%token,1,32)
- if ((%match != $null) && (%match != lolipop)) { return $true }
- inc %i
- }
- return $false
- }
- alias -l bracket { if ($1- != $null) { return $chr(91) $+ $1- $+ $chr(93) } }
- dialog nickAlert {
- title "nickAlert Settings"
- size -1 -1 125 137
- option dbu
- text "Alternate nicks (seperated by spaces)", 9, 5 6 95 10
- edit "", 10, 5 15 115 12
- check "Watch Active Channel", 11, 20 31 70 9
- text "(in addition to inactive channels)", 111, 20 39 80 8, center
- radio "Normal Window", 12, 20 48 70 10, group
- radio "Desktop Window", 13, 20 56 70 10
- check "Play Audible nickAlert", 14, 20 69 70 9
- text "Alert Sound (wav, mp3, or mid)", 15, 17 82 91 8
- edit "", 16, 17 89 91 12
- button "Play", 161, 85 67 16 7, flat
- button "Stop", 162, 85 74 16 7, flat
- text "(put the file in the mIRC Sounds folder, or add the complete path)", 17, 10 102 90 15, center
- button "&OK", 1000, 47 122 30 10, default ok
- button "&Cancel", 1001, 81 122 30 10, cancel
- button "&Unload", 1002, 13 122 30 10
- }
- On *:dialog:nickAlert:*:*:{
- if ($devent == init) {
- did -ra $dname 10 %nickAlert.AlternateNicks
- if (%nickAlert.ActiveChannel == Yes) { did -c $dname 11 }
- if (%nickAlert.DesktopWindow == Yes) { did -c $dname 13 }
- else { did -c $dname 12 }
- if (%nickAlert.PlaySound == Yes) { did -c $dname 14 }
- did -ra $dname 16 %nickAlert.SoundFile
- }
- if ($devent == sclick) {
- if ($did == 161) { splay $did($dname,16).text }
- if ($did == 162) { splay stop }
- if ($did == 1001) { }
- if ($did == 1002) { dialog -c nickAlert | .unload -rs $script }
- if ($did == 1000) {
- set %nickAlert.AlternateNicks $did($dname,10).text
- if ($did($dname,11).state == 1) { set %nickAlert.ActiveChannel Yes } | else { set %nickAlert.ActiveChannel No }
- if ($did($dname,13).state == 1) { set %nickAlert.DesktopWindow Yes } | else { set %nickAlert.DesktopWindow No }
- if ($did($dname,14).state == 1) { set %nickAlert.PlaySound Yes } | else { set %nickAlert.PlaySound No }
- set %nickAlert.SoundFile $did($dname,16).text
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement