Closed robotrono closed 10 years ago
What info do you want to get after sending a command?
idk, for example a "Hello World", but i want send on a group chat
Yes you can use commands in group chat(rooms) using join_muc_room and leave_muc_room to join or leave rooms. Commands are created the same way as you would create them for individual chat.
can you make a example please? i want send a message to room
import zxlolbot
class testbot(zxlolbot.zxLoLBoT):
"""Small bot that joins the room 'test' and replies to the command 'hello' """
def __init__(self, username, password, region="NA"):
zxlolbot.zxLoLBoT.__init__(self, username, password, region)
self.add_event_handler("got_online", self.got_online) #Adds an event handler for when the bot is online
def got_online(self):
"""When the bot is online we can join the room"""
self.join_muc_room("test")
@zxlolbot.botcommand
def hello(self, sender, args):
"""Replies hello"""
self.message(sender, "Hello world :)")
bot = testbot("USERNAME", "PASSWORD", "REGION")
bot.connect()
The bot connects then joins the room test. At that point you can use the command hello in the test room or individually to get the reply
Thanks for the example, but dont work the command on room chat, works fine individually chat.
Does the bot actually join the room? is it a private room or a public room? Are you on NA?
yes the bot join to public room*, im in LAN Server
this is my code:
` import zxlolbot class helloworld(zxlolbot.zxLoLBoT): def init(self, username, password, region="LAN"): zxlolbot.zxLoLBoT.init(self, username, password, region) self.add_event_handler("message", self.on_message) self.add_event_handler("got_online", self.got_online) #Adds an event handler for when the bot is online def got_online(self): """When the bot is online we can join the room""" self.join_muc_room("eslolnet") def onmessage(self, args): """Handler for message event""" print(args["sender"] + ": " + args["message"]) @zxlolbot.botcommand def hello(self, sender, args): """Replies hello to the sender""" self.message(sender, "Hello world") @zxlolbot.botcommand def test(self, sender, args): """Handler for message event""" self.message(sender, "mierda") bot = helloworld("*****", "_") bot.connect() bot.set_status(level=30, status_msg="Version 1.0")
Did you edit zxlolbot.py yourself? If so can you show me what you changed in it? You can either mail me the full file to ContactMathzx@gmail.com or post it here (please use the python markdown)
Could you also tell me the content of the file called lol.properties in your league of legends folder?
It is located at
League of Legends\RADS\projects\lol_air_client\releases\(take the highest number here)\deploy
For example my own is located at:
C:\League of Legends\RADS\projects\lol_air_client\releases\0.0.1.94\deploy
Thank you
Done, check your email.
Your bot account has to be level 5 in order to talk in group chats. I'm sorry for not thinking about that earlier!
Oh thanks!
one question, Your bot have a timer feature for Baron and Dragon, how can implement that?
this is possible?
On a group chat send a command and send me the info
sorry for my bad english