mIRC Home    About    Download    Register    News    Help

Print Thread
#165560 27/11/06 09:01 PM
Joined: Feb 2005
Posts: 344
B
Fjord artisan
OP Offline
Fjord artisan
B
Joined: Feb 2005
Posts: 344
rightclick on a nick opens a dialog with a list. ( controle panel )
In that list i can add icons that perform sertain commands.
but after clicking on a nick how do i whois that person from the dialog?
$3 aint working it return no nickname given.

Greettzz

#165561 27/11/06 10:13 PM
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Usually, $1 is the $nick when right clicking on a nick.


Invision Support
#Invision on irc.irchighway.net
#165562 28/11/06 06:49 AM
Joined: Feb 2005
Posts: 344
B
Fjord artisan
OP Offline
Fjord artisan
B
Joined: Feb 2005
Posts: 344
sorry was thing with another alias that uses $3 for the nick.
Any idea on how to save $1 so i can use it ?
Now it forgets $1 after the dialog is opend all commands that use $1 are giving back: "no nickname given"
So somekind of alias with a var to save $1 would be needed is my guess but i have no idea howto do that.
Any help is welcome.
Any more help is even better :tongue:

Greetzz

#165563 28/11/06 08:05 AM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
You can do something like
Code:
 menu nicklist {
Whois : set %nick $1 | whois %nick
}
 


Depending on why you're wanting that information, you might find my Whois Dialog informative. You can get it here

#165564 29/11/06 02:20 PM
Joined: Feb 2005
Posts: 344
B
Fjord artisan
OP Offline
Fjord artisan
B
Joined: Feb 2005
Posts: 344
I have this as nicklist menu:
Code:
 menu nicklist { 
$iif($cpanel, /cpanel) : {}
}
 

This opens a dialog and from there by double click i want to do stuff with the selected nick.
But i can't get it to remember the nick ( $1 )
if you want to try it for yourself here is the code of the controle panel.
Code:
 on *:LOAD:echo -at *** Control Panel v1.5 loaded :] (/cpanel) | echo -at *** by k3v1n
menu nicklist {
  $iif($cpanel, /cpanel) : {}
}

alias cpanel {
  //sendkey % $+ 
  d cpanel
}

dialog cpanel {
  icon $shortfn($mircdiricons\cpanel.ico)
  title "Control Panel"
  option dbu
  size -1 -1 210 120
  button "", 1, 0 0 0 0,ok
  list 2, 50 1 148 110,size extsel
  button "", 3, 0 0 0 0
  box "", 4, 2 0 46 35
  icon 5, 17 7 16 16, $shortfn($mircdiricons\cpanel.ico) , center
  text "Control Panel", 6, 4 25 42 8, center
  text "Control your modules easily ! :P", 7, 4 39 42 40, center
  text "Author: k3v1n", 8, 4 82 42 14
  check "Run on start", 9, 2 97 46 10
  check "Run on conn.", 10, 2 106 46 10
}

on *:dialog:cpanel:init:0:{
  var %m = $shortfn($mircdirdll\mdx.dll)
  dll %m SetMircVersion $version
  dll %m MarkDialog $dname
  dll %m SetControlMDX 2 ListView infotip autoarrange > $shortfn($mircdirdll\views.mdx)
  did -i $dname 2 1 IconSize normal large
  dll %m SetControlMDX 3 Positioner size maxbox minbox > $shortfn($mircdirdll\dialog.mdx)
  if (!$exists($cpaneli)) .write $cpaneli
  cpanel.actu
  if ($l == f) { dialog -t cpanel Panneau de contrôle - [/cpanel] | did -ra cpanel 8 Auteur: $gettok($did(cpanel,8),2-,32) | did -ra cpanel 9 Lance au dém. | did -ra cpanel 10 Lance à la con. | did -ra cpanel 7 Contrôle facilement tes modules ! :P }

}
on *:dialog:cpanel:dclick:2: {
  $gettok($read($cpaneli,$calc($did(2).sel -1)),7-,124)
  .timer 1 1 dialog -x cpanel
}
on *:dialog:cpanel:sclick:9,10:{
  if (!$did(2).sel) return
  var %s = $calc($did(2).sel -1),%f = $cpaneli,%r = $read(%f,%s)
  write -l $+ %s %f $+($gettok(%r,1-4,124),|,$did(9).state,|,$did(10).state,|,$gettok(%r,7-,124))
}
on *:dialog:cpanel:sclick:2:{
  var %s = $calc($did(2).sel -1),%m = $shortfn($mircdirdll\MPopup.dll)
  tokenize 124 $read($cpaneli,%s)
  var %n = $1,%d = $2,%a = $3,%i = $4,%st = $5,%co = $6,%c = $7-
  tokenize 124 Command:|Add command|Edit module|Change icon|Change title|Change description|Change author|Change command|Delete command|Refresh|Close|Language|Author:
  if ($l == f) tokenize 124 Commande:|Ajouter commande|Editer module|Changer icône|Changer titre|Changer description|Changer auteur|Changer commande|Supprimer commande|Rafraîchir|Fermer|Langage|Auteur:
  if ($gettok($did(2,1),1-2,32) == rclick recent) {
    var %y = $gettok($dll(%m,MPCreateMenu,cpanel),2,32)
    if ($did(2).sel) {
      dll %m MPAddItem %y > 1 0 0 %n > %c
      dll %m MPAddItem %y > 2 0 1 $1 %c > -
      dll %m MPAddItem %y > 3 0 0 - > -
    }
    dll %m MPAddItem %y > 4 0 0 $2 > cpanel.add
    if ($did(2).sel) {
      var %z = $gettok($dll(%m,MPAddSubMenu,%y > 5 0 0 $3),2,32)
      dll %m MPAddItem %z > 6 0 0 $4 ( $+ %i $+ ) > cpanel.change icon %s
      dll %m MPAddItem %z > 7 0 0 $5 ( $+ %n $+ ) > cpanel.change title %s
      dll %m MPAddItem %z > 8 0 0 $6 ( $+ %d $+ ) > cpanel.change description %s
      dll %m MPAddItem %z > 9 0 0 $7 ( $+ %a $+ ) > cpanel.change author %s
      dll %m MPAddItem %z > 10 0 0 $8 ( $+ %c $+ ) > cpanel.change command %s
      dll %m MPAddItem %y > 11 0 0 $9 > cpanel.del %s
    }
    dll %m MPAddItem %y > 12 0 0 - > -
    dll %m MPAddItem %y > 13 0 0 $10 > cpanel.actu
    dll %m MPAddItem %y > 14 0 0 $11 > .timer -m 1 10 dialog -x cpanel
    dll %m MPAddItem %y > 15 0 0 - > -
    var %o = $gettok($dll(%m,MPAddSubMenu,%y > 16 0 0 $12),2,32)
    var %g = e | if ($l == e) var %g = f
    dll %m MPAddItem %o > 17 0 $iif($l == f,2,0) Français > cpanel.language f
    dll %m MPAddItem %o > 18 0 $iif($l == e,2,0) English > cpanel.language e

    dll %m MPopup cpanel > $mouse.dx $mouse.dy left left left
  }
  elseif ($did(2).sel) {
    if (!$exists(%i)) var %i = $shortfn($mircdiricons\cpanel.ico)
    did -g $dname 5 %i
    did -ra $dname 6 %n
    did -ra $dname 7 %d
    did -ra $dname 8 $13 %a
    did $replace(%st,0,-u,1,-c) $dname 9
    did $replace(%co,0,-u,1,-c) $dname 10
  }
}
on *:dialog:cpanel:sclick:3:if ($gettok($did(3),1,32) == size) dll $shortfn($mircdirdll\mdx.dll) MoveControl $dname 2 * * $calc($dialog($dname).cw -102) $calc($dialog($dname).ch -2)

alias cpanel.language {
  write -c $+($shortfn($scriptdir),language) $1
  if ($l == e) { dialog -t cpanel Control Panel - [/cpanel] | did -ra cpanel 8 Author: $gettok($did(cpanel,8),2-,32) | did -ra cpanel 9 Run on start | did -ra cpanel 10 Run on conn. }
  else { dialog -t cpanel Panneau de contrôle - [/cpanel] | did -ra cpanel 8 Auteur: $gettok($did(cpanel,8),2-,32) | did -ra cpanel 9 Lance au dém. | did -ra cpanel 10 Lance à la con. }
}

alias cpanel.change {
  var %n,%d,%a,%i,%c,%read = $read($cpaneli,$2),%en = $gettok(%read,1,124),%ed = $gettok(%read,2,124),%ea = $gettok(%read,3,124),%ei = $gettok(%read,4,124),%k = $gettok(%read,5-6,124),%ec = $gettok(%read,7-,124)
  write -dl $+ $2 $cpaneli
  if ($1 == icon) var %i = $shortfn($sfile(*.ico,$iif($l == e,Choose an icon file,Choisis un fichier icône)))
  elseif ($1 == title) var %n = $?="Tit $+ $iif($l == e,l,r) $+ e ?"
  elseif ($1 == description) var %d = $?="Description ?"
  elseif ($1 == author) var %a = $?="Aut $+ $iif($l == e,ho,eu) $+ r ?"
  elseif ($1 == command) var %c = $?="Command $+ $iif($l == f,e) ?"
  if (!%n) var %n = %en | if (!%d) var %d = %ed | if (!%a) var %a = %ea | if (!%i) var %i = %ei | if (!%c) var %c = %ec
  write $cpaneli $+(%n,|,%d,|,%a,|,%i,|,%k,|,%c)
  cpanel.actu
}

alias cpanel.actu {
  var %i = $cpaneli,%x = 0
  .filter -cfft 1 124 %i %i
  did -r cpanel 2
  did -i cpanel 2 1 clearicons normal
  while (%x < $lines(%i)) {
    inc %x
    var %t = $read(%i,%x),%k = $gettok(%t,4,124)
    if (!$exists(%k)) var %k = $shortfn($mircdiricons\cpanel.ico)
    did -i cpanel 2 1 SetIcon normal 0 %k
    did -a cpanel 2 0 %x $gettok(%t,1,124)
  }
}
alias cpanel.del {
  if (!$1) || (!$input($iif($l == e,Delete this command,Supprimer cette commande) ?,y,$iif($l == e,Control Panel,Panneau de contrôle) v1.5)) return
  write -dl $+ $1 $cpaneli
  cpanel.actu
}

alias cpanel.add {
  tokenize 32 Title Author Command Choose an icon file (optionnal)
  if ($l == f) tokenize 32 Titre Auteur Commande Choisis un fichier icône (optionnel)
  var %n = $?=" $+ $1 ?" | if (!%n) return
  var %d = $?="Description ?" | if (!%d) return
  var %a = $?=" $+ $2 ?" | if (!%a) return
  var %c = $?=" $+ $3 ?" | if (!%c) return
  var %i = $shortfn($sfile(*.ico,$4-)) | if (!%i) var %i = $shortfn($scriptdircpanel.ico)
  write $cpaneli $+(%n,|,%d,|,%a,|,%i,|0|0|,%c)
  cpanel.actu
}

menu menubar {
  $iif($l == e,Control Panel,Panneau de contrôle) :cpanel
}

alias -l d dialog $iif(($dialog($1)),-ve,-m $+ $2 $1) $1
alias -l l return $read($scriptdirlanguage)
alias cpaneli return $+(",$scriptdircpanel.txt,")
alias bekijk { /w $$1 }

on *:START:var %x = 0 | while (%x < $lines($cpaneli)) { inc %x | var %t = $read($cpaneli,%x) | if ($gettok(%t,5,124) == 1) $gettok(%t,7-,124) }
on *:CONNECT:var %x = 0 | while (%x < $lines($cpaneli)) { inc %x | var %t = $read($cpaneli,%x) | if ($gettok(%t,6,124) == 1) $gettok(%t,7-,124) }
 


The controle panel isn't mine, i just want to use it for the menu's ( channel, query, status and nicklist )
Channel, query and status are simple and they work but nicklist it has his $1 ( nick ) problem.
Hope there is a sollution.

Greettzz


Link Copied to Clipboard