IP address database for bot.
Platform: mIRC
Published Jun 02, 2012
Updated Jun 02, 2012
This script will store IPs for you.
So you never forget them..
Example
<Aha2Y> !ip add localhost 127.0.0.1
<mSLBot[15]> successfuly added localhost to the database.
<Aha2Y> !ip view localhost
<mSLBot[15]> localhost = 127.0.0.1
<Aha2Y> !ip del localhost
<mSLbot[15]]> Sucessfull removed localhost from the database
;IP Storage on ini.
;by Aha2Y.
on *:text:!ip *:#: {
if ($2 == add) {
if ($3 == $null) {
msg $chan $nick $+ : (ip add <what> <address>) -- Adds a IP address to the database
halt }
if ($4 == $null) {
msg $chan $getError(1)
halt }
writeini ips.ini table $3 $4 }
if ($regex($strip($4),/((\d{1,3}\.){3}\d{1,3})/S)) {
msg $chan successfuly added $3 to the database.
else {
msg $chan $getError(2) | halt
}
}
if ($2 == del) {
if ($3 == $null) {
msg $chan $nick $+ : (ip del <what>) -- Remove IP address from the database
halt }
if ($readini(ips.ini, table, $3) != $null) {
remini ips.ini table $3
msg $chan Sucessfull removed $3 from the database
}
else {
msg $chan $getError(3)
}
}
if ($2 == view) {
if ($3 == $null) {
msg $chan $nick $+ : (ip view <what>) -- Views the IP
halt }
if ($readini(ips.ini, table, $3) != $null) {
msg $chan $3 = $readini(ips.ini, table, $3)
}
else {
msg $chan $getError(3)
}
}
if ($2 == stats) {
msg $chan I have $ini(ips.ini,list) Ips
}
}
alias -l getError {
if ($1 == 1) { return Syntax Error - Missing: address }
if ($1 == 2) { return Syntax Error - Not a valid IP address }
if ($1 == 3) { return Syntax Error - No ip found }
}