mIRC Home    About    Download    Register    News    Help

Print Thread
#124289 04/07/05 05:58 AM
Joined: Jul 2005
Posts: 4
B
Self-satisified door
OP Offline
Self-satisified door
B
Joined: Jul 2005
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

Last edited by babyboyke; 04/07/05 06:00 AM.
#124290 04/07/05 06:03 AM
Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
Sorry dude, I don't understand. Could you show a screenshot or something?

-Andy

#124291 04/07/05 06:12 AM
Joined: Jul 2005
Posts: 4
B
Self-satisified door
OP Offline
Self-satisified door
B
Joined: Jul 2005
Posts: 4

Last edited by babyboyke; 04/07/05 06:13 AM.
#124292 04/07/05 06:24 AM
Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
And the dialog code please? smile

-Andy

#124293 04/07/05 06:27 AM
Joined: Jul 2005
Posts: 4
B
Self-satisified door
OP Offline
Self-satisified door
B
Joined: Jul 2005
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 
  }
}

 

#124294 04/07/05 06:55 AM
Joined: Jul 2005
Posts: 4
B
Self-satisified door
OP Offline
Self-satisified door
B
Joined: Jul 2005
Posts: 4
I vond the broblem
instad of using
Code:
if ( ) {
} elseif ( ) {
}

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

#124295 04/07/05 08:45 AM
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
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.


Link Copied to Clipboard