The Scripts Monitor addon is a simple script that will allow you to view all of the addons/scripts you currently have loaded into your mIRC client. Built-in is also a feature to view any of the files, either with the built-in viewer, notepad or an application of your choice. However, these viewers should never replace the standard mIRC script editor window.
Updates (26 August 2008):
Updates (26 August 2008):
;ALIASES
alias smonitor ddialog smonitor
alias -l ddialog $iif(!$dialog($1),dialog -m $1 $1)
alias -l check.list var %s = $selmon | did - $+ $iif(%s,e,b) smonitor 3,23,24
alias -l selmon return $iif(!$1,$did(smonitor,19,$did(smonitor,19).sel),$did(smonitor,19).sel)
alias -l do.readme var %f = " $+ $scriptdirreadme.txt $+ " | $iif($isfile(%f),run %f,return $input(ReadMe.txt file not found!,wo,File Not Found))
alias -l smonitor_unload {
.timerSviewer* off
.timerSviewer 1 0 return $input(Scripts Monitor Unloaded Successfully! $+ $crlf $+ $crlf $+ Thank you for using!,io,Unload Complete)
.unload -rs $+(",$nopath($script),")
}
alias -l unload.script {
var %s = $check.script, %v = $1, %x = $iif(%s == $+(",$script,"),1,0), %d = dialog -x
if (%s) {
if ($input($iif(%x,You are attempting to unload the Scripts Monitor addon that you are currently using. Are you sure that you want to do this?,Are you sure that you wish to unload this script?),wy,Confirm Unload)) {
if (%x) { $iif($dialog(smonitor),%d smonitor) | $iif($dialog(sviewer),%d sviewer) | $iif($dialog(sabout),%d sabout) }
.unload -rs %s
if (!%x) { gather.scripts }
}
}
}
alias check.script {
var %s = $selmon
if (%s) {
:begin
if (Script: isin %s) { %s = $+(",$script($gettok(%s,2-,32)),") }
else { %s = $did(smonitor,19,$calc($did(smonitor,19).sel - 1)) | goto begin }
return %s
}
}
alias -l open.custom {
var %f = $check.script, %v = $+(",$sfile($mircdir*.exe,Select a custom file to open this script with...,Use),")
if (%v) {
if (!$isfile(%v)) { return $input(The application you have attempted to use does not exist. Please try again.,ho,Script View Failure) }
if (!$isfile(%f)) { gather.scripts | return $input(The mIRC script file you have attempted to view no longer exists. Please try again.,ho,Script View Failure) }
run %v %f
}
}
alias -l load.new {
var %f = $+(",$sfile($mircdir*.mrc,Select new mIRC script to load,Load),")
if ($isfile(%f)) {
if (*.mrc" !iswm %f) { $iif(!$input(This file does not end in the traditional '.mrc' mIRC Script file extension. However $+ $chr(44) if you are sure that it is a mIRC Script file you may continue to load it. $+ $crlf $+ $crlf $+ Do you still wish to load this file?,iyk18,Unknown Extension),return) }
.load -rs %f
if ($dialog(smonitor)) { gather.scripts }
return $input(%f $+ $crlf $+ $crlf $+ Script has been loaded successfully!,iok6,Script Loaded)
}
}
alias -l sview {
var %s = $check.script, %v = $1
if (%s) {
if (%v == d) { ddialog sviewer }
sload %v %s
}
}
alias -l ofolder {
var %s = $selmon, %i = $selmon(1)
if (%s) {
if (Location: isin %s) { run $+(",$gettok(%s,2-,32),") | return }
run $nofile($+(",$script($gettok(%s,2-,32)),"))
}
}
alias -l squick {
var %i = 1, %oString, %p = $1, %t = $script(0)
if (!%i) return No Scripts Are Currently Loaded!
while (%i <= %t) {
%oString = %oString $+ $iif(%p,$script(%i),$nopath($script(%i))) $+ $crlf
inc %i
}
return %oString
}
alias -l sload {
var %v = $1, %s = $2-
if ($isfile(%s)) {
if (%v == d) {
loadbuf -ro sviewer 2 %s
did -c sviewer 2 1
did -ra sviewer 1 Script Loaded: %s
return
}
run notepad %s
}
}
alias -l gather.scripts {
if ($dialog(smonitor)) {
var %i = 1, %t = $script(0), %d = smonitor, %f, %a = did -a %d 19
did -r %d 19
did -ra %d 18 &Currently Loaded Scripts ( $+ %t $+ )
while (%i <= %t) {
%f = $script(%i)
%a Script: $nopath(%f)
%a Location: $nofile(%f)
%a $chr(32)
inc %i
}
check.list
}
}
;DIALOGS
dialog -l smonitor {
title "Scripts Monitor"
size -1 -1 222 126
option dbu
menu "&File", 1
item "Load &New Script...", 2, 1
menu "&Open", 3, 1
item "Using Notep&ad", 4, 3
item "Using &Dialog Viewer", 5, 3
item break, 6, 3
item "C&ustom...", 7, 3
item break, 8, 1
item "&Exit", 9, 1, cancel
menu "&View", 10
item "Re&fresh", 13, 10
menu "&Help", 14
item "Read&Me...", 15, 14
item break, 16, 14
item "&About...", 17, 14
box "", 18, 3 24 216 99
list 19, 7 32 207 87, size hsbar vsbar
button "", 20, -4 0 230 21, disable
button "Vie&w...", 21, 3 3 30 14, flat
button "&Refresh", 22, 37 3 36 14, flat
button "&Open Folder", 23, 77 3 36 14, flat
button "&Unload Script", 24, 125 3 39 14, flat
button "&Close", 25, 180 3 39 14, flat ok
}
;;EVENTS FOR 'smonitor' DIALOG
ON *:DIALOG:smonitor:*:*: {
var %d = $dname, %e = $devent, %i = $did
if (%e == init) { gather.scripts }
if (%e == menu) {
if (%i == 2) { load.new }
if (%i == 4) { sview n }
if (%i == 5) { sview d }
if (%i == 7) { open.custom }
if (%i == 13) { gather.scripts }
if (%i == 15) { do.readme }
if (%i == 17) { ddialog sabout }
}
if (%e == sclick) {
if (%i == 19) { check.list }
if (%i == 21) { sview d }
if (%i == 22) { gather.scripts }
if (%i == 23) { ofolder }
if (%i == 24) { unload.script }
}
if ((%e == dclick) && (%i == 19)) { sview d }
}
dialog -l sviewer {
title "Script Viewer"
size -1 -1 315 213
option dbu
box "Script Loaded:", 1, 3 3 309 186
edit "", 2, 6 12 303 174, read multi return hsbar vsbar rich
button "View With &Notepad", 3, 90 193 54 15, ok
button "&Close", 4, 164 193 54 15, cancel
}
;;EVENTS FOR 'sviewier' DIALOG
ON *:DIALOG:sviewer:sclick:3:sview n $gettok($did(1),2-,58)
dialog -l sabout {
title "About Scripts Monitor"
size -1 -1 138 78
option dbu
icon 1, 5 9 40 40
text "Addon:", 2, 52 16 30 9
text "Scripts Monitor v1.00", 3, 84 16 51 9
text "Created by:", 4, 52 33 30 9
text "Zmodem", 5, 84 33 51 9
box "", 6, -4 53 145 4
link "http://www.hawkee.com/", 7, 6 63 63 9
button "&Close", 8, 102 61 30 12, cancel
text "Icon Not Found!", 9, 5 25 44 9
}
;;EVENTS FOR 'sabout' DIALOG
on *:DIALOG:sabout:init:0:var %f = " $+ $scriptdirsmonitor.png $+ " | if ($exists(%f)) { did -h sabout 9 | did -g sabout 1 %f | return } | did -h sabout 1
on *:DIALOG:sabout:sclick:7:run http://www.hawkee.com/
;MENUS
menu menubar,status {
Scripts Monitor
.Run...:smonitor
.-
.Quick View
..Show Total Scripts:return $input(Total Scripts Loaded: $script(0),io,QuickView: Total Scripts)
..-
..Show Basic List (No Paths):return $input(Scripts Currently Loaded: $+ $crlf $+ $crlf $+ $squick,io,QuickView: Basic List)
..Show Basic List (With Paths):return $input(Scripts Currently Loaded: $+ $crlf $+ $crlf $+ $squick(1),io,QuickView: Basic List)
.-
.Help
..About:ddialog sabout
..-
..ReadMe:do.readme
.-
.Unload:$iif($input(Are you sure you want to unload the Scripts Monitor addon?,wy,Confirm Unload),smonitor_unload)
}
;;LOAD EVENTS
ON *:LOAD:var %q = $input(Script Monitor Successfully Loaded! $+ $crlf $+ $crlf Would you like to run it now?,iyvk6,Addon Loaded!) | $iif((%q != $no) && (%q != $timeout),smonitor,return $input(You can run the addon at any time by typing: /smonitor,iok6,Additional Help))
Okay, as I've said, the edit boxes are limited in mIRC's dialogs. However, Khaled has recently responded to my post at the mIRC Bug Forum: http://trout.snt.utwente.nl/ubbthreads/ubbthreads.php?ubb=showflat&Number=205274&page=0#Post205274 with this:
"mIRC uses the standard Windows editbox by default in most dialogs, including custom dialogs. The limit for the standard editbox is between 32k and 64k. I'll add support for richedit editboxes in custom dialogs for the next version however, which will allow you to specify an arbitrary limit using the "limit" custom dialog parameter."
Things are lookin' up! :-)
Just to let everyone know, if you're finding that your entire script is not showing, please bear in mind that windows standard edit boxes, not a RICH EDIT which mIRC does NOT use, will not hold more than 64kb of data; this will result in the edit box holding around 655-660 lines of code MAX. However, I've actually ran into a predicament with that statement as well, as I've got 46kb files that will not show either. Unfortunately, this issue cannot be fixed, as it is a direct problem with Windows and mIRC, since Khaled won't use Rich Edit boxes, which store unlimited data. Sorry for any inconvenience!
Did you read my 'introduction', NIGathan & mascovy? The part where I put:
However, these viewers should never replace the standard mIRC script editor window.
As for why?. Why not? Why do people make auto-joins when there is one in mIRC? Why away systems? Why custom notify lists? It's just fun to create.
Scakk:
Still not able to open any of my scripts using the "View..." button. No error saying why at all.
Unload does not work either.
Both of these bugs should be fixed now. If it is still persisting, let me know. I have it set to use "QUOTES" around your file names, so even long names should work. I tested this under the name Long Old File Name.mrc and the unload feature worked. I went one step further and put an mIRC and the script into respective long folders C:\New Folder\Secondary New Folder\Long Folder\mIRC\my addons\testing script monitor.mrc and it still unloaded just fine.
As well, loading the files via the View... button should work properly now, almost for the exact same reason as the unload feature not working.
Please let me know if these problems persist.
Eugenio:
It still wont unload for me and now I get this error: * /unload: no such file 'Script' (line 10, Script Monitor)
FIXED! Sorry about that! The problem here seemed to be that I forgot about integrating the fact that lfn/long-file-names could be used (ie: needed $+(",fn,").
Thanks again for testing!
Scakk: Viewing via notepad worls fine for me. However just clicking View does not as it gives me the below error. - loadbuf -ro sviewer 2 %s
Eugenio: SMONITOR_UNLOAD Unknown command is the only error I got, apart from that this pwnz.....I like all the helpfull/usefull features aswell like unload script
Thanks guys for the bug feedback! :-)