bot talk to bots?
 

News:

29 December 2022 - PtokaX 0.5.3.0 (20th anniversary edition) released...
11 April 2017 - PtokaX 0.5.2.2 released...
8 April 2015 Anti child and anti pedo pr0n scripts are not allowed anymore on this board!
28 September 2015 - PtokaX 0.5.2.1 for Windows 10 IoT released...
3 September 2015 - PtokaX 0.5.2.1 released...
16 August 2015 - PtokaX 0.5.2.0 released...
1 August 2015 - Crowdfunding for ADC protocol support in PtokaX ended. Clearly nobody want ADC support...
30 June 2015 - PtokaX 0.5.1.0 released...
30 April 2015 Crowdfunding for ADC protocol support in PtokaX
26 April 2015 New support hub!
20 February 2015 - PtokaX 0.5.0.3 released...
13 April 2014 - PtokaX 0.5.0.2 released...
23 March 2014 - PtokaX testing version 0.5.0.1 build 454 is available.
04 March 2014 - PtokaX.org sites were temporary down because of DDOS attacks and issues with hosting service provider.

Main Menu

bot talk to bots?

Started by dvxjunkie, 23 February, 2004, 00:09:02

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

dvxjunkie

Anyone know how to get two seperate stand alone chatbots to react to each other? I used to be able to do it but only between the old chaos hubgod client and a nmdc vb chatbot. The elfgirls.lua random chatbot talks to itself in a way, so im thinking it should be possible th alter my lua chatbot so it "hears" another chatbot. any ideas? here is the chatbot im using minus the triggers:

botname = "gabby"
trigs ={}}    
         

function Main()
frmHub:RegBot(botname)
end
function DataArrival(curUser, data)
     
if( strsub(data, 1, 1) == "<" ) then
-- get the msg only using regular expression
s,e,msg = strfind(data, "%b<>%s+(.+)")
                                     
-- look in the table
for key, value in trigs do
                for key2, value2 in value do
                   
if( strfind( strlower(msg), key) ) then
              else break
end
        if( strfind( strlower(msg), "!me") ) then
               t="**"..curUser.sName
               data=gsub (msg, "!me", t, 1 )
end
SendToAll( data ) -- send the original data
                   
         SetTimer(3200)
               StartTimer()
answer, x = gsub(value[random(1,getn(value))], "%b[]", curUser.sName)
return 1; -- tell the hub we have processed the data
end
end
end
end
function OnTimer()
SendToAll( botname, answer ) -- send bot's answer
StopTimer()
end

nErBoS

Hi,

You want a triggie Bot which reacts when another BOT do something ???

Best regards, nErBoS
--## nErBoS Spot ##--

dvxjunkie

yes so that when one bot triggers and speaks, the other bot can trigger off from the response.

nErBoS

OK..

Make tell what are the questions that you want the bot awnswer (give also the awanswers).

Best regards, nErBoS
--## nErBoS Spot ##--

dvxjunkie

well my triggger list has hundreds of triggers so you prolly dont wanna edit those. but it wont help much to do that anyway. I already tried setting up two bots, and setting second bot up with trigger phrases that where copy pasted from the first bots reponses. the bot will respond to the same trigger when a user says it but if another bot says it it will not trigger. this is the delima.
 I believe its somthing in this piece of code that needs modifying but not sure:

function DataArrival(curUser, data)
     
if( strsub(data, 1, 1) == "<" ) then
-- get the msg only using regular expression
s,e,msg = strfind(data, "%b<>%s+(.+)")

pHaTTy

problem is that admin console on ptokax is sent b4 it processes the data, and same with the scripts, they are done b4 text is procoessed so,it only processings whats not on the internal, ie external (clients)

so,you could have a bot that w8s on something like a pm from another bot wth /talk whatever

and the bot can check if /talk then do the checks but it means sending to main and in pm to the other bot ;)

g'luck
Resistance is futile!

nErBoS

Well were goes a wint...

I suposse you only want the triggie responde to phrases that the other bot send in main so you can do this....

In the DataArrival..

if strfind(data, Bot2) --Catch every times the bots send a messange in the main

then you do this

if strfind(data, "The Bot2 was gagged the user") then
SendToAll(Bot, "Don?t do that Bot2.")

I think that is this that you want.

Best regards, nErBoS
--## nErBoS Spot ##--

pHaTTy

hmm no dont think scripts can catch script data, cause technically its not real info its just a simple string from script like Par text, what you say in main so

you wud have to do in dataarrival

from pm if strsub = "/talk " type of thing
Resistance is futile!

nErBoS

Hi,

I have tryied and worked phatty, i think talk is data.

Best regards, nErBoS
--## nErBoS Spot ##--

NotRabidWombat

Latest public release of PtokaX.

A SendToAll, SendPmToAll, etc sends directly to all users,bypassing the scripts (it makes sense to save processing time). Think of the chaos that would ensue if a SendToAll sent it back to scripts, including the one that sent the original message (oiy!).

You could output all messages to a text file. Then you have the other script parse the data at a specific time interval (250ms should be fine) and *respond* to that data with another SendToAll.

-NotRabidWombat


I like childish behavior. Maybe this post will be deleted next.

plop

why not ptokax in combination with bcdc++.
both can do lua scripting.

plop
http://www.plop.nl lua scripts/howto\'s.
http://www.thegoldenangel.net
http://www.vikingshub.com
http://www.lua.org

>>----> he who fights hatred with hatred, drives the spreading of hatred <----<<

NightLitch

#11
One simple way must be using two tables like this one,
this is just a long shot from me, haven't tested or nothing, have no hubsoft where I am now so, pls try, :-)

Bot1 = "Name"
Bot2 = "Name"

-- words in tables should be the same, but different message's
Table1 = {
["word1"] = "Line",
}
Table2 = {
["word1"] = "Line",
}


function DataArrival(user, data)
	if( strsub(data, 1, 1) == "<" ) then
		s,e,msg = strfind(data, "%b<> ([ -z]*)")
		local check1, key1,answer1 = ReturnPhrase(user,Table1,msg)
		if check1 then
			SendToAll( data )
			SendToAll( Bot1, answer1 )
		end
		if Table2[key1] then
			local check2, key2, respons = ReturnPhrase(user,Table2,msg)
			SendToAll( Bot2, respons )
		end
		return 1
	end
end

function ReturnPhrase(user,table,msg)
	for key, value in table do
		if( strfind( strlower(msg), key) ) then
			answer, x = gsub(value, "%b[]", user.sName) 
			return 1,key,answer
		end
	end
end
//NL

SMF spam blocked by CleanTalk