mIRC Home    About    Download    Register    News    Help

Print Thread
#115677 28/03/05 11:11 PM
Joined: May 2003
Posts: 21
T
TRABEL Offline OP
Ameglian cow
OP Offline
Ameglian cow
T
Joined: May 2003
Posts: 21
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,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
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:

Joined: May 2003
Posts: 21
T
TRABEL Offline OP
Ameglian cow
OP Offline
Ameglian cow
T
Joined: May 2003
Posts: 21
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,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
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.

Joined: May 2003
Posts: 21
T
TRABEL Offline OP
Ameglian cow
OP Offline
Ameglian cow
T
Joined: May 2003
Posts: 21
thx !!!
i'll tweak it like i need , but its working laugh
thx

Joined: May 2003
Posts: 21
T
TRABEL Offline OP
Ameglian cow
OP Offline
Ameglian cow
T
Joined: May 2003
Posts: 21
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,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
What do you mean combine, sorry?

Joined: May 2003
Posts: 21
T
TRABEL Offline OP
Ameglian cow
OP Offline
Ameglian cow
T
Joined: May 2003
Posts: 21
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,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
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.
Joined: May 2003
Posts: 21
T
TRABEL Offline OP
Ameglian cow
OP Offline
Ameglian cow
T
Joined: May 2003
Posts: 21
thx
i will understand ....
if not you'll see me again ;P
thx

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

Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
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

Joined: May 2003
Posts: 21
T
TRABEL Offline OP
Ameglian cow
OP Offline
Ameglian cow
T
Joined: May 2003
Posts: 21
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.
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
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