"Message Received" plugin

2006-02-04
2013-04-30
  • thespiritoftal
    thespiritoftal
    2006-02-04

    Normally I am busy with my computer and can't look at ICC and I don't want to miss the tells I received..I also hear no voices from Jin as I am listening to the music all the time.So I wrote a plugin which pops up when I receive a tell.You can modify it so that it can pop-up on other actions too..
    Requirements :
    1 . Linux ( windows is for losers)
    2 . python( %99 of linux boxes have it no worries)
    3 . wxpython ( a python extension to create sweet guis . apt-get install python-wxgtk2.6 if you have a debian based distro)otherwise search and see www.wxpython.org
    4 . Allright you can make this work on windoze too what you need is python (www.python.org) and wxpython(www.wxpython.org)
    here is what you have to do to make it work:
    Create a Beanshell script with whatever name,choose Chat(all types of tells) as event type choose personal tells and write
    exec("python popup.py " + sender + " " +message);

    Then open your favourite editor ( vim if you ask me :p ) write the code below and save as popup.py

    #!/usr/bin/python
    import wx,time,sys
    sender=sys.argv[1]
    message=sys.argv[2:]
    mes=""
    for k in message:
        mes=mes+" "+k
    b=time.localtime()
    if len(str(b[3]))==1: hour="0"+str(b[3])
    else: hour=str(b[3])
    if len(str(b[4]))==1: minute="0"+str(b[4])
    else: minute=str(b[4])
    if len(str(b[5]))==1: second="0"+str(b[5])
    else: second=str(b[5])
    year=str(b[0])
    month=str(b[1])
    day=str(b[2])
    TIME=hour+":"+minute+":"+second+"   "+day+"-"+month+"-"+year
    app = wx.PySimpleApp()
    frame = wx.Frame(None, -1, "Tell received from ICC",size=(500,200))
    frame.SetBackgroundColour("Aquamarine")
    k=wx.StaticText(frame, -1, "Message received\nFrom: %s\nMessage: '%s'" %(sender,mes),wx.Point(0, 0))
    k.SetFont(wx.Font(20, wx.SWISS,False,False, 0, 'Arial'))
    l=wx.StaticText(frame, -1, "Date : %s"% (TIME),wx.Point(0,100))
    l.SetFont(wx.Font(15,False,False,False,0,'Arial'))
    frame.Show(1)
    app.MainLoop()

    here is how it looks like
    http://www.students.itu.edu.tr/~polatel/popup.png
    note: this is the most basic way to integrate python with jin. If you have any other suggestions or wishes just post I'll have a look...
    enjoy
    thespiritoftal

     
    • thespiritoftal
      thespiritoftal
      2006-02-04

      forgot to say : you have to save popup.py in jin's folder and do 'chmod a+x popup.py'

       
    • It's a script, not a plugin :-)