View Full Version : My AutoResponder... problem
Jason2gs
02-19-2007, 01:54 AM
I'm currently putting together a nice autoresponder. One problem.
If someone says the word "Hi" to me, I will respond with one of three phrases, either hello, sup, or whats up.
But let's say I have one of my replies the same as one of the phrases that someone can ask, there's a chance I'll reply to one of my own answers!
My question is if there's a way around this. I have no idea what to look for, I just want to fix it before it's a problem.
Please write,
Mike.
Infantry001
02-19-2007, 02:04 AM
Here is something from Fawki's PotatoeResponder:
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
else
begin
Put that at the beginning of your AUtorespond procedure, and it will skip any line that has 'yo' (you) or your Player Nickname.
Jason2gs
02-19-2007, 02:06 AM
Thanks inf :D
People in this community are really helpful!
Infantry001
02-19-2007, 02:10 AM
Glad to help :D
Jason2gs
02-19-2007, 02:17 AM
Wait, before you leave.
I put that at the begining of my procedure as it is, (I did put 'uby' in place of 'yo'), but it didn't seem to work. Am I supposed to doctor it up at all?
Infantry001
02-19-2007, 02:26 AM
What do you mean by uby?
you have to add the variables OldLine,NewLine,TheName,and Theline, and you put your responding stuff after the whole thing i listed up there
Jason2gs
02-19-2007, 02:30 AM
'uby' is the nickname to the account I'm testing this on. Am I not supposed to replace that with my nickname?
So is this right?
program AutoResponder;
{.include SRL/SRL.scar}
var
wclevel, OldLine, TheName, TheLine, NewLine : integer;
procedure AutoRespond;
begin
SetupSRL;
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('uby', TheName) <> 0) or (pos(Players[CurrentPlayer].Nick, TheName) <> 0)then
begin
end
else
begin
/////////// AutoRespond Start //////////
Infantry001
02-19-2007, 03:06 AM
o no leave that as 'yo'. That is part of the word 'you' so it wont take into effect anything such as "You found an emerald!" or anything like that.
Jason2gs
02-19-2007, 03:11 AM
Ohhh... That's not exaclty what I'm looking for.
I want it to ignore anything I type.
So I should put in both 'yo' and 'uby'? How can I do that?
Infantry001
02-19-2007, 04:16 AM
No it will work because it also has pos(Players[CurrentPlayer].Nick, TheName) <> 0)
Jason2gs
02-19-2007, 04:29 AM
Kk. It still doesn't seem to work. I tried it before. Here...
program AutoResponder;
{.include SRL/SRL.scar}
var
wclevel : integer;
procedure AutoRespond;
begin
SetupSRL;
/////////// AutoRespond Start //////////
Can you please put it in? I can't seem to be able to get it =/
Infantry001
02-19-2007, 04:37 AM
Look at this tut: http://www.srl-forums.com/forum/potatoresponder-t1310.html?t=1310
Jason2gs
02-19-2007, 04:38 AM
Thanks =D
Sorry for all of my questions today. There have been a lot of them =O
Jason2gs
02-19-2007, 04:48 AM
I keep getting this 'Identifier Expected' error =/
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
Infantry001
02-19-2007, 05:03 AM
did you declare the variables?
Jason2gs
02-19-2007, 05:06 AM
Declaring the variables? I tried, but it said it was duplicated, so I took them out.
Meanage
02-19-2007, 05:19 AM
if its duplicated then change it to newline2 or something
Jason2gs
02-19-2007, 05:20 AM
I'll try that =) Wish me luck.
Wait. The example on the tutorial doesn't have the variables declared.
Smartzkid
02-19-2007, 03:28 PM
I think they're declared in SRL, you might not have to...
I think the only one you need to declare is the nickname
Powered by vBulletin® Version 4.2.1 Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.