-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexample.tcl
executable file
·31 lines (30 loc) · 1.23 KB
/
example.tcl
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
#!/usr/bin/tclsh
package require IRCServices
set CONNECT_ID [::IRCServices::connection]; # Creer une instance services
$CONNECT_ID connect 127.0.0.1 +7002 passwordlink 1 Extra-Cool.FR 00C
set BOT_ID [$CONNECT_ID bot]; #Creer une instance bot dans linstance services
$BOT_ID create ClaraServ services ClaraServ.eggdrop.fr "Visit: https://git.io/JYY9b" +Soiq
$BOT_ID join #Services
$BOT_ID eventbind PRIVMSG {
set cmd [lindex [msg] 0]
set data [lrange [msg] 1 end]
##########################
#--> Commandes Privés <--#
##########################
# si [target] ne commence pas par # c'est un pseudo
if { [string index [target] 0] != "#"} {
if { $cmd == "help" } {
puts "PRIV: [who2] [target2] $cmd $data"
}
}
##########################
#--> Commandes Salons <--#
##########################
# si [target] commence par # c'est un salon
if { [string index [target] 0] == "#"} {
if { $cmd == "!help" } {
puts "PUB: [who] [target] $cmd $data"
}
}
}; # Creer un event sur PRIVMSG
vwait state