mIRC Homepage
Posted By: TRABEL custom window help plz :) - 28/03/05 11:11 PM
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
Posted By: SladeKraven Re: custom window help plz :) - 28/03/05 11:23 PM
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:
Posted By: TRABEL Re: custom window help plz :) - 28/03/05 11:34 PM
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
Posted By: SladeKraven Re: custom window help plz :) - 28/03/05 11:40 PM
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.
Posted By: TRABEL Re: custom window help plz :) - 28/03/05 11:51 PM
thx !!!
i'll tweak it like i need , but its working laugh
thx
Posted By: TRABEL Re: custom window help plz :) - 29/03/05 12:02 AM
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
Posted By: SladeKraven Re: custom window help plz :) - 29/03/05 12:09 AM
What do you mean combine, sorry?
Posted By: TRABEL Re: custom window help plz :) - 29/03/05 12:15 AM
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
Posted By: SladeKraven Re: custom window help plz :) - 29/03/05 12:39 AM
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.
Posted By: TRABEL Re: custom window help plz :) - 29/03/05 03:48 AM
thx
i will understand ....
if not you'll see me again ;P
thx
Posted By: SladeKraven Re: custom window help plz :) - 29/03/05 03:51 AM
You're welcome. :tongue:
Posted By: DaveC Re: custom window help plz :) - 29/03/05 06:53 AM
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
Posted By: TRABEL Re: custom window help plz :) - 29/03/05 07:55 AM
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
Posted By: DaveC Re: custom window help plz :) - 29/03/05 09:46 PM
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"
© mIRC Discussion Forums