QueryBlocker

QueryBlocker

Quellcode

###POPUP SECTION###
 
menu channel {
  AddOns
  .Query Blocker
  ..$iif((!%glob.qcheck),Query Blocker deaktivieren): { set %glob.qcheck 1 | echo -a  $+ $cl1 $+ ( $+ $cl2 $+  $time $+  $+ $cl1 $+ )0• • $+ $cl1 $+ [ $+ $cl3 $+ Query Blocker deaktiviert $+ $cl1 $+ ]0• • $+ $rlogo }
  ..$iif((%glob.qcheck),Query Blocker aktivieren): { unset %glob.qcheck | echo -a  $+ $cl1 $+ ( $+ $cl2 $+ $time $+  $+ $cl1 $+ )0• • $+ $cl1 $+ [ $+ $cl3 $+  Query Blocker aktiviert $+ $cl1 $+ ]0• • $+ $rlogo }
  ..-
  ..edit user list:query.edit
  .Pager
  ..View Pages:dialog -m query_away query_away
}
 
menu query {
  AddOns
  .Query Blocker
  ..$iif((!%glob.qcheck),Query Blocker deaktivieren): { set %glob.qcheck 1 | echo -a  $+ $cl1 $+ ( $+ $cl2 $+  $time $+  $+ $cl1 $+ )0• • $+ $cl1 $+ [ $+ $cl3 $+ Query Blocker deaktiviert $+ $cl1 $+ ]0• • $+ $rlogo }
  ..$iif((%glob.qcheck),Query Blocker aktivieren): { unset %glob.qcheck | echo -a  $+ $cl1 $+ ( $+ $cl2 $+ $time $+  $+ $cl1 $+ )0• • $+ $cl1 $+ [ $+ $cl3 $+  Query Blocker aktiviert $+ $cl1 $+ ]0• • $+ $rlogo }
  ..-
  ..edit user list:query.edit
  .Pager
  ..View Pages:dialog -m query_away query_away
}
 
###REMOTE SECTION###
 
on *:open:?: {
  if (!%glob.qcheck) {
    set %glob.user $nick
    set %glob.cnttmp $lines($scriptdiruser.lst)
    set %glob.cnt1 1
    while (%glob.cnt1 <= %glob.cnttmp) {
      set %glob.blah $read($scriptdiruser.lst, %glob.cnt1)
      if (%glob.blah == $nick) { unset %glob.user | unset %glob.cnttmp | unset %glob.cnt1 | unset %glob.blah | halt }
      inc %glob.cnt1
    }
    if ($dialog(query_block) == query_block) { set %glob.qname1 $nick $+ ( $+ $host $+ ) | set %glob.nick1 $nick | set %glob.qtime1 $time | set %glob.qmsg1 $1- | dloop | halt }
    if ($away == $true) {
      if ($timer(738)) { set %glob.qname1 $nick $+ ( $+ $host $+ ) | set %glob.nick1 $nick | set %glob.qtime1 $time | set %glob.qmsg1 $1- | dloop | halt 
      }
      .msg $nick 4(15 $+ $time $+ 4) 4[ 15User ist im Moment AFK, query Fenster schliesst sich in 3 minuten wenn du eine nachricht hinterlassen willst tippe: /ctcp $me pager deine nachricht 4]
      set %glob.nick $nick
      .timer738 1 180 close window -c %glob.nick
      .timer839 1 181 unset %glob.nick
      halt
    }
    .msg $nick 4(15 $+ $time $+ 4) 4[ 15Deine Query wurde geblockt bitte warte bis sie angenommen wurde... 4]
    set %glob.qname $nick $+ ( $+ $host $+ )
    set %glob.nick $nick
    set %glob.qtime $time
    set %glob.qmsg $1-
    query.block
  }
  unset %glob.user
  unset %glob.cnttmp | unset %glob.cnt1 | unset %glob.blah
}
 
ctcp 1:pager:*: { 
  if ($dialog(query_away).title == Pager) {
    did -a query_away 3 $time $nick
    did -a query_away 1 $2-
    write -a $scriptdirpages.lst $time - $nick $+ ; $+ $2-
    notice $nick 4(15 $+ $time $+ 4) 4[ 15Page erhalten $nick 4]
  }
  Else { write -a $scriptdirpages.lst $time - $nick $+ ; $+ $2- | dialog -m query_away query_away | notice $nick 4(15 $+ $time $+ 4) 4[ 15Page erhalten $nick 4] }
}
###ALIAS SECTION###
 
Alias query.block {
  dialog -m query_block query_block
  .timerq 1 180 query.delayed
}
Alias query.edit { dialog -m query_edit query_edit }
Alias query.delayed {
  if (!$window(@QueryLog)) window -k0 @QueryLog
  aline @QueryLog 4(15 $+ %glob.qtime $+ 4) 4[ 15Query from: %glob.qname 4]15• 15•4[ 15Message: %glob.qmsg 4]
  dialog -x query_block query_block | window -c %glob.nick | unset %glob.qname | unset %glob.qtime | unset %glob.qmsg | unset %glob.nick
}
Alias dloop {
  if (!$window(@QueryLog)) window -k0 @QueryLog
  msg %glob.nick1 4(15User hat bereits eine Query in der Warteschleife, deine wird geloggt und später beantwortet4)
  aline @QueryLog 4(15 $+ %glob.qtime1 8LOGGED $+ 4) 4[ 15Query from: %glob.qname1 4]15• 15•4[ 15Message: %glob.qmsg1 4]
  echo -a 4(15 $+ %glob.qtime1 8LOGGED $+ 4) 4[ 15Query from: %glob.qname1 4]15• 15•4[ 15Message: %glob.qmsg1 4]
  window -c %glob.nick1 | unset %glob.qname1 | unset %glob.qtime1 | unset %glob.qmsg1 | unset %glob.nick1
}
Alias qtest { dialog -m query_block query_block }
###DIALOG SECTION###
 
#Blocker#
on *:dialog:query_block:init:0:{
  did -a query_block 2 %glob.qname
  did -a query_block 3 %glob.qtime
  did -a query_block 4 %glob.qmsg
}
dialog query_block {
  title "RedZIRC Reloaded Query Blocker"
  size -1 -1 139 69
  option dbu
  box "Query Request", 1, 3 2 134 48
  edit "", 2, 23 12 110 10, disable
  edit "", 3, 23 23 110 10, disable
  edit "", 4, 23 34 110 10, disable
  button "accept", 5, 3 53 37 12
  button "decline", 6, 99 53 37 12
  text "Nick", 7, 6 13 16 8
  text "Zeit", 8, 7 24 16 8
  text "MSG", 9, 7 35 16 8
}
 
on *:dialog:query_block:sclick:5: {
  .msg %glob.nick 4(15 $+ $time $+ 4) 4[ 15Deine Query wurde authorisiert du kannst schreiben 4]
  dialog -x query_block query_block
  .timerq off
  unset %glob.qname | unset %glob.qtime | unset %glob.qmsg | unset %glob.nick
}
on *:dialog:query_block:sclick:6: {
  msg %glob.nick 4(15 $+ $time $+ 4) 4[ 8Sorry, zur Zeit keine Query möglich bitte versuche es später wieder 4]
  dialog -x query_block query_block
  window -c %glob.nick
  .timerq off
  unset %glob.qname | unset %glob.qtime | unset %glob.qmsg | unset %glob.nick
}
 
#END Blocker#
 
#Edit#
 
dialog query_edit {
  title "Query Blocker User Edit"
  size -1 -1 150 134
  option dbu
  list 1, 3 15 94 115, size vsbar
  button "add user", 2, 105 4 37 12, flat
  button "del user", 3, 105 19 37 12, flat
  button "done", 4, 105 115 37 12, flat, ok
  edit "", 5, 3 3 93 10
}
 
on *:dialog:query_edit:init:0:{
  var %query.cnt = $lines($scriptdiruser.lst)
  var %query.cnt2 = 1
  if (%query.cnt < 1) { echo -a dialog -m query_edit query_edit | halt }
  while (%query.cnt2 <= %query.cnt) {
    did -a query_edit 1 $read($scriptdiruser.lst, %query.cnt2)
    inc %query.cnt2
  }
}
on *:dialog:query_edit:sclick:2: {
  if ($did(query_edit,5,seltext) == $null) { echo -a 4ERROR: no nick to add | halt }
  write -a $scriptdiruser.lst $did(query_edit,5).text
  did -a query_edit 1 $read($scriptdiruser.lst,$lines($scriptdiruser.lst))
  did -r query_edit 5
}
on *:dialog:query_edit:sclick:3: {
  if ($did(query_edit,1).seltext == $null) { echo -a 4ERROR: no Nick selected | halt }
  write -dl $+ $did(1).sel $scriptdiruser.lst
  did -d query_edit 1 $did(1).sel
}
 
#END Edit#
 
#Away Manager#
 
dialog query_away {
  title "Pager"
  size -1 -1 283 136
  option dbu
  button "done", 5, 52 119 37 12, ok
  list 1, 91 13 182 95, size hsbar vsbar
  list 3, 8 13 74 94, size vsbar
  box "Nick", 2, 4 6 82 106
  box "Message", 4, 88 6 189 106
  text "Pager Addon by PsyCore", 6, 144 121 64 8
  link "www.Reloaded.net.tc", 7, 215 121 59 8
  button "del page", 8, 5 119 37 12
}
 
on *:dialog:query_away:init:0: {
  var %tmp1 = $lines($scriptdirpages.lst)
  var %tmp2 = 1
  if (%tmp1 < 1) { echo -a 4You haven't any pages | halt }
  while (%tmp2 <= %tmp1) { 
    did -a query_away 3 $remove($left($read($scriptdirpages.lst,%tmp2),$pos($read($scriptdirpages.lst,%tmp2),;)),;)
    did -a query_away 1 $remove($right($read($scriptdirpages.lst,%tmp2),- $+ $pos($read($scriptdirpages.lst,%tmp2),;)),;)
    inc %tmp2
  }
}
on *:dialog:query_away:sclick:8: {
  if ($did(query_away,3).seltext == $null) { echo -a 4ERROR: no Page selected | halt }
  if ($did(query_away,1).seltext == $null) { echo -a 4ERROR: no Page selected | halt }
  write -dl $+ $did(1).sel $scriptdirpages.lst
  did -d query_away 1 $did(1).sel
  did -d query_away 3 $did(3).sel
}
on *:dialog:query_away:sclick:3: {
  did -c query_away 1 $did(query_away,3).sel
} 
on *:dialog:query_away:sclick:1: {
  did -c query_away 3 $did(query_away,1).sel
}
archiv/coding/msl/queryblock.txt · Zuletzt geändert: 2008/02/02 12:38
CC Attribution-Noncommercial-Share Alike 4.0 International