Question: How to send a tell

General discussion on Budabot.
Assx
Member
Posts: 11
Joined: Fri May 27, 2016 11:48 am
antispam: Rimor

Question: How to send a tell

Postby Assx » Tue Dec 20, 2016 1:02 pm

Greetings,

could anyone tell me how I could create a bot event which sends a tell (to another player) and sends a msg to a public channel like ooc?

That would be rly great!

Kind regards,

Assx
Assx
Member
Posts: 11
Joined: Fri May 27, 2016 11:48 am
antispam: Rimor

Re: Question: How to send a tell

Postby Assx » Tue Dec 20, 2016 1:57 pm

I just found out how to send a tell via an event:

Code: Select all

$this->chatBot->sendTell("Message", Player);

did the trick. =)

But how do I send a message to a public chat like OOC?
Tyrence
The Team
Posts: 1876
Joined: Sat Jan 09, 2010 1:32 am

Re: Question: How to send a tell

Postby Tyrence » Tue Dec 20, 2016 8:25 pm

This should work for sending to public channels:

Code: Select all

$message = "hello world";
$channel = "OT OOC";

$this->chatBot->sendPublic($message, $channel);


Just curious, but what are you building?
"Those who expect to reap the blessings of freedom, must, like men, undergo the fatigues of supporting it." — Thomas Paine
"Nearly all men stand adversity, but if you want to test a man's character, give him power." — Abraham Lincoln
Budabot Releases and Downloads: https://github.com/Budabot/Budabot/releases
Assx
Member
Posts: 11
Joined: Fri May 27, 2016 11:48 am
antispam: Rimor

Re: Question: How to send a tell

Postby Assx » Thu Dec 22, 2016 7:46 am

Thanks, Tyrence.

It is working.
But at first I was thinking that it is not - there is no logger in console. Then I saw, that there is something missing in:

./core/Budabot.class.php

you could add this to line 319

Code: Select all

$this->logger->log_chat("Out. Msg.", $channel, $message);


Can you tell me why the following code provides a working "make_chatcmd" in a tell but when I send the same message to a public channel the link is not clickable?

Code: Select all

$message = "Some text in here or " . $this->text->make_chatcmd("just click here", "/tell <myname> hello");
$channel = "Clan OOC";
$this->chatBot->sendPublic($message, $channel);


Regards,

Assx
equi88
Member
Posts: 3
Joined: Wed Dec 21, 2016 10:37 am
antispam: rimor

Re: Question: How to send a tell

Postby equi88 » Thu Dec 22, 2016 10:15 am

Not sure, but maybe funcom deactivated commands in public (like 70-80% sure :lol: ).
Try manually this two versions, if they dont work, youll have to put it in a box.

Code: Select all

<a href='chatcmd:///ymca'>Click here to YMCA</a>
<a href="chatcmd:///ymca">Click here to YMCA</a>
Tyrence
The Team
Posts: 1876
Joined: Sat Jan 09, 2010 1:32 am

Re: Question: How to send a tell

Postby Tyrence » Thu Dec 22, 2016 11:10 am

Messages sent to public channels are not logged when they are sent, because the server will send a message back when they are received and that is when they are logged. However, messages from shopping, OOC, and a few others are ignored by default. You can edit $channelsToIgnore on line 70 in ./core/Budabot.class.php and that will allow messages from those channels to be logged. Unfortunately, there is no other way to do that that I can think of except editing the code.

In regards to the chatcmd, actually, if I remember correctly, that won't work in any channel, even tells. Instead you have to create a blob and then put the chatcmd inside the blob and then send the blob to the channel you want to display it in.
"Those who expect to reap the blessings of freedom, must, like men, undergo the fatigues of supporting it." — Thomas Paine
"Nearly all men stand adversity, but if you want to test a man's character, give him power." — Abraham Lincoln
Budabot Releases and Downloads: https://github.com/Budabot/Budabot/releases
equi88
Member
Posts: 3
Joined: Wed Dec 21, 2016 10:37 am
antispam: rimor

Re: Question: How to send a tell

Postby equi88 » Thu Dec 22, 2016 12:00 pm

You also can remove the filter check in the process function for public messages(line 608, comment/remove 620-623).
Since all events/cmds processing is filtered be "if" clauses for specific channels, there should be no sideeffects beside that all channels will be displayed/logged.
I would suggest Tyrence solution^^

Return to “General Discussion”

Who is online

Users browsing this forum: No registered users and 1 guest