mIRC Home    About    Download    Register    News    Help

Print Thread
#191553 11/12/07 12:42 PM
S
skovicniq
skovicniq
S
can anybody help me to creat this simple dialog box

i need dialog have [ add ] button to add user level. eg: .auser abc blabla. and [ del ] button eg: ruser abc blabla. i need two more button [ list 1 ] .. [ list 2 ] .. if i click 1 of those button it will show in "list box" all user level. eg: [ list 1 ] will show $level(level1) .. and [ list 2 ] will show $level(level2) in "list box" .. Last one check box that i can set on off. eg: if checked .set %this on and if unchecked .set %this off. Please help me. Thanks

#191657 13/12/07 04:15 PM
Joined: Aug 2005
Posts: 1,052
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Aug 2005
Posts: 1,052
I made the dialog for you, I included text, how to use my script is type /xlev it will pull up the dialog, now you code smile

References of mirc help file

/help dialogs
/help $ulevel
/help $level

etc...

Here you go

Code:
dialog Ulev {
  title "ulevel"
  size -1 -1 94 73
  option dbu
  list 1, -1 -1 48 50, size vsbar
  list 2, 46 -1 48 50, size vsbar
  button "[Add]", 3, 1 50 19 12, flat
  button "[Del]", 4, 25 50 19 12, flat
  button "[List 1]", 5, 49 50 19 12, flat
  button "[List 2]", 6, 73 50 19 12, flat
  check "On/Off", 7, 2 63 31 10, flat
}
alias xlev { dialog -md ulev ulev }

on *:dialog:ulev:*:*:{
  if ($devent == INIT) { 
    did -a $dname 1 Adding stuff to list
    did -a $dname 2 At Startup :P
    ;This area of the called INIT is where you put stuff when your dialog starts maybe a stored var or command?
  }
  elseif ($devent == Sclick) {
    if ($did == 3) { did -a $dname 1,2 Added stuff to both list }
    ;Added item to both list 1 and 2 by using 1 and 2
    elseif ($did == 4) { did -r $dname 1 $did($dname,1).sel }
    ;deleted selected item from list 1
    elseif ($did == 5) { did -a $dname 1 Added whatever command or text to list 1 }
    elseif ($did == 6) { did -a $dname 2 Added whatever command or text to list 2 }
    elseif ($did == 7) {
      if (!%this) || (%this == off) { %this = on }
      else { %this = off }
      ;Now you choosed this way to use that checkmark to set a var but its not needed because
      ;You can check to see if the checkmark is on or off by using $did($dname,7).state
      ;This will return either 0 or 1 if unchecked or checked :)
    }
  }
}


Now it's your turn smile


Link Copied to Clipboard