mIRC Home    About    Download    Register    News    Help

Print Thread
#157526 25/08/06 07:01 PM
Joined: Aug 2006
Posts: 9
T
Tom_S Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
T
Joined: Aug 2006
Posts: 9
I am trying to make my script modify the default output of channel text messages so that I can colorize the timestamp and nick, and am having some difficulty with one specific part of it. I can halt the default message, and can modify the nick's colorization, as well as the timestamp, but the way I am currently doing it seems a bit excessive in terms of code bloat.

What I have done is disabled the timestamp in the mIRC messages dialog, copied the entire options section of mirc.ini into a new file, then enabled it again, and copied the entire options section to that same new file. I then compared the lines until I found which option was changed by the enable/disable timestamp check box. Then I created a timer that checks that option every millisecond from the time mirc is started until the time it is closed, so that if someone changes the option, it takes effect immediately.

Then I made the on text event and do
if (timestamp == 1) echo message with timestamp
else echo message without timestamp

This is all well and good except that I also have the $1- at the end set to be stripped of control codes if the user specifies in the same messages dialog by doing $strip($1-,mo)

What I want to know is: IS there any way to get the status of whether global timestamping is enabled or not without having to use the timer, like there is for whether stripbold is on? What is it?

I have looked at several scripts that modify the default output of channel messages via the ON ^*:TEXT:*:#: event, and all of them seem to just ignore the mirc messages dialog timestamp enable/disable setting. They all also seem to have their own timestamp option in their script's dialog.

Joined: Aug 2006
Posts: 9
T
Tom_S Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
T
Joined: Aug 2006
Posts: 9
Never mind, i just changed how it worked so that the timestamp check is in an alias, and call that alias for each event.

Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
i was sure there was a identifieer for it, if not u could just read the relevent line in the mirc.ini, and see what its set to, OR just write something to a hidden window, and see if it added a timestamp to the front. (id do the last one, less disk intensive the critics would say)

Joined: Feb 2005
Posts: 342
R
Fjord artisan
Offline
Fjord artisan
R
Joined: Feb 2005
Posts: 342
To color your timestamps the way you want:

Code:
on *:start:{
  .timestamp -f ^k##hh:nn.ss^k
}


Just replace: ^k## with the color code and the colors you wish to give your timestamp. You can also add whatever type of format you want to it. like: !^k##hh:nn.ss^k!

Then you can use: /echo -t $chan < $nick > $1-

The -t switch works with the timestamp on/off options. So you don't have to worry about using any sort of timer. That should be all you really need.

And just a "FYI," you can use: $window($chan).stamp to determine if the channel has timestamps turned on or off (it will return $true if it is turned on).

Enjoy.


Link Copied to Clipboard