Sie sind nicht angemeldet.

Medinet

Administrator

  • »Medinet« ist der Autor dieses Themas

Beiträge: 65

Wohnort: Gütersloh

Beruf: *

  • Nachricht senden

1

Dienstag, 23. April 2013, 22:18

pm blocker

Quellcode

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
dialog qbw {
  title "QueryBlocker 1.4 [deutsch]"
  size -1 -1 165 165
  icon graphics\icons\popup\09.ico, 1
  option dbu
  tab "Whitelist", 1, 5 0 156 160
  box "Kontrolle", 3, 20 129 125 25, group tab 1
  list 4, 10 42 145 85, tab 1 sort size
  button "+", 5, 28 137 30 12, group tab 1
  button "—", 6, 67 137 30 12, group tab 1
  button "-> Black", 7, 106 137 30 12, group tab 1
  combo 13, 10 27 145 100, tab 1 sort size edit drop
  tab "Blacklist", 2
  list 8, 10 42 145 85, tab 2 sort size
  box "Kontrolle", 9, 20 129 125 25, tab 2
  button "+", 10, 28 137 30 12, group tab 2
  button "—", 11, 67 137 30 12, group tab 2
  button "White <-", 12, 106 137 30 12, group tab 2
  combo 14, 10 27 145 100, tab 2 sort size edit drop  
  tab "Ignore", 29
  button "+", 30, 45 137 30 12, group tab 29
  button "—", 31, 90 137 30 12, group tab 29
  box "Kontrolle", 32, 20 129 125 25, group tab 29
  combo 33, 10 27 145 85, tab 29 sort size edit drop
  list 34, 10 42 145 70, tab 29 size sort
  text "ignoriere für", 35, 40 118 30 8, tab 29
  edit "5", 36, 74 116 30 10, tab 29 autohs center
  text "mins", 37, 109 118 15 8, tab 29
  tab "Notizen", 38
  list 39, 10 42 145 70, tab 38 size sort
  combo 40, 10 27 145 85, tab 38 sort size edit drop
  text "Benachrichtigung alle", 41, 30 118 55 8, tab 38
  edit "5", 42, 83 116 30 10, tab 38 autohs center
  text "Min.", 43, 118 118 15 8, tab 38
  box "Kontrolle", 44, 20 129 125 25, group tab 38
  button "+", 45, 45 137 30 12, group tab 38
  button "—", 46, 90 137 30 12, group tab 38  
  tab "Einstell.", 15
  box "aktiviere", 16, 10 27 145 55, tab 15
  check "Queryblocker", 17, 15 37 45 10, tab 15
  edit "", 18, 115 52 20 10, tab 15 autohs center
  check "ignoriere nach", 19, 15 52 45 10, tab 15
  edit "", 20, 60 52 20 10, tab 15 autohs center
  text "Versuch", 21, 84 53 19 8, tab 15
  box "Mitteilungen", 22, 10 87 145 65, tab 15
  text "Warnmitteilung", 23, 15 102 36 8, tab 15
  edit "", 24, 15 112 135 10, tab 15 autohs center
  text "Endnachricht", 25, 15 127 37 8, tab 15
  edit "", 26, 15 137 135 10, tab 15 autohs center
  text "für", 27, 105 53 10 8, tab 15
  text "Min.", 28, 138 53 11 8, tab 15
  check "Notizen von gelisteten Usern blocken", 47, 15 67 100 10, tab 15
}
menu @blockierte_querys {
  Inhalt löschen: query.blw -c
  Fenster schliessen: window -c @blockierte_Querys
}

###########
### Events

on *:start: { hmake query.ul 10 | query.hsh -l }
on *:exit: { query.hsh -s }
on *:unload: { query.hsh -s }
on *:active:*:{ if ($dialog(qbw)) { qbw.combo } }

on *:OPEN:?:*:{
  if ($hget(query.ul,enable.blocker) == 1) {
	var %txt = $qt($scriptdirquery.bl.txt) | set -u300 %q.b.cid $cid
	if ($hget(query.ul,$nick) == 1) { .msg $nick $iif($away == $true,Ich bin nicht da... versuche es später nocheinmal,Query accepted) | echo -at 9QUERYBLOCKER: $nick schrieb Dich im PM an }
	elseif ($hget(query.ul,$nick) == 2) { .write %txt $timestamp 4[BLACKLISTED] $nick :> $1- | window -c $nick | .ignore -pu86400 $nick | echo -at 4QUERYBLOCKER: $nick steht jetzt auf Ignore }
	else { .write %txt $timestamp 8[NOT LISTED] $nick :> $1- | query.block $nick | window -c $nick }
  }
}

on ^*:notice:*:*: {
  if ($hget(query.ul,enable.notice) == 1) && ($istok($hget(query.ul,notice.blocked),$nick,59)) { 
	if (!%nb. [ $+ [ $nick ] ]) { .notice $nick Your Notice has been blocked, all attempts are futile. | set $+(-u,$calc($hget(query.ul,nb.time) *60)) %nb. [ $+ [ $nick ] ] 1 }
	haltdef
  }
}

on *:dialog:qbw:*:*: {
  if ($devent == init) { qbw.list | qbw.combo }
  elseif ($devent == sclick) {
	if ($did == 5) && ($did(qbw,13).text) { hadd query.ul $did(qbw,13).text 1 | qbw.list | qbw.combo }
	elseif ($did == 6) && ($did(qbw,4).seltext) { hdel query.ul $did(qbw,4).seltext | qbw.list | qbw.combo }
	elseif ($did == 7) && ($did(qbw,4).seltext) { hadd query.ul $did(qbw,4).seltext 2 | qbw.list }
	elseif ($did == 10) && ($did(qbw,14).text) { hadd query.ul $did(qbw,14).text 2 | qbw.list | qbw.combo }
	elseif ($did == 11) && ($did(qbw,8).seltext) { hdel query.ul $did(qbw,8).seltext | qbw.list | qbw.combo }
	elseif ($did == 12) && ($did(qbw,8).seltext) { hadd query.ul $did(qbw,8).seltext 1 | qbw.list }
	elseif ($did == 17) { hadd query.ul enable.blocker $did(qbw,17).state }
	elseif ($did == 19) { hadd query.ul enable.ignore $did(qbw,19).state }
	elseif ($did == 30) && ($did(qbw,33).text) { .ignore $+(-pu,$did(qbw,36).text) $calc($did(qbw,33).text *60) | qbw.list | qbw.combo }
	elseif ($did == 31) && ($did(qbw,34).seltext) { .ignore -r $gettok($did(qbw,34).seltext,1,33) | qbw.list | qbw.combo }
	elseif ($did == 45) && ($did(qbw,40).text) { hadd query.ul notice.blocked $addtok($hget(query.ul,notice.blocked),$did(qbw,40).text,59) | qbw.list | qbw.combo }
	elseif ($did == 46) && ($did(qbw,39).seltext) { hadd query.ul notice.blocked $remtok($hget(query.ul,notice.blocked),$did(qbw,39).seltext,1,59) | qbw.list | qbw.combo }

	elseif ($did == 47) { hadd query.ul enable.notice $did(qbw,47).state }
  }
  elseif ($devent == edit) {
	if ($did == 18) { hadd query.ul enable.itime $did(qbw,18).text }
	elseif ($did == 20) { hadd query.ul enable.trys $did(qbw,20).text }
	elseif ($did == 24) { hadd query.ul message.warn $did(qbw,24).text }
	elseif ($did == 26) { hadd query.ul message.final $did(qbw,26).text }
	elseif ($did == 36) { hadd query.ul ign.time $did(qbw,36).text }
	elseif ($did == 42) { hadd query.ul nb.time $did(qbw,42).text }
  }
  elseif ($devent == close) { query.hsh -s }
}

###########
### Aliase

alias qbw {
  if ($dialog(qbw)) { dialog -x qbw }
  dialog -m qbw qbw
}

alias query.hsh {
  var %hsh = $qt($scriptdirquery.ul.hsh)
  if ($1 == -l) { hload query.ul %hsh }
  elseif ($1 == -s) { hsave query.ul %hsh }
}

alias query.add {
  if ($1 == -w) { hadd query.ul $2 1 }
  elseif ($1 == -b) { hadd query.ul $2 2 }
  elseif ($1 == -n) { hadd query.ul $2 4 }
}

alias qbw.list {
  did -r qbw 4,8,34,39
  var %i = 1
  while (%i <= $hget(query.ul,0).item) {
	if (!$istok(enable.blocker;enable.ignore;enable.notice;nb.time;enable.trys;enable.itime;message.warn;message.final,$hget(query.ul,%i).item,59)) {
  	if ($hget(query.ul,$hget(query.ul,%i).item) == 1) { did -a qbw 4 $hget(query.ul,%i).item } 
  	if ($hget(query.ul,$hget(query.ul,%i).item) == 2) { did -a qbw 8 $hget(query.ul,%i).item } 
	}
	inc %i
  }
  var %i = 1 | while (%i <= $ignore(0)) { did -a qbw 34 $ignore(%i) | inc %i }
  var %i = 1 | while (%i <= $numtok($hget(query.ul,notice.blocked),59)) { did -a qbw 39 $gettok($hget(query.ul,notice.blocked),%i,59) | inc %i  }
  if ($hget(query.ul,enable.blocker) == 1) { did -c qbw 17 }
  if ($hget(query.ul,enable.ignore) == 1) { did -c qbw 19 }
  if ($hget(query.ul,enable.notice) == 1) { did -c qbw 47 }
  did -ra qbw 18 $hget(query.ul,enable.itime) | did -ra qbw 20 $hget(query.ul,enable.trys)
  did -ra qbw 24 $hget(query.ul,message.warn) | did -ra qbw 26 $hget(query.ul,message.final)
  did -ra qbw 36 $hget(query.ul,ign.time) | did -ra qbw 42 $hget(query.ul,nb.time)
}

alias qbw.combo {
  var %i = 1, %chan = $active | scid %q.b.cid | did -r qbw 13,14,33,40
  while (%i <= $nick(%chan,0)) { 
	if ($hget(query.ul,$nick(%chan,%i)) != 1) { did -a qbw 13 $nick(%chan,%i) }
	if ($hget(query.ul,$nick(%chan,%i)) != 2) { did -a qbw 14 $nick(%chan,%i) }
	if (!$istok($hget(query.ul,notice.blocked),$nick(%chan,%i),59)) { did -a qbw 40 $nick(%chan,%i) }
	did -a qbw 33 $nick(%chan,%i)
	inc %i 
  }
}

alias query.blw {
  var %txt = $qt($scriptdirquery.bl.txt)
  if ($1 == -c) { .remove %txt | window -c @blockierte_querys | echo -ta 9[blockierte Querys] Liste geleert }
  elseif ($1 == -s) { 
	if ($lines(%txt) != 0) { window @blockierte_querys 400 250 600 400 | .loadbuf -p @blockierte_querys %txt }
	else { echo -ta 4[blockierte Querys] Liste ist leer }
  }
}

alias query.block {
  var %nick = $1 
  if (!%qbw. [ $+ [ %nick ] ]) || (%qbw. [ $+ [ %nick ] ] < $hget(query.ul,enable.trys)) {
	scid %q.b.cid .msg %nick $iif($hget(query.ul,message.warn),$hget(query.ul,message.warn),4ich hab Dich nicht reingebeten 9| 4Sprich mich erstmal im Chan an !!!)
	if ($query.comchan(%nick)) { scid %q.b.cid .msg %nick $+(04,$iif($query.comchan(%nick) > 1,Chans,Chan),:14) $query.comchan(%nick) }
	echo -at 8QUERYBLOCKER: %nick sprach Dich auf $network im PM an und wurde verwarnt 
	echo -at 14Host: 15(4 $+ $iif($address(%nick,0),$address(%nick,0),unknown) $+ 15)14 Comchannel: 15(4 $+ $iif($query.comchan(%nick),$query.comchan(%nick),none) $+ 15)
	inc -u300 %qbw. [ $+ [ %nick ] ]
  }
  else { query.fu %nick }
}

alias query.comchan {
  var %i = 1, %nick = $1
  while (%i <= $comchan(%nick,0)) { var %chan = $comchan(%nick,%i) %chan | inc %i } | return %chan
}

alias query.fu {
  var %nick = $1
  scid %q.b.cid .msg %nick 1...................4/¯/)
  scid %q.b.cid .msg %nick  1.................4/¯¯/
  scid %q.b.cid .msg %nick  1...............4/¯1..4/
  scid %q.b.cid .msg %nick  1..........4/´¯./'1...4'/´¯¯.·¸
  scid %q.b.cid .msg %nick  1........4/'/1....4/1....4/1....4//¯\
  scid %q.b.cid .msg %nick  1......4('(1....4´1....4´1.....4¯/'1...4')
  scid %q.b.cid .msg %nick  1......4\1................. 4_.·´
  scid %q.b.cid .msg %nick  1.......4\1................4(
  scid %q.b.cid .msg %nick  1........4\ 1..............4\
  scid %q.b.cid .msg %nick $iif($hget(query.ul,message.final),$hget(query.ul,message.final),4Ich hab Dich gewarnt!!!)
  echo -at 4QUERYBLOCKER: %nick $iif($hget(query.ul,enable.ignore) == 1,ist jetzt auf Ignore,erhielt die letzte Warnung)
  echo -at 14Host: 15(4 $+ $iif($address(%nick,0),$address(%nick,0),unknown) $+ 15)14 Comchannel: 15(4 $+ $iif($query.comchan(%nick),$query.comchan(%nick),none) $+ 15)
  scid %q.b.cid $iif($hget(query.ul,enable.ignore) == 1,.ignore $+(-pu,$iif($hget(query.ul,enable.itime),$calc($hget(query.ul,enable.itime) *60),3600)) %nick)
}

<dyfakdsfhjuia

Ähnliche Themen

Counter:

Hits heute: 7 445 | Hits gestern: 10 507 | Hits Tagesrekord: 40 743 | Hits gesamt: 6 515 314 | Hits pro Tag: 2 198,25