Username:
Password:
  Home About Us Articles Rules Script Library FAQ Help
Not logged in (register
Chanserv Interface for mIRC

Last Modified: Apr 06 3:35pm (r8)

Provides a popup-based interface for ChanServ.

Create a new file, anywhere, preferrably to your mIRC folder or its subdirectories and save the code there. Now in mIRC, write:
//load -rs $sfile($shortfn($mircdir))
and then select the file you just created. Answer 'yes' to the next question and then how you please.

After the initialization, go to Status window, right-click and you can see "ChanServ" menu. There you should add UtoNet to the CS-networks and click to identify internally if you are identified.

After that, you will find a similiar Chanserv menu in nicklist and channel windows.

Updates
r1: Annoyances fixed, useless code removed. Added hload/hsave.
r2: Cleaner unload, made the one long line smaller, fixed stuff. Btw, if you think this needs commenting on some parts, say so.
r3: Fixed a bunch of bugs.
r4: Owner pw saving, options to have default input like kick messages, comments, fixed bunch of stuff.
r5: ban evasion, fixed some stuff, made loading more fun.
r6: Added some $shortfn's. $input-dialogs a bit better looking now, though I think I should make my own flexible $dialog for these. I think this pretty much completes the ChanServ stuff, will move onto NickServ when/if I have the time.
r7: Bah, a typo. :I
r8: Another "typo"

Oh, feedback greatly appreciated.
; saves or loads all the settings
on *:start:{
  if ($isfile($shortfn($scriptdircs.hashes))) {
    hmake services.zz 20
    hload services.zz $shortfn($scriptdircs.hashes)
  }
}
on *:exit:{
  var %i = 1
  while ($scon(%i)) {
    scon %i
    if ($nw) _hash ident. $+ $network 0
    inc %i
  }
  hsave -o services.zz $shortfn($scriptdircs.hashes)
}
; initiailizes some stuff
on *:load:{
  _hash levels. $+ $network 100.50.40.30.50.100.1000.100.50.1.40.100.50.30.40.100.50.50.100
  _hash nw
  var %i = 1, %server = 1
  while ($scon(%server).$network) {
    if ($input(Do you want ChanServ Interface enabled in $scon(%server).$network,yq,Enable Chanserv Interface)) {
      scon %server
      nw $network add
      while ($chan(%i)) { _hash $+($chan(%i),.,$network,.modes) $str(0.,12) | inc %i }
    }
    inc %server
  }
}

on *:ban:#:{
  if ($nw) && ($lvl($chan,9,a)) && ($_hash(autounban. $+ $network) == 1) {
    if ($banmask iswm $address($me,5)) _cs unban $chan
  }
}

; parsing event for the button "Get from CS" in one of the dialogs.
#cs.parsing off
on *:notice:*:*:{
  if ($nick == ChanServ) {
    var %j = AUTOPROTECT AUTOOP AUTOHALFOP AUTOVOICE INVITE AKICK SET CLEAR UNBAN ACC-LIST ACC-CHANGE MEMO OP-DEOP VOICE HALFOP PROTECT KICK TOPIC STATUS
    if (($istok(%j,$1,32)) && ($2 != $did(lvls,$findtok(%j,$1,1,32)))) {
      _hash $+($_hash(chan),.,$network,.levels) $puttok($iif($+($_hash(chan),.,$network,.levels),$+($_hash(chan),.,$network,.levels),$_hash(levels. $+ $network)),$2,$findtok(%j,$1,1,32),32)
      did -ra lvls $findtok(%j,$1,1,32) $2
      if ($1 == status) .disable #cs.parsing
    }
  }
}
#cs.parsing end

; disconnects removes identification
on *:disconnect:{
  if ($nw) _hash ident. $+ $network 0
}

; initializes some stuff or deletes it if it's pointless when leaving
on *:join:#:if (($nw) && (!$_hash($+($chan,.,$network,.modes)))) _hash $+($chan,.,$network,.modes) $str(0.,12)
on *:part:#:if (($nw) && ((!$myacc($chan)) || (!$reg))) _hash $+($chan,.,$network,.modes)

; some parsing to detect if the nick is identified
on *:notice:*:*: {
  if (($nick == NickServ) || ($nw)) {
    if (($1- == Password accepted -- you are now recognized.) || ($1- == Authentication succeeded; your nickname registration is now complete.)) _hash ident. $+ $network 1
    if ($1- == Your nickname and all linked nicknames have been dropped.) _hash ident. $+ $network 0
  }
  if (($nick == ChanServ) || ($nw)) {
    if ($1-9 == Password accepted -- you now have founder-level access to) {
      myacc $remove($10,$right($10,1)) 1000
    }
  }
}

; delete the temp item which helped to see which channel the dialog is in
on *:dialog:lvls:close:*:hdel services.zz levels.dialog

; dialog init stuff, fills the fields etc
on *:dialog:lvls:init:0:{
  fill.fields $iif($_hash($+($_hash(chan),.,$network,.levels)),$_hash($+($_hash(chan),.,$network,.levels)),$_hash(levels. $+ $network))
  did -ra lvls 41 $_hash(chan) @ $network
  if ($_hash(levels.dialog) == 1) did -ra lvls 40 This is an internal access level sheet and the changes will only apply to what popups you can see, not anything real.
  else did -ra lvls 40 After clicking ok, every change will be sent to chanserv.
  did $iif($myacc($_hash(chan)) == 1000,-v,-h) lvls 42
}

on *:dialog:lvls:sclick:*:{
  ; ok button, saves all the data internally, sends modified data to cs if needed. also checks if the data is valid
  if ($did == 39) {
    var %i = 1,%j,%k,%p
    while (%i <= 19) {
      if (($did(%i) < -999) || ($did(%i) > 1000)) { did -ra lvls %i :( | %j = 1 }
      %p = %p $+ $iif($did(%i) != $gettok($_hash(levels1),%i,46),1,2)
      %k = $instok(%k,$did(%i),0,46)
      inc %i
    }
    if (%j > 0) return
    if ($_hash(levels.dialog) == 1) {
      if (%k != $_hash(levels. $+ $network)) _hash $+($_hash(chan),.,$network,.levels) %k
    }
    else {
      %i = 1
      while ($gettok(%k,%i,46)) {
        if ($mid(%p,%i,1) == 1) .msg chanserv levels $_hash(chan) set $did($calc(%i + 19)) $did(%i)
        inc %i
      }
      _hash $+($_hash(chan),.,$network,.levels) %k
    }
  }
  ; starts the parsing to see what are the levels at currently
  if ($did == 42) {
    .enable #cs.parsing
    .msg chanserv levels $_hash(chan) list
  }
}

; eases the use of hash table, if data is empty it deletes the item, retrieves or saves info.
alias -l _hash {
  if ($isid == $false) {
    if (!$2) hdel services.zz $1
    else hadd -m services.zz $1 $$2
  }
  else return $hget(services.zz,$1)
}

; command to load either the real levels changing dialog or the internal one
alias -l dailog {
  if ($1 == 1) _hash levels.dialog 1
  else _hash levels.dialog 2
  _hash chan $chan
  dialog -m lvls levels
}

; help command for the dialog initialization
alias -l fill.fields {
  var %i = $1-,%j = 1
  _hash levels. $+ $network %i
  while ($gettok(%i,%j,46)) { did -ra lvls %j $gettok(%i,%j,46) | inc %j }
}

; checks if the channel is registered
alias -l reg return $iif(r isincs $chan($chan).mode,1)

; checks what is the required level for the specified cs command.
; See the all caps line earlier inside the #cs.parsing group
; so 1 is for autoprotect and 2 is for autoop.
alias -l chanlvl {
  if ($_hash($+($1,.,$network,.levels))) return $gettok($_hash($+($1,.,$network,.levels)),$2,46)
  else return $gettok($_hash(levels. $+ $network),$2,46)
}

; checks if your access is higher/equal than the one required for the cs command
alias -l lvl {
  if ($myacc($1) $iif(!$3,==,>=) $calc($chanlvl($1,$2) + $iif($prop,1))) return $true
  else return $false
}

; returns the nick with the @%+ stuff with the nick or without it.
alias pnick {
  var %i = $nick($chan,$1).pnick,%j = $nick($chan,$1)
  %i = $remove(%i,$nick($chan,%j))
  if ($prop == highest) %i = $left(%i,1)
  return %i
}

; checks if the nick is kickable (it has no protection)
alias kickable return $iif($pnick($1).highest !isin ~&,1)

; fills popup menu with some commands
; detects whether you have the access to these and displays them accordingly
alias -l _control {
  var %temp = $gettok($1-,2,32)
  var %i = Protect Deprotect Op Deop Halfop Dehalfop Voice Devoice,%j = $pnick(%temp)
  if (!$lvl($chan,16,a)) %i = $removecs(%i,Protect,Deprotect)
  if (!$lvl($chan,13,a)) %i = $removecs(%i,Op,Deop)
  if (!$lvl($chan,15,a)) %i = $removecs(%i,Halfop,Dehalfop)
  if (!$lvl($chan,14,a)) %i = $removecs(%i,Voice,Devoice)
  %i = $removecs(%i,$iif(~ isin %j || & isin %j,Protect,Deprotect))
  %i = $removecs(%i,$iif(@ isin %j,Op,Deop))
  %i = $removecs(%i,$iif(% isin %j,Halfop,Dehalfop))
  %i = $removecs(%i,$iif(+ isin %j,Voice,Devoice))
  if (($1 <= $calc($numtok(%i,32) + 1)) && ($numtok(%i,32))) return $gettok(%i,$1,32) : _cs $gettok(%i,$1,32) $chan $snick($chan,1)
}

; retrieves or changes your access to a chan
alias -l myacc {
  if ($isid == $false) _hash $1 $+ .my. $+ $network $2
  else return $_hash($1 $+ .my. $+ $network)
}

; another menu filling alias that puts most of the on/off stuff there
alias -l _control3 {
  if (($1 == begin) || ($1 == end)) return -
  var %i = Enforce Keeptopic Leaveops Opnotice Private Restricted Secure Secureops Topiclock
  if ($1 <= 9) return $style($bz($chan,$1)) $gettok(%i,$1,32) : _cs set $chan onoff $gettok(%i,$1,32) $1
}

; returns the channel's owner password if it has one and if the support is enabled.
alias -l pw {
  if (($_hash($chan $+ .password. $+ $network)) && ($_hash(store.pws) == 1)) return $_hash($chan $+ .password. $+ $network)
  else return $false
}

; returns true if user is identified and the chan is registered.
alias -l a return $iif($reg && $_hash(ident. $+ $network) == 1,$true)

; if the option is on, this will save your password
alias -l inputpw {
  var %i = $input($1-,pegoq,Input password)
  if ($_hash(store.pws) == 1) _hash $chan $+ .password. $+ $network %i
}

; returns a random line from a file or if the line isnt a file, the file itself.
alias rreason {
  var %i = $_hash(di.dialog. $+ $1)
  if (($_hash(di.dialog. $+ $calc($1 + 4)) == 2) && (!$2)) return
  if (!%i) return
  if ($isfile(%i)) return $read(" $+ %i $+ ")
  else return %i
}

; the actual alias that sends stuff to cs. First was kinda useless but
; it's easier to change stuff when this exists.
alias -l _cs {
  var %q
  if ($1 == unban) {
    var %q = $iif($2,$2,$input(Channel,egoq,Unban from))
    if (!%q) return
  }
  if ($1 == info) %q = $2 all
  if ($1 == register) {
    var %1 = $iif($2,$2,$input(Channel,egoq,Register channel))
    if (!%1) return
    var %2 = $input(Set the founder password,pegoq,Set password)
    if (!%2) return
    var %3 = $input(Make a description for the channel,egoq,Make description)
    if (!%3) return
    if ($_hash(store.pws) == 1) _hash $2 $+ .password. $+ $network %2
    %q = %1 %2 %3
  }
  if ($1 == kick) %q = $2 $3 $iif($rreason(1),$rreason(1),$input(Reason,egoq,Reason,Reason for the kick,$iif($_hash(di.dialog.1) && $_hash(di.dialog.5) == 2,$rreason(1,2))))
  if ($istok(voice devoice halfop dehalfop op deop protect deprotect,$1,32)) %q = $2 $3
  if ($1 == akick) %q = $2 add $address($3,3) $iif($rreason(2),$rreason(2),$input(Reason,egoq,Reason,Reason for the akick,$iif($_hash(di.dialog.2) && $_hash(di.dialog.6) == 2,$rreason(2,2))))
  if ($istok(vop hop aop sop,$1,32)) %q = $2-
  if ($1 == status) %q = $2 $3
  if ($1 == identify) { %q = $2 $iif($pw,$pw,$inputpw(Password)) | if (!%q) return }
  if ($1 == topic) {
    %q = $2 $input(New topic of $2,egoq,Set topic,Input request,$chan($2).topic)
    if (($gettok(%q,2-,32) === $chan($2).topic) || (!%q)) return
  }
  if ($1 == drop) {
    _hash $chan $+ .password. $+ $network
    %q = $2
  }
  if ($1 == access) %q = $2 $3 $4 $iif($3 == add,$input(Access level? $chr(40) $+ your max is $calc($myacc($chan) - 1) $+ $chr(41),egoq,Set level))
  if ($1 == clear) %q = $2-
  if ($1 == unset) %q = $2-
  if ($1 == set) {
    if ($3 == onoff) {
      tokenize 32 $remove($1-,onoff)
      bz $2 $4
      %q = $2 $3 $iif($bz($2,$4) == 1,on,off)
    }
    if ($3 == hide) {
      var %i
      if ($4 == email) { bz $2 10 | %i = 10 }
      if ($4 == topic) { bz $2 11 | %i = 11 }
      if ($4 == mlock) { bz $2 12 | %i = 12 }
      %q = $2 $3 $4 $iif($bz($2,%i) == 1,on,off)
    }
    if ($3 == desc) %q = $2 $3 $input(New description,egoq,Set description)
    if ($3 == email) %q = $2 $3 $iif($rreason(3),$rreason(3),$input(New e-mail,egoq,Set e-mail,New e-mail,$iif($rreason(3,1) && $_hash(di.dialog.7) == 2,$rreason(3,1))))
    if ($3 == url) %q = $2 $3 $iif($rreason(4),$rreason(4),$input(New URL,egoq,Set url,New e-mail,$iif($rreason(4,1) && $_hash(di.dialog.8) == 2,$rreason(4,1))))
    if ($3 == password) {
      %q = $2 $3 $input(New channel password,pegoq,Set password)
      _hash $chan $+ .password. $+ $network $gettok(%q,3,32)
    }
    if ($3 == founder) %q = $2 $3 $iif($4,$4,$input(New channel founder,egoq,Set founder))
    if ($3 == entrymsg) %q = $2 $3 $input(Entry-message,egoq,Set entry-message)
    if ($3 == successor) %q = $2 $3 $iif($4,$4,$input(New successor,egqo,Set successor))
    if ($3 == mlock) %q = $2 $3 $input(Locked modes,egoq,Set locked modes)
  }
  .msg chanserv $1 %q
}

; cs's on/off functions. Retrieves or save new settings.
alias -l bz {
  if (!$_hash($+($chan,.,$network,.modes))) _hash $+($chan,.,$network,.modes) $str(0.,12)
  if ($isid == $false) {
    if ($gettok($_hash($+($1,.,$network,.modes)),$2,46) == 1) _hash $+($1,.,$network,.modes) $puttok($_hash($+($1,.,$network,.modes)),0,$2,46)
    else _hash $+($1,.,$network,.modes) $puttok($_hash($+($1,.,$network,.modes)),1,$2,46)
  }
  else return $gettok($_hash($+($1,.,$network,.modes)),$2,46)
}

; finds out if certain group exists in a channel. For example halfops.
; This is used to see if the clear command has any point.
alias -l nicknum {
  var %i = 1,%j
  while ($nick($chan,%i)) { if ($1 isin $pnick($nick($chan,$calc(%i)))) inc %j | inc %i }
  return %j
}

; enables or disables the script in a network, if used as an identifer returns $true if
; the network has enabled
alias -l nw {
  if (!$isid) {
    if ($istok($_hash(nw),$1,46)) {
      if ($2 == del) _hash nw $remtok($_hash(nw),$1,1,46)
      else return
    }
    else {
      if ($2 == add) _hash nw $addtok($_hash(nw),$1,46)
      else return
    }
  }
  else return $istok($_hash(nw),$network,46)
}

; menus, enough said
menu status {
  Chanserv
  . $iif($_hash(ident. $+ $network) == 1 && $nw,Unban me..) : _cs unban
  . $iif($_hash(ident. $+ $network) == 1 && $nw,Register a channel..) : _cs register
  . -
  . $style($iif($nw,1,0)) $iif($nw,Enabled,Disabled) for $network : nw $network $iif($nw,del,add)
  . $iif($nw,Settings)
  .. $style($_hash(ident. $+ $network)) Identified (internal) : _hash ident. $+ $network $iif($_hash(ident. $+ $network) == 1,0,1)
  .. $style($_hash(store.pws)) Remember channel passwords : _hash store.pws $iif($_hash(store.pws) == 1,0,1)
  .. $style($iif($_hash(autounban. $+ $network),$_hash(autounban. $+ $network),0)) Unban automatically if possible : _hash autounban. $+ $network $iif($_hash(autounban. $+ $network) == 1,0,1)
  .. Input requests.. : dialog -m di prefill
  . -
  . Unload.. : Unload -rs $shortfn($script)
}
menu nicklist {
  $iif($nw && $a,Chanserv)
  . $iif($kickable($1) && $lvl($chan,17,a),Kick) : _cs kick $chan $1
  . -
  . $submenu($_control($1 $snick($chan,1)))
  . -
  . $iif($lvl($chan,6,a),Put on Autokick) : _cs akick $chan $1
  . $iif($lvl($chan,19,a),Status) : _cs status $chan $1
  . -
  . $iif($lvl($chan,11,a),Access list)
  .. $iif($lvl($chan,4,a).a,Autovoice $chr(40) $+ $gettok($_hash(levels. $+ $network),4,46) $+ $chr(41))
  ... Add : _cs vop $chan add $1
  ... Delete : _cs vop $chan del $1
  .. $iif($lvl($chan,3,a).a,Autohalfop $chr(40) $+ $gettok($_hash(levels. $+ $network),3,46) $+ $chr(41))
  ... Add : _cs hop $chan add $1
  ... Delete : _cs hop $chan del $1
  .. $iif($lvl($chan,2,a).a,Auto-op $chr(40) $+ $gettok($_hash(levels. $+ $network),2,46) $+ $chr(41))
  ... Add : _cs aop $chan add $1
  ... Delete : _cs aop $chan del $1
  .. $iif($lvl($chan,1,a).a,Autoprotect $chr(40) $+ $gettok($_hash(levels. $+ $network),1,46) $+ $chr(41))
  ... Add : _cs sop $chan add $1
  ... Delete : _cs sop $chan del $1
  .. -
  .. Custom level
  ... Add : _cs access $chan add $1
  ... Delete : _cs access $chan del $1
  .. -
  .. $iif($mylvl($chan) == 1000,Make founder) : _cs set $chan founder $1
  .. $iif($lvl($chan,7,a),Make successor) : _cs set $chan successor $1
}
menu channel {
  $iif($nw,Chanserv)
  . $iif(!$reg && $_hash(ident. $+ $network) == 1,Register $chan) : _cs register $chan
  . $iif($a,Identify as founder) : _cs identify $chan
  . $iif($reg,Info) : _cs info $chan
  . -
  . $iif($lvl($chan,7,a) && $a,Set)
  .. $iif($myacc($chan) == 1000,Founder password) : _cs set $chan password
  .. $iif($myacc($chan) == 1000,New founder) : _cs set $chan founder
  .. Successor : _cs set $chan successor
  .. -
  .. Description : _cs set $chan desc
  .. E-mail : _cs set $chan email
  .. URL : _cs set $chan url
  .. Entry-msg : _cs set $chan entrymsg
  .. -
  .. Hide
  ... $style($bz($chan,10)) E-mail : _cs set $chan hide email
  ... $style($bz($chan,11)) Topic  : _cs set $chan hide topic
  ... $style($bz($chan,12)) Mlock  : _cs set $chan hide mlock
  .. Mlock : _cs set $chan mlock
  .. $submenu($_control3($1))
  . $iif($lvl($chan,7,a) && $a,Unset)
  .. Successor : _cs unset $chan successor
  .. URL : _cs unset $chan url
  .. E-mail : _cs unset $chan email
  .. Entry-msg : _cs unset $chan entrymsg
  . -
  . $iif($lvl($chan,8,a) && $a,Clear)
  .. Modes : _cs clear $chan modes
  .. $iif($ibl($chan,0),Bans) : _cs clear $chan bans
  .. Exceptions : _cs clear $chan exceptions
  .. $iif($nicknum(@),Ops) : _cs clear $chan ops
  .. $iif($nicknum(%),Halfops) : _cs clear $chan halfops
  .. $iif($nicknum(+),Voices) : _cs clear $chan voices
  .. Users : _cs clear $chan users
  . $iif($lvl($chan,18,a) && $a,Set topic) : _cs topic $chan
  . -
  . $iif($myacc($chan) == 1000 && $a,Drop the channel) : _cs drop $chan
  . $iif($a,Unban me) : _cs unban $chan
  . -
  . $iif($a,My access)
  .. $style($iif(!$myacc($chan) || $myacc($chan) == 0,1,0)) No access : myacc $chan 0
  .. $style($iif($lvl($chan,4),1,0)) Voice $chr(40) $+ $chanlvl($chan,4) $+ $chr(41) : myacc $chan $chanlvl($chan,4)
  .. $style($iif($lvl($chan,3),1,0)) Halfop $chr(40) $+ $chanlvl($chan,3) $+ $chr(41) : myacc $chan $chanlvl($chan,3)
  .. $style($iif($lvl($chan,2),1,0)) Op $chr(40) $+ $chanlvl($chan,2) $+ $chr(41) : myacc $chan $chanlvl($chan,2)
  .. $style($iif($lvl($chan,1),1,0)) SOP $chr(40) $+ $chanlvl($chan,1) $+ $chr(41) : myacc $chan $chanlvl($chan,1)
  .. $style($iif($myacc($chan) == 1000,1,0)) Owner : myacc $chan 1000
  .. -
  .. $style($iif(!$istok($b,$myacc($chan),32) && $myacc($chan),1,0)) Other level.. $iif(!$istok($b $null,$myacc($chan),32) && $myacc($chan),$+($chr(40),$myacc($chan),$chr(41))) : myacc $chan $input(Level,egoq,Set own access)
  . $iif($a,Levels)
  .. Script's internal levels : dailog 1
  .. $iif($myacc($chan) == 1000,Chanserv's levels) : dailog
}

; one line was very long and it had this twice in it so made it even a little bit shorter
alias -l b return 1000 $chanlvl($chan,4) $chanlvl($chan,3) $chanlvl($chan,2) $chanlvl($chan,1)
dialog -l levels {
  title "LEVELS"
  size -1 -1 136 166
  option dbu
  edit "", 1, 37 31 25 10, center
  edit "", 2, 37 42 25 10, center
  edit "", 3, 37 53 25 10, center
  edit "", 5, 37 75 25 10, center
  edit "", 6, 37 86 25 10, center
  edit "", 4, 37 64 25 10, center
  edit "", 8, 37 108 25 10, center
  edit "", 9, 37 119 25 10, center
  edit "", 10, 37 130 25 10, center
  edit "", 11, 106 30 25 10, center
  edit "", 12, 106 41 25 10, center
  edit "", 13, 106 52 25 10, center
  edit "", 14, 106 63 25 10, center
  edit "", 15, 106 74 25 10, center
  edit "", 16, 106 85 25 10, center
  edit "", 17, 106 96 25 10, center
  edit "", 18, 106 107 25 10, center
  edit "", 19, 106 118 25 10, center
  text "Autoprotect", 20, 5 33 30 8, right
  text "Autoop", 21, 16 44 19 8, right
  text "Autohalfop", 22, 7 55 28 8, right
  text "Autovoice", 23, 10 66 25 8, right
  text "Invite", 24, 20 77 15 8, right
  text "Akick", 25, 22 88 13 8, right
  text "Clear", 27, 22 109 13 8, right
  text "Unban", 28, 18 120 17 8, right
  text "Acc-list", 29, 17 131 18 8, right
  text "Acc-change", 30, 75 31 29 8, right
  text "Memo", 31, 89 42 15 8, right
  text "Op-deop", 32, 82 53 22 8, right
  text "Voice", 33, 90 64 14 8, right
  text "Halfop", 34, 87 75 17 8, right
  text "Protect", 35, 85 86 19 8, right
  text "Kick", 36, 94 97 10 8, right
  text "Topic", 37, 91 108 14 8, right
  text "Status", 38, 87 119 17 8, right
  button "Ok", 39, 89 147 43 15, ok
  text "Text Label", 40, 5 3 126 25
  text "Text Label", 41, 17 150 67 8
  edit "", 7, 37 97 25 10, center
  text "Set", 26, 25 99 10 8, right
  button "Get from CS", 42, 89 131 42 14, hide
}
dialog -l prefill {
  title "If filled, you won't get bugged everytime"
  size -1 -1 186 111
  option dbu
  text "Random kick reason", 55, 55 5 50 8
  edit "", 1, 54 13 93 10, autohs hsbar
  combo 5, 3 13 50 11, edit drop
  button "Browse..", 9, 149 13 30 10
  combo 6, 3 33 50 11, edit drop
  text "Random akick reason", 56, 55 25 52 8
  edit "", 2, 54 33 93 10, autohs hsbar
  button "Browse..", 10, 149 33 30 10
  combo 7, 3 53 50 11, edit drop
  text "Default e-mail", 57, 55 45 50 8
  edit "", 3, 54 53 93 10, autohs hsbar
  combo 8, 3 73 50 11, edit drop
  text "Default URL", 58, 55 65 50 8
  edit "", 4, 54 73 93 10, autohs hsbar
  button "Ok", 15, 142 92 37 12, ok
  text "File in the random lines will output a random line from the line, if it doesnt exist or it isnt a file, it will output the line.", 16, 3 89 133 21
}


on *:dialog:di:init:0:{
  var %i = 1
  while (%i < 9) {
    if (%i < 5) did -ra di %i $_hash(di.dialog. $+ %i)
    if (%i > 4) {
      didtok di %i 46 Automatic.Just fill
      did -c di %i $_hash(di.dialog. $+ %i)
    }
    inc %i
  }
}
on *:dialog:di:sclick:9,10:{
  did -ra di $calc($did - 8) $sfile($shortfn($scriptdir))
}
on *:dialog:di:sclick:15:{
  var %i = 1,%j
  while (%i < 9) {
    if (%i < 5) %j = $did(di,%i)
    if (%i > 4) %j = $iif($did(di,%i) == Automatic,1,2)
    _hash di.dialog. $+ %i %j
    inc %i
  }
}
; cleaner unload
on *:unload:{
  hfree services.zz
  if ($isfile($shortfn($scriptdircs.hashes))) .remove $shortfn($scriptdircs.hashes)
}

Comments
arcane
Jul 31 2:54pm
.. $style($iif(!$istok(1000 $chanlvl($chan,4) $chanlvl($chan,3) $chanlvl($chan,2) $chanlvl($chan,1),$myacc($chan),32) && $myacc($chan),1,0)) Other level.. $iif(!$istok(1000 $chanlvl($chan,4) $chanlvl($chan,3) $chanlvl($chan,2) $null $chanlvl($chan,1),$myacc($chan),32) && $myacc($chan),$+($chr(40),$myacc($chan),$chr(41))) : myacc $chan $input(Level,ego)

That's a long line. =)
secretz
Aug 01 5:57am
Yeah, it's weird how while making it it seemed so clear.
Pauly
Sep 21 9:53am
I tried to make something like this a while back:P

I would suggest looking into making one for all of the modes. It will not only help you learn and memorize most all of the modes, but is also where most people on utonet have problems.
 
All content Copyright © 2004 - 2008 UtoNet IRC Network
UtoNet is sponsored and hosted by Datinix Systems