mIRC Home    About    Download    Register    News    Help

Print Thread
#140572 27/01/06 11:56 AM
Joined: Feb 2005
Posts: 344
B
Fjord artisan
OP Offline
Fjord artisan
B
Joined: Feb 2005
Posts: 344
This is what I have for a friendlist in my query blocker.
how do I get the names added and removed from the list confused
Do I need to make a ini or txt file or can it be done without that ?
Also the names stay in the edit after i clicked the add or remove button.
Code:
 dialog vrlis {
  title "friendlist"
  size -1 -1 175 131
  option dbu
  icon $mircdirSysteem\icons\scrippie2.ico, 0
  edit "", 1, 7 14 60 90, read multi return vsbar
  text "friendlist", 2, 19 4 36 8, center
  edit "", 85, 76 12 50 10, autohs
  button "add", 86, 76 24 37 12
  edit "", 87, 76 38 50 10, autohs
  button "remove", 88, 76 50 37 12
  button "Okee", 3, 19 110 37 12, ok
}


on *:DIALOG:vrlis:sclick:86: { auser prive $did(vrlis,85).text }
on *:DIALOG:vrlis:sclick:88: { ruser prive $did(vrlis,87).text }

on *:DIALOG:vrlis:init:0: {
  var %i = $ulist(*,prive,0) | while ( %i ) { did vrlis 1 $ulist(*,prive,%i) $crlf | dec %i }
} 

#140573 27/01/06 12:27 PM
Joined: Mar 2004
Posts: 21
Ameglian cow
Offline
Ameglian cow
Joined: Mar 2004
Posts: 21
Hello Bullseye,

Quote:
Code:
 did vrlis 1 $ulist(*,prive,%i)


It seems you have not specified the flag for /did command. /did never works without one.

Look at the /help file for more information about all its flag.

* -a add text in a control
* -r del text in a control
* $dname returns the dialog name in Dialog event, or aliases called from it.

Also, I think it would be easier to use a list instead of an edit control to configurate your 'friend list' (especially to del an item, by just selecting a line before clicking on 'del' button, without having to type the nickname)


-Be cool with my English-
irc.EpiKnet.org:#scripts
#140574 27/01/06 02:16 PM
Joined: Feb 2005
Posts: 344
B
Fjord artisan
OP Offline
Fjord artisan
B
Joined: Feb 2005
Posts: 344
As far as I know everything is working except one thing.
Removing the user from the user list by selecting it from the list.
I can't get it to know the selected name from the list and i'll get
* /ruser: no such user prive
If I remove prive from the red line i get
* No such user in user list
The red is the line that should remove the name from the list.
The line you see
here is the code that should select the name:
Code:
on *:DIALOG:vrlis:sclick:88: {
  [color:red] ruser prive $Did(vrlis, 1, 0).sel[/color]
  if ($Did(vrlis, 1).sel) {
    .var %a = $Did(vrlis, 1, 0).sel
    While (%a) {
      .hdel uitz $Gettok($Did(vrlis, 1, %a).seltext, 6, 32)
      .did -d vrlis 1 $Did(vrlis, 1, %a).sel
      .dec %a
    }
    .did -z vrlis 1   
    .did -b vrlis 88
}
}
  


Last edited by Bullseye; 27/01/06 04:03 PM.
#140575 27/01/06 07:33 PM
Joined: Mar 2004
Posts: 21
Ameglian cow
Offline
Ameglian cow
Joined: Mar 2004
Posts: 21
If you have multi-selections in your list, you can not delete all matched Users with just one commande /ruser. Moreover your $did().sel probably returns the number of selected lines, and not their texts.

Try to put the /ruser commande in you /while.
Code:
ruser prive $did(vrlis, 1,%a).seltext


-Be cool with my English-
irc.EpiKnet.org:#scripts
#140576 27/01/06 09:31 PM
Joined: Feb 2005
Posts: 344
B
Fjord artisan
OP Offline
Fjord artisan
B
Joined: Feb 2005
Posts: 344
just found it.
this is the corect line:
Code:
 ruser prive $Gettok($Did(instel, 89, %a).seltext, 6, 32)
 

And the place is behind this line:
Code:
 .var %a = $Did(instel, 89, 0).sel
 

and all workes like a charme smile
but thanks all who's been helping or tryed to help


Link Copied to Clipboard