mIRC Home    About    Download    Register    News    Help

Topic Options
#124289 - 04/07/05 06:58 AM $active command
babyboyke Offline
Self-satisified door

Registered: 04/07/05
Posts: 4
Haveing troble to use the $active command and on *:ACTIVE:*:

when i use this
Code:
on *:ACTIVE:*: {
  echo -a $active en $query($active)
}

its show
Quote:

on status window
Status Window en

on channel
#channel en

on qerty
Babyboy en Babyboy
on qerty 2
Lingotje en Lingotje


thats good thats what i want but wen i do this

Code:
on *:ACTIVE:*: {
  echo -a $active en $query($active)
  if ($active == $chan) {  ; do not show npanel or remove if exist
    hos Undock npanel
    dialog -x npanel npanel
    halt
    } elseif ($active == $query($active)) { ; show npanel
    hos Dock npanel top 0
    hos DockSize npanel 55
    halt
    } elseif ($active == Status Window)  { ; do not show npanel or remove if exist
    hos Undock npanel
    dialog -x npanel npanel
    halt
  } 
}


but the result of that is
on status window its shows npanel and on a qerty but it may only showing on a qerty and not status window
eniway idea?
and even the echo is good but the commands not
greets


Edited by babyboyke (04/07/05 07:00 AM)

Top
#124290 - 04/07/05 07:03 AM Re: $active command
SladeKraven Offline
Planetary brain

Registered: 19/12/02
Posts: 3547
Loc: Kent, England
Sorry dude, I don't understand. Could you show a screenshot or something?

-Andy

Top
#124291 - 04/07/05 07:12 AM Re: $active command
babyboyke Offline
Self-satisified door

Registered: 04/07/05
Posts: 4


Edited by babyboyke (04/07/05 07:13 AM)

Top
#124292 - 04/07/05 07:24 AM Re: $active command
SladeKraven Offline
Planetary brain

Registered: 19/12/02
Posts: 3547
Loc: Kent, England
And the dialog code please? smile

-Andy

Top
#124293 - 04/07/05 07:27 AM Re: $active command
babyboyke Offline
Self-satisified door

Registered: 04/07/05
Posts: 4
Code:
 
alias npanel  dialog -m npanel npanel
alias -l npanel_f return $+($mrcdir,npanel.txt)
dialog npanel {
  title "Nick Panel - [/npanel]"
  size -1 -1 0 0
  option dbu
  icon $ico, 0
  list 2, 0 0  200 110, result size
  list 4, 0 110 200 10, size
}

on *:dialog:npanel:init:0:{
  mdx SetMircVersion $version
  mdx MarkDialog $dname
  mdx SetControlMDX $dname 2 ListView infotip autoarrange > $vmdx
  mdx SetControlMDX $dname 4 Statusbar hsbar > $bmdx
  mdx SetBorderStyle $dname 4 noborder
  mdx SetBorderStyle $dname 2 noborder
  did -i $dname 2 1 setbkg color $rgb(235,235,235)
  did -i $dname 4 1 setbkcolor $rgb(235,235,235)
  did -i $dname 2 1 settxt bgcolor $rgb(235,235,235)
  ;did -i $dname 4 1 setparts 10000 200 -1 
  did -i $dname 4 1 seticon big $ico
  did -i $dname 4 2 1 /npanel 
  npanel.initicon
}
alias  npanel.initicon {
  var %file = $npanel_f,%line = 0
  did -r npanel 2
  did -i npanel 2 1 clearicons normal
  while (%line < $lines(%file)) {
    inc %line
    tokenize 124 $read(%file,%line)
    var %iconfile = $iif($gettok($2,2,44),$ifmatch,$gettok($1,2,44)) 
    if (!$isfile(%iconfile)) var %iconfile = $icodir $+ cpanel.ico
    else %iconfile = $2
    did -i npanel 2 1 seticon normal %iconfile
    did -a npanel 2 0 %line  $1 
  }
}

on *:dialog:npanel:dclick:*:{
  var %line = $get_a_line1($gettok($did(2).seltext,6-,32)) 
  $gettok(%line,3,124)
}
on *:dialog:npanel:sclick:*:{
  if  ($gettok($did(2,1),1,32) = sclick) {
    var %line = $get_a_line1($gettok($did(2).seltext,6-,32)) 
    var %iconfile = $gettok(%line,2,124)
    did -i $dname 4 1 clearIcons
    if (%iconfile) { 
      did -i $dname 4 1 seticon big %iconfile 
      did -i $dname 4 2 +p 1 $gettok(%line,1,124) 
      goto end 
      } else { 
      did -i $dname 4 1 seticon big $ico 
      did -i $dname 4 2 +p 1 /npanel 
      goto end 
    }
    :end
  }
}
alias Get_A_Line1 {
  var %file = $npanel_f,%line = 0
  while (%line < $lines(%file)) {
    inc %line
    var %linetext =  $read(%file,%line)
    if ($1- = $gettok(%linetext,1,124))  return %linetext 
  }
}

 

Top
#124294 - 04/07/05 07:55 AM Re: $active command
babyboyke Offline
Self-satisified door

Registered: 04/07/05
Posts: 4
I vond the broblem
instad of using
Code:
if ( ) {
} elseif ( ) {
}

i have to use
Code:
 
if ( ) {
} 
elseif ( ) {
}

Top
#124295 - 04/07/05 09:45 AM Re: $active command
DaveC Offline
Planetary brain

Registered: 26/09/03
Posts: 4230
You can place the else there but you need a | infront of it, something to do with it recognizing it as a new command i guess.

Code:
if ( ) { ...
} | elseif ( ) { ...
} | else { ...
}


Its just symantics, but if u like your code formated that way, then thats how.

Top