Groups Viewer

By Zmodem on Oct 11, 2008

Groups Viewer is a very simple and basic snippet that allows you to view all of the #Groups that are loaded into mIRC. At this stage, it's very simple. More features may be added in the future as suggestions and ideas come rolling in.

Syntax: /gviewer

Image

Image

I'd also like to mention that Scakk had previously created something along these same lines; however, he implemented much more functionality within his. View it here.

UPDATE (25 October 2008): Added new features to the dialog:
1. Rich edit box now displays the script in the Group Viewer dialog. This ensures that an unlimited amount of characters can now be displayed. YOU MUST HAVE mIRC 6.35 or HIGHER FOR THIS TO WORK as this feature was just added in that version!

UPDATE (17 October 2008): Added new features to the dialog:
  1. Now you can see at which line in the script file the group begins at.

  2. You can now click on the new View button which will load the group from start to finish into a custom dialog window. This can make it easier to find groups that are causing weird actions to happen in your mIRC sessions.

  3. Added a 'Groups Viewer' menu to all of the menus, including: the menubar, channel menus, status menus and chat menus.
4. Now works with ini script files.
5. Added the ability to 'Run' the script file that the group is within, on both the Groups Viewer dialog as well as the View Group dialog.

;
; Basic snippet which will allow you to view all of the groups
; that are contained within your script files.
; Also contains the ability to enable/disable these groups.
;
; Syntax: /gviewer
;
; Use the dialog to navigate through the loaded groups.
;

; Aliases
alias gviewer dialog - $+ $iif($dialog(gviewer),a,m gviewer) gviewer
alias -l gadd if ($dialog(gviewer)) { did - $+ $iif($2,r,a) gviewer 2 $1 }
alias -l gendis {
  var %1 = $1, %g = $did(gviewer,2,$did(gviewer,2).sel), %e = $group(%g).status
  $iif(%1 == 5,.enable,.disable) %g
  did -c gviewer %1
  if (%e != $group(%g).status) { return $input(The group %g has been successfully $iif(%1 == 5,enabled,disabled) $+ !) }
}
alias -l glist {
  var %i = $group(0)
  did -u gviewer 5,6
  did -ra gviewer 1 Groups ( $+ $iif(%i,%i,0) $+ )
  gadd 1 1
  while (%i) {
    gadd $group(%i)
    dec %i
  }
  did -b gviewer 5,6,13,14
  did -r gviewer 8,12
}
alias -l gload {
  did -u gviewer 5,6
  did -e gviewer 13,14
  var %g = $did(gviewer,2,$did(gviewer,2).sel), %f, %l, %m, %i = 1
  %f = $qt($group(%g).fname)
  did -c gviewer $iif($group(%g).status == on,5,6)
  did -ra gviewer 8 %f
  did -c gviewer 8 1
  did -e gviewer 5,6
  window -c @gviewer
  window -h @gviewer
  loadbuf @gviewer %f
  %m = $line(@gviewer,0)
  while (%i <= %m) {
    %l = $line(@gviewer,%i)
    if ((* $+ %g on iswm %l) || (* $+ %g off iswm %l)) { did -ra gviewer 12 $iif(*.ini iswm %f,$calc(%i - 1),%i) | break }
    inc %i
  }
  window -c @gviewer
}
alias -l gview {
  var %g = $did(gviewer,2,$did(gviewer,2).sel), %f, %st = $did(gviewer,12), %i = %st, %fi = 0, %l
  %f = $qt($group(%g).fname)
  window -c @gviewer
  window -h @gviewer
  loadbuf @gviewer %f
  while (!%fi) {
    %l = $line(@gviewer,%i)
    if (* $+ %g end iswm %l) { %fi = %i | break }
    inc %i
  }
  dialog - $+ $iif($dialog(vgroup),a,m vgroup) vgroup
  did -ra vgroup 1 %f
  did -r vgroup 2
  if (*.ini iswm %f) {
    %st = $calc(%st - 1)
    while (%st <= %fi) {
      did -a vgroup 2 $readini(%f,script,n $+ %st) $+ $iif(%st < %fi,$crlf)
      inc %st
    }
  }
  else { loadbuf $+(%st,-,%fi) -o vgroup 2 %f }
  window -c @gviewer
  did -c vgroup 2 1
}

; Dialogs
dialog -l gviewer {
  title "Groups Viewer"
  size -1 -1 267 81
  option dbu
  box "Groups", 1, 3 3 108 75
  list 2, 7 11 99 63, sort size hsbar vsbar
  box "Information", 3, 114 3 150 59
  text "Status:", 4, 118 14 21 9
  radio "&On", 5, 145 14 25 9, group
  radio "&Off", 6, 186 14 25 9
  text "Filename:", 7, 118 32 39 9
  edit "", 8, 160 31 72 11, read multi return autohs
  button "&Refresh", 9, 114 65 30 12
  button "&OK", 10, 234 65 30 12, ok
  text "Starts At Line #", 11, 118 46 39 9
  edit "", 12, 160 45 45 11, read multi return autohs
  button "&View", 13, 207 45 24 12
  button "&Open...", 14, 235 30 24 12
}

; Dialog Events For: gviewer
ON *:DIALOG:gviewer:init:0:glist
ON *:DIALOG:gviewer:sclick:2:gload
ON *:DIALOG:gviewer:dclick:2:gview
ON *:DIALOG:gviewer:sclick:5,6:gendis $did
ON *:DIALOG:gviewer:sclick:9:glist
ON *:DIALOG:gviewer:sclick:13:gview
ON *:DIALOG:gviewer:sclick:14:run $did(8)

dialog -l vgroup {
  title "View Group"
  size -1 -1 228 144
  option dbu
  box "", 1, 3 3 222 120
  edit "", 2, 7 10 213 108, read multi return hsbar vsbar rich
  button "&Close", 3, 122 126 36 15, cancel
  button "&Run...", 4, 64 126 36 15, ok
}
; Dialog Events For: vgroup
ON *:DIALOG:vgroup:sclick:4:run $did(1)

; Menus
menu * {
  Groups Viewer:gviewer
}

Comments

Sign in to comment.
Zmodem   -  May 11, 2009

Thanks! I appreciate it ;)

 Respond  
eyiezinc   -  May 08, 2009

Nice work Zmodem!!

 Respond  
^Neptune   -  Oct 19, 2008

Nice. How you made it check what line it is is beyond me.

 Respond  
Zmodem   -  Oct 17, 2008

Updated again, added Run feature, thanks to Nemesis!

 Respond  
Zmodem   -  Oct 17, 2008

Alright, it's been updated! It will now work with ini script files. Feedback is appreciated! :)

 Respond  
Zmodem   -  Oct 17, 2008

Hey guys, sorry for any inconveniences, but I'm currently working on getting this to work with ini script files. Thank you for your patience!

 Respond  
Zmodem   -  Oct 17, 2008

Okay, updated it. Sorry about that! Should work now! Thanks for testing!

 Respond  
EL   -  Oct 17, 2008

I would if they worked, /loadbuf isnt working for meh

  • /loadbuf: unable to open file 'C:\Documents' (line 56, script28.txt)
  • /loadbuf: unable to open file 'C:\Documents' (line 56, script28.txt)
  • /loadbuf: unable to open file 'C:\Documents' (line 56, script28.txt)
  • /loadbuf: unable to open file 'C:\Documents' (line 56, script28.txt)
 Respond  
Zmodem   -  Oct 17, 2008

Updated! Let me know what you think of the new features!

 Respond  
^Neptune   -  Oct 13, 2008

That was me. lol

Head over to the server i'm on Zmodem. :)

 Respond  
Zmodem   -  Oct 13, 2008

Finally a like :-)

 Respond  
Zmodem   -  Oct 13, 2008

Hey, thanks guys! :-) But nobody has pressed the 'Liked' button yet! :-)

 Respond  
irchainscriptz   -  Oct 13, 2008

This is good Zmodem nicely done!

 Respond  
water_dragon   -  Oct 13, 2008

Nice! i like it 9/10 From Me! :)

 Respond  
Zmodem   -  Oct 12, 2008

Thanks, Kirby! :-D

 Respond  
Kirby   -  Oct 11, 2008

Hmm...I like this. :)

 Respond  
Zmodem   -  Oct 11, 2008

No problem! Thanks for testing it in the first place! :-)

 Respond  
^Neptune   -  Oct 11, 2008

Oh yeah. Sorry, didn't notice it :P

 Respond  
Zmodem   -  Oct 11, 2008

There is a box, bro, above the listbox on the left, it says how many are loaded.

As for adding a picture, done!

 Respond  
^Neptune   -  Oct 11, 2008

You should put up a lil' screenshot. :P

Also, maybe have a box or something displaying the total number of groups?

 Respond  
Zmodem   -  Oct 11, 2008

Agreed! And, I've removed it. Thanks!

 Respond  
^Neptune   -  Oct 11, 2008

The little dialog that pops up saying when you've changed state is kind of annoying, but other than that it works very well! 8/10 from me.

 Respond  
Zmodem   -  Oct 11, 2008

Comments and suggestions are appreciated guys, thanks!

 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.