Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;-------- - -
- ; Aliases
- ;-------- - -
- alias -l cx.swear {
- if ($isid) { return $readini $scriptdircx-swear.ini settings $1 }
- else { .writeini $scriptdircx-swear.ini settings $1 $2- }
- }
- alias -l cx.hash {
- if ($hget(cx.list,0) == $lines($scriptdircx-swear.txt)) return
- if ($hget(cx.list)) hfree cx.list
- hmake cx.list 1000
- var %i = 0
- while (%i < $lines($scriptdircx-swear.txt)) {
- inc %i
- var %cx.input = [ $read -l [ $+ [ %i ] ] $scriptdircx-swear.txt ]
- hadd cx.list %i %cx.input
- }
- }
- alias -l cx.swear.chk {
- var %i = 0
- while (%i < $hget(cx.list,0).item) {
- inc %i
- if ($hget(cx.list,%i) iswm $1-) { return $true }
- }
- return $false
- }
- ;-------- - -
- ; Popups
- ;-------- - -
- MENU menubar,channel {
- -
- Swear Protection:.dialog -m cx.swear cx.swear
- -
- }
- ;-------- - -
- ; Dialogs
- ;-------- - -
- dialog cx.swear {
- title ">> Swear Protection"
- size -1 -1 124 84
- option dbu notheme
- button "done", 1, 50 74 24 9, flat cancel
- box "Swear Protection Settings", 2, 0 28 124 44
- button "del", 3, 100 55 16 10, flat
- combo 4, 4 55 92 50, sort drop
- button "add", 5, 100 40 16 10, flat
- edit "", 6, 4 40 92 11, autohs
- box "Adjust Console", 7, 0 0 124 24
- radio "Disable", 8, 87 10 36 8, flat
- radio "Enable", 9, 8 10 32 8, flat
- }
- on *:DIALOG:cx.swear:*:*: {
- if (($devent == INIT) && ($did == 0)) {
- if ($cx.swear(toggle) == enable) {
- did -c $dname 9 | did -u $dname 8 | did -e $dname 3,4,5,6
- var %i = 0
- while (%i < $lines($scriptdircx-swear.txt)) {
- inc %i
- .did -a $dname 4 [ $read -l [ $+ [ %i ] ] $scriptdircx-swear.txt ]
- }
- }
- else { did -c $dname 8 | did -u $dname 9 | did -b $dname 3,4,5,6 }
- }
- if ($devent == SCLICK) {
- if ($did == 3) { if ($did($dname,4).sel) { .write -dw [ $+ [ $did($dname,4).text ] ] $scriptdircx-swear.txt | did -d $dname 4 $did($dname,4).sel } }
- if ($did == 5) { if ($did($dname,6).text) { did -a $dname 4 $ifmatch | .write $scriptdircx-swear.txt $ifmatch } }
- if ($did == 8) { cx.swear toggle disable | did -c $dname 8 | did -u $dname 9 | did -b $dname 3,4,5,6 }
- if ($did == 9) { cx.swear toggle enable | did -c $dname 9 | did -u $dname 8 | did -e $dname 3,4,5,6 }
- }
- }
- ;-------- - -
- ; Remote
- ;-------- - -
- on *:TEXT:*:#: {
- if ((($me isop $chan) && ($nick !isop $chan) && ($cx.swear(toggle) == enable))) {
- cx.hash
- if ($cx.swear.chk($strip($1-)) == $true) {
- .raw MODE # +b $wildsite
- .kick # $nick >>> Swear protection.
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement