Welcome

User: Pass:   register


Helpline manager with several options.

alias is-help { if ($dialog(is-help)) { dialog -ve is-help } | else { dialog -md is-help is-help | .timeris-help.up 0 60 is-help.up } }

on *:START:{ if (!$hget(is-help)) { .hmake is-help 100 | if ($findfile($scriptdir,is-help.hsh,1)) { .hload is-help $findfile($scriptdir,is-help.hsh,1) } } }

dialog is-help {
  title "IS-Help Line Manager"
  size -1 -1 205 139
  option dbu
  edit "", 1, 3 3 199 10, autohs
  list 2, 3 13 59 123, sort size extsel
  button "&Add", 3, 65 16 14 10, flat
  button "&Del", 4, 79 16 14 10, flat
  button "Sa&ve", 5, 93 16 14 10, flat
  button "&Import From File", 6, 65 27 42 8, flat
  button "E&xport To File", 7, 65 36 42 8, flat
  radio "&Notice", 8, 110 25 27 10, left
  radio "&Channel", 9, 110 33 27 10, left
  combo 10, 142 14 60 50, size drop
  list 11, 142 25 60 111, size extsel
  box "", 12, 1 -2 203 140
  box "", 13, 63 11 78 124
  box "", 14, 108 13 31 31
  box "", 15, 108 21 31 5
  box "", 16, 63 42 78 5
  text "Method", 17, 109 17 27 8, center
  edit , 18, 65 48 74 85, read multi center
  button "", 19, 0 0 0 0, ok
  button "", 20, 0 0 0 0, default
}

on *:DIALOG:is-help:INIT:0:{
  is-help.list
  is-help.chans
  did -c is-help 10 $iif($me ison $active,$didwm(is-help,10,$active),$iif($didwm(is-help,10,*help*),$didwm(is-help,10,*help*),1))
  is-help.nicks
  is-help.method
  did -o is-help 18 1 $crlf $crlf --- $crlf <-- select helpline(s) $crlf --- $crlf select nick(s) --> $crlf --- $crlf [enter] or double-click to send help line(s) $crlf ---
  did -b is-help 6,7
  did -f is-help 2
}

on *:DIALOG:is-help:SCLICK:*:{
  if ($did == 2) { did -o is-help 1 1 $hget(is-help,$did(is-help,2).seltext) }
  if ($did == 3) { is-help.add }
  if ($did == 4) { is-help.del }
  if ($did == 5) { is-help.save }
  if ($did == 6) { is-help.import }
  if ($did == 7) { is-help.export }
  if ($did == 8) { set %is-help.method notice | is-help.method }
  if ($did == 9) { set %is-help.method channel | is-help.method }
  if ($did == 10) { is-help.nicks }
  if ($did == 20) { is-help.send }
  did -t is-help 20
}

on *:DIALOG:is-help:DCLICK:2,11:{ is-help.send | did -t is-help 20 }

alias -l is-help.send {
  if (!$did(is-help,11).seltext) || (!$did(is-help,2).seltext) || ($me !ison $did(is-help,10)) { return }
  var %is-help.chan $did(is-help,10).seltext
  var %a = 1
  while %a <= $did(is-help,11,0).sel { var %is-help.nicks = $addtok(%is-help.nicks,$did(is-help,11,$did(is-help,11,%a).sel),44) | inc %a }
  var %b = 1
  while %b <= $did(is-help,2,0).sel { var %is-help.topics = $addtok(%is-help.topics,$did(is-help,2,$did(is-help,2,%b).sel),44) | inc %b }
  if (%is-help.method == notice) { msg %is-help.chan help notice'd to $+($chr(91),$remove(%is-help.nicks,@,+),$chr(93)) $+($chr(40),%is-help.topics,$chr(41)) }
  var %y = 1
  while %y <= $did(is-help,11,0).sel {
    var %x = 1
    while %x <= $did(is-help,2,0).sel {
      if (%is-help.method == notice) { .notice $remove($did(is-help,11,$did(is-help,11,%y).sel),$chr(64),$chr(43)) $hget(is-help,$did(is-help,2,$did(is-help,2,%x).sel)) }
      elseif (%is-help.method == channel) { msg %is-help.chan $iif($isalias(nc),$nc($remove($did(is-help,11,$did(is-help,11,%y).sel),$chr(64),$chr(43))),$remove($did(is-help,11,$did(is-help,11,%y).sel),$chr(64),$chr(43))) $hget(is-help,$did(is-help,2,$did(is-help,2,%x).sel)) }
      inc %x
    }
    inc %y
  }
}

alias -l is-help.list { did -r is-help 2 | var %x $hget(is-help,0).item | while %x { did -a is-help 2 $hget(is-help,%x).item | dec %x } }

alias -l is-help.chans { did -r is-help 10 | var %x $chan(0) | while %x { did -a is-help 10 $chan(%x) | dec %x } }

alias -l is-help.nicks { did -r is-help 11 | var %x = 1 | while %x <= $nick($did(is-help,10),0) { did -a is-help 11 $nick($did(is-help,10),%x).pnick | inc %x } }

alias -l is-help.method { if (%is-help.method == notice) { did -c is-help 8 | did -u is-help 9 } | elseif (%is-help.method == channel) { did -c is-help 9 | did -u is-help 8 } }

alias -l is-help.add { hadd -m is-help $$?="Help Line Name" $$?="Help Line Info" | is-help.list }

alias -l is-help.del {
  var %x = $did(is-help,2,0).sel
  while %x {
    hdel is-help $did(is-help,2,$did(is-help,2,%x).sel)
    dec %x
  }
  is-help.list 
}

alias -l is-help.save { hadd -m is-help $did(is-help,2).seltext $did(is-help,1) }

alias is-help.up { if ($dialog(is-help)) { is-help.chans | did -c is-help 10 $iif($me ison $active,$didwm(is-help,10,$active),$iif($didwm(is-help,10,*help*),$didwm(is-help,10,*help*),1)) | is-help.nicks | did -c is-help 10 $didwm(is-help,10,$active) } | else .timeris-help.up off }

on *:EXIT:{ .hsave -o is-help is-help.hsh }

alias hl {
  if ($1 ison $active) { var %nick $1 | var %tag $2 | var %extra $3- }
  else { var %tag $1 | var %extra $2- }
  if (!$1) || (!$hget(is-help,%tag)) { echo -a Usage: /hl [nick] <helpline tag> [additional comments] | return }
  msg $active $iif(%nick,$nc(%nick)) $hget(is-help,%tag) %extra
}

alias hlf {
  if (!$2) { echo -a Usage: /hlf <nick> <fake helpline tag> | return }
  else { msg $active help notice'd to $+($chr(91),$1,$chr(93)) ( $+ $2- $+ )
  }
}

alias hln {
  if (!$1) || (!$hget(is-help,$2)) { echo -a Usage: /hln <nick> <helpline tag> [additional comments] | return }
  .notice $1 $hget(is-help,$2) $3-
  msg $active help notice'd to $+($chr(91),$1,$chr(93)) ( $+ $2 $+ )
}

alias hk {
  if (!$1) || (!$hget(is-help,$2)) { echo -a Usage: /hk [#channel] <nick> <helpline tag> [comments] | return }
  if ($1 ischan) { var %chan $1 | tokenize 32 $2- } | else { var %chan # }
  kick %chan $1 $hget(is-help,$2) $3-
}

alias hkb {
  if (!$1) || (!$hget(is-help,$2)) { echo -a Usage: /hkb [#channel] <nick> <helpline tag> [comments] | return }
  if ($1 ischan) { var %chan $1 | tokenize 32 $2- } | else { var %chan # }
  kb 5 %chan $1 $hget(is-help,$2) $3-
}






© 1996-2010 hdesk.org and dalnethelpdesk.com