How to Auto Respond in 5 Seconds!
well, i have never made a long tutorial and this will not be the first time. My tutorials so far are always about things i think might go unnoticed.
So you have this script which works fairly fine but it doesn't have an autoresponder. What do you do?
You really have two choices. you either make a really cool autoresponder by yourself and use it or you use someone else's. but you don't want to go through the pain of meddleing in the other person's script. And this is where i can help you
I don't know how many of you have the habbit of just simply exploring your SRL folders. I do.
SCAR Code:
function FindNormalRandoms: Boolean;
var
i: Integer;
begin
for i := 1 to 9 do
begin
case I of
1: Result := SolveNonTalkingRandoms;
2: Respond;
3: Result := FindTalk;
4: Result := FindDead;
5: Result := FindLamp(LampSkill);
6: if FindBox then
Result := SolveBox;
7: Result := RC;
8: Result := FindMod;
9: if (SRL_Procs[srl_OnRandomCall] <> nil) then
SRL_Procs[srl_OnRandomCall]();
end;
if Result then
begin
if (SRL_Procs[srl_OnFindRandom] <> nil) then
SRL_Procs[srl_OnFindRandom]();
Break;
end;
//Wait(1);
end;
end;
this is in AntiRandoms.scar in /core/antirandoms.
we've all seen it before, nothing new... but notice this:
" 2: Respond; "
Now, have you ever seen srl responding just simply by itself? Think about it.... If you are not a dev then the correct answer is no
SCAR Code:
function Respond:Boolean;
Begin
Result := False;
end;
This is how Respond looks. pretty useless to us really. But the potential in it is that everytime you call FindNormalRandoms it will also call the Responder. And that responder will be in any script that uses srl
so how to get your responder into any script? Easy
Change the inside part of Respond to your responder
Respond is in srl/core/CAutoRespond.scar
Tip: Read through srl. There are actually lots of useful stuff in there
~RM