Id: 9124; Nick: Teppuli; Timestamp: 2008-04-13 17:44:21; Pasted as: mIRC
Description: n/a
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
 
# Command trigger. Example: If trigger is "!", commands start with: "!sbnc":
set sbnc(trigger)   "\."
#
# sBNC home channel:
set sbnc(chan)      "#thrubnc"
#
# sBNC ident of this bot.:
set sbnc(ident)     "G"
#
# IRC-server where new sBNC's connect:
set sbnc(ircserver) "127.0.0.1 6667"
#
# Domain of sBNC server:
set sbnc(server)    "irc.thruhere.net"
#
# sBNC port of sBNC server:
set sbnc(port)      "5500"
#
# Realname of new sBNC's:
set sbnc(realname)  "ThruNet Bouncer"
#
#
# End of script configuration
#
#
#
#
#
# *************************************************************************************
# Script source. DONT TOUCH ANYTHING, IF YOU ARE NOT SURE WHAT YOU ARE DOING!
# *************************************************************************************
# Bindings/data needed by script:
bind PUB  n|- $sbnc(trigger)sbnc sbnc:iface
bind NOTC  |  *                  sbnc:notice
set sbnc(version)   "0.5"
set sbnc(author) "-"
# *************************************************************************************
#
#
#
#
putlog "sBNC Admin Script version $sbnc(version) scripted by $sbnc(author)"
	proc sbnc:iface { nick host hand chan arg } {
            global sbnc
            switch -exact -- [string tolower [lindex [split $arg] 0]] {
                "add" {
                    set ident [lindex [split $arg] 1]
                    set password [expr {int(rand()*1000000) + 1}]
                    set bncnickname [lindex [split $arg] 2]
					set realname $sbnc(realname)
 
                    putquick "SBNC ADDUSER $ident $password"
                    putquick "SBNC SIMUL $ident SBNC SET REALNAME $realname"
 
                    putquick "SBNC SIMUL $ident SBNC SET SERVER $sbnc(ircserver)"
 
              
 
                    putquick "NOTICE $nick :Done. New bouncer added."
					putquick "PRIVMSG $bncnickname :Hi! New ThruNet Bouncer has been created for you. Info:"
                    putquick "PRIVMSG $bncnickname :Bouncer server: $sbnc(server), Port: $sbnc(port), Ident: $ident, Password: $password, Web interface: http://irc.thruhere.net/iface/"
					putquick "PRIVMSG $bncnickname :You are not allowed to part from $sbnc(chan) or your bouncer gets suspended"
putquick "PRIVMSG $bncnickname :If you're using mIRC, you can type: /server -m irc.thruhere.net 5500 $password -i $ident $ident $ident\@ThruBnc $ident to connect fast."
                }
                "del" {
                    set ident [lindex [split $arg] 1]
                    putquick "SBNC DELUSER $ident"
                    putquick "NOTICE $nick :Done. User ($ident) deleted."
                }
                "password" {
                    set ident [lindex [split $arg] 1]
                    set password [expr {int(rand()*1000000) + 1}]
                    putquick "SBNC RESETPASS $ident $password"
                    putquick "NOTICE $nick :Done. New password for user ($ident) created."
                    putquick "NOTICE $nick :Password: $password"
                }
 
                "admin" {
                    set ident [lindex [split $arg] 1]
                    if {$ident == "$sbnc(ident)"} {
                        putquick "NOTICE $nick :Error. This user is already an admin."
                        return
                    } else {
                        putquick "SBNC ADMIN $ident"
                        putquick "NOTICE $nick :Done. User ($ident) has now admin rights."
                    }
                }
                "unadmin" {
                    set ident [lindex [split $arg] 1]
                    if {$ident == "$sbnc(ident)"} {
                        putquick "NOTICE $nick :Error. This user needs admin rights."
                        return
                    } else {
                        putquick "SBNC UNADMIN $ident"
                        putquick "NOTICE $nick :Done. Admin rights for user ($ident) deleted."
                    }
                }
                "global" {
               set arg [lrange [split $arg] 1 end]
                    putquick "SBNC GLOBAL :(Broadcast) $arg"
                    putquick "NOTICE $nick :Done. Global notice to all bouncer users transmitted."
                }
                "join" {
				    set sbnc(simulcommand) [lrange [split $arg] 1 end]
 
 
					putquick "SBNC MSIMUL JOIN $sbnc(simulcommand)"
putquick "NOTICE $nick :Done"
 
                }
                "do" {
 
				    set sbnc(simulcommand) [lrange [split $arg] 1 end]
 
 
					putquick "SBNC MSIMUL $sbnc(simulcommand)"
putquick "NOTICE $nick :Done"
                }
				"part" {
							set sbnc(simulcommand) [lrange [split $arg] 1 end]
 
 
					putquick "SBNC MSIMUL PART $sbnc(simulcommand)"
putquick "NOTICE $nick :Done"
 
 
                }
				"suspend" {
               set bncident [lindex [split $arg] 1]
			     set reason [lrange [split $arg] 2 end]
                    putquick "SBNC SUSPEND $bncident : $reason"
                    putquick "NOTICE $nick :Done. Bouncer suspended."
                }
								"simul" {
               set bncident [lindex [split $arg] 1]
			     set reason [lrange [split $arg] 2 end]
                    putquick "SBNC SIMUL $bncident :$reason"
                    putquick "NOTICE $nick :Done. Command simulated."
                }
			"unsuspend" {
               set bncident [lindex [split $arg] 1]
 
                    putquick "SBNC UNSUSPEND $bncident"
                    putquick "NOTICE $nick :Done. Bouncer unsuspended."
                }
"putunotice" {
set bncident [lindex [split $arg] 1]
  set arg [lrange [split $arg] 4 end]
putserv "sbnc tcl :setctx $bncident ; putclient \":B!Data@sbnc.thruhere.net NOTICE :Notice from admin: $bncident $arg\""
putserv "notice $nick :Done."
}
                "help" {
                    putserv "NOTICE $nick :\037sBNC admin script HELP\037:"
                    putserv "NOTICE $nick :Use $sbnc(trigger)sbnc add 'ident' 'nickname' to add a bouncer."
                    putserv "NOTICE $nick :Use $sbnc(trigger)sbnc del 'ident' to delete a bouncer."
                    putserv "NOTICE $nick :Use $sbnc(trigger)sbnc password 'ident' to generate a new password."
utserv "NOTICE $nick :Use $sbnc(trigger)sbnc putunotice 'ident' 'text' to send notice to user."
                    putserv "NOTICE $nick :Use $sbnc(trigger)sbnc admin 'ident' to give admin rights."
                    putserv "NOTICE $nick :Use $sbnc(trigger)sbnc unadmin 'ident' to remove admin rights."
                    putserv "NOTICE $nick :Use $sbnc(trigger)sbnc global 'message' to send a global notice to all bouncer users."
                    putserv "NOTICE $nick :Use $sbnc(trigger)sbnc do 'command' to force all users simulate command."
                    putserv "NOTICE $nick :Use $sbnc(trigger)sbnc join 'chan' to force all users join to chan."
					putserv "NOTICE $nick :Use $sbnc(trigger)sbnc part 'chan' to force all users part from chan."
					putserv "NOTICE $nick :Use $sbnc(trigger)sbnc suspend 'ident' 'reason' to suspend user."
					putserv "NOTICE $nick :Use $sbnc(trigger)sbnc unsuspend 'ident' to unsuspend user."
 
					putserv "NOTICE $nick :Use $sbnc(trigger)sbnc unsuspend 'ident' to unsuspend user."
	putserv "NOTICE $nick :Use $sbnc(trigger)sbnc version to get info about the script."
                    putserv "NOTICE $nick :End of HELP."
                }
                "version" {
                    putserv "PRIVMSG $chan :sBNC Admin script version 0.5 for sBNC 1.1 by Teppuli (#teppuli @ QuakeNet)"
                }
                "default" {
                    putserv "NOTICE $nick :Use $sbnc(trigger)sbnc help to see commands."
                }
            }
        }
 
 
# END OF SCRIPT
 
Options: New, Download,
, mIRC Parser;
Copyright © 2006 by Zyberdog - Some rights reserved. (Browse/Disclaimer/Stats/About)