SRL Archive - RS3 Outdated / Broken Scripts

AutoRespondZor(...); by masterkill


MasterKill

2007-09-25 14:40:08

AutoResponder(…);

heey guys, this is a auto responder i made. i think some 'starting' scripters can use this in there scripts, easy to use.

The Responder:

to use the responder you need to place this in your script:
{*******************************************************************************
Function AutoResponder(FindText, SayText: TStringArray; LookInLastIntegerLines: integer):Boolean;
By: MasterKill.
Description: If Found the FindText then random say one of the SeyTexts
Use: AutoResponder(['bot','auto','macro'], ['im not an bot!','im not ' +PlayerName,'whats that?'], 2);
Error: Use 'PlayerName' on own risk! scars GetTextAt is a lil buggy
*******************************************************************************}
var
PlayerName: String;
Function AutoResponder(FindText, SayText: TStringArray; LookInLastIntegerLines: integer):Boolean;
var
textx, texty, Ymod, GetNameTrys, Coordspace, SRT, R: Integer;
TextSayd, TextFound: String;
begin
If (LookInLastIntegerLines > 8) then
begin
WriteLn(' auto respond [ERROR] Wrong >LookInLastIntegerLines< not setted up correct:');
WriteLn(' error in Respond: ' + FindText[0]);
exit;
end;
case LookInLastIntegerLines of
1: Ymod := 441;
2: Ymod := 428;
3: Ymod := 414;
4: Ymod := 400;
5: Ymod := 386;
6: Ymod := 372;
7: Ymod := 358;
8: Ymod := 344;
end;
For R := 0 To (GetArrayLength(findtext)-1) Do
begin
if IsTextInAreaEx(8, Ymod, 291, 461, textx, texty, FindText[R], 12, smallchars, False, True, 0, 1, 16711680) then
begin
Coordspace := Texty;
//writeLn(IntToStr(Coordspace));
PlayerName := '';
Repeat
PlayerName := GetTextAtEx(12, (Coordspace), 0, SmallChars, False, False, 0, 5, 0, 40, False, tr_AllChars)
If Not (playerName = '') then Break;
GetNameTrys := GetNameTrys + 1;
Until not (PlayerName = '') or (GetNameTrys > 5)
Wait(2000);
if (Pos(Players[CurrentPlayer].Nick, PlayerName) > 0) then exit;
Result := True;
respzz := True;
SRT := Random(GetArrayLength(SayText));
TypeSend(SayText[SRT]);
TextSayd := SayText[SRT];
TextFound := FindText[R];
responds := responds + 1;
WriteLn(' -Auto Respond');
If (Trim(PlayerName) = '') then
begin
PlayerName := 'Anonymous:';
WriteLn(' not found player name');
end;
WriteLn(' ' + Trim(PlayerName) +' ' + TextFound);
WriteLn(' ' + Players[CurrentPlayer].Name + ': '+ TextSayd);
WriteLn(' -Auto Respond');
If (PlayerName = 'Anonymous:') then
begin
Case Random(3) Of
0: PlayerName := 'dude'
1: PlayerName := 'sir'
2: PlayerName := 'noob'
end;
end;
end;
If (Result = True) then exit;
end;
end;

WARNING!

you CAN NOT have the same 'findtext' as 'saytext'! couse then it would be reacting to it self! so make sure 'findtext' (is not the same / is not a part of) 'seytext'



Gl and post comments plz! :D

Dumpin

2007-09-25 15:22:21

First Post w00t :P
nice.. though I don't understand everything but I will… Later.. :P

good job

ShowerThoughts

2007-09-25 15:25:11

this must be owning nice one ;)

MasterKill

2007-09-25 16:12:17

thanks, i hope this will help some people :)

upmar

2007-09-26 12:03:36

Whats ewa lol?

MasterKill

2007-09-26 12:32:25

some dutch poeple say that ;) (i don't)

Rikje

2007-09-26 13:06:40

ewo = someting like hello!.

@masterkill, accactly only kisrten says ewa to everybody. and i mostlenly i say it to here :p. i rofl about it to see it here :).

Wizzup?

2007-09-26 14:26:11

You can use TextCoords. :)
Try getting the text once (s := GetTextAtEx), then loop that string through alot of things you'd like to respond on, with (Pos(sometext, s) <> 0).

ShowerThoughts

2007-09-26 14:27:52

did i said ewo i said owning thats omthing diff ;)

Dumpin

2007-09-26 15:36:21

@ herpie

he meaned the post of upmar

Markus

2007-09-26 16:12:25

Let it check for it's own name before responding. Do a split at the :, if the text before is players[currentplayer].name then exit; so it cant respond to itself :)

MasterKill

2007-09-26 16:45:00

From: Markus
Let it check for it's own name before responding. Do a split at the :, if the text before is players[currentplayer].name then exit; so it cant respond to itself :)


yes i allready was thinking of a procedure like that, and i think i know how to do that. but first i got some other stuff to do. so i might do that later. this is just a 'simple' and working responder.



From: rikjess
ewo = someting like hello!.

@masterkill, accactly only kisrten says ewa to everybody. and i mostlenly i say it to here :p. i rofl about it to see it here :).


i can't get it out of my head :) stupid kirsten ;)

EvilChicken!

2007-10-10 16:40:30

Your siggy = t3h 0wn4g3!:sasmokin:

MasterKill

2007-10-11 01:06:26

lol thanks :) it was hard work ;)

P1nky

2007-10-11 19:53:31

looks good but hey lol idk??? what to do -.-

what will it respond too dude and which goes 1st
function or the responder

MasterKill

2007-10-12 01:11:31

AutoRespondZor('look for this text', 'random this saytext 1', 'random this say text 2', 'random this say text 3', {look in last ? chat lines (1 - 8)});

mastaraymond

2007-10-12 02:59:03

From: MasterKill
AutoRespondZor('look for this text', 'random this saytext 1', 'random this say text 2', 'random this say text 3', {look in last ? chat lines (1 - 8)});


You should use a array of strings as parameter.. ['random this say text 1','random this say text 2','random this say text 3'] That allows you to say like 10 random texts..

MasterKill

2007-10-12 05:26:55

yea maybe i'll add that ;)

Negaal

2007-10-12 15:00:47

zzz… why isn't any talking functions added to SRL, this one looks nice, altough it may reply if it will see currentplayer name(now fixed?), please, i'll be happy when someone adds something like this to SRL core


edit: really can't understand anything about smallchars, tradechars, etc…:D:D:D

MasterKill

2007-10-12 15:03:08

yea i'll take a look at that soon ;)

'lan party first :D'

MasterKill

2007-11-20 13:19:44

UPDATED.

hyper version.

(was allready released for srl members)