forked from NIBLCO/niblscripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathxdccfilter-advanced.mrc
130 lines (105 loc) · 3.79 KB
/
xdccfilter-advanced.mrc
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
; XDCC Announcement Filter - v2.01.9
;
; Type /xdcca to bring up the XDCC Announcement window.
; This will intercept announcements.
; By typing the command again it'll realign itself to mIRC.
;
; If you have a script that adds a theme to your mIRC,
; you will need to adjust that script slightly
; so that the bots (halfops) messages do not show up in normal chat.
; Below is something you can add to it to 'adjust' it.
;
; NOTE, the following ONLY applies if you already have a "theme" script:
;
; * If this is the case, look for the event "on ^*:text:"
; * You'll need to add something like this (between the --- lines):
; * ---------------------------------------
; * var %networks = Rizon , %nicks = ahobot ReleaseBitch
; * if ($window(@xdcca) && $istok(%networks,$network,32)) {
; * if ($nick ishop $chan || $istok(%nicks,$nick,32)) {
; * haltdef | return
; * }
; * }
; * ----------------------------------------
; * This will need to go inside of your on text event,
; * towards the top.
; If you don't want this to automatically open your XDCCA window,
; comment the following line out:
on *:start:{ xdcca }
; Command to create the XDCC Announce window.
; You can tweak the position.x and y, along with the width and height
; to adjust the size of the window. If you move your mIRC window or resize it
; you'll be able to type /xdcca again, and it'll reposition itself.
alias xdcca {
var %position.x = $window(-3).dx
var %position.y = $window(-3).dy
var %width = $window(-3).dw
var %height = 50
; If you want to change the height to be more dynamic:
; var %height = $window(-3).dh * 0.1
var %xywh = %position.x %position.y $calc(%width - 130) 50
; We only want the XDCCA window to appear if we're in a channel.
if (#* iswm $active) { var %switches = -dofa }
else { var %switches = -dfh }
window %switches -t32,64,120 +dL @xdcca %xywh
}
; This alias is used for formatting.
; You can use it to set up your own themes if you want..
; /_specialmsg window nickname message
alias _specialmsg {
var %chan = $1 , %nick = $2 , %msg = $3-
var %pre = $iif($_prefix(%chan,%nick),09 $+ $v1)
if ($2 == $me) { var %nick = $+(%pre,10,$me,: ) }
else { var %nick = $+(%pre,4,$2,: ) }
echo -tcmbfli12 normal %chan %nick %msg
}
; Prefix. @ % +
alias -l _prefix { return $iif($left($nick($1,$2).pnick,1) isin $prefix,$v1,$null) }
; On text event to redirect bot messages to the @xdcca window - but only if it's open.
on ^*:text:*:#:{
var %networks = Rizon , %nicks = ahobot ReleaseBitch , %text = $1- , %w = @xdcca
if ($window(%w) && $istok(%networks,$network,32)) {
if ($nick ishop $chan || $istok(%nicks,$nick,32)) {
var %text = $regsubex(xdccanc,%text,/(\/?msg \S+ xdcc send #?\d+)/ig,\t 7[GETIT])
_specialmsg @xdcca $nick %text
haltdef
return
}
}
haltdef
}
; On active and appactive - this determines whether to show the window or not. (only shows in channels)
; Hides the window (because it's on top) when mIRC is not the active application.
on *:active:*:{
var %w = @xdcca
if ($window(%w)) {
if (#* iswm $active && #* !iswm $lactive) {
window -o %w
}
elseif ($active != %w && #* !iswm $active) {
window -uh %w
}
}
}
on *:appactive:{
var %w = @xdcca
if ($window(%w)) {
if ($appactive) { window -o %w }
else { window -uh %w }
}
}
; On hotlink - Makes the [GETIT] tag clickable.
on ^*:hotlink:*GETIT*:*:{
tokenize 32 $hotlinepos
var %t = $gettok($hotline,$1,32)
if (7[GETIT]* iswm %t) { return }
halt
}
on *:hotlink:*GETIT*:*:{
tokenize 32 $hotlinepos
var %start = $calc($1 - 5) , %finish = $calc(%start + 4)
var %t = $gettok($hotline,%start - %finish,32)
if ($regex(%t,/^\/?msg (\S+) xdcc send (#?\d+)$/iS)) {
msg $regml(1) xdcc send $regml(2)
}
}