;;
;; Noticetalker v0.9
;;
;; DIALOG TABLES
dialog ntalk {
title "<nick> on <server>"
size -1 -1 200 95
option dbu
edit "", 4, 2 63 155 10, autohs limit 300
button "&Send", 2, 160 62 37 12, default disabled
button "&Close", 1, 160 82 37 12, ok
edit "", 3, 2 2 196 60, read multi autovs vsbar
check "Show timestamp", 13, 2 74 155 10, flat
check "Close this window on disconnect from the server", 5, 2 84 155 10, flat
menu "&Options", 6
item "&Save...", 8, 6
item "&Options", 10, 6
item break, 9, 6
item "&Close", 7, 6, cancel
menu "&?", 11
item "&Info", 12, 11
text "mirc", 99, 0 0 0 0, hide
text "custom", 98, 0 0 0 0, hide
}
dialog ntalk.conf {
title "Notice Talker Config"
size -1 -1 154 142
option dbu
box "Default Settings", 1, 2 2 150 50
check "Enable Timestamp ", 2, 5 10 145 10, flat
check "Close Dialog on Disconnect from Server", 3, 5 20 145 10, flat
check "Ask me before closing (to close it)", 4, 15 30 135 10, disable flat
check "Ask me before closing (to save and close it)", 5, 15 40 135 10, disable flat
box "Design", 6, 2 55 150 70
radio "mIRC Design", 7, 5 65 145 10,flat
radio "MSN Messenger Design", 8, 5 75 145 10,flat
radio "AOL Instant Messenger Design", 9, 5 85 145 10,flat
radio "Custom Design:", 10, 5 95 145 10,flat
edit "", 11, 5 105 145 10, autovs disable
text "<nick> - <text> - <timestamp> - <time> - <return>", 12, 5 116 145 8, center hide
button "&Ok", 13, 40 127 37 12, default
button "&Cancel", 14, 80 127 37 12, cancel
}
;; DIALOG EVENTS
on *:dialog:ntalk.*.*:init:0:{
if ($conf(timestamp)) { did -c $dname 13 }
if ($conf(auto.close)) { did -c $dname 5 }
if ($conf(design) = custom) { did -b $dname 13 }
did -b $dname 8
dialog -t $dname $replace($dialog($dname).title,<nick>,$nnick,<server>,$scid($nscon).server)
did -ra $dname 98 $conf(custom)
did -ra $dname 99 $conf(design)
}
on *:dialog:ntalk.*.*:edit:4:{
if ($remove($did(4).text,$chr(32))) { did -e $dname 2 }
else { did -b $dname 2 }
}
on *:dialog:ntalk.*.*:menu:12:{
var %x = $input(mIRC Noticetalker v0.9 $crlf $crlf $+ written by Christopher 'Sephiroth' R. $crlf $crlf $+ Contact: Sephiroth@leech-world.de,tog,About)
}
on *:dialog:ntalk.*.*:menu:8:{ save }
on *:dialog:ntalk.*.*:menu:10:{ ntalk.conf }
on *:dialog:ntalk.*.*:sclick:5,13:{ did -f $dname 4 }
on *:dialog:ntalk.*.*:sclick:2:{
var %ta = $did(13).state,%t = $iif(%ta,$time($strip($timestampfmt)))
if ($design = msn) { a %t $scid($nscon).me says: | a $str($chr(160),2) $+ $strip($did(4).text) }
elseif ($design = aol) { a $scid($nscon).me $+ $iif(%ta,$chr(32) ( $+ $time(HH:nn:ss) $+ )) $+ : $strip($did(4).text) }
elseif ($design = custom) { a $replace($custom,<nick>,$scid($nscon).me,<time>,$time(HH:nn:ss),<timestamp>,$strip($timestamp),<return>,$crlf,<text>,$strip($did(4).text)) }
else { a %t -> - $+ $nnick $+ - $strip($did(4).text) }
!.scid $nscon !.notice $nnick $eval($strip($did(4).text),0)
did -rf $dname 4
did -b $dname 2
}
on *:dialog:ntalk.conf:sclick:3:{
if ($did(3).state) { did -e $dname 4,5 }
else { did -b $dname 4,5 }
}
on *:dialog:ntalk.conf:sclick:4,5:{ did -u $dname $iif($did == 4,5,4) }
on *:dialog:ntalk.conf:init:0:{
if ($conf(timestamp)) { did -c $dname 2 }
if ($conf(auto.close)) { did -c $dname 3 | did -e $dname 4,5 }
if ($conf(prompt)) { did -c $dname $conf(prompt) }
if ($conf(design) = custom) { did -c $dname 10 | did -aer $dname 11 $conf(custom) | did -v $dname 12 }
elseif ($conf(design) = aol) { did -c $dname 9 }
elseif ($conf(design) = msn) { did -c $dname 8 }
else { did -c $dname 7 }
}
on *:dialog:ntalk.conf:sclick:7,8,9,10:{
if ($did == 10) { did -afer $dname 11 $conf(custom) | did -v $dname 12 }
else { did -br $dname 11 | did -h $dname 12 }
}
on *:dialog:ntalk.conf:sclick:13:{
if (!$did(11) && $did(10).state) || ($did(10).state && (<text> !isin $did(11) || <nick> !isin $did(11))) {
if (!$did(11)) { did -ra $dname 12 Please add a custom format in this field! }
else { did -ra $dname 12 You have to add <text> and <nick>. }
did -f $dname 11 | beep
!.timerconfig.reset.text 1 3 did -ra $dname 12 <nick> - <text> - <timestamp> - <time> - <return>
}
else {
conf timestamp $did(2).state
conf auto.close $did(3).state
conf prompt $iif($did(4).state,4,$iif($did(5).state,5,0))
var %olddesign = $conf(design) $conf(custom)
if ($did(10).state) { conf design custom | conf custom $did(11).text }
elseif ($did(8).state) { conf design msn }
elseif ($did(9).state) { conf design aol }
else { conf design mIRC }
!.timerconfig.reset.text off
dialog -c $dname
write -c ntalk.hsh
hsave -o ntalk ntalk.hsh
if (%olddesign != $conf(design) $conf(custom)) { !.timer 1 0 var % $+ x = $!input(You have changed the Design $!+ $!chr(44) the changes will take effect if you reopen the Dialogs.,oig,Settings changed) }
}
}
on *:dialog:ntalk.conf:close:0:{ !.timerconfig.reset.text off }
;; EVENTS
on *:disconnect:{ dis }
on ^*:notice:*:?:{
if ($dialog($_dname)) {
if ($1-2 == DCC Send) && ((*?.?*.?*.?*) iswm $4)) { return }
haltdef
var %ta = $did($_dname,13).state,%t = $iif(%ta,$time($strip($timestampfmt)))
if ($design = msn) { a %t $nick says: | a $str($chr(160),2) $+ $strip($1-) }
elseif ($design = aol) { a $nick $+ $iif(%ta,$chr(32) ( $+ $time(HH:nn:ss) $+ )) $+ : $strip($1-) }
elseif ($design = custom) { a $replace($custom,<nick>,$nick,<time>,$time(HH:nn:ss),<timestamp>,$strip($timestamp),<return>,$crlf,<text>,$strip($1-)) }
else { a %t - $+ $nick $+ - $strip($1-) }
}
}
on *:start:{
if (!$hget(ntalk)) { hmake ntalk }
if ($exists(ntalk.hsh)) { hload ntalk ntalk.hsh }
}
on *:load:{
if ($version < 6.14) { unload -rs " $+ $script $+ " | echo $color(other) -ta mIRC 6.14 is needed to use this Script, please update your mIRC v $+ $version }
else {
conf custon <nick>: <text>
ntalk.conf
linesep
echo $color(info) -t Thank you for downloading and loading my Script.
echo $color(info) -t Type /ntalk <nick> [cid] to open a 'notice conversation' with <nick>.
echo $color(info) -t If you have found a bug, please contact me: Sephiroth@leech-world.de
linesep
}
}
on *:unload:{
if ($exists(ntalk.hsh)) { !.remove -rs ntalk.hsh }
if ($hget(ntalk)) { hfree ntalk }
echo $color(info) -t Thanks for using my Script. The configurationfile has been removed.
echo $color(info) -t If you have found a bug, please contact me: Sephiroth@leech-world.de
}
;; ALIASES
alias -l nscon { return $gettok($dname,2,46) }
alias -l nnick { return $gettok($iif($1,$1,$dname),3,46) }
alias -l design { return $did($iif($dname,$dname,$_dname),99) }
alias -l custom { return $did($iif($dname,$dname,$_dname),98) }
alias -l _dname { return $+(ntalk.,$cid,.,$nick) }
alias -l a {
var %dname = $iif($dname,$dname,$_dname)
did -e %dname 8
did -a %dname 3 $iif($did(%dname,3,1),$crlf) $+ $1-
}
alias ntalk {
if ($1) {
tokenize 32 $1 $iif($2,$2,$cid)
if ($2 isnum && $scid($2).status == connected) {
if (!$dialog($+(ntalk.,$2,.,$1))) { dialog -dm $+(ntalk.,$2,.,$1) ntalk }
}
else { echo $color(info) -a * The connection ID $2 doesn't exists or you are not connected. }
}
else { echo $color(info) -a * Usage: /ntalk <nick> [cid] }
}
alias -l conf {
if ($isid) { return $hget(ntalk,$$1) }
else { hadd -m ntalk $1 $$2- }
}
alias -l ntalk.conf { if (!$dialog(ntalk.conf)) { dialog -dm ntalk.conf ntalk.conf } }
alias -l tmp {
if ($isid) { return $hget(nclose.tmp,$$1) }
else { hadd -m nclose.tmp $1 $$2- }
}
alias -l dis {
var %x = $dialog(0)
while (%x) {
:research
if (!$tmp($dialog(%x))) {
tmp $dialog(%x) ignored
if (ntalk.*.* iswm $dialog(%x)) {
if ($did($dialog(%x),5).state) {
if ($conf(prompt) = 4) { !.timer 1 0 ntalk.closedialog 1 $dialog(%x) }
elseif ($conf(prompt) = 5) { !.timer 1 0 ntalk.closedialog 2 $dialog(%x) }
else { !.timer 1 0 ntalk.closedialog 3 $dialog(%x) }
%x = $dialog(0)
goto research
}
}
}
dec %x
}
if ($hget(nclose.tmp)) hfree nclose.tmp
}
alias ntalk.closedialog {
if ($1 = 1) { $-yesno(Do you want to close the conversation between you and $dialog($2).title $+ ?,dialog -c $2) }
elseif ($1 = 2) { $-yesno(Do you want to save the conversation with $dialog($2).title $+ ? $crlf $crlf $+ Note: If you choose "No" it will also be closed.,saveclose $2,dialog -c $2) }
elseif ($1 = 3) { dialog -c $2 }
}
alias -l saveclose { dialog -v $$1 | save $1 | dialog -c $1 }
alias -l save {
var %p = $conf(lastpath)
if (!%p) { %p = $logdir }
var %p = $$sfile($+(%p,$nnick($1),.,$date(yyyymmdd),.log),Select File,Save)
conf lastpath $nofile(%p)
savebuf -o $iif($1,$1,$dname) 3 " $+ %p $+ "
goto done
:error
reseterror
-error Error while saving file %p $+ , maybe you don't have access to this directory/file. $crlf $crlf $+ It could also be that the file is write protected.
:done
}
alias -l -error { $left($input($1-,adiog,Error),0) }
alias -l -yesno { if ($input($1,adiyg,Sure?)) { $2 } | else { $$3 } }