Page 1 of 1

[SCRIPT] Bansearch

Posted: Fri Sep 13, 2013 4:18 pm
by thepolm3
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

Re: [SCRIPT] Bansearch

Posted: Mon Sep 16, 2013 8:25 am
by shaz
Isn't this the script that publishes to IRC?

I think you pasted the wrong one Blue_BigSmile

Re: [SCRIPT] Bansearch

Posted: Mon Sep 16, 2013 11:58 am
by thepolm3
I think I did XD Facepalm
FIXED

Re: [SCRIPT] Bansearch

Posted: Thu Sep 19, 2013 12:14 am
by shaz
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?

Re: [SCRIPT] Bansearch

Posted: Thu Sep 19, 2013 2:49 pm
by thepolm3
Try it with the console... I will try to fix this

Re: [SCRIPT] Bansearch

Posted: Tue Oct 01, 2013 11:00 am
by TimeToDie
How use it ?
There is speacial command ?

Re: [SCRIPT] Bansearch

Posted: Tue Oct 01, 2013 1:36 pm
by VladVP
idantheking99 wrote:
How use it ?
There is speacial command ?
Use /bansearch <player name OR ipa>