All pastes #154659 Raw Edit

Unnamed

public text v1 · immutable
#154659 ·published 2006-08-30 14:35 UTC
rendered paste body
on *:dialog:Query.*:init:*:{
  var %nick $gettok($dname,2-,$asc(.))
  did -ar $dname 3 %nick
  did -ar $dname 12 $date(mm\dd\yy)
  did -ar $dname 16 $hget(queries,$gettok($address(%nick,2),2-,$asc(@)))
  var %i = 1
  while ($comchan(%nick,%i) != $null) {
    var %chans = $iif(%chans,$v1 - $comchan(%nick,%i),$comchan(%nick,%i))
    inc %i
  }
  did -ar $dname 18 $iif(%chans,$v1,None)
}
dialog Query {
  title "Query"
  size -1 -1 166 145
  option dbu
  box "Query System", 1, 0 1 165 99
  text "Nick:", 2, 3 106 12 8
  text "blah", 3, 15 106 148 8
  edit "", 4, 1 19 161 79, read multi return autovs
  button "Accept", 5, 118 6 22 12
  button "Deny", 6, 142 6 18 12
  button "Ignore", 7, 96 6 19 12
  button "Always accept", 8, 53 6 40 12
  text "Address:", 9, 3 115 22 8
  text "addr", 10, 24 115 139 8
  text "Date:", 11, 6 8 14 9
  text "/d/d/d", 12, 21 8 25 9
  button "", 13, 0 0 0 0, ok
  box "User information", 14, 1 100 164 44
  text "Times queried:", 15, 3 123 36 8
  text "#timesqueried", 16, 39 123 124 8
  text "Com chans:", 17, 3 131 30 8
  text "channels", 18, 34 131 129 8
}
on *:TEXT:*:?:{ if ($dialog(Query. $+ $nick)) { did -a $+(Query.,$nick) 4 ( $+ $time(hh:mm:ss) $+ ) $nick $+ : $strip($1-) $+ $crlf } }
on *:dialog:Query.*:*:*:{
  var %nick $gettok($hget(query,$dname),1,32)
  var %addr = $gettok($hget(query,$dname),2,32)
  if ($devent == SCLICK) {
    if ($did == 5) { msg %nick Your message was accepted, you have been waiting for $duration($calc($ctime - $hget(ctimes,%nick))) $+ . | window -wa %nick | dialog -c $dname query | hdel ctimes %nick }
    if ($did == 6) { msg %nick Your message wasn't accepted. | .timer 1 1 window -c %nick | dialog -c $dname query }
    if ($did == 7) { msg %nick Your message was found to be stupid, you will be ignored from PMs for now on. | .auser ignore %addr | window -c %nick | dialog -c $dname query | hdel ctimes %nick }
    if ($did == 8) { window -wa %nick | .auser query %addr | msg %nick Your message and all messages from you has been accepted. (You waited for: $duration($calc($ctime - $hget(ctimes,%nick))) $+ ) | dialog -c $dname query | hdel ctimes %nick }
  } 
}
raw 311:*:{

  if ($dialog(Query. $+ $2) != $null) {
    did -ar query. $+ $2 10 $3 $+ @ $+ $4
    hadd -m query query. $+ $2 $2 $4
  }
}

on *:open:?:*:{
  if (!$ial($nick)) { !whois $nick | pause s 1 }
  if ($hget(queries) == $null) {
    hmake queries 5000
    if ($exists(queries.db) == $true) { hload queries queries.db }
  }
  hinc queries $site | hsave queries queries.db
  if ($level($site) == ignore) { haltdef | close -m $nick | halt }
  if ($level($site) != query) {
    window -h $nick
    hadd -m ctimes $nick $ctime
    set %q.nick $nick
    set %qery query. $+ %q.nick
    set %q.msg $strip($1-)
    dialog -m %qery Query
    msg $nick Your message is being reviewed, I have  $+ $query(0) $+  $iif($query(0) > 1,queries,query) open. Stupid pms will be ignored.
    $iif($idle != 0,msg $nick I'm currently idle and have been for  $+ $duration($idle))
  }
}
alias pause {
  var %e = !echo $color(info) -a * /pause:
  if ($version < 5.91) {
    %e this snippet requires atleast mIRC version 5.91
  }
  elseif (!$regex(pause,$1-,/^m?s \d+$/Si)) {
    %e incorrect/insufficient parameters. Syntax: /pause <s|ms> <N>
  }
  elseif ($1 == ms) && ($istok(95 98 ME,$os,32)) {
    %e cannot use milliseconds parameter on OS'es beneath Win2k
  }
  elseif ($2 !isnum 1-) {
    %e must specify a number within range 1-
  }
  else {
    var %wsh = wsh $+ $ticks, %cmd
    if ($1 == s) %cmd = ping.exe -n $int($calc($2 + 1)) 127.0.0.1
    else %cmd = pathping.exe -n -w 1 -q 1 -h 1 -p $iif($2 > 40,$calc($2 - 40),$2) 127.0.0.1
    .comopen %wsh wscript.shell
    .comclose %wsh $com(%wsh,run,1,bstr*,% $+ comspec% /c %cmd >nul,uint,0,bool,true)
  }
}