All pastes #475914 Raw Edit

Miscellany

public text v1 · immutable
·published 2007-05-07 19:36 UTC
rendered paste body
dialog qc {
  title "Query Control"
  size -1 -1 130 47
  option dbu

  text "From:", 1, 4 7 25 10 center
  text "Time:", 2, 82 7 15 10 center
  edit "", 3, 97 6 28 10, read
  edit "", 4, 30 6 50 10, read
  text "Message:", 5, 4 19 25 10 left
  edit "", 6, 30 18 95 10, read
  box "", 7, 1 1 127 29

  button "Accept", 8, 4 32 20 10 ok
  button "Decline", 9, 25 32 20 10 ok
  button "Ignore", 10, 46 32 20 10 ok
  box "", 11, 1 27 68 17

  link "e-mail", 12, 75 34 15 8
  text "v1.5.2", 13, 95 35 18 8 left
  box "", 14, 70 27 58 17 
}

on *:dialog:qc:sclick:8:{
  window -w %qc.nick
  .msg %qc.nick $ewrap(Query Accepted. I am reading what you've already said.)
  dialog -x qc
  window -a %qc.nick
  unset %qc.nick
}
on *:dialog:qc:sclick:9:{
  .msg %qc.nick $ewrap(Private Message Declined. Sorry.)
  window -c %qc.nick
  unset %qc.nick
  dialog -x qc
}
on *:dialog:qc:sclick:10:{
  .msg %qc.nick $ewrap(Private Message Declined. You have been ignored.)
  window -c %qc.nick
  ignore -pu1200 %qc.nick
  unset %qc.nick
  dialog -x qc
}
on *:dialog:qc:sclick:12:{
  url -na mailto:acethebunny@gmail.com
}
#qc on
on *:start:{ echo -st 6» Script: Query Control script is loaded. }
on *:OPEN:?:{ 
  if ($nick == -psybnc) {
    halt
  }
  elseif ($dialog(qc)) {
    .msg $nick $ewrap(Sorry $nick $+ , but I am busy with another message. Please try again later. (15 second ignore))
    close -m $nick
    ignore -pu15 $nick
  }
  else {
    set %qc.nick $nick
    window -h $nick
    .msg $nick $ewrap(Please Wait For PM Acceptance/Decline)
    dialog -mdo qc qc
    did -a qc 3 $asctime(hh:nn:ss)    
    did -a qc 4 $nick
    did -a qc 6 $1-
  }
}
#qc end

menu * {
  $iif($group(#qc) == on,$style(1)Disable,$style(0)Enable) Query Control: {
    var %status = $iif($group(#qc) == on,Disable,Enable)
    $+(.,%status) #qc
    echo -a 4» Query Control has been $+(%status,d)
  }
} 
menu menubar {
  About Query Control:/dialog -mo about_qc about_qc
}
Dialog about_qc {
  title About
  size -1 -1 80 50
  option dbu
  box "Query Control", 1, 4 4 70 43
  text "Author: SyntaxError", 2, 10 12 50 8 left
  link "E-Mail Me", 3, 10 20 50 8 
  text "Version: 1.5.2", 4, 10 28 50 8, left
  text "© 2007 SyntaxError", 5, 10 36 50 8 left
}
on *:dialog:about_qc:sclick:3:{
  url -na mailto:Hamish_2_kill@hotmail.co.uk
}
alias ewrap {
  var %msg
  var %tok = 1
  var %word
  while ($gettok($1-,%tok,32) != $null) {
    %word = $gettok($1-,%tok,32)
    %msg = %msg 15 $+ $upper($left(%word,1)) $+ 15 $+ $right(%word,-1) 
    inc %tok
  }
  return 12,1{~15 $+ %msg $+ 12~}
}