mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Mar 2008
Posts: 5
T
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
T
Joined: Mar 2008
Posts: 5
I am fairly new to mirc and scripting/coding. Can someone please tell me how to get the timestamp to only show once a minute? I found a code snippet that said it could do that but I don't know where to put it. It said to replace the /echo command with it. Any ideas? The more specific, the better; as i said, I'm pretty new to this. Thanks. smile

Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
If you found a code snippet that does that, then all you need to do is copy & paste it into a new remote file.
1) Press Alt+R to open the Script Editor at the Remotes Tab
2) If there is a script already showing, then Click File - New
3) paste the script/snippet into the new file
4) click OK to Save and Close the Script Editor

Joined: Mar 2008
Posts: 5
T
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
T
Joined: Mar 2008
Posts: 5
Thanks for the quick reply! However, I tried that and no dice. Here is the snippet, if that helps...

alias echo { var %t = $3-, %p = $1, %w = $2, %we = $2, %c if ($1 isnum) var %p = $2, %w = $3, %we = $3, %c = $1, %t = $4- if (-*t* !iswm %p) { echo $1- | return } if (-*s* iswm %p) var %w = Status Window, %we, %t = $iif($1 isnum,$3-,$2-) elseif (-*a* iswm %p) var %w = $active, %we, %t = $iif($1 isnum,$3-,$2-) elseif ("Status == %w) var %w = Status Window, %we, %t = $gettok(%t,2-,32) echo %c $iif($replace($remove(%p,t),i2,i19) != -,$ifmatch) %we $iif($strip($timestamp) == $strip($gettok($line(%w,$line(%w,0)),1,32)),$+( ,$colour(background),$strip($timestamp), ),$timestamp) %t }

Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
All I can say is "eww!" smile

I do like the idea of timestamps only appearing once every X minutes. I don't like them there normally, but at the same time, it's helpful to have a timeframe. Maybe I'll look into it later if no one else comes up with something before then.


Invision Support
#Invision on irc.irchighway.net
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
I hope that you didn't get the snippet exactly as it posted here, because if you did, you're going to have problems galore with it.
I'll try to re-create the proper snippet based on what you've given me.
Code:
alias echo {
  var %t = $3-, %p = $1, %w = $2, %we = $2, %c
  if ($1 isnum) var %p = $2, %w = $3, %we = $3, %c = $1, %t = $4-
  if (-*t* !iswm %p) { echo $1- | return }
  if (-*s* iswm %p) var %w = Status Window, %we, %t = $iif($1 isnum,$3-,$2-)
  elseif (-*a* iswm %p) var %w = $active, %we, %t = $iif($1 isnum,$3-,$2-)
  elseif ("Status == %w) var %w = Status Window, %we, %t = $gettok(%t,$2-,32)
  echo %c $iif($replace($remove(%p,t),i2,i19) != -,$ifmatch) %we $iif($strip($timestamp) == $strip($gettok($line(%w,$line(%w,0)),1,32)),$+( ,$colour(background),$strip($timestamp), ),$timestamp) %t 
}


Personally I don't like naming aliases with the same name as internal commands.
I fixed that up to the best of my ability, but I can't guarantee it.

Joined: Mar 2008
Posts: 5
T
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
T
Joined: Mar 2008
Posts: 5
Thanks again, for trying. I apologize, too; the snippet I posted did come in the proper format (more than one line, etc.) but it didn't paste that way here for whatever reason.

Putting this into a new remote does not appear to work. The directions with the snippet said to replace the /echo command with IT, but I don't know where the /echo command is.

Any ideas?

Joined: Feb 2006
Posts: 546
J
Fjord artisan
Offline
Fjord artisan
J
Joined: Feb 2006
Posts: 546
here's a simple snippet, $stamp(<window>), that'll return $timestamp for a specific window at most once a minute. $null otherwise

the method that alias uses for this is prone to error, if you use /clear for example it won't be able to refer to the last timestamped line

Code:
alias stamp {
  var %x = $hash($1 $cid,32)
  if ($calc($ctime - $hget(timestamp,%x)) > 59) {
    hadd -m timestamp %x $ctime
    return $timestamp
  }
}


and the directions probably assume that you already have an existing on ^*:text (or on input, etc) event that uses /echo to modify the appearance of lines. if you don't, these aliases alone won't really benefit you





"The only excuse for making a useless script is that one admires it intensely" - Oscar Wilde
Joined: Mar 2008
Posts: 5
T
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
T
Joined: Mar 2008
Posts: 5
Thanks for posting.

Where do I put that in the script editor to make it work?

Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
That goes in the Remote section. smile

Joined: Mar 2008
Posts: 5
T
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
T
Joined: Mar 2008
Posts: 5
I put it in the remote section and it does not work. Am I missing something?


Link Copied to Clipboard