The PotatoResponder
WT-Fakawi
2006-05-15 17:10:55
The recent talks about autotalking/responding has led me to make this thread.
This is the PotatoResponder. I have released this code a month ago, leech free. I didnt get the responce I was hoping for, so here it is explained. Please study it carefully.
Based upon the same principle are parts of our own private library, including the mysterious AutoResponder everybody has been bothering me about :)
Its engine is fairly simple, based on something I saw ages ago, made by the RSCI devs. A function that grabs the last line of chat and compares it to predefined strings. So ((inChat('what') or inChat('wat')) and (inChat('doi') or inChat('oin'))) evaluates to a combination of 'what' or 'wat' and 'doi' or 'oin', meaning in normal english "what are you doing? The PotatoResponder would then respond with one of of 10 rotating responces:
PotatoeText[1] := 'I am picking potatoes';
PotatoeText[2] := 'I just love potatoes';
PotatoeText[3] := 'I am the potatoepicker';
PotatoeText[4] := 'making stews.';
PotatoeText[5] := 'yummie potatoes. I pick m';
PotatoeText[6] := 'potatoes are easy to get.';
PotatoeText[7] := 'making french fries';
PotatoeText[8] := 'i am the potatoeking.';
PotatoeText[9] := 'look, potatoes everywhere.';
So this is nice. We are no longer a bot. It gets even better, because next we check for this: if (inChat('hah') or inChat('heh') or inChat('lol') or inChat('lmao'))
PoatoRespond responds with:
PotatoeText[10] := 'lolol';
PotatoeText[11] := 'lol';
PotatoeText[12] := 'haha';
PotatoeText[13] := 'hihi';
PotatoeText[14] := 'ghehe';
PotatoeText[15] := 'lmao';
PotatoeText[16] := 'lmfao';
PotatoeText[17] := 'rofls';
PotatoeText[18] := 'fun';
PotatoeText[19] := 'nice';
Works 90% of the time. I hope that at least some of you apprecciate it's posibilities, and realise this "hidden" potential. Easy enough to build a gigantic library.
[php]//—————————————————————————-//
procedure PotatoeRespond;
var
TheResponce : String;
begin
OldLine := TheLine;
TheName := lowercase(trim(GetTextAtEx(20, 415, 45, SmallChars, False, False, 0, 2, 0, 40, True, tr_NormalChars)));
TheLine := lowercase(trim(GetTextAtEx(20, 415, 45, SmallChars, False, False, 0, 2, 16711680, 40, False, tr_NormalChars)));
NewLine := TheLine;
if OldLine <> NewLine then
if (pos('yo', TheName) <> 0) or (pos(Players[CurrentPlayer].Nick, TheName) <> 0) then
begin
end // skip our own text! and "you have etc…."
else
begin
if ((inChat('what') or inChat('wat')) and (inChat('doi') or inChat('oin'))) then
begin
TheResponce := PotatoeText[what + 1];
Wait(1000);
TypeSend(TheResponce + ' ' + TheName)
what := what + 1;
if what > 10 then
what := 1;
end;
if (inChat('hah') or inChat('heh') or inChat('lol') or inChat('lmao')) then
begin
TheResponce := PotatoeText[10 + lol];
TypeSend(TheResponce);
lol := lol + 1;
if lol > 10 then
lol := 1;
end;
end;
end;
{*******************************************************************************
function InChat(Text : String) : Boolean;
By:WT-Fakawi
Description: Returns True if Text is in last Chat Message.
*******************************************************************************}
function InChat(Text : String) : Boolean;
begin
if (pos(Text, TheLine) <> 0) then
Result := True
else
Result := False;
end;
[/php]
and
[php] PotatoeText[1] := 'I am picking potatoes'; // respond to doing & what
PotatoeText[2] := 'I just love potatoes';
PotatoeText[3] := 'I am the potatoepicker';
PotatoeText[4] := 'making stews.';
PotatoeText[5] := 'yummie potatoes. I pick m';
PotatoeText[6] := 'potatoes are easy to get.';
PotatoeText[7] := 'making french fries';
PotatoeText[8] := 'i am the potatoeking.';
PotatoeText[9] := 'look, potatoes everywhere.';
PotatoeText[10] := 'lolol'; // lol
PotatoeText[11] := 'lol';
PotatoeText[12] := 'haha';
PotatoeText[13] := 'hihi';
PotatoeText[14] := 'ghehe';
PotatoeText[15] := 'lmao';
PotatoeText[16] := 'lmfao';
PotatoeText[17] := 'rofls';
PotatoeText[18] := 'fun';
PotatoeText[19] := 'nice';[/php]
P.S.
Have you noticed that the PotatoRespond splits up chattext into TheName and TheLine? Realise that you can speak out the legit players name? :)
The Un-Named
2006-05-15 17:20:20
Ok this is starting to scare me.
After seeing the thread about the potatoresponder I went to search for your script to take a look at it, then I went to search for my resonder(it was very similar to yours, except used case of, basically "if(IsChatMessage(RandChat))then SendKeys2(RandChat);", this would check the chat for random phrases and could have the possibilty to send them back. It was limmited to a few phrases"hi, lol ect", but it worked. Unfourtunatly it got deletec by accedent but wouldn't be too hard to make another.
solemn wishes
2006-05-15 17:30:08
lol the-un-mamed, nice tut fawki but i think it covers *alot* more than you gave it credit for in the name, and definatly will help some people out.
Renax
2006-05-15 17:52:37
hmmm… let me see…
Kernel Klink
2006-05-15 17:52:41
Yes, this will definetely give those willing to make an autoresponder a stable start. Excellent tutorial, and I as one, apoligise for underappreciating your potatoe responder.
Krazy_Meerkat
2006-05-15 17:53:28
;p The potato responder? The uses of this are unlimited..
I'd be more than happy to add some custom phrases for mining etc.. Why not pick a phrase at random from the list?
[php]if (inChat('hah') or inChat('heh') or inChat('lol') or inChat('lmao')) then
begin
TheResponce := PotatoeText[10 + random(11)];
TypeSend(TheResponce);
end; [/php]
Although I've seen a lot of auto-talkers which will say the same thing twice lol, which might seem a bit odd to a regular person. Still, if the library was large enough then we'd have no probs at all. I also made a procedure for adding spoken strings to a list and not using them for at least 5 mins once..
I'm going to get to work copying some phrases from a java auto-talker which I edited.
The Un-Named
2006-05-15 18:00:59
From: Krazy_Meerkat
Still, if the library was large enough then we'd have no probs at all.
If your having trouble getting alot of stuff, phrases ect, add asmuch people on msn as you can and all message them with somthing like hi, or lol or somthing.
timmyboy
2006-05-15 18:31:08
Ooo, i'd be willing to create the library. I'll get right on it.:D
imafatmess
2006-05-15 19:03:06
There is one problem with autoresponders…
You could get autoers saying something like
autoer1: 'lol'
autoer2: 'he he'
autoer1: 'ha ha'
autoer2: 'lol'
…
and so on…
From: imafatmess
There is one problem with autoresponders…
You could get autoers saying something like
autoer1: 'lol'
autoer2: 'he he'
autoer1: 'ha ha'
autoer2: 'lol'
…
and so on…
Lmfao.
That would be crazy.
Like an endless loop of laughter.
Who wants to try it out with me. :p
Dankness
2006-05-15 19:24:30
wow the possibility's are endless…. :cool: But the main reason for my post is unless your Dan Quayle potato doesn't have a E :cool: lol but honestly i dont belive you released that its pretty much a fully working auto responder it just needs more questions/answers….
The Un-Named
2006-05-15 19:31:00
You can do somthing to check the username(if(chatmessage(whatever) and (username = usernamefromlastchatmessage) then break;)
Cheesehunk
2006-05-15 19:46:31
This is pure genious!:)
I was about to make one, but thean I didn't, I say you put this in Test Corner, and so people can add questions and answers.
Also, to stop autoers from talking with each other do this: If name1 says something, and you say lol, and it says another one of the lol responses, then it stops!
Would be a bit challenging to make, but its all possible!
The Un-Named
2006-05-15 19:54:54
Cheesehunk
2006-05-15 20:15:15
From: The Un-Named
http://82.92.130.193/forums/showpost.php?p=14360&postcount=12
Lol, I saw that after I posted..
I think I left it idle for like 10 Minutes before I posted..
WhiteShadow
2006-05-15 21:11:15
This is awesome, and I thought our capabilities of human likeness had reached it's pinnacle. :p
Krazy_Meerkat
2006-05-15 23:34:49
You could make it have a 1 in 5 chance of responding to text as well.. Maybe combined with random chat, it would really work well. Unfortunately, I didn't find any of the chat responses I made a while ago :(
If we all pitch in, we could have a rather extensive library. I thought of making a sentence generator once which could type dynamic replies (it would have to make sense).. I might give it a try, but anyway here's what I've come up with on the spot:
[php] if ((inChat('want') or inChat('have') or inChat('need') or inChat('give')) and (inChat('free') or inChat('money') or inChat('stuf') or inChat('wep') or inChat('armour'))) then
begin
TheResponce := PotatoeText[20 + lol];
TypeSend(TheResponce);
lol := lol + 1;
if lol > 29 then
lol := 21;
end;[/php]
and the reply
[php] PotatoeText[20] := 'no ty'; // No thanks
PotatoeText[21] := 'nah thanks';
PotatoeText[22] := 'naw';
PotatoeText[23] := 'leave me alone';
PotatoeText[24] := 'i don''t think so';
PotatoeText[25] := '??';
PotatoeText[26] := 'grr';
PotatoeText[27] := 'you don''t know me';
PotatoeText[28] := 'i''m busy';
PotatoeText[29] := 'not enough space';[/php]
I also suggest having it check if our username (or nick) has been said, and making the responder pay attention to the next few seconds of chat and make a response if needed.
Also checking if it has replied to the same thing in the last 30 seconds (noobs spamming you).
WT-Fakawi
2006-05-16 02:21:12
Good of you to pick it up guys. And devs, stop pretending, you are lousy liars :)
I am working on the ultimate challenge.
Responding to Mods :)
[php]Case responselevel1 of:
hi: begin
case responselevel2 of
'im fine' :
' thats nice':
case responselevel3 of
etc etc
[/php]
You could easily nest convos like that
Krazy_Meerkat
2006-05-16 03:36:51
Wow, mod-chatting is risky.. You could have an excuse-logout system. "Wow a mod, I'm going to get my main", "Can you make me a mod? I will ask on the forums"…
Although mod chat would be very interesting :) logging out was not really a good thing to do.
The Un-Named
2006-05-16 06:13:06
From: Krazy_Meerkat
Wow, mod-chatting is risky.. You could have an excuse-logout system. "Wow a mod, I'm going to get my main", "Can you make me a mod? I will ask on the forums"…
Although mod chat would be very interesting :) logging out was not really a good thing to do.
You can do this a few times before mods catch on…
"oh fuck, I think the icecream truck just knocked a kid over, brb".
Krazy_Meerkat
2006-05-16 06:18:33
From: The Un-Named
"oh fuck, I think the icecream truck just knocked a kid over, brb".
Lmfao! Interesting excuse..
WT-Fakawi
2006-05-16 06:57:25
thats the spirit!
Lets make a Project-Group out of this! I will need to implement this inside the forum structure, but I think we might all benefit. More info later…
Ahhahah this all reminds me of the smarter child bot for msn.
add [email]smarterchild@hotmail.com[/email] and talk away. It is actually very cool. Simple to make just it has it has like Tons and tons of things to reply to. like swear and it will say dont use that language. Say a word it doesnt know and it will ask what does that mean. Say info :(question) and it willeither google search it or search for it in a encyclopedia.
/kinda offtopic
I think ill start on this tonight after my hockey game.
Avaphi
2006-05-16 21:46:45
Wow fakawi, this is really, REALLY nice. We can document what people say to you ingame, and have a response for it.
OFF TOPIC: fakawi, good idea on making forums private in a few days.
Krazy_Meerkat
2006-05-16 22:17:12
Nobody seems to be following my example, so here's some more on-the-spot action:
[php]if (inChat('hi') or inChat('hello') or inChat('hey') or inChat('howdy'))then
begin
TheResponce := PotatoeText[30 + lol];
TypeSend(TheResponce);
lol := lol + 1;
if lol > 39 then
lol := 31;
end;[/php] and the reply [php] PotatoeText[30] := 'hi'; // hello
PotatoeText[31] := 'hello';
PotatoeText[32] := 'hey';
PotatoeText[33] := 'howdy';
PotatoeText[34] := 'get lost';
PotatoeText[35] := '-.-';
PotatoeText[36] := 'pfft';
PotatoeText[37] := 'hi';
PotatoeText[38] := 'hi';
PotatoeText[39] := 'hi';[/php]
[php]if ((inChat('how are') or inChat('how r ') or inChat('hwo r ') or inChat('hwo are'))and(inChat('you') or inChat('yuo') or inChat(' u ')))then
begin
TheResponce := PotatoeText[40 + lol];
TypeSend(TheResponce);
lol := lol + 1;
if lol > 49 then
lol := 41;
end;[/php] and the reply [php] PotatoeText[40] := 'good'; // good
PotatoeText[41] := 'great';
PotatoeText[42] := 'fine';
PotatoeText[43] := 'ok..';
PotatoeText[44] := '=.=';
PotatoeText[45] := 'good, you?';
PotatoeText[46] := 'good, u?';
PotatoeText[47] := 'alright';
PotatoeText[48] := 'pretty good';
PotatoeText[49] := 'i have the flu';[/php]
[php]if ((inChat('what are') or inChat('what r ') or inChat('wat r ') or inChat('wat are'))and(inChat('you') or inChat('yuo') or inChat(' u '))and(inChat('oin')))then
begin
TheResponce := PotatoeText[50 + lol];
TypeSend(TheResponce);
lol := lol + 1;
if lol > 59 then
lol := 51;
end;[/php] and the reply [php] PotatoeText[50] := 'nothing'; // nothing
PotatoeText[51] := 'not much';
PotatoeText[52] := 'what does it look like?';
PotatoeText[53] := 'i dont really feel like talking';
PotatoeText[54] := '?';
PotatoeText[55] := 'nm?';
PotatoeText[56] := 'nm, u?';
PotatoeText[57] := 'not a lot';
PotatoeText[58] := 'stuff';
PotatoeText[59] := 'huh?';[/php]
[php]if (inChat('sorry') or inChat('sory') or inChat('sorri'))then
begin
TheResponce := PotatoeText[60 + lol];
TypeSend(TheResponce);
lol := lol + 1;
if lol > 69 then
lol := 61;
end;[/php] and the reply [php] PotatoeText[60] := 'thanks'; // ty
PotatoeText[61] := 'don''t worry about it';
PotatoeText[62] := 'its ok';
PotatoeText[63] := 'why?';
PotatoeText[64] := 'about what?';
PotatoeText[65] := 'don''t even trip';
PotatoeText[66] := 'eh..';
PotatoeText[67] := 'nothing to cry about';
PotatoeText[68] := 'it''ll be fine';
PotatoeText[69] := 'its nothing';[/php]
Everyone please pitch in.
Krichevskoy
2006-05-16 23:07:46
You know what I've always wanted to do along these lines? Have a chat-logger bot sit in wherever you want to auto on and off for about a week or so and then feed all of that into a Markov chain sentence generator (something like Jibble's
JMegaHal - 4th-order chains for the technical, decently coherent if you have no clue what that means).
That way you could get somewhat contextual responses generated on-the-spot instead of pulling from a predefined list.
Whatyouknow13
2006-05-16 23:34:55
Woah, this thing is amazing and in the samy way weird.
The Un-Named
2006-05-17 04:27:20
From: Krichevskoy
You know what I've always wanted to do along these lines? Have a chat-logger bot sit in wherever you want to auto on and off for about a week or so and then feed all of that into a Markov chain sentence generator (something like Jibble's JMegaHal - 4th-order chains for the technical, decently coherent if you have no clue what that means).
That way you could get somewhat contextual responses generated on-the-spot instead of pulling from a predefined list.
I beleve fawaki logs his chats. ^^
EDIT: :o I got fakawi's name wrong :o
WT-Fakawi
2006-05-17 04:43:07
yes he does. Care to see some of it?
torrent
2006-05-17 09:43:49
y dont we all make a list of questions and responses :) then use the good once.. 1 answer which wud answer alot of questions is a nice one to use :)
The Un-Named
2006-05-17 09:55:54
"Your post is inapropiate so I don't feel the need to answer." ;)
Renax
2006-05-17 16:16:02
this should help, i find it's better the inchat, i modded it from lorax's SimilarStrings
function MatchText(TextA, TextB: string): Integer;
var
i, Trues, Falses: Integer;
Temp: Extended;
begin
for i:= 1 to Length(TextA) do
begin
if (i > Length(TextB)) then
Break;
if (not(Lowercase(TextA[i]) = LowerCase(TextB[i]))) then
begin
insert(TextA[i], TextB, i);
Falses:= Falses + 1;
end;
if (Lowercase(TextA[i]) = LowerCase(TextB[i])) then
Trues:= trues + 1;
end;
Temp:= (Trues - Falses) div Length(TextA);
Temp:= Temp * 100;
Result:= Round(Temp);
end;
Cheesehunk
2006-05-20 00:10:14
Hmm, very interesting!!
I was thinking of making something using this that if a player kept swearing it would add the player to the Ignore list, however, the new update blocks out almost all swearing. I thought that was a pretty good idea though.:p
scar_ownz
2006-09-18 21:30:00
From: The Un-Named
You can do this a few times before mods catch on…
"oh fuck, I think the icecream truck just knocked a kid over, brb".
lol maybe you could have it say wow a mod or hello (mods name)
EDIT why not create a new topic so people can post questions on like 3 answers and possibly include them into the srl library and about the multiple autoers responding to the question make it a 1/3 chance of responding
Yakman
2006-09-19 17:01:42
i was reading though this and i was cracking up at the though to 2 autoers saying hi to each other, also in my script i made a very simple auto responder to mods,
if(findmod2)then
begin
case random(6) of
0:typesend('whats that crown?')
1:typesend('whats that crown mean')
2:typesend('are u a pmod?')
3:typesend('are u a player mod')
4:typesend('wow a pmod')
5:typesend('wow a player mod!')
end
//note, findmod2 is the modified antirandom, it finds the mod but doesnt logout
it might be suspitous if there are 10 autoers and a mod comes and they all says the same thing
[PHP]
mod:hi
guy1:whats that crown?
guy2:whats that crown?
guy3:whats that crown?
guy4:whats that crown?
guy5:whats that crown?
guy6:whats that crown?
guy7:whats that crown?
guy8:whats that crown?
guy9:whats that crown?
mod:reported haha
[/PHP]
Cheesehunk
2006-09-19 22:20:18
From: Yakman
i was reading though this and i was cracking up at the though to 2 autoers saying hi to each other
It has happened to me before I think.. :p
Some guy: Hahaa
Me: Lol
Guy:Haha
Me: Haha
Guy:=p
Not an actual conversation, but you get the point..
Yakman
2006-09-20 04:51:35
well this is a simply way to prevent this, just use MarkTimes
if(timefrommark(hi)>30000)then
begin //responds to people saying hi
if(pos('hi',theline)<>0)or
(pos('hey',theline)<>0)or
(pos('hello',theline)<>0)then
begin
typesend('hi')
marktime(hi)
hi:=hi+random(30000)
end
end
the reason iv got pos( is because before this is didnt know about inchat
i think youll find if you look hard enough at potatoe responder you will see it logs the persons name so it doesnt talk to the same person twice in a row
t3h ub3r k1tten
2006-09-23 01:18:54
*gets idea*
Maybe ill make a script that will have one response, and no time limiter, :P
it will have one player vpc somewhere, ill have others nearby, and itll be an endless loop of them saying the same phrases over and over, and people will say: wtf?
Then Ill have some guy report them all till he becomes a lvl 3 jmod lol.
invisible
2006-10-02 21:12:57
i see how this helps but im not really one to learn by example can someone please create a tutorial for this?
edit: what if you reply to yourself?
other player:hi
you:hello
you:hey
you:hi
you:yo
etc
etc
botmaster
2006-10-28 17:48:06
This is awesome and could possibly be the start of a 4th generation SCAR script family. Scripts could become so fricking humanlike its not even funny… :eek:
Like, make a dichotomous language detection key with several filters in front to filter people already replied to and yourself. Then use the key to search through all the possible responses, and generate sentences using english/french/german/spanish/l337 language and grammar rules. :wink:
The process would involve reconstructing part of an entire language though… But just imagine the possibilities. You could stay logged in, talk to jmods, regular mods, or people that are pissed at you :D .
lardmaster
2006-10-29 12:39:58
about errors of responding multiple times to people, my songsinger stores all of the usernames of the people its talked to,the number of responses its given, and the last time since its talked to that player. i have three different categories, normal, bored, and bugged. the first response is normal, the next two bored, and the fourth is bugged. after that it wont respond to that player anymore. it also checks if its responded to a player in the last ten seconds, thus eliminating the 'lol', 'lol','lol','lol','lol' syndrome. maybe i could identify different types of questions/comments later and respond to them appropriatly, i tried to make my responses as universal as posible, including about a fifth "Lol"'s.
i am looking into megahal, and it seems to work pretty good, but for some reason, getsentance doesnt seem to be working
bullzeye95
2007-09-04 19:28:51
From: JackLKrawl
THANKYOU SO much. I'm going to have a hell of a lot of fun with this one, +rep to you, and now I'm going to get mass spammed for being a 'leecher' since this is my 25th post.
How? You're gonna script with it, correct? 'Cause that's great!
Smartzkid
2007-09-04 19:33:11
10-29-2006, 12:39 PM
*cough*
Gama-Bomb
2007-09-05 02:01:38
Thanks alot
bballoakie
2007-09-09 20:03:01
Mhhm, Potatoes, I like potatoes. I do like how you threw some randomness into the sayings.
jhildy
2007-09-11 21:06:50
[YELL]STOP BUMPING OLD TOPICS!!!!![/YELL]
Seriously though this topic is over a year old and gravedigging is against the rules.