SRL Archive - OSR Help

Autoresponder


nielsie95

2007-02-10 11:34:51

Hi,

I'm very new to scripting and i'm learning (for now) by looking into scripts and copy and paste moste of the parts into new ones. It's going slow, but i do learn from it :)

Now i would like to add an AutoResponder…
I looked in the SRL includes: The only usefull thing i found there was 'InChat' and 'IsChatMessage'. Wool has used those in his Responder and i do understand how to use them, but they dont work?

So i searched in scripts with an autoresponder in it. However im not a very good scripter yet and i cant understand most of the responders that are used (Juniors Aircrafter, Charms WillowRaper). One of the more simple I do understand, is the one from Wools Powerminer..

It would be very helpfull if someone could explaine me how the Responders are made/used..

Thank You

whales

2007-02-10 12:35:26

Basically auto responders use an arrays of words.. If they get an in chat message of Hi, for example, then it will randomly choose one of the words from an array and then type it out.. Thats the basics of it. I would recommend looking at Charm's Willow Rapper for a good example of an auto responder.

MasterKill

2007-09-13 14:11:55

R U KIDDING ME? :D

i got one but i think it's a lil to advanced for a begining scripter, so i'll post the whole thing ;)

IsTextInAreaEx({x1}, {y1}, {x2}, {y2}, textx{add to var}, texty{add to var}, {look for this text}, 12, smallchars, False, True, 0, 1, {TextColor})))



<———————————————————–>



it's looking in the last 2 line's for text to respond to. if you use it don't forget to credit me ^^

Function AutoRespondByRick (FindText, SayRandomText1, SayRandomText2, SayRandomText3 : string):Boolean;
var
textx, texty: Integer;
TextSayd : String;
TextFound : String;
begin
if (not (IsTextInAreaEx(8, 428, 291, 461, textx, texty, FindText, 12, smallchars, False, True, 0, 1, 16711680))) then
begin
exit;
end else
begin
Result := True;
Case Random (3) of
0: begin
Typesend(SayRandomText1);
TextSayd := SayRandomText1
end;
1: begin
Typesend(SayRandomText2);
TextSayd := SayRandomText2
end;
2: begin
Typesend(SayRandomText3);
TextSayd := SayRandomText3
end;
end;
TextFound := FindText
WriteLn('- - - Auto Respond By MasterKill - - -');
WriteLn('- MrX: ' + TextFound);
WriteLn('- ' + Players[CurrentPlayer].Name + ': '+ TextSayd);
WriteLn('');
end;
end;




use like this:

Procedure AutoRespond;
begin
AutoRespondByRick('Hi','yoo','yo','ewa');
AutoRespondByRick('Noob','stfu','look at yourself','u r');
AutoRespondByRick('Haha','lol','rofl','not funny');
AutoRespondByRick('Total','look it up','look in hi-scores','not telling');
end;



AutoRespondByRick('look for text', 'random say 1', 'random say 2', 'random say 3');

EDIT:

REMEMBER: if the ('LookForText' = the same as 'random say x') then it will respond to him self!

ShowerThoughts

2007-09-13 14:14:29

omg nice bump! man this was nielsjie when he begon lol
and he should get nub points not he is one but other wise we lie to the system

JuKKa

2007-09-13 15:21:37

From: MasterKill
R U KIDDING ME? :D

i got one but i think it's a lil to advanced for a begining scripter, so i'll post the whole thing ;)

IsTextInAreaEx({x1}, {y1}, {x2}, {y2}, textx{add to var}, texty{add to var}, {look for this text}, 12, smallchars, False, True, 0, 1, {TextColor})))



<———————————————————–>



it's looking in the last 2 line's for text to respond to. if you use it don't forget to credit me ^^

Function AutoRespondByRick (FindText, SayRandomText1, SayRandomText2, SayRandomText3 : string):Boolean;
var
textx, texty: Integer;
TextSayd : String;
TextFound : String;
begin
if (not (IsTextInAreaEx(8, 428, 291, 461, textx, texty, FindText, 12, smallchars, False, True, 0, 1, 16711680))) then
begin
exit;
end else
begin
Result := True;
Case Random (3) of
0: begin
Typesend(SayRandomText1);
TextSayd := SayRandomText1
end;
1: begin
Typesend(SayRandomText2);
TextSayd := SayRandomText2
end;
2: begin
Typesend(SayRandomText3);
TextSayd := SayRandomText3
end;
end;
TextFound := FindText
WriteLn('- - - Auto Respond By MasterKill - - -');
WriteLn('- MrX: ' + TextFound);
WriteLn('- ' + Players[CurrentPlayer].Name + ': '+ TextSayd);
WriteLn('');
end;
end;




use like this:

Procedure AutoRespond;
begin
AutoRespondByRick('Hi','yoo','yo','ewa');
AutoRespondByRick('Noob','stfu','look at yourself','u r');
AutoRespondByRick('Haha','lol','rofl','not funny');
AutoRespondByRick('Total','look it up','look in hi-scores','not telling');
end;



AutoRespondByRick('look for text', 'random say 1', 'random say 2', 'random say 3');

EDIT:

REMEMBER: if the ('LookForText' = the same as 'random say x') then it will respond to him self!


ONE NICE BUMP!
02-10-2007 <— Z0mG!

MasterKill

2007-09-13 16:05:01

*confused* :confused:

lol it was standing at 'similair treads' so i thought that was a lil 'up to date' sorry :P

ShowerThoughts

2007-09-13 16:28:39

gratz *gives a cup* you won the best bumper of the month price a app for masterkill*app*

MasterKill

2007-09-14 01:16:54

W00T :) next time i'll check the date first ;)

nielsie95

2007-09-14 07:13:10

Hehe, thanks.. But I already made my own responder (right, The Claw? :p) ;)

MasterKill

2007-09-14 10:53:55

hell yes i'm sure of that :p

i saw your responder to (2000 lines?). but i thought you where jk'ing to show noob's how to ask some stuff :) but 'simulair treads' is not 'up to date' ;)

SORRY :D

The Claw

2007-09-15 04:27:51

From: nielsie95
Hehe, thanks.. But I already made my own responder (right, The Claw? :p) ;)


its pretty good too :spot: