-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathhelp.tcl
More file actions
57 lines (49 loc) · 1.42 KB
/
help.tcl
File metadata and controls
57 lines (49 loc) · 1.42 KB
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
# help.tcl
#
# This script shows a help text with the !help command.
#
# Usage:
# !help show help text
#
# Enable for a channel with: .chanset #channel +help
# Disable for a channel with: .chanset #channel -help
#
# See https://github.com/hwipl/eggdrop-scripts for the latest version and
# additional information including the license (MIT).
# tested versions, might run on earlier versions
package require Tcl 8.6
package require eggdrop 1.8.4
namespace eval ::help {
# channel flag for enabling/disabling
setudef flag help
# help text
variable helpText {
"*** command help: ***"
" Quake2 Server List Commands:"
" !addserver ip:port - add server with ip:port to list"
" !delserver number - remove server with number from list"
" !serverlist - show servers in list"
" !refresh - refresh servers in list"
" !refresh number - refresh server with number in list"
" Others:"
" !help - show this help"
" !insult user - insult user with random insult"
"*** end of help ***"
}
}
proc ::help::show { nick host hand chan arg } {
variable helpText
# check channel flag if enabled in this channel
if {![channel get $chan help]} {
return 0
}
# send each line of help text as a message
foreach i $helpText {
puthelp "PRIVMSG $nick :$i"
}
return 1
}
namespace eval ::help {
bind pub - !help ::help::show
putlog "Loaded help.tcl"
}