collapse collapse
* User Info
 
 
Welcome, Guest. Please login or register.
* Search

* Board Stats
  • stats Total Members: 989
  • stats Total Posts: 18366
  • stats Total Topics: 2501
  • stats Total Categories: 7
  • stats Total Boards: 35
  • stats Most Online: 1144

Author Topic: diving in head first :)  (Read 11468 times)

0 Members and 1 Guest are viewing this topic.

Offline lordamadeus

  • BeBot User
  • **
  • Posts: 45
  • Karma: +0/-0
diving in head first :)
« on: May 07, 2010, 05:29:44 pm »
ive got a little pet project id like to do with the bot.

what i want to do is catch any tell message sent to a bot and process said message, similar to someone sending !calc 2+2 in a tell message to keep out of org chat. what module is first to take a look at user input.

thx

Offline Khalem

  • BeBot Founder
  • Administrator
  • ********
  • Posts: 1169
  • Karma: +0/-0
    • http://www.ancarim.com
Re: diving in head first :)
« Reply #1 on: May 08, 2010, 12:00:10 pm »
The simplest way would be if you play around with the current development version in the trunk branch on Launchpad. Then you can simply register a listener for the core.on_tell event.

For 0.6 you will want to either go into Source/AOChat.php and do your magic at the incoming packet (not really recommended) or in the fuction inc_tell (iirc) and i think that one is in Bot.php
BeBot Founder and Fixer Kingpin

Offline lordamadeus

  • BeBot User
  • **
  • Posts: 45
  • Karma: +0/-0
Re: diving in head first :)
« Reply #2 on: May 08, 2010, 04:25:58 pm »
thx a bunch, ill take a look at both ends

Offline lordamadeus

  • BeBot User
  • **
  • Posts: 45
  • Karma: +0/-0
Re: diving in head first :)
« Reply #3 on: May 08, 2010, 05:33:56 pm »
$found = $this -> handle_command_input($user, $args[1], "tell");

$found = $this -> hand_to_chat($found, $user, $args[1], "tells");

where in the world are those functions lol
i had to look in at leaset 25 php files trying to find those lol

Offline lordamadeus

  • BeBot User
  • **
  • Posts: 45
  • Karma: +0/-0
Re: diving in head first :)
« Reply #4 on: May 09, 2010, 04:22:33 am »
is there by chance that there is a diagram of the bebot structure, would help tremedously in trying to follow the function routing?

and i mis typed my last post, i still cant find those functions, ive looked all over for them :)

Offline lordamadeus

  • BeBot User
  • **
  • Posts: 45
  • Karma: +0/-0
Re: diving in head first :)
« Reply #5 on: May 09, 2010, 04:36:04 am »
i feel stupid now lol

for some reson text search didnt work, just had to scroll up a bit  :P

Offline lordamadeus

  • BeBot User
  • **
  • Posts: 45
  • Karma: +0/-0
Re: diving in head first :)
« Reply #6 on: May 09, 2010, 07:22:36 am »
what i am attempting to do is relay a tell message received by bot xyz and turn around and post that message into a small alliance relay setup, abc, qwe, oiu bots.

but im stumped, the way !items for example is limited to just the guild chat or private chat, the bot cannot post a message that is carried thru multible bots in relay. simply posting it the same way the results to an !items request to that particular channel is simple and easy, but looking at how the private channel and other channels in a relay environment, the results from the !items call is never seen by any other channels.

the question is, how do i get the output of a bot to be transferable thru a relay environment from the originating input of a tell message?

one thing is that ive seen the code for a bot to ignore its own output, but if i go around this and make the bot think that the output is player didle talking about his day at work rather than a result from !items or !calc, to get this particular peice of output to be taken and relayed thru the relay system to the other bots, will this cause a fatal loop?

i am going to attempt this with a stand alone relay setup with the aid of our friend boolean, but i might be abit off logic, so if such a fatal loop does arise, i can just kill it. i know that manipulating bot.php, this can be done, but im sure if others are interested in such a mod, im not real sure on how to do this without manipulating bot.php.

if anyone knows any tid bits that might be handy in this scenerio, please, by all means, thro them at me.

Offline Yite

  • BeBot Apprentice
  • ***
  • Posts: 152
  • Karma: +0/-0
    • Niflheim - Crom
Re: diving in head first :)
« Reply #7 on: May 10, 2010, 11:18:27 am »
Take a look at Borgan's alliance chat (http://bebot.link/aoc-0-6-x-customunofficial-modules/borgan%27s-alliance-chat) seems to do what you want.

(We've been using it for a while now in our alliance and it works fine)
-Yite [Crom]

Offline lordamadeus

  • BeBot User
  • **
  • Posts: 45
  • Karma: +0/-0
Re: diving in head first :)
« Reply #8 on: May 13, 2010, 02:07:29 pm »
i appreciate ur response, but what im after is a way for a bot to recive a random tell from a particular pre specified char and that message automatically populate thru a realy envirnment, ive trid playing with bot.php and have been able to post to gc the tell message, but getting the bot to then take its own output and consider it as input and by way of boolean allow processing of its own message, but am running into a logic error that causes a fatal loop.

im at the point now where i think i need to make my own mod that will turmp bot.php's initial catching of the gc chat and tells, or using a combination of 2 bots, one hidden, but that seems to complicated for such a simpl task. the code works diligently to prevent the exact thing that i am trying to make it do lol. my main test was to get the bot to post !online itself using a predfined toon sending that bot a tell "!online".

user a sends tell "/tell bot !online", and i have gotten the bot to spit that out to chat, but any way i have thought of to get the bot to process its own command has been kicking my butt, cause it would have to do this in order for it to consider this as user b typing a message that would in a small relay environment be seen by all members of the small relay as user text, ie "good morning, im lft". as far as running the command, it isnt necesary, but to get the bot to treat said text as input and populate the relay, so all users int he relay can see that text. having a very tough time trying to get that to work.

Offline Khalem

  • BeBot Founder
  • Administrator
  • ********
  • Posts: 1169
  • Karma: +0/-0
    • http://www.ancarim.com
Re: diving in head first :)
« Reply #9 on: May 14, 2010, 12:20:53 am »
I'm a bit confused as towards what you are trying to archieve here.

From what I can gather you want to take incomning tells and relay these somewhere else.
What I cannot understand is where capturing the bots own output to GC comes in? What do you want with the bot output?

Maybe you could clarify exactly what you are trying to archieve here. As aside from the capturing of the bot's output which I fail to see the purpose of (and would generally be considered a bad idea anyways due to the inherent dangers of loops), all your trying to do seems to me to be covered both by the shipped relay functionality as well as Borgans alliance chat.
BeBot Founder and Fixer Kingpin

 

* Recent Posts
Com bot module by bitnykk
[November 25, 2024, 05:36:11 pm ]


0.8.x updates for AO by bitnykk
[June 23, 2024, 03:19:47 pm ]


0.8.x updates for AoC by bitnykk
[June 23, 2024, 03:19:44 pm ]


[AoC] special char for items module by bitnykk
[February 09, 2024, 09:41:18 pm ]


BeBot still alive & kicking ! by bitnykk
[December 17, 2023, 12:58:44 am ]

* Who's Online
  • Dot Guests: 238
  • Dot Hidden: 0
  • Dot Users: 0

There aren't any users online.
* Forum Staff
bitnykk admin bitnykk
Administrator
Khalem admin Khalem
Administrator
WeZoN gmod WeZoN
Global Moderator
SimplePortal 2.3.7 © 2008-2024, SimplePortal