mIRC Home    About    Download    Register    News    Help

Topic Options
#115677 - 29/03/05 12:11 AM custom window help plz :)
TRABEL Offline
Ameglian cow

Registered: 10/05/03
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

Top
#115678 - 29/03/05 12:23 AM Re: custom window help plz :)
SladeKraven Offline
Planetary brain

Registered: 19/12/02
Posts: 3547
Loc: Kent, England
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:

Top
#115679 - 29/03/05 12:34 AM Re: custom window help plz :)
TRABEL Offline
Ameglian cow

Registered: 10/05/03
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

Top
#115680 - 29/03/05 12:40 AM Re: custom window help plz :)
SladeKraven Offline
Planetary brain

Registered: 19/12/02
Posts: 3547
Loc: Kent, England
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.

Top
#115681 - 29/03/05 12:51 AM Re: custom window help plz :)
TRABEL Offline
Ameglian cow

Registered: 10/05/03
Posts: 21
thx !!!
i'll tweak it like i need , but its working laugh
thx

Top
#115682 - 29/03/05 01:02 AM Re: custom window help plz :)
TRABEL Offline
Ameglian cow

Registered: 10/05/03
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

Top
#115683 - 29/03/05 01:09 AM Re: custom window help plz :)
SladeKraven Offline
Planetary brain

Registered: 19/12/02
Posts: 3547
Loc: Kent, England
What do you mean combine, sorry?

Top
#115684 - 29/03/05 01:15 AM Re: custom window help plz :)
TRABEL Offline
Ameglian cow

Registered: 10/05/03
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

Top
#115685 - 29/03/05 01:39 AM Re: custom window help plz :)
SladeKraven Offline
Planetary brain

Registered: 19/12/02
Posts: 3547
Loc: Kent, England
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.


Edited by SladeKraven (29/03/05 01:40 AM)

Top
#115686 - 29/03/05 04:48 AM Re: custom window help plz :)
TRABEL Offline
Ameglian cow

Registered: 10/05/03
Posts: 21
thx
i will understand ....
if not you'll see me again ;P
thx

Top
#115687 - 29/03/05 04:51 AM Re: custom window help plz :)
SladeKraven Offline
Planetary brain

Registered: 19/12/02
Posts: 3547
Loc: Kent, England
You're welcome. :tongue:

Top
#115688 - 29/03/05 07:53 AM Re: custom window help plz :)
DaveC Offline
Planetary brain

Registered: 26/09/03
Posts: 4230
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

Top
#115689 - 29/03/05 08:55 AM Re: custom window help plz :)
TRABEL Offline
Ameglian cow

Registered: 10/05/03
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


Edited by TRABEL (29/03/05 09:01 AM)

Top
#115690 - 29/03/05 10:46 PM Re: custom window help plz :)
DaveC Offline
Planetary brain

Registered: 26/09/03
Posts: 4230
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"

Top