mIRC Home    About    Download    Register    News    Help

Print Thread
#56392 21/10/03 12:50 AM
Joined: Apr 2003
Posts: 426
Fjord artisan
OP Offline
Fjord artisan
Joined: Apr 2003
Posts: 426
This isn't so much me asking for help, but for those of you who are wondering how to create your own /say or /msg aliases, then this is how to do it.

Put these into aliases.ini

Code:
/say {
  raw -q PRIVMSG $active : $+ $1-
  if (($active ischan) && ($me ison $chan)) {
    if ($gettok($readini($mircini,options,n0),23,44) == 1) {
      echo $colour(own) -tmqi5 $active ( $+  $+ $colour(highlight) $+ $nick($chan,$me).pnick $+  $+ ) $1-
    }
    if ($gettok($readini($mircini,options,n0),23,44) != 1) {
      echo $colour(own) -tmqi5 $active ( $+  $+ $colour(highlight) $+ $me $+  $+ ) $1-
    }
  }
  if ($query($active)) {
    echo $colour(own) -tmqi5 $active ( $+  $+ $colour(highlight) $+ $me $+  $+ ) $1-
  }
}

/msg {
  raw -q PRIVMSG $1 : $+ $2-
  if (($1 ischan) && ($me ison $1)) {
    if ($gettok($readini($mircini,options,n0),23,44) == 1) {
      echo $colour(own) -tqi5 $1 ( $+  $+ $colour(highlight) $+ $nick($chan,$me).pnick $+  $+ ) $2-
    }
    if ($gettok($readini($mircini,options,n0),23,44) != 1) {
      echo $colour(own) -tqi5 $1 ( $+  $+ $colour(highlight) $+ $me $+  $+ ) $2-
    }
  }
  if ($1 == $query($1)) {
    echo $colour(own) -tqi5 $query($1) ( $+  $+ $colour(highlight) $+ $me $+  $+ ) $2-
  }
  if (($1 !ischan) && ($1 != $query($1))) {
    echo $colour(notice) -atqi5 $str($chr(149),3) (privmsg)  $+ $chr(187) $1 $chr(187) $+  $2-
  }
}



As you can see there, they use a custom format of mine, but if you don't like it, simply change the echo part.



For those of you that like to nitpick, could you please point out if I could improve it a little bit more?



Anyway, I've tried to get these as close to mirroring the default mIRC /say and /msg commands.

/msg #chan <text> (.msg will be quiet)
/msg nick <text> (.msg will be quiet)

/say <text>


Also, depending on you mIRC options (eg, self mode prefix), your text will be prefixed.


Have fun.


--------
mIRC - fun for all the family (except grandma and grandpa)
#56393 21/10/03 05:13 AM
Joined: Mar 2003
Posts: 1,271
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Mar 2003
Posts: 1,271
Ok, at the risk of getting flamed into oblivion, this is a help forum, where people ask help. It is not a place to post scripts you have written. There are other websites for that.


DALnet #Helpdesk
I hear and I forget. I see and I remember. I do and I understand. -Confucius
#56394 21/10/03 06:19 AM
Joined: Apr 2003
Posts: 426
Fjord artisan
OP Offline
Fjord artisan
Joined: Apr 2003
Posts: 426
At the risk of flaming you, who gives a ****.

If this has helped someone (which, by your own admission, is what these forums are for), then I'm happy.

If you don't like this thread being here, then tough diddums.


--------
mIRC - fun for all the family (except grandma and grandpa)
#56395 21/10/03 08:19 AM
Joined: Feb 2003
Posts: 810
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Feb 2003
Posts: 810
I didn't read carefully your code (going to sleep) and I'm sure I'd have some things to 'nitpick' ( :tongue: ), the only thing I can point out now is that you forgot to support chats and the dedicated query window.
Also, since you're customizing the /msg output, you might want to work with /amsg, /qmsg and /query as well.

Edit: /say could be just msg $active $1- with some $active checking, you don't really need to make it echo things. Redirect this job to only one alias (/msg, that is).

Last edited by cold; 21/10/03 08:27 AM.

* cold edits his posts 24/7
#56396 21/10/03 11:56 PM
Joined: Apr 2003
Posts: 426
Fjord artisan
OP Offline
Fjord artisan
Joined: Apr 2003
Posts: 426
Chats as in DCC?

I haven't been able to work those out yet, and even so, DCC works without me supporting it.

Also, could you further explain dedicated query window?

I have done an /amsg, /qmsg and and /qme. I'm yet to create a /query one.


Also, for the purposes of this, one can use either a /say or /msg seperately. You are correct though, one can just use /msg within the /say.


--------
mIRC - fun for all the family (except grandma and grandpa)
#56397 22/10/03 02:41 AM
Joined: Feb 2003
Posts: 810
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Feb 2003
Posts: 810
Quote:
Chats as in DCC? I haven't been able to work those out yet, and even so, DCC works without me supporting it.

The point is, if you use /say or /msg =nick, they won't take a dcc chat window in account.

Quote:
Also, could you further explain dedicated query window?

/help /dqwindow
I don't know how many people use this, I guess it's fine to leave it alone, but just a tip.

Quote:
Also, for the purposes of this, one can use either a /say or /msg seperately. You are correct though, one can just use /msg within the /say.

I didn't understand, "/say or /msg seperately", thus I don't know if I was clear. What I suggested was that instead of coding the stuff twice (/say and /msg), you could just code /msg and let /say to do only "/msg $active $1-", after some window checking (so it wouldn't "/msg Status Window $1-", for example).


* cold edits his posts 24/7
#56398 22/10/03 03:50 AM
Joined: Apr 2003
Posts: 426
Fjord artisan
OP Offline
Fjord artisan
Joined: Apr 2003
Posts: 426
I did know what you meant about the /say comment.

However, what I meant was, I've posted them here seperately so that if one wanted only to use a custom /say command, the could simply copy the code for it.

Thanks for the tip on the DCC and dqwindow smile


*edit* - I can't see how I'd get the /say or /msg to work within a DCC window.

Last edited by neophyte; 22/10/03 04:02 AM.

--------
mIRC - fun for all the family (except grandma and grandpa)
#56399 22/10/03 03:59 AM
Joined: Feb 2003
Posts: 810
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Feb 2003
Posts: 810
Ahh I got it now :tongue:


* cold edits his posts 24/7
#56400 22/10/03 04:05 AM
Joined: Apr 2003
Posts: 426
Fjord artisan
OP Offline
Fjord artisan
Joined: Apr 2003
Posts: 426
You wouldn't happen to know how I could get /say <text>
and /msg =nick <text> to work with DCC?

I've been trying to capture the output through debug, but, because debug only captures server send (and client to server), its very hard to figure out how its routed.


--------
mIRC - fun for all the family (except grandma and grandpa)
#56401 22/10/03 04:19 AM
Joined: Feb 2003
Posts: 810
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Feb 2003
Posts: 810
If I get what you meant..
For /say it would be the same thing, I guess. For /msg, you'd use something like:
Code:
if (=* iswm $1) &amp;&amp; ($chat($mid($1,2)) echo $1 etc

You can't use /raw for this part. Actually, you don't need /raw, just use !.msg, so you'll also support DCC chats.


* cold edits his posts 24/7
#56402 22/10/03 05:31 AM
Joined: Apr 2003
Posts: 426
Fjord artisan
OP Offline
Fjord artisan
Joined: Apr 2003
Posts: 426
Code:
/say {
  if ((=* iswm $active) &amp;&amp; ($chat($remove($active,=)) == $remove($active,=))) {
    !say $1-
  }
  else {
    raw -q PRIVMSG $active : $+ $1-
    if (($active ischan) &amp;&amp; ($me ison $chan)) {
      if ($gettok($readini($mircini,options,n0),23,44) == 1) {
        echo $colour(own) -tmi5 $active ( $+  $+ $colour(highlight) $+ $nick($chan,$me).pnick $+  $+ ) $1-
      }
      if ($gettok($readini($mircini,options,n0),23,44) != 1) {
        echo $colour(own) -tmi5 $active ( $+  $+ $colour(highlight) $+ $me $+  $+ ) $1-
      }
    }
    if ($query($active)) {
      echo $colour(own) -tmi5 $active ( $+  $+ $colour(highlight) $+ $me $+  $+ ) $1-
    }
  }
}

/msg {
  if ((=* iswm $1) &amp;&amp; ($chat($remove($1,=)) == $remove($1,=))) {
    !msg $1-
  }
  else {
    raw -q PRIVMSG $1 : $+ $2-
    if (($1 ischan) &amp;&amp; ($me ison $1)) {
      if ($gettok($readini($mircini,options,n0),23,44) == 1) {
        echo $colour(own) -tqi5 $1 ( $+  $+ $colour(highlight) $+ $nick($chan,$me).pnick $+  $+ ) $2-
      }
      if ($gettok($readini($mircini,options,n0),23,44) != 1) {
        echo $colour(own) -tqi5 $1 ( $+  $+ $colour(highlight) $+ $me $+  $+ ) $2-
      }
    }
    if ($1 == $query($1)) {
      echo $colour(own) -tqi5 $query($1) ( $+  $+ $colour(highlight) $+ $me $+  $+ ) $2-
    }
    if (($1 !ischan) &amp;&amp; ($1 != $query($1))) {
      echo $colour(notice) -atqi5 $str($chr(149),3) (privmsg)  $+ $chr(187) $1 $chr(187) $+  $2-
    }
  }
}


*Added support for DCC windows.


That is the updated commands. I suggest people ignore the first post.

Cold:
I haven't added support for /dqwindow because I haven't found the identifier that lets mIRC know its on. However, if you notice, when using the /msg <nick> <text> command, if the query window isn't opened, it echos: "(privmsg) <blah blah>" in the active window. I believe this is sufficient enough.
smile

Thanks for the pointers though smile


--------
mIRC - fun for all the family (except grandma and grandpa)
#56403 22/10/03 05:44 PM
Joined: Feb 2003
Posts: 810
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Feb 2003
Posts: 810
I thought you were going to customize the chat display too?
Anyway, yeah, the dqwindow doesn't seem to have any identifier returning it's on/off. You could get it by reading $mircini, though (that's what I used to do).


* cold edits his posts 24/7
#56404 23/10/03 03:54 AM
Joined: Apr 2003
Posts: 426
Fjord artisan
OP Offline
Fjord artisan
Joined: Apr 2003
Posts: 426
No. I'm not customising the chat display. smile

Anyway, I've gone looking for something in the mirc.ini file that would return if the dqwindow was on or not, but there doesn't seem to be anything that indicates it, but I haven't thoroughly compared it yet.

There was also no mention of it in one of the mirc.ini guides mentioned in this forum (can't recall the link, but its around).


--------
mIRC - fun for all the family (except grandma and grandpa)
#56405 23/10/03 04:26 AM
Joined: Feb 2003
Posts: 810
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Feb 2003
Posts: 810
You'd not need it anyway, you'd just need to know if it's open actually.. use $window(*,N) to get its name, I think it's "message window" but I'm not sure.


* cold edits his posts 24/7
#56406 23/10/03 08:22 AM
Joined: Aug 2003
Posts: 1,831
I
Hoopy frood
Offline
Hoopy frood
I
Joined: Aug 2003
Posts: 1,831
//saveini | echo -s $gettok($readini($mircini,options,n0),22,44)
0 = off; 1 = on


Link Copied to Clipboard