mIRC Home    About    Download    Register    News    Help

Print Thread
#113733 08/03/05 11:53 AM
Joined: Mar 2005
Posts: 14
S
shaked Offline OP
Pikka bird
OP Offline
Pikka bird
S
Joined: Mar 2005
Posts: 14
i want to have a 2nd window in channel, above the chat window with means i could put all the join/quit/op/deop and all that stuff in the upper window and pure chat in the lower window, i also want the upper window to be 100 pixels, i have mirc 6.01- how do i do that?

#113734 08/03/05 01:45 PM
Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
Code:
On ^*:Op:#: {
  if (!$window(@Modes)) { 
    window @Modes 1 1 100 100 
    echo 3 @Modes $nick Opped $opnick 
  }
  else {
    echo 3 @Modes $nick Opped $opnick 
  }
  haltdef
}

On ^*:DeOp:#: {
  if (!$window(@Modes)) { 
    window @Modes 1 1 100 100 
    echo 3 @Modes $nick DeOpped $opnick 
  }
  else {
    echo 3 @Modes $nick DeOpped $opnick 
  }
  haltdef
}

On ^*:Voice:#: {
  if (!$window(@Modes)) { 
    window @Modes 1 1 100 100 
    echo 3 @Modes $nick Voiced $vnick 
  }
  else {
    echo 3 @Modes $nick Voiced $vnick 
  }
  haltdef
}

On ^*:DeVoice:#: {
  if (!$window(@Modes)) { 
    window @Modes 1 1 100 100 
    echo 3 @Modes $nick DeVoiced $vnick 
  }
  else {
    echo 3 @Modes $nick DeVoiced $vnick 
  }
  haltdef
}


There is a more simplistic way to shorten the code, but I'm used to coding windows into events. Good luck.

#113735 08/03/05 05:23 PM
Joined: Mar 2005
Posts: 14
S
shaked Offline OP
Pikka bird
OP Offline
Pikka bird
S
Joined: Mar 2005
Posts: 14
i want it to be a part of the channel window, not a float

Last edited by shaked; 08/03/05 05:42 PM.
#113736 08/03/05 08:28 PM
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
Quote:
Code:
On ^*:Op:#: {
  if (!$window(@Modes)) { 
    window @Modes 1 1 100 100 
    echo 3 @Modes $nick Opped $opnick 
  }
  else {
    echo 3 @Modes $nick Opped $opnick 
  }
  haltdef
}


/me is grating his teeth
Im sorry I have to speak up here, can you please only put the thing that is relevent to the IF inside the IF

Code:
On ^*:Op:#: {
  if (!$window(@Modes)) { window @Modes 1 1 100 100 }
  echo 3 @Modes $nick Opped $opnick 
  haltdef
}


Wheather or not u put the /WINDOW command on the same line as the /IF is of course your choice. Actually its all your choice, but i just shudder when i see code being replicated in a IF ELSE that i can see could easily follow it.

#113737 09/03/05 07:53 AM
Joined: Mar 2005
Posts: 14
S
shaked Offline OP
Pikka bird
OP Offline
Pikka bird
S
Joined: Mar 2005
Posts: 14
i'm not sure i understand what youre saying but what i want is that the @window will be an integral part of the channel window

#113738 09/03/05 08:10 AM
Joined: Feb 2004
Posts: 2,019
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
I completely understand what you're saying, seeing a lot of unnecessary repeated code is kind of annoying if you know of much shorter ways.

I'd even take it a step further and make a custom alias, which is passed <mode> <nickname>

For instance:

on ^*:OP:#: winmode Opped $opnick
on ^*:DEOP:#: winmode DeOpped $opnick
on ^*:VOICE:#: winmode Voiced $vnick
on ^*:DEVOICE:#: winmode DeVoiced $vnick

alias winmode {
window -dh +L @Modes 1 1 100 100
echo 3 @Modes # $nick $1-
halt
}

The if check for existance of the window isn't needed, it's done internally.

Btw this post isn't really related to what the original requester asked for, I'm just replying to/agreeing with yours.


Gone.
#113739 09/03/05 08:50 AM
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
Quote:
The if check for existance of the window isn't needed, it's done internally.


Agggghhhhhh I had always assumed it was an error, I never even checked to see if it wasnt (pretty plain it wasnt now i think about it). Thanks for the info.

#113740 09/03/05 09:52 AM
Joined: Nov 2003
Posts: 2,327
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Nov 2003
Posts: 2,327
I think there was an error in older versions, i'm too lazy to check though :tongue:


New username: hixxy
#113741 09/03/05 10:07 AM
Joined: Mar 2005
Posts: 14
S
shaked Offline OP
Pikka bird
OP Offline
Pikka bird
S
Joined: Mar 2005
Posts: 14
the window is still a float, not an integral part of the channel window!

where can i learn about all @window options?

Last edited by shaked; 09/03/05 10:08 AM.
#113742 09/03/05 11:36 AM
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
you complainer! LOL

Code:
;
alias -l Fix.Str2File { return $replace($1,&amp;,&amp;26,\,&amp;5C,/,&amp;2F,:,&amp;3A,*,&amp;2A,?,&amp;3F,",&amp;22,&lt;,&amp;3C,&gt;,&amp;3E,|,&amp;7C,.,&amp;2E) }
alias -l Fix.File2Str { return $replace($1,&amp;5C,\,&amp;2F,/,&amp;3A,:,&amp;2A,*,&amp;3F,?,&amp;22,",&amp;3C,&lt;,&amp;3E,&gt;,&amp;7C,|,&amp;2E,.,&amp;26,&amp;) }
;
on ^*:JOIN:#:    win2 $chan $color(join text) JOIN by $fulladdress
on ^*:OP:#:      win2 $chan $color(info text) $nick Opped $opnick
on ^*:DEOP:#:    win2 $chan $color(info text) $nick DeOpped $opnick
on ^*:VOICE:#:   win2 $chan $color(info text) $nick Voiced $vnick
on ^*:DEVOICE:#: win2 $chan $color(info text) $nick DeVoiced $vnick
alias win2 {
  ;echo -st CP WIN2 $1-
  var %win2 = @win2. [ $+ [ $$1 ] ]
  var %win2.font = $window($1).font
  var %win2.fontsize = $window($1).fontsize
  var %win2.fontbold = $window($1).fontbold
  if ($window(%win2) != %win2) {
    window -hp %win2 1 1 480 240 %win2.font %win2.fontsize
    window %win2 1 1 $calc(480 + (480 - $window(%win2).bw)) $calc(240 + (240 - $window(%win2).bh))
  }
  var %height = $height($3-,%win2.font,%win2.fontsize) + 2
  drawscroll %win2 0 $calc(- %height)) 1 1 480 240
  drawrect -f %win2 $color(background) x 1 $calc(240 - %height) 480 %height
  drawtext -p $+ $iif(%win2.fontbold,o) %win2 $2 %win2.font %win2.fontsize 1 $calc(240 - %height) $3-
  ;
  var %f = $+($Fix.Str2File(%win2),.jpg)
  drawsave %win2 %f
  background -p $1 %f
  haltdef
}


Try that.

If you want to change the colors do so. What ever you want to send to the little window its formated as so...
/WIN2 <originalwindowname> <color> <text text text>

* IT DOESNT ERROR CHECK STUFF SO IF YOU SEND IT RUBBISH EXPECT RUBBISH BACK

? Is $color(info text) the right one to use for ops and voices ? I dont know I just took a punt.

#113743 09/03/05 05:59 PM
Joined: Mar 2005
Posts: 14
S
shaked Offline OP
Pikka bird
OP Offline
Pikka bird
S
Joined: Mar 2005
Posts: 14
i don't want it to be a backround! i want it to be a scrollable window, and i'm very sorry for being mr. complainy

Last edited by shaked; 09/03/05 06:11 PM.
#113744 09/03/05 06:07 PM
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
Is there a file there called that?

Works fine for me., try changing the .jpg to .bmp maybe ya .jpg builder is kapoot!?!?! (or u dont have access rights or something insane like that)


Link Copied to Clipboard