· 8 years ago · May 12, 2018, 10:28 AM
1;Copyright Chiel Tondeleir
2
3on *:START: {
4 ; create the hash table of 100 items (size of 10)
5 /hmake voicechannels 10
6 ; Load our hash file if it's there, other wise initialize the hash table
7 if ($isFile(voicechannels.hsh)) {
8 ; file exists, now we load it
9 /hload voicechannels voicechannels.hsh
10 }
11 else {
12 ; the file does not exist. Now we initialize, and save
13 /voicechannels.init
14 /hsave -o voicechannels voicechannels.hsh
15 }
16}
17
18on *:EXIT: {
19 ; save our table on exit
20 /hsave -o voicechannels voicechannels.hsh
21 ; clear the used memory
22 /hfree voicechannels
23}
24
25on *:TEXT:!Addvoice:#:{
26 /hadd voicechannels $chan
27}
28
29
30on *:JOIN:#:{
31if ($hget(voicechannels, $chan)) {
32 /mode $chan +v $nick
33}
34}