-
Notifications
You must be signed in to change notification settings - Fork 0
/
services.etcl
executable file
·83 lines (78 loc) · 4.02 KB
/
services.etcl
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
## All the shit below is to do with *real* Services from the Network
bind notc - "*please choose another*" "notc_error serv_nickopauth"
bind msgm - "*please choose another*" "msgm_error serv_nickopauth"
bind notc - "*identified yourself*" "notc_error serv_nickopauth"
bind msgm - "*identified yourself*" "msgm_error serv_nickopauth"
bind notc - "*information concerning*" "notc_error serv_nickopkill"
bind msgm - "*information concerning*" "msgm_error serv_nickopkill"
bind notc - * "notc_error serv_notes"
bind msgm - * "msgm_error serv_notes"
# For identifying to Nickname Service
proc serv_nickopauth {nick uhost handle text} {
global set
if {$set(nickpass) == ""} {
putlog "> Attempted to authenticate to $set(nickserv) but no password set..."
} elseif {[string tolower $set(nickserv)] == [string tolower $nick] || [string tolower $set(noteserv)] == [string tolower $nick] || [string tolower $set(chanserv)] == [string tolower $nick]} {
putquick "$set(nickcmd) $set(nickserv) :identify $set(nickpass)"
putlog "> $nick ($uhost) requested authentication... auto-authenticating"
} else {
putlog "> $nick ($uhost) requested authentication.. who are they?!"
}
}
# For killing a dead nickname
proc serv_nickopkill {tnick uhost handle text} {
global set nick botnick
if {[string tolower $botnick] != [string tolower $nick] && [string tolower $tnick] == [string tolower $set(nickserv)]} {
if {$set(nickghost) == "1"} {
set cmd "ghost"
} else {
set cmd "kill"
}
if {$set(nickusemsg) == "1"} {
putquick "PRIVMSG $set(nickserv) :$cmd $nick $set(nickpass)"
} else {
putquick "$set(nickserv) $cmd $nick $set(nickpass)"
}
putlog "> Nickname ($botnick) not registered, attempting to regain real nickname ($nick)"
} else {
putlog "> Nickname ($botnick) not registered, please register the nickname..."
}
}
# NoteOP forwarding to eggdrop
set set(tempnote) ""
set set(tempcnote) ""
proc serv_notes {nick uhost handle text} {
global set
if {[string tolower $set(noteserv)] == [string tolower $nick]} {
if {[string match "You just received a note from *. \002/msg NoteOP read *\002" $text]} {
msg $set(noteserv) "READ [string trimright [lindex $text 10] \002]"
putlog "> Recieved NoteOP from [lindex $text 6] -> Continuing to send to Level 200 Operators"
} elseif {[string match "You just received a channel note from *. \002/msg NoteOP read *\002" $text]} {
msg $set(noteserv) "READ [string trimright [lindex $text 11] \002]"
putlog "> Recieved NoteOP [lindex $text 7] -> Continuing to send to Level 200 Operators"
} elseif {[string match "Note * from \002*\002 -- Sent \002*" $text]} {
set set(tempnote) "[string trim [lindex $text 3] \002] {[string trim [lrange $text 6 end] \002]}"
} elseif {[string match "* \002-> *\002 *min: * max: *: *\002" $text]} {
set set(tempcnote) "([lindex $set(tempcnote) 1]) $text"
if {[string length $set(tempcnote)] > "340"} {
msg $set(noteserv) "SEND $set(owner) [letters $set(tempcnote) 340 1] \[+ More\]"
msg $set(noteserv) "SEND $set(owner) \[cont >\] [letters $set(tempcnote) 340 0]"
} else {
msg $set(noteserv) "SEND $set(owner) $set(tempcnote)"
}
set set(tempcnote) ""
} elseif {[string match "You have a total of * note* (* unread, * read, * other)" $text]} {
putlog "> NoteOP says I have [string trimleft [lindex $text 7] (] new messages. -> Continueing to see what they are!"
msg $set(noteserv) "READ new"
} elseif {$set(tempnote) != ""} {
set set(tempnote) "([lindex $set(tempnote) 1]) [lindex $set(tempnote) 0] -> $text"
if {[string length $set(tempnote)] > "340"} {
msg $set(noteserv) "SEND $set(owner) [letters $set(tempnote) 340 1] \[+ More\]"
msg $set(noteserv) "SEND $set(owner) \[cont >\] [letters $set(tempnote) 340 0]"
} else {
msg $set(noteserv) "SEND $set(owner) $set(tempnote)"
}
set set(tempnote) ""
}
}
}