SRL Archive - RS3 Script Requests

Talker alarm


Reveille

2012-01-04 14:58:42

I've been trying to make a script myself that would warn you if someone was talking, however I'm still learning and couldn't get it to work at all so I'm putting the idea out there.

Its main use would be for those who bot in secluded areas either fighting, livid farm, etc… so you don't have to babysit. You would just run the bot you want and set the client to the bot that's already running on SMART.

The idea is that if someone talks, the script will set off an alarm alerting you to check your character. And then press a key like the space bar to reset it until someone talks again. It would be well worth it to have a script like this, easy to maintain and add features and maybe even implement inside other scripts. I know I have wanted something like this for a while and I'm sure it would benefit many others as well.

I'm sure its fairly easy to do but I couldn't get the functions to work. Maybe someone else will have more luck.

PatDuffy

2012-01-04 15:02:25

It would be much easier to set this as a function inside the scripts, or possibly the SRL include. Then, you could make the script automatically check for chat, which is quite easy to do in itself.

I know there's a way to make it play sounds, I've never done it though.

Mat

2012-01-04 15:23:11

http://villavu.com/forum/showthread.php?t=36824&highlight=playsound
:)

Brandon

2012-01-04 15:26:34

I use this.. and I call it after every procedure in my main loop.. it'll play the sound 5 times so that it gets your attention for sure..

Procedure SomeoneTalked;
var
I: Integer;
begin
FixChat;
OldLine := TheLine;

if(LastChatter(TheName))then
begin
GetLastChatText(TheLine);
if OldLine <> TheLine then
try
For I:= 0 To 5 do
begin
PlaySound('C:\Users\Brandon\Downloads\MSN_Sound.wav');
wait(150);
end;
writeln(TheLine);
except end;
end else
begin
GetLastChatText(TheLine);
if OldLine <> TheLine then
try
For I:= 0 To 5 do
begin
PlaySound('C:\Users\Brandon\Downloads\MSN_Sound.wav');
wait(150);
end;
writeln(TheLine);
except end;
end;
end;

Reveille

2012-01-04 17:31:37

Thanks a lot ggzz, I was able to tinker around with that a little bit to get a desired result. I hope it can help others.

JN13

2012-01-05 00:32:47

Thank you, this has been my project all day today to figure this out. its nice to have u know?

Reveille

2012-01-12 15:22:37

ggzz, if i put repeats inside your code and run it as just that script will there be any memory leak? My computer sounds like its trying to work hard when I run it, I'm sure if i wait a second before repeat it would be more efficient?

program TalkerAlarm;
{.include SRL/SRL.scar}
Const
//The path of the file including the extension (ex: 'C:\Simba\Includes\SRL\SRL\misc\untitled.wav')
THESONG = 'C:\Simba\Includes\SRL\SRL\misc\untitled.wav';

Procedure SomeoneTalked;
begin
repeat
FixChat;
OldLine := TheLine;

if(LastChatter(TheName))then
begin
GetLastChatText(TheLine);
if OldLine <> TheLine then
try
begin
PlaySound(THESONG);
wait(150);
end;
writeln(TheLine);
except end;
end else
begin
GetLastChatText(TheLine);
if OldLine <> TheLine then
try
begin
PlaySound(THESONG);
wait(150);
end;
writeln(TheLine);
except end;
end;
until(false);
end;

begin
SomeoneTalked;
end.