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
|
on $*:TEXT:/^[\!]/:#:{
var %1 = $1
tokenize 32 $mid($1,2) $2-
if ($1 == sms) {
if ($!hget(smsreg,$gettok($fulladdress,2,64)) { .msg $chan Sorry $nick $+ , you need more priveleges to use that cmd... | return }
elseif (!$3 || $2 !isnum) { .msg $chan Syntax: %1 number msg | return }
/send_sms $2 $3- | msg $chan Message sent to $2 with text: $3- | msg #CSMS msg av $nick på $chan : $3-
}
if ($1 == regsms) {
if (im.bloodsome.com !== $ial($fulladdress).host || im.bloodsome.com !== $gettok($fulladdress,2,64)) { return }
elseif (!$2) { .notice $nick Syntax: %1 host (the portion after @) | return }
if (!$ial($2) && !$address($2,5)) { .notice $nick I couldn't find their hosts... I am not performing an auto update. Please try again in a minute. | ial-update | return }
/hadd regsms $iif($ial($2),$ial($2).host,$gettok($address($2,5),2,64)) permissiong_is_granted
.notice $nick Added $iif($ial($2),$ial($2).host,$gettok($address($2,5),2,64)) to the registered...
}
}
on *:start:{ hmake smsreg 100 | hload smsreg smsreg.TwN | /timer 0 600 hsave smsreg smsreg.TwN }
alias showial {
; here we create a new window
window @IAL
var %i = 1
; lets begin to loop through the entire IAL. $ial(*,0) returns the total number of items
while (%i <= $ial(*,0)) {
; we need to add every item of the IAL to the window @IAL
aline -p @IAL $chr(160) $+ %i $+ . $ial(*,%i)
; increase looping variable
inc %i
}
}
alias -l max.who {
; maximum number of replies in a WHO, too big may cause 'Max sendQ exceeded' disconnection
; too low may take the script a long time to update the IAL, 500 or 400 should be fine for most situations
!return 700
}
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ALIAS LEN.WHO ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
alias -l len.who {
; maximum length of the /who <string>, too long may cause the server to ignore the command
; too low may slow things down, 400 should be fine in most cases
!return 500
}
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ALIAS DELAY.WHO ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
alias -l delay.who {
; N seconds after the first join, the script starts to update the IAL
!return 10
}
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ALIAS REPEAT.WHO ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
alias -l repeat.who {
; wait N seconds after doing /who to do the next check and /who
!return 10
}
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ALIAS SHOW ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
alias -l show.who {
; set this to 1 if you want the script to echo when the IAL is updated
; shows number of opers, number of users that are away, number of users that are deaf (+d),
; number of users that have fake host (+x)
; may slow things down, needs some checks / loops etc
; only shows when a whole channel is being who'd
!return 0
}
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; JOIN EVENT ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
on *:join:#:{
; we join, IAL not updated, timer does not run, start a timer
if ($nick == $me) && (!$timer($+($cid,.ial-update.update))) {
.!timer $+ $cid $+ .ial-update.update 1 $$delay.who ial-update.update
}
}
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; LOAD EVENT ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
on *:load:{ !scon -at1 .!timer $!+ $!cid $!+ .ial-update.update 1 $$delay.who ial-update.update }
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ALIAS IALUPDATE ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
alias ialupdate { ial on | ialupdate}
|