Share

TuxServe

The forum address has changed, you have been automatically redirected. Please update any bookmarks to use the new URL.

Subscribe

Hey u steal my ideaaaaaaaaa

You are viewing a single message from this topic. View all messages.

  1. 2006-03-08 13:09:51 UTC
    I was working for a weak for the fileserver but in python!
    But u are working very well than me!As u have started and u have already make ur team I will stop my work!
    As i am still going school i have not so many time as u! But i will show my work !if u want a python scripter plz tell me now in this forum i will be greatfull!Also tell me if this is good

    __module_name__ = "The new world comes"
    __module_version__ = "1.0"
    __module_description__ = "Cran's file server"
    import xchat
    import re
    import string
    import os
    queus=2
    trigger={'!books':'/home/user/docs/'}
    q=0
    real=0
    mynick=['Cran1988']
    mychannels=['#download']
    m=True
    n=[]
    def abortprints(word,word_eol,userdata):
    global m

    global openfile
    if xchat.get_info('channel') in mychannels and xchat.get_info('nick') in mynick:
    xchat.command(('msg %s Ooops Aborted ')%(word[0]))
    m=True
    openfile=[]


    def commandchannel(word,word_eol,userdata):
    global real
    global mynick
    global mychannels
    global m
    global openfile
    global trigger
    if xchat.get_info('channel') in mychannels and xchat.get_info('nick') in mynick:
    if word[1]=='!list':

    xchat.command(('say Triggers:%s ')%(trigger.keys()))
    if trigger.has_key(word[1]):

    if m is True and len(xchat.get_list('dcc'))!=3:
    real=trigger[word[1]]
    openfile=[]
    for i in os.listdir(real):
    openfile.append(i)
    xchat.command(('dcc chat %s')%(word[0]))
    xchat.command(('msg %s FileServer from Cran ')%(word[0]))
    m=False


    def commandprv(word,word_eol,userdata):
    global real
    global mynick
    global openfile

    dprv = re.split(' ',string.lower(word[1]))


    if dprv[0]=='ls':
    for item in openfile:
    xchat.command(("say %s")%item)
    elif dprv[0]=='get':
    if dprv[1] in openfile:
    xchat.command(("dcc send %s %s")%(word[0],real + dprv[1]))

    elif dprv[0]=='cd':
    if dprv[1] in openfile:
    del openfile
    openfile=[]
    for item in os.listdir(real+dprv[1]):
    openfile.append(item)
    xchat.command(('say %s')%item)


    elif dprv[0]=='back':
    del openfile
    openfile=[]
    for i in os.listdir(real):
    openfile.append(i)
    xchat.command(("say %s")%i)




    #------------------------------------------------------------------------
    xchat.hook_print('Channel Message',commandchannel)

    xchat.hook_print('Private Message to Dialog',commandprv)
    xchat.hook_print('DCC CHAT Abort',abortprints)
    xchat.hook_print('DCC CHAT Failed',abortprints)
< Previous | 1 | Next >

Add a Reply

This forum does not allow anonymous participation.

Log in to add a reply. Not registered? Create an account to participate and receive email updates when replies are posted to this topic.