mIRC Home    About    Download    Register    News    Help

Print Thread
#115677 28/03/05 11:11 PM
T
TRABEL
TRABEL
T
hi
im adding a custom window to have msg some lines to it ..
i want to have time stamp of when the msg loged to this window ....
should i state it when im building the window ?
or add a switch to the msg command ?
from mirc help , im using with /aline @windowname for msg .
thx

Joined: Dec 2002
Posts: 3,534
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,534
How will you be calling the window (which event)?

Something like . . .

Code:
On *:Text:*:*: {
  if (!$window(@msg)) { window -l +lC @msg  }
  aline @msg $timestamp $+(<,$nick,>) $1-
}


I'm quite confused as to what you meant. confused

Could you explain a little more to this newbie? :tongue:

T
TRABEL
TRABEL
T
well...
i want to make
on *:TEXT:*:#:{
/aline @window text
}

in the window i want to get
[time] text
time = the time the text got msg to the window
thx

Joined: Dec 2002
Posts: 3,534
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,534
This will work. smile

Code:
On *:Text:*:#: {
  if (!$window(@window)) { window -l +lC @window  }
  aline @window $timestamp $+(<,$nick,>) $1-
}


If you don't want it to show the nickname sending the message remove $+(<,$nick,>).

Hope this helps.

-Andy.

T
TRABEL
TRABEL
T
thx !!!
i'll tweak it like i need , but its working laugh
thx

T
TRABEL
TRABEL
T
mmmm.....
SladeKraven .....
any way to combine this scrip in the building of the window ?
or i need to add this line to every different script im adding to msg something to the window ?
i mean , if can add the time to global settings of the window ?
thx

Joined: Dec 2002
Posts: 3,534
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,534
What do you mean combine, sorry?

T
TRABEL
TRABEL
T
well
i got it added to remote to start the window when open mirc
on *:START: {
/window -e @window
}

is ther any way to add the string to the time thingy smile to this ?
so i wont have to add the whole
if (!$window(@window)) { window -l +lC @window }
aline @window $timestamp $1-
in every on text script im writing for this window ...
i confused myself ... hope you understood me smile

Joined: Dec 2002
Posts: 3,534
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,534
Simply call the window from an alias. smile

Code:
alias emsg {
  if (!$window(@window)) { window -l +lC @window  }
  set -u1 %msg $1-
  aline @window $timestamp $+(&lt;,$nick,&gt;) %msg
}

On *:Text:*:*: {
  set -u1 %msg $1-
  emsg
}


In every on Text event all you'd need to add is:

set -u1 %msg $1-
emsg

I hope I understood sufficiently.

-Andy.

Last edited by SladeKraven; 29/03/05 12:40 AM.
T
TRABEL
TRABEL
T
thx
i will understand ....
if not you'll see me again ;P
thx

Joined: Dec 2002
Posts: 3,534
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,534
You're welcome. :tongue:

D
DaveC
DaveC
D
No start event is needed, you can simply call and alias in replace of hardcoding the window name in, this allows the window to be created if it doesnt exist, before its alined to. Or any things else etc.

Code:
;
;Usage 
;(1) /window.name -- this well create the window if it doesnt exist
;(2) $window.name -- this well return with the name of the window, and well create it if it doesnt exist
;(3) $window.name(only) -- this well return with the name of the window
;
alias window.name {
  var %temp = @window
  if (!$window(%temp) &amp;&amp; $1- != only ) { window -l +lC %temp }
  return %temp
}


examples of use

aline $window.name $timestamp $1-
aline $window.name $timestamp -- user has left ---
;^ makes the window if it doesnt exist and displays said text

echo number of lines in $window.name is $line($window.name,0)
;^ returns the window name (both examples) if it didnt exist its created

if (window($window.name(only))) echo $window.name(only) does not exist.
;^ returns the window name (both examples) but does NOT create the window if it doesnt exist

T
TRABEL
TRABEL
T
now i lost you smile
i tried this alias .... didnt work for me . i have closed the windo and tried to aline it but just got
(%window.name) Unknown command
can be nice to auto creat window even if not restarted mirc
plz explain

Last edited by TRABEL; 29/03/05 08:01 AM.
D
DaveC
DaveC
D
You didnt follow my examples did you frown

re: (%window.name) Unknown command

I never said %window.name i said $window.name

$window.name runs the alias with this name, returning the contents the alias sets in the /RETURN command, the same as say $time returns sa "12:34:56", $window.name returns "@window" but also creates the window unless you use $window.name(only) in which case it only returns the "@window"


Link Copied to Clipboard