-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathtimeradddel.ini
101 lines (101 loc) · 4.39 KB
/
timeradddel.ini
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
[script]
n0=on *:text:!timer *:#: {
n1= if ($msgtags(mod).key == 1 || $right(#,-1) == $nick) {
n2= if (add == $2) {
n3= set %timer.channel. [ $+ [ $chan ] ]
n4= var %r = $read(# $+ timers.txt,ns,$3)
n5= if (%r) { .msg $chan [ $+ $nick $+ ] : Error, This timer $qt($3) is already exist into the database! | return }
n6= if ($4 < 60) { msg # Timer is set too low, please inscrease the amount of seconds the timer should run at. | return }
n7= if( $4 !isnum) { msg # Needs a number of seconds :) | return }
n8= write # $+ timers.txt $3-
n9= .timer $+ $3 $+ $chan 0 $4 TimerRun $3 $chan
n10= msg $chan /me + Timer $3 has been added to the database!
n11= }
n12= if (del == $2) {
n13= var %r = $read(# $+ timers.txt,ns,$3)
n14= if (!%r) { .msg $chan [ $+ $nick $+ ]: Error, This timer $qt($3) does NOT exist into the database! | return }
n15= write -dl $+ $readn # $+ timers.txt
n16= .timer $+ $3 $+ $chan off
n17= msg $chan /me - Timer $3 has been deleted from the database!
n18= }
n19= if (edit == $2) {
n20= var %r = $read(# $+ timers.txt,ns,$3)
n21= if (!%r) { .msg $chan [ $+ $nick $+ ]: Error, This timer $qt($3) does NOT exist into the database! | return }
n22= if ($4 < 60) { msg # Timer is set too low, please inscrease the amount of seconds the timer should run at. | return }
n23= if( $4 !isnum) { msg # Needs a number of seconds :) | return }
n24= write -l $+ $readn # $+ timers.txt $3-
n25= .timer $+ $3 $+ $chan 0 $4 TimerRun $3 $chan
n26= msg $chan /me -> Timer $3 has been updated!
n27= }
n28= if ($2 == on) {
n29= var %r = $read(# $+ timers.txt,ns,$3)
n30= if (!%r) { .msg $chan [ $+ $nick $+ ]: Error, This timer $qt($3) does NOT exist into the database! | return }
n31= elseif ($timer($3 $+ $chan) != $null) { msg # Timer $3 is already on! }
n32= else {
n33= var %timermessage $read(# $+ timers.txt,ns,$3)
n34= .timer $+ $3 $+ $chan 0 $gettok(%timermessage,1,32) TimerRun $3 $chan
n35= msg $chan /me -> Timer $3 has been turned on!
n36= }
n37= }
n38= if ($2 == off) {
n39= var %r = $read(# $+ timers.txt,ns,$3)
n40= if (!%r) { .msg $chan [ $+ $nick $+ ]: Error, This timer $qt($3) does NOT exist into the database! | return }
n41= elseif ($timer($3 $+ $chan) == $null) { msg # Timer $3 is already off! }
n42= else {
n43= .timer $+ $3 $+ $chan off
n44= msg $chan /me -> Timer $3 has been turned off!
n45= }
n46= }
n47= }
n48=}
n49=
n50=on *:text:!timers off:#:{
n51= if ($msgtags(mod).key == 1 || $right(#,-1) == $nick) {
n52= var %numbertimers = $timer(0)
n53= var %timer = 1
n54= while (%timer <= %numbertimers) {
n55= if ($right($timer(%timer),$len(#)) == #) {
n56= .timer $+ $timer(%timer) off
n57= }
n58= inc %timer
n59= }
n60= msg # All timers are now off!
n61= }
n62=}
n63=
n64=on *:join:#:{
n65= if ($nick == $me) {
n66= set %timer. [ $+ [ $chan ] ] 0
n67= set %amountoftimers. [ $+ [ $chan ] ] $lines(# $+ timers.txt)
n68= var %x. [ $+ [ $chan ] ] $lines(# $+ timers.txt)
n69= while (%x. [ $+ [ $chan ] ] > 0) {
n70= var %timermessage $read(# $+ timers.txt, n, %x. [ $+ [ $chan ] ] )
n71= var %time = $gettok(%timermessage,2,32)
n72= var %timer. [ $+ [ $chan ] ] $calc(%timer. [ $+ [ $chan ] ] + %time )
n73= dec %x. [ $+ [ $chan ] ]
n74= }
n75= if (%amountoftimers. [ $+ [ $chan ] ] == 0) { return }
n76= var %avgtime. [ $+ [ # ] ] $calc(%timer. [ $+ [ $chan ] ] / $calc( $lines(# $+ timers.txt) * 5))
n77= .timerfloodtimer. [ $+ [ $chan ] ] %amountoftimers. [ $+ [ $chan ] ] %avgtime. [ $+ [ # ] ] timeopen $chan
n78= }
n79=}
n80=alias -l timeopen {
n81= if (%amountoftimers. [ $+ [ $1 ] ] > 0) {
n82= var %timermessagespecific $read($1 $+ timers.txt,n,%amountoftimers. [ $+ [ $1 ] ] )
n83= .timer $+ $gettok(%timermessagespecific,1,32) $+ [ $1 ] 0 $gettok(%timermessagespecific, 2,32) TimerRun $gettok(%timermessagespecific,1,32) $1
n84= dec %amountoftimers. [ $+ [ $1 ] ]
n85= }
n86=}
n87=
n88=alias -l TimerRun {
n89= if (%chat. [ $+ [ $2 ] ] >= 1) {
n90= var %timermessagespecific. $read($2 $+ timers.txt,ns, $1)
n91= msg $2 $gettok(%timermessagespecific.,2-,32)
n92= set %chat. [ $+ [ $2 ] ] 0
n93= }
n94=}
n95=on *:text:*:#:{
n96= if (($nick != $me) && ($nick != twitchnotify)) {
n97= set %chat. [ $+ [ $chan ] ] 1
n98= }
n99=}