Adding users dialog

By slub77 on Feb 06, 2010

This is a dialog i have made to make it simpler, for people to add users.
It works by getting everyone's name in the channel then putting them in a list, then a selection of buttons become available.

Features
.Add users
.Create your own custom levels with names
.Warn users
.Inform user
.Get someone's host

Please do not edit this dialog unless you understand what to replace, as some removals may create an error with in it, and then well screw up your MIRC.

EDIT
New features:
1.Filtering system
..Aloows you to filter between non users- and usera
2.Warning system improved
..Now with selective actions such as how many times warned and reset
3.Help system included
..help for the dialog, how to use etc

Image
^^^ Preview

Please rate/comment/Like

menu * {
  Add Users:/dialog -ma add add
}

dialog add {
  Title Add Users
  size -1 -1 208 118
  option dbu

  list 1, 2 1 90 120,
  combo 2, 97 3 50 1, drop
  edit , 3, 97 20 100 10, disable, center
  text levels to choose, 4, 150 3 50 10
  button Add user, 5, 97 50 50 10
  button del user, 6, 150 50 50 10
  button inform user, 7, 150 70 50 10
  button Warn user, 8, 97 70 50 10
  button Host, 9, 122 90 50 10
  text Commands to use for: , 10, 110 30 90 10, disable
  button +, 11, 189 2 10 10
  button Filter, 12, 97 103 50 10
  combo 13, 150 103 50 10, drop
  edit , 14, 97 89 50 10, disable, center
  button Reset warnings, 15, 150 89 50 10
  box Warnings, 16, 98 80 103 20
  button *, 17, 92 80 10 10
  button Help, 20, 140 37 15 10
  box Help, 21, 97 3 99 110
  button (*), 22, 198 2 10 10
  edit , 23, 99 10 94 100, multi, read, return, center, vsbar

}

alias -l addtext {
  did -r $dname 23 | did -i $dname 23 1 Welcome to the help menu, Here you can learn how to use the dialog. | did -i $dname 23 4 1.First off you must add a level, to do this you click the + once pressed you will be asked to enter a name, this will be your levels name, next it will ask you for a number, this is going to be he level it self aka 2 is level 2. | did -i $dname 23 11 2.Now that we have a level, we can start adding people to the user list, to do this you must first go in to a channel, thenre-open the dialog, and you will see the names of everyone in the channel, by clicking on each name you will have the option to add them, if they are added, you will not. So find some one that is not added and click them, then from the top drop down menu, select your level, and click add user. you have now added a user | did -i $dname 23 11 | did -i $dname 23 27 3.Deleteing a user: to delete a user, they must first be added (see 2.) if they are, the option to delete will show, once you click that,the user no longer has any power | did -i $dname 23 27 | did -i $dname 23 34 4.Warning a user: When you warn a user, you tell them that they are at risk of lossing there power, the warning's can be seen bu clicking the * button below the warn button, this will show you the selected persons warnng, and if they have any the option to reset them. | did -i $dname 23 34 | did -i $dname 23 44 5.Informming: This will message the highlighted person, there current level | did -i $dname 23 44 | did -i $dname 23 48 6.Host:This will show you the highlighted person host in the edit box | did -i $dname 23 48 | did -i $dname 23 52 7.Filter:you can filter the people in the channel, in to non-users and users | did -i $dname 23 52
}

on *:DIALOG:add:init:*:{
  $chanu
  $levelo
  $levelu
  did -h $dname 4-10,14,15,16,17,21,22,23
  did -b $dname 2
  did -i $dname 13 1 Non-users | did -i $dname 13 1 Users

}

on *:DIALOG:ADD:SCLICK:20:{
  if !$did(22).visable { did -h $dname 2-17,20 | did -b $dname 1 | did -v $dname 21,22,23 | $addtext }
else { did -v $dname 2,3,22 } }

on *:DIALOG:ADD:SCLICK:22:{ did -v $dname 2,3,20,11,12,13 | did -h $dname 22,21,23 | did -e $dname 1 }

on *:DIALOG:add:SCLICK:1:{
  did -o $dname 3 1 $level3 | did -v $dname 5-8,17
  if !$did(14).visable { did -v $dname 5-8,17 9 }

  did -a $dname 10 Commands for $did(1).seltext

  if ($level3 == Unknown) { did -b $dname 6-8, | did -e $dname 2 | did -v $dname 4 }
  else { did -e $dname 6-8 | did -b $dname 2,4 | did -h $dname 4  }

  $warned 
}

on *:DIALOG:add:sclick:6:ruser $address($did(1).seltext,3) | $reset

on *:DIALOG:ADD:SCLICK:5:guser -a $levele $did(1).seltext 3 | $reset

on *:DIALOG:ADD:SCLICK:7:notice $did(1).seltext Hello $did(1).seltext Your Level is: $level3

on *:DIALOG:ADD:SCLICK:8:{
  notice $did(1).seltext Hello $did(1).seltext I am warning you about your current power, may be at risk of being taken away. : Current warnings $readini(warn.ini, warning, $address($did(1).seltext,2))
  if !$readini(warn.ini, warning, $address($did(1).seltext,2)) { writeini warn.ini warning $address($did(1).seltext,2)) 1 }
  else {
    var %a $readini(warn.ini, warning, $address($did(1).seltext,2))
    inc %a
    writeini warn.ini warning $address($did(1).seltext,2)) %a
  }
  $reset
}

on *:DIALOG:ADD:SCLICK:9:did -o $dname 3 1 $address($did(1).seltext,3)

on *:DIALOG:add:SCLICK:11:{
  var %a 1 | var %b 1
  :loop
  if $($+(%,%a,.,level),2) { inc %a | goto loop }
  else {
    $?="You must enter a level name" 
    if !$! { noop }
    else { set $+(%,%a,.,level) $! | $?="Enter the level value" }
    if !$! { noop }
    else { set $+(%,%a,.,levelp) $! | dialog -x add add | dialog -ma add add }
  }
}

on *:DIALOG:add:Sclick:12:{
  if !$did(13,0) { did -o $dname 3 1 Please select a filter }
  else {
    if $did(13,0) == Non-users { did -r $dname 1 | $filtern }
if $did(13,0) == users { did -r $dname 1 | $filtery } } }

on *:DIALOG:ADD:SCLICK:15:remini warn.ini warning $address($did(1).seltext,2) | $reset

on *:DIALOG:add:SCLICK:17:{
  if $did(14).visible { did -h $dname 14-16 | did -v $dname 9 }
else { did -v $dname 14-16 | did -h $dname 9 } }

;;;;;;;;;;;;;;;;;;;;;;;;;;;

alias -l warned {
  if !$readini(warn.ini, warning, $address($did(1).seltext,2)) { did -i $dname 14 1 No warnings | did -b $dname 15 1 }
  else { did -i $dname 14 1 Warned : $readini(warn.ini, warning, $address($did(1).seltext,2)) | did -e $dname 15 1 }
}

alias -l filtern {
  var %peep $nick(%channel,0) | var %b 1 | var %a 1
  :lol
  if %b == %peep { noop }
  elseif !$ulist($address($nick(%channel,%b),3)) { did -i $dname 1 %a $nick(%channel,%b) | inc %a | inc %b | goto lol }
else { inc %b | goto lol } }

alias -l filtery {
  var %peep1 $nick(%channel,0) | var %c 1 | var %d 1
  :lol
  if %c == %peep1 { noop }
  else {
    if !$ulist($address($nick(%channel,%c),3)) { inc %c | goto lol }
else { did -i $dname 1 %d $nick(%channel,%c) | inc %c | inc %d | goto lol } } }

alias -l reset {
  dialog -x $dname $dname | dialog -ma add add
}
alias -l levelE {
  var %a 1 | var %b 1
  :loop
  if !$($+(%,%a,.,level),2) { halt }
  if $($+(%,%a,.,level),2) == $did(add,2,0) { return $($+(%,%a,.,levelp),2) }
else { inc %a | goto loop } }

alias -l levelu {
  var %a 1 | var %b 1
  :lev
  if $($+(%,%a,.,level),2) { did -o $dname 2 %b $($+(%,%a,.,level),2) | inc %a | inc %b | goto lev }
else { noop } }

alias -l level3 {
  var %a 1 | var %b 2
  :loop
  if $($+(%,%a,.,level),2) {
    if $level($address($did(1).seltext,3)) isin $($+(%,%a,.,levelp),2) { return Level : $($+(%,%a,.,level),2) }
  else { inc %a | goto loop } }
else { return Unknown } }

alias -l chanu {
  $safea
  set %channel $active
  var %peep $calc($nick(%channel,0) +1)
  var %b 1
  :lol
  if %b == %peep { noop }
else { did -i $dname 1 %b $nick(%channel,%b) | inc %a | inc %b | goto lol } }

alias -l safea {
  if $active == Status Window { dialog -x add add | noop $tip(n,ERROR,Must be in a channel,2,,,,,)) | halt }
}

alias -l levelo {
  if !%1.level {
   noop $?="You must enter a level name" 
    if !$! { noop }
    else { set %1.level $! | noop $?="Enter the level value" }
    if !$! { dialog -x add add }
    else { set $+(%,1,.,levelp) $! }
  }
  else {
    if $levelo2 == no { noop }
    else {
      var %d 1
did -o $dname 2 %d $levelo2(%d) } } }

alias -l levelo2 {
  var %c $1
  if $+(%,%a,.,level) { return $($+(%,%c,.,level),2) }
else { return no } }

Comments

Sign in to comment.
Warriorii   -  Jun 27, 2012

Great dialog slub77, I am using it now and so far it's working great. Thx

 Respond  
slub77   -  Feb 08, 2010

ok i have added a help system, just to clear any thing up that people do not understand :)

 Respond  
slub77   -  Feb 07, 2010

Thanks, the filter system should work, if you don't add the user then it won't come up if u filter user only, also it get's the userlist from the channel so you can just add users on that channel, if you were to just add people it may get confusing, because it mainly works if they are there, and if it can't get the address then it won't work.

Lol please rate in rating

 Respond  
Ghost-writer   -  Feb 07, 2010

I couldnt get the filter to work and i dont really see the point of it but it works and its somewhat good, i dont like the fact it gets users from a channel, maybe if it had a built in user list that you could add/delete people yourself. The code is kinda spaced out and bloated, could be shortend. Also it left me a lot of variables, i didnt enjoy that. Overall good script, decent coding. 7/10.

 Respond  
slub77   -  Feb 07, 2010

No one comments when i make something of use lol

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.