-
Notifications
You must be signed in to change notification settings - Fork 0
/
PIKbl.tcl
64 lines (61 loc) · 3.63 KB
/
PIKbl.tcl
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
##############################################################################################
## ## PIKbl.tcl v1.337 for eggdrop by munZe irc.krstarica.com ## ##
##############################################################################################
##############################################################################################
## ____ __ ########################################### ##
## / __/___ _ ___ _ ___/ /____ ___ ___ ########################################### ##
## / _/ / _ `// _ `// _ // __// _ \ / _ \ ########################################### ##
## /___/ \_, / \_, / \_,_//_/ \___// .__/ ########################################### ##
## /___/ /___/ /_/ ########################################### ##
## ########################################### ##
##############################################################################################
## ## Start Setup. ## ##
##############################################################################################
package require http
package require tls
http::register https 443 [list ::tls::socket -tls1 1]
namespace eval PIK {
## Podesava nulu sa dve decimale (NE DIRATI) ##
set NULLA [format "%.2f" 0]
## ako je sadrzaj izlaza > od neke konstante koju definisemo (npr. 60.6) da banuje ##
set BanAkoJeVeceOd [format "%.2f" 60.6]
## Kanal na koji ce da siba poruke ##
set KanalZaObavestenja "#services"
## ako je sadrzaj izlaza < 0 da ispise da je problem ##
set ManjeOdNuleNaKanaluIspisuje ""
## Change bantype to the type of ban you want: gzline, zline ##
set bantype "GLINE"
## Change bantime to the length of ban you want ##
set bantime "12h"
## Change opernick and operpass to reflect the info from the bots oper block ##
## If you already have a oper script, comment out the bind at the bottom of this script ##
set opernick opernickhere
set operpass operpasshere
##############################################################################################
## ## End Setup. ## ##
##############################################################################################
proc IPlookup {ip} {
set url "https://pricaonica.krstarica.com/ipcheck.php?ip=$ip"
set token [ ::http::geturl $url ]
if {[::http::status $token] == "ok"} {
set page [ ::http::data $token ]
set ajdedagamerimo [regexp -all -inline {\d+.\d+} $page]
if {$ajdedagamerimo <= $PIK::NULLA} { putmsg $PIK::KanalZaObavestenja $PIK::ManjeOdNuleNaKanaluIspisuje }
if {$ajdedagamerimo >= $PIK::BanAkoJeVeceOd} { putnow "$PIK::bantype *@$a.$b.$c.$d $PIK::bantime :Vasa IP adresa $ip je problematicna" }
} else { putmsg $PIK::KanalZaObavestenja Error: IPCheck Status: [::http::status $token] }
}
proc connection {host type text} {
if {[string match -nocase {*client connecting*} $text]} {
#Gets IP
regexp -- {.*@([^\)]+)} $text null ip
#Check IP
PIK::IPlookup $ip
}
}
proc operup {type} {
putserv "OPER $PIK::opernick $PIK::operpass"
}
}
bind raw - NOTICE PIK::connection
## You can comment out the event below if you already have a oper script for this bot.
bind evnt - init-server PIK::operup