mIRC Home    About    Download    Register    News    Help

Print Thread
#113382 04/03/05 01:18 AM
Joined: Feb 2005
Posts: 194
A
Vogon poet
OP Offline
Vogon poet
A
Joined: Feb 2005
Posts: 194
Hey. I'm brand new to dialogs. I've seen that in a dialog with a list, it can say: play blah.txt. How can I view a list of users on a certain user level in a list. For example, how can i have a list that displays all of the users on level 10? Does it still use play?


"God sometimes puts us in the dark for us to see the light"
#113383 04/03/05 01:20 AM
Joined: Nov 2003
Posts: 2,327
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Nov 2003
Posts: 2,327
Code:
var %i = 1
while ($ulist(*,10,%i)) {
  did -a dialog id $v1
  inc %i
}


New username: hixxy
#113384 04/03/05 02:40 AM
Joined: Feb 2005
Posts: 194
A
Vogon poet
OP Offline
Vogon poet
A
Joined: Feb 2005
Posts: 194
Ok. Like I said, i'm totally new at this. This is the list I want to display the users on level 10 in:
Code:
[color:blue] list 1, 12 41 240 267, tab 4 hsbar vsbar size sort extsel 
[/color] So what would the "sclick" be?


"God sometimes puts us in the dark for us to see the light"
#113385 04/03/05 02:46 AM
Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
Code:
On *:dialog:dname:sclick:1: {
  stuff
}

#113386 04/03/05 03:03 AM
Joined: Feb 2005
Posts: 194
A
Vogon poet
OP Offline
Vogon poet
A
Joined: Feb 2005
Posts: 194
Ok. Got it to display the list. I have 2 more questions, then i should know enough to continue on. The list is set to scroll horizontal and vertical. It wont let me in order to see the entire address. The stuff I use is bellow. I complied it using stuff from another dialog I downloaded. Is it right? And what do I add to get it to scroll?
Code:
 on *:dialog:userlist:init:*: {   
  var %i = 1
  while ($ulist(*,10,%i)) {
    did -a userlist 7 $v1
    inc %i
  }
}
on *:dialog:userlist:sclick:7: {  
  did -e userlist 7 $vl
} 
Also, what would the code be to add and remove a user to the user level 10 from the dialog? Ohhh. I almost forgot. I need it to add that user to the user list using the $address($nick,13) mask please.

Last edited by alhammer; 04/03/05 03:21 AM.

"God sometimes puts us in the dark for us to see the light"
#113387 04/03/05 04:18 AM
Joined: Nov 2003
Posts: 2,327
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Nov 2003
Posts: 2,327
1) use /did -h to get the horizontal scrollbar to show.
2) on *:dialog:name:sclick:buttonid:{ auser level $address($$did(editid),13) }


New username: hixxy
#113388 04/03/05 05:35 AM
Joined: Nov 2004
Posts: 332
R
Fjord artisan
Offline
Fjord artisan
R
Joined: Nov 2004
Posts: 332
on mirc.net there are several dialog makesr that help take the monotony out of making dialogs
i suggest making your first however many by hand and once you feel like you know what your doing and it shifts from learning to boredom you might want to nab one of those


The Kodokan will move you, one way or another.
#113389 04/03/05 01:03 PM
Joined: Feb 2005
Posts: 194
A
Vogon poet
OP Offline
Vogon poet
A
Joined: Feb 2005
Posts: 194
Ok. I designed it using Dialog Editor. It looks fine, it's just the code part i'm having trouble with. There are many unfamilar parrameters. Is there a tutorial somewhere that lists all of them? I am pasting my dialog here just in case there are any errors in the code. When you gave me the code for the list and auser, you made it vauge enough for me to put in my specific parameters. The only problem is, I dont know anything. confused blush So, if you would, please show me the code to view the list, and an add and remove button for just 1 tab. Thanks. I dont want to bug anyone. I just need a little boost. Since each tab is exactly the same, just a different level, i should able to code the whole dialog with just code for 1 list, add, and remove button. Thanks!!! smile
Code:
 dialog userlist {
  title "User List Editor"
  size -1 -1 263 394
  option pixels notheme
  tab "Owner", 3, -2 0 287 355
  tab "Host", 4
  tab "Kick List", 5
  tab "Spam List", 6
  list 1, 12 41 240 267, tab 4 hsbar vsbar size sort extsel
  list 9, 12 41 240 267, tab 5 hsbar vsbar size sort extsel
  list 11, 12 41 240 267, tab 6 hsbar vsbar size sort extsel
  button "Add", 13, 144 325 41 19, tab 3
  button "Delete", 14, 202 325 46 19, tab 3
  button "OK", 15, 99 360 65 25, ok
  button "Cancel", 16, 183 360 65 25, cancel
  list 7, 12 41 240 267, tab 3 hsbar vsbar size sort extsel
  box "Owner Access Users:", 2, 4 25 254 296, tab 3
  box "Host Access Users:", 8, 4 25 254 296, tab 4
  box "Kick List Users:", 10, 4 25 254 296, tab 5
  box "Spam List Users:", 12, 4 25 254 296, tab 6
  button "Add", 17, 144 325 41 19, tab 4
  button "Add", 18, 144 325 41 19, tab 5
  button "Add", 19, 144 325 41 19, tab 6
  button "Delete", 20, 202 325 46 19, tab 4
  button "Delete", 21, 202 325 46 19, tab 5
  button "Delete", 22, 202 325 46 19, tab 6
}
 


"God sometimes puts us in the dark for us to see the light"
#113390 04/03/05 09:25 PM
Joined: Aug 2003
Posts: 1,831
I
Hoopy frood
Offline
Hoopy frood
I
Joined: Aug 2003
Posts: 1,831
OK slight (or not) re-numbering here for ease, made tabs ID# reflect levels (see notes below on how to change the 'levels' I used to your own), lists and buttons are tab numbers plus 100/200/300.
Code:
dialog userlist {
  title "User List Editor"
  size -1 -1 263 394
  option pixels notheme

  tab "Owner", 15, -2 0 287 355
  box "Owner Access Users:", 11, 4 25 254 296, tab 15
  list 115, 12 41 240 267, hsbar vsbar size sort extsel tab 15
  button "Add", 215, 144 325 41 19, tab 15
  button "Delete", 315, 202 325 46 19, tab 15

  tab "Host", 10
  box "Host Access Users:", 16, 4 25 254 296, tab 10
  list 110, 12 41 240 267, hsbar vsbar size sort extsel tab 10
  button "Add", 210, 144 325 41 19, tab 10
  button "Delete", 310, 202 325 46 19, tab 10

  tab "Kick List", 5
  box "Kick List Users:", 6, 4 25 254 296, tab 5
  list 105, 12 41 240 267, hsbar vsbar size sort extsel tab 5
  button "Add", 205, 144 325 41 19, tab 5
  button "Delete", 305, 202 325 46 19, tab 5

  tab "Spam List", 2
  box "Spam List Users:", 8, 4 25 254 296, tab 2
  list 102, 12 41 240 267, hsbar vsbar size sort extsel tab 2
  button "Add", 202, 144 325 41 19, tab 2
  button "Delete", 302, 202 325 46 19, tab 2

  button "OK", 98, 99 360 65 25, ok
  button "Cancel", 99, 183 360 65 25, cancel
}
on *:dialog:userlist:init:0:{
  var %i = 1 | while ($ulist(*,15,%i)) { did -a userlist 115 $v1 | inc %i }
  var %i = 1 | while ($ulist(*,10,%i)) { did -a userlist 110 $v1 | inc %i }
  var %i = 1 | while ($ulist(*,5,%i)) { did -a userlist 105 $v1 | inc %i }
  var %i = 1 | while ($ulist(*,2,%i)) { did -a userlist 102 $v1 | inc %i }
[color:gray]  ; ^^ adds all levels to the list[/color]
  did -z $dname 102,105,110,115
[color:gray]  ; reset the hsbars[/color]
}
on *:dialog:userlist:sclick:202,205,210,215:{
[color:gray]  ; Fires for sclick on the ID's 202, 205, 210 & 215 (The "add" buttons)[/color]
  var %a = $did - 200,%b = $did - 100
[color:gray]  : vars for level and listbox id[/color]
  did -a $dname %b $$input(Add user to list,equ,Add user.)
[color:gray]  ; get input to add to listbox[/color]
  auser %a $!
[color:gray]  ; adds the same input to the address list[/color]
  did -z $dname %b
[color:gray]  ; reset the hsbar[/color]
}
on *:dialog:userlist:sclick:302,305,310,315:{
[color:gray]  ; Fires for sclick on the ID's 302, 305, 310 & 315 (The "delete" buttons)[/color]
  var %a = $did - 300,%b = $did - 200
[color:gray]  : vars for level and listbox id
  ; the listboxes are extsel, so loop each selected item[/color]
  while $did(%b,1).sel {
    ruser %a $did(%b,1).seltext 
[color:gray]    ; deletes sellected line from the address list[/color]
    did -d $dname %b $did(%b,1).sel
[color:gray]    ; and deletes the selected line[/color]
  }
}


-----------------------
I don't know what levels you use so I ad-libbed, you need to change the ID#s
e.g. If Kicklist is level 22, change all the IDs 5,105,205,305 to 22,122,222.322
Code:
  tab "Kick List", [color:blue]22[/color]
  box "Kick List Users:", 6, 4 25 254 296, tab [color:blue]22[/color]
  list [color:red]1[/color][color:blue]22[/color], 12 41 240 267, hsbar vsbar size sort extsel tab [color:blue]22[/color]
  button "Add", [color:red]2[/color][color:blue]22[/color], 144 325 41 19, tab [color:blue]22[/color]
  button "Delete", [color:red]3[/color][color:blue]22[/color], 202 325 46 19, tab [color:blue]22[/color]
AND
Code:
  var %i = 1 | while ($ulist(*,15,%i)) { did -a userlist 115 $v1 | inc %i }
  var %i = 1 | while ($ulist(*,10,%i)) { did -a userlist 110 $v1 | inc %i }
  var %i = 1 | while ($ulist(*,[color:blue]22[/color],%i)) { did -a userlist [color:red]1[/color][color:blue]22[/color] $v1 | inc %i }
  var %i = 1 | while ($ulist(*,2,%i)) { did -a userlist 102 $v1 | inc %i }
AND
Code:
on *:dialog:userlist:sclick:202,[color:red]2[/color][color:blue]22[/color],210,215:{
  var %a = $did - 200,%b = $did - 100
  did -a $dname %b $$input(Add user to list,equ,Add user.)
  auser %a $!
  did -z $dname %b
}
AND
Code:
on *:dialog:userlist:sclick:302,[color:red]3[/color][color:blue]22[/color],310,315:{
  var %a = $did - 300,%b = $did - 200
  while $did(%b,1).sel {
    ruser %a $did(%b,1).seltext 
    did -d $dname %b $did(%b,1).sel
  }
}

#113391 04/03/05 10:39 PM
Joined: Feb 2005
Posts: 194
A
Vogon poet
OP Offline
Vogon poet
A
Joined: Feb 2005
Posts: 194
Excellent! Thanks everyone. Got 1 quick question. I believe it is simple. For the add and remove buttons, what would the code be to refresh the list after something is added or deleted? I'm sure it's a simple 1 line, but if not, dont worry about it. It's no big deal. Thanks again. Everything works great. And thanks for the clear descriptions in the code. I hate stuff without descriptions. It may work, but i want to know how! lol. thanks grin grin


"God sometimes puts us in the dark for us to see the light"
#113392 04/03/05 10:53 PM
Joined: Aug 2003
Posts: 1,831
I
Hoopy frood
Offline
Hoopy frood
I
Joined: Aug 2003
Posts: 1,831
Change these sections
Code:
on *:dialog:userlist:init:0:{ _init.users }
alias -l _init.users {
  did -r userlist 102,105,110,115
  var %i = 1 | while ($ulist(*,15,%i)) { did -a userlist 115 $v1 | inc %i }
  var %i = 1 | while ($ulist(*,10,%i)) { did -a userlist 110 $v1 | inc %i }
  var %i = 1 | while ($ulist(*,5,%i)) { did -a userlist 105 $v1 | inc %i }
  var %i = 1 | while ($ulist(*,2,%i)) { did -a userlist 102 $v1 | inc %i }
  did -z userlist 102,105,110,115
}
on *:dialog:userlist:sclick:202,205,210,215:{
  var %a = $did - 200,%b = $did - 100
  did -a $dname %b $$input(Add user to list,equ,Add user.)
  auser %a $!
  _init.users
}
on *:dialog:userlist:sclick:302,305,310,315:{
  var %a = $did - 300,%b = $did - 200
  while $did(%b,1).sel {
    ruser %a $did(%b,1).seltext 
    did -d $dname %b $did(%b,1).sel
  }
  _init.users
}

#113393 04/03/05 11:34 PM
Joined: Feb 2005
Posts: 194
A
Vogon poet
OP Offline
Vogon poet
A
Joined: Feb 2005
Posts: 194
Perfect! Thanks! By the way, may I have your premision to give this dialog to some people? I will credit you if you approve!


"God sometimes puts us in the dark for us to see the light"
#113394 04/03/05 11:40 PM
Joined: Aug 2003
Posts: 1,831
I
Hoopy frood
Offline
Hoopy frood
I
Joined: Aug 2003
Posts: 1,831
Surely. Give it out freely, no credits needed. smile


Link Copied to Clipboard