Jump to content

Recommended Posts

Posted

Create your own SkypeBOT

 

What is Skype4Py

 

Skype4Py is a Python wrapper for the Skype API. It is platform independent, written completely in Python and reimplements the Skype4COM's API in a pythonic way.

This specific tutorial is written for Python 2, however it can easily be translated for Python 3. Even though this does have a lot of stuff, I will be going over what I personally use.

By the way, it says PHP code. That's because I want syntax highlighting. All this is in python. Not php.

Also, This will be a shitty bot. I feel the need to say this, because I'm covering the VERY BASICS. Learning python will help you a lot more.

 

Download Links

 

I assume you already have python when reading this, if not Download Here  Also, you will need to download Skype4Py  Anyways, that should be everything you need.

 

Get the bot attached to skype

 

 

First you will want your bot to attach to skype. This can be easily done with the code below.

 

PHP Code:
import Skype4Py

# Create an instance of the Skype class.
skype = Skype4Py.Skype()

# Connect the Skype object to the Skype client.
skype.Attach() 

 

After that, you should get something like this

 

hCaja.png

 

Starting with the bot

 

Here's a few things you should know. These are the main things I use in my bot.

I still recommend you learn the other stuff too.

 

PHP Code:
#Here's a short example on what you could do.

if Message.Body == '!test':
    Message.Chat.SendMessage('Appears to work!')

#This makes it so whenever a message is "!test", it sends "Appears to work!"

#You could always do something along the lines of

if msg.startswith('!test'):
    Message.Chat.SendMessage('Appears to work!')

#This makes it so if someone's message starts with !test, it will send. Even if it has random characters after it. 

 

#This is extremely useful. This allows the bot to send messages.
#If you need an example, view it above. 

 

This is also very useful. Let's say you want admin controls, that only you can do. My bot has a simple leave feature, and it's set up like

 

if Status == 'SENT' or Message.FromHandle == 'MySkypeName': #If sent by the bot, or if it's sent by me.
    if Message.Body == '!leave': #If the command activates
    Message.Chat.SendMessage('Buh-bye!')
    Message.Chat.SendMessage('/leave') #Sends /leave, which happens to be a skype command 

 

Putting together the bot

 

Now, I don't think you want to know everything in depth. If you do, you can check the links below.

 

First of all, you should import Skype4Py

 

import Skype4Py[php]

[color=white]Then you want skype4py to attach to your skype. Heres something you should add.[/color]
[php]
skype = Skype4Py.Skype();
skype.OnMessageStatus = command
if skype.Client.IsRunning == False:
    skype.Client.Start()
skype.Attach(); 

 

Then you want to set up a command, and set it up so it reads it. You then need to set up a test command, which you can see below.

 

def command(Message, Status):
    if Status == 'SENT' or (Status == 'RECEIVED'):
  if Message.Body == '!test':
    Message.Chat.SendMessage('Appears to work!') 

 

And then an endless loop (There are many ways to do this).

 

while True:
    raw_input('') 

 

And then, you're all set! (I think)

 

Useful Links

 

http://python.org/

http://skype4py.sourceforge.net/doc/html/

http://sourceforge.net/projects/skype4py/

 

Download to my thinned-down bot (not an achievement at all):

 

http://db.tt/ZHBlcT3M

 

import Skype4Py 

def command(Message, Status): 
    if Status == 'SENT' or (Status == 'RECEIVED'): 
  if Message.Body == '!test': 
    Message.Chat.SendMessage('Appears to work!') 

skype = Skype4Py.Skype(); 
skype.OnMessageStatus = command 
if skype.Client.IsRunning == False: 
    skype.Client.Start() 
skype.Attach();  
while True: 
    raw_input('')

 

Have Fun!  8)

  • 4 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Posts

    • nice work, welcome back to world of lineage development @melron 😄
    • He's likely baiting you to download his source full of backdoors indeed
    • Yeah inside router i had to enable udnp services 
    • Hello cheaters, As a team of avid developers and enthusiasts of Lineage 2, we are excited to present the L2 Control Hub, a groundbreaking plugin designed by myself and my collaborator, StinkyMadness. This innovative tool equips server administrators with powerful automation capabilities directly within the game's community board. L2 Control Hub simplifies the creation and management of automations, enabling you to customize your server operations without the need to modify the source code.   Key Features of L2 Control Hub: Robust Automation Triggers: Select from a plethora of triggers currently available, with continuous additions in the works to enhance your control options. Dynamic Conditions and Actions: Tailor your server operations with an extensive range of conditions and actions, ensuring flexible and precise control over game events and player interactions. Customizable Variables: Easily integrate server-specific variables from your database to further personalize and streamline your automations. Utilize these variables across various automation scenarios to cater to your specific server requirements. JavaScript Integration: Execute custom JavaScript codes that interact seamlessly with Java classes, bringing advanced functionalities to your server's ecosystem.   Explore L2 Control Hub in Action: We've prepared a series of video tutorials to demonstrate the capabilities of L2 Control Hub: Control Hub - Create a Simple Flow with 1 Condition and 1 Action: Get started with basic automations. Control Hub - Multiple Conditions with Multiple Actions: Explore more complex automations for detailed server management. Control Hub - Using Variables: Discover how to implement and use custom variables for tailored automations. Control Hub - Using JavaScript: Experience the power of custom scripts in enhancing your server functionality.   L2 Control Hub is currently about 70% complete, and we are actively developing and refining features. We invite you to join our ➡️ Discord community ⬅️ to engage with the development process, provide feedback, and be the first to test new features. Additionally, any updates or changes to the plugin are seamlessly delivered to all customers directly from our web server, ensuring your system is always up-to-date without the need for manual downloads.   Your game, your rules, automated. Join us in redefining server management in Lineage 2 and elevate your gaming community with unmatched automation capabilities. For more details, contact us directly to get started with L2 Control Hub.   Currently, the plugin is developed using aCis sources. We will continue with these sources until we finalize all the necessary details before proceeding to integrate with the more prominent sources available.       The L2 Control Hub is designed to extend beyond mere functional additions to your server. We are in the process of implementing a suite of advanced mechanisms, such as a vote manager capable of interfacing with any Lineage 2 voting site without requiring configuration, live statistics to provide admins with real-time insights, and an event engine that can generate any desired event within seconds. All these features will be seamlessly integrated into the module, enhancing your server management experience significantly.     Please note that L2 Control Hub will be a premium tool, reflecting the extensive features and benefits it offers. While we are finalizing the pricing structure, rest assured that we aim to deliver great value for your investment. We will announce the cost details soon on our platforms to ensure everyone is well-informed and can plan accordingly. Join us to take your server management to the next level with L2 Control Hub.     
    • The link soucer and system are off, reup please, thanks very much @HypeH
  • Topics

×
×
  • Create New...