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
|
on $*:text:/^\*/:#:{
var %cmd = $mid($1,2)
If %cmd == help {
timer 1 0 notice $nick Help list
timer 1 1 notice $nick topic cmd: *topic <text> (This will change the topic and save it)
timer 1 2 notice $nick refresh cmd: *refresh (This will load the topic)
timer 1 3 notice $nick remove cmd: *remove (This will remove the saved topic)
timer 1 4 notice $nick setlevel cmd: *setlevel <nick> <level> (This will add a new user)
timer 1 5 notice $nick level cmd: *levels (This will list the bot levels)
}
elseif %cmd == levels {
timer 1 0 notice $nick Aviable levels
timer 1 1 notice $nick 0 =
timer 1 2 notice $nick 1 =
timer 1 3 notice $nick 2 =
timer 1 4 notice $nick 3 =
timer 1 5 notice $nick 4 =
timer 1 6 notice $nick 5 =
}
elseif %cmd == topic {
($readini(bot.ini, userlist, $address($nick, 1)) => 9) {
remove topic $+ $chan $+ .txt
write topic $+ $chan $+ .txt $2-
topic $chan $2-
timer 1 1 notice $nick topic saved.
timer 1 2 notice $nick to reset the topic, use *refresh
}
}
elseif %cmd == refresh {
($readini(bot.ini, userlist, $address($nick, 1)) => 9)
topic $chan $read(topic $+ $chan $+ .txt $+ )
notice $nick topic from channel $chan resetted.
}
elseif %cmd == remove {
($readini(bot.ini, userlist, $address($nick, 1)) => 9)
remove topic $+ $chan $+ .txt
notice $nick database: removed $chan $+ 's topic
topic $chan Warning: Topic from $chan has been removed.. To save it again, Use *topic <text>
}
elseif %cmd == setlevel {
if ($readini(bot.ini, $chan $+ , $address($nick, 1)) => 4) || ($readini(bot.ini, userlist, $address($nick, 1)) => 9) {
if ($2 ison $chan) {
if ($3 != $null) {
If (!$readini(bot.ini, $chan $+ , $address($nick,1)))
notice $nick Added $2 to userlist with level: $3
writeini bot.ini $chan $+ $address($2,1) $3
}
else {
notice $nick The user already exists. ( $+ $address($nick,1) $+ )
}
}
else {
notice $nick info: no level given (eg: *setlevel Jqson 100)
}
}
else {
notice $nick info: $2 was not found on $chan
}
}
else {
notice $nick No access.
}
}
|