[SCRIPT] Bansearch

Intended for use on live public servers.
7 posts Page 1 of 1
thepolm3
Scripter
Scripter
Posts: 424
Joined: Sat Feb 16, 2013 10:49 pm


Code: Select all
"""
bansearch
find a banned player by name or ip
"""
from commands import add,admin
from twisted.internet.reactor import callLater

@admin
def bansearch(connection,value):
    value=str(value)
    f=open("bans.txt")
    bans = eval(f.read())
    f.close()
    retli = []
    for i in range(len(bans)):
        ban = bans[i]
        if value == ban[0] or value == ban[1]:return ban
        elif value in ban[0] or value == ban[1][:len(value)] or value == ban[2][:len(value)] or value == ban[2]:retli.append(i)
    if len(retli)==1:
        return bans[retli[0]]
    else:
        if connection.name!="Console":
            print(len(retli))
            for i in range(len(retli)):
                callLater(i,connection.send_chat,bans[retli[i]])
        else:
            retstr = ""
            for i in retli:
                retstr+=(str(bans[i])+"\n")
            return retstr[:len(retstr)-2]
add(bansearch)

def apply_script(a,b,c):
    return a,b
My computer is back! :')
So happy
Last edited by thepolm3 on Mon Sep 16, 2013 4:30 pm, edited 1 time in total.
shaz
Deuced Up
Posts: 316
Joined: Wed Nov 21, 2012 10:17 pm


Isn't this the script that publishes to IRC?

I think you pasted the wrong one Blue_BigSmile
thepolm3
Scripter
Scripter
Posts: 424
Joined: Sat Feb 16, 2013 10:49 pm


I think I did XD Facepalm
FIXED
shaz
Deuced Up
Posts: 316
Joined: Wed Nov 21, 2012 10:17 pm


Just wanted to update on this, it doesn't return anything when trying to find anyone either by name or IP. Perhaps I'm mistaken but can this be clarified?
thepolm3
Scripter
Scripter
Posts: 424
Joined: Sat Feb 16, 2013 10:49 pm


Try it with the console... I will try to fix this
TimeToDie
Green Master Race
Green Master Race
Posts: 37
Joined: Tue Sep 17, 2013 3:52 pm


How use it ?
There is speacial command ?
VladVP
Post Demon
Post Demon
Posts: 1425
Joined: Fri Dec 14, 2012 10:48 pm


idantheking99 wrote:
How use it ?
There is speacial command ?
Use /bansearch <player name OR ipa>
7 posts Page 1 of 1
Return to “Completed Releases”

Who is online

Users browsing this forum: No registered users and 3 guests