Menteroth   -  Nov 20, 2013

How do I check if a @window exists?

I am echoing text to another window on :input: but it echoes in active window if there is no existing window.

if (@window == $true) echo bla bla bla
else return

Meta  -  Nov 20, 2013

$window(@window_name_here) -- Will return the window name if it exists, else $null (nothing).

You can also use wildcards in the window name and use a second parameter "N" to refer to the Nth matching window... for example: *$window(@some,1)* will return the name of the first window that wildmatches @some

Menteroth  -  Nov 21, 2013

I feel I'm really too slow for this scripting thing haha.

how would I add that feature to only echo to the @window if it exists?

on *:input:#jasonbigs:{
  if (!$ctrlenter) && ($left($1,1) !== $readini(mirc.ini,text,commandchar)) {
    echo @jasonbigs 14(00 $+ $time $+ 14) 13( $+ 00 $+ $me $+ 13) 00 $+ $1-

when it doesn't exist it looks like this:

@jasonbigs (16:30:18) (menteroth) 123

P.S and no, I didn't create this input myself. just wanted to add this window thing. :)

Meta  -  Nov 21, 2013

just add it in the condition:

if (!$ctrlenter) && ($left($1,1) !isin $+(/,$readini($mircini,text,commandchar))) && ($window(@jasonbigs)) {

You could also just open the window if it isn't already, eg.

on *:INPUT:#jasonbigs:{
  if !$ctrlenter && $left($1,1) !isin $+(/,$readini($mircini,text,commandchar)) {
    if !$window(@jasonbigs) { window -en @jasonbigs }
    echo @jasonbigs 14(00 $+ $time $+ 14) 13( $+ 00 $+ $me $+ 13) 00 $+ $1-
Menteroth  -  Dec 19, 2013

Thought I answered this already. But thanks.

Sign in to comment

Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.