Luke L
07-18-2012, 03:45 PM
Hey all. I'm making this small autoing tutorial to help you babysit a bot. If your anything like me (working on a max cape), you don't like to leave bots alone too much. When I first joined I wanted this function, and luckily the SRL member Brandon helped me by writing it!
This tutorial will show you how to put a function into any existing script you may be using. The purpose of the function is to play a loud sound (of your choosing) from your computer speakers when it detects another person talking. That way you can watch movies, cook, play other games, etc. and not have to actually watch your script. It can also be used (for hardcore botters :stirthepot:) overnight. Simply wake up, respond to the person, world hop, and start your bot back up!
This function won't be for everyone nor for all scripts. It is geared towards scripts where you rarely have communication with anyone besides the occasional bot hunter or legit noob. Including Armoured zombies, waterfiends, wood cutting, crafting/alching at empty banks, etc!
Let's get started :spot:!
First, your going to need the function! Thanks to Brandon for letting me use this awesome function he wrote!!
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\Luke\Downloads\Alarm.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\Luke\Downloads\Alarm.wav');
wait(150);
end;
writeln(TheLine);
except end;
end;
end;
Secondly, your going to need your .wav file. You can easily google for a .wav file you want. I choose one that makes a loud obnoxious alarm noise :P. This site has many .wav alarm files , and it's safe! I chose the first one (as seen in the pic below):
>>>>>>>>>>.http://soundjax.com/alarm-1.html<<<<<<<<<<<<<<<<
http://i47.tinypic.com/2yp15yh.png
Once you pick your sound (making sure it's a .wav) save it somewhere on your computer, just make sure you know where it is!
Now is where a bit of scripting comes in. Don't worry if you have NO experience at all! Neither did I, and I was helped through this. (but feel free to poke around your script some, you might learn something :D).
The first thing we're going to do is place the function in your script by copy and pasting. Make sure you post the procedure in the script decently high up. Also, don't put it in the middle of any procedures lol, just make sure you put it in between some procedures of the script towards the top (see the last example for more reference.)
Next your going to modify the function with your own file destination information. For example, you see it says "C:\Users\Luke\Downloads\Alarm.wav" in blue? All you have to do is change that to where YOUR .wav file is located on YOUR computer. It's not too hard to find :).
tip: make sure you replace it in BOTH spots in the function I gave you - there are two!
Now you will need to post this function in your script,
procedure FindMyRandoms;
begin
FindNormalRandoms;
SomeoneTalked;
end;
just make sure it's BELOW the larger function we just put in!
And Finally, after we have the function corrected to work for you personally, now we need to make the script so that it calls the procedure correctly.
Your script should have (if it doesn't.. Idk if it's safe to use!) a function called "FindNormalRandoms". All you have to do is use Ctrl + R, then type in "FindNormalRandoms", and replace it with "FindMyRandoms". What this is doing is changing every place in the script it checks for randoms, to make it run your new procedure that checks for randoms AND checks for talking!
Here is an example of how the final product should kind of look like.
note: this is for the script I was using, so it shouldn't look EXACTLY like this. But as for the placement of the procedures, etc. - this is what you should aim for.
Procedure InitializeVariables;
begin
if (Length(Food) = 0) then
begin
SetLength(Food, 1);
Food[0]:= 'none';
end;
if (Potion = '') then
Potion:= 'none';
if (Closed = False) then
TerminateScript;
end;
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\luke\Music\ALARM.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\luke\Music\ALARM.wav');
wait(150);
end;
writeln(TheLine);
except end;
end;
end;
procedure FindMyRandoms;
begin
FindNormalRandoms;
SomeoneTalked;
end;
And there you have it! Now every time your script checks to see if you are in a random, it will also use the "SomeoneTalked" function to see if anyone has spoken in the chat (most of the time, it's to you), and if so it will then play the loud file you choose to alert you! This is also particularly helpful because a good majority of randoms cause your character to autorespond like "uh-oh!". It will also detect this, so you can manually solve the random if you wish.
Congrats , now you can go do other things - just make sure your speakers are turned up nice and loud ^.^!
Note: I am not a very good scripter, just guide writer. I am learning scripting , and this guide was made possible by the help of the SRL member Brandon, and scripting tips from Sir R. M8gic1an. There may be problems when it comes to replacing the "FindNormalRandoms" if your script doesn't have it.. I will be reworking the guide to try to fix that too. Thanks for your consideration!
This tutorial will show you how to put a function into any existing script you may be using. The purpose of the function is to play a loud sound (of your choosing) from your computer speakers when it detects another person talking. That way you can watch movies, cook, play other games, etc. and not have to actually watch your script. It can also be used (for hardcore botters :stirthepot:) overnight. Simply wake up, respond to the person, world hop, and start your bot back up!
This function won't be for everyone nor for all scripts. It is geared towards scripts where you rarely have communication with anyone besides the occasional bot hunter or legit noob. Including Armoured zombies, waterfiends, wood cutting, crafting/alching at empty banks, etc!
Let's get started :spot:!
First, your going to need the function! Thanks to Brandon for letting me use this awesome function he wrote!!
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\Luke\Downloads\Alarm.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\Luke\Downloads\Alarm.wav');
wait(150);
end;
writeln(TheLine);
except end;
end;
end;
Secondly, your going to need your .wav file. You can easily google for a .wav file you want. I choose one that makes a loud obnoxious alarm noise :P. This site has many .wav alarm files , and it's safe! I chose the first one (as seen in the pic below):
>>>>>>>>>>.http://soundjax.com/alarm-1.html<<<<<<<<<<<<<<<<
http://i47.tinypic.com/2yp15yh.png
Once you pick your sound (making sure it's a .wav) save it somewhere on your computer, just make sure you know where it is!
Now is where a bit of scripting comes in. Don't worry if you have NO experience at all! Neither did I, and I was helped through this. (but feel free to poke around your script some, you might learn something :D).
The first thing we're going to do is place the function in your script by copy and pasting. Make sure you post the procedure in the script decently high up. Also, don't put it in the middle of any procedures lol, just make sure you put it in between some procedures of the script towards the top (see the last example for more reference.)
Next your going to modify the function with your own file destination information. For example, you see it says "C:\Users\Luke\Downloads\Alarm.wav" in blue? All you have to do is change that to where YOUR .wav file is located on YOUR computer. It's not too hard to find :).
tip: make sure you replace it in BOTH spots in the function I gave you - there are two!
Now you will need to post this function in your script,
procedure FindMyRandoms;
begin
FindNormalRandoms;
SomeoneTalked;
end;
just make sure it's BELOW the larger function we just put in!
And Finally, after we have the function corrected to work for you personally, now we need to make the script so that it calls the procedure correctly.
Your script should have (if it doesn't.. Idk if it's safe to use!) a function called "FindNormalRandoms". All you have to do is use Ctrl + R, then type in "FindNormalRandoms", and replace it with "FindMyRandoms". What this is doing is changing every place in the script it checks for randoms, to make it run your new procedure that checks for randoms AND checks for talking!
Here is an example of how the final product should kind of look like.
note: this is for the script I was using, so it shouldn't look EXACTLY like this. But as for the placement of the procedures, etc. - this is what you should aim for.
Procedure InitializeVariables;
begin
if (Length(Food) = 0) then
begin
SetLength(Food, 1);
Food[0]:= 'none';
end;
if (Potion = '') then
Potion:= 'none';
if (Closed = False) then
TerminateScript;
end;
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\luke\Music\ALARM.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\luke\Music\ALARM.wav');
wait(150);
end;
writeln(TheLine);
except end;
end;
end;
procedure FindMyRandoms;
begin
FindNormalRandoms;
SomeoneTalked;
end;
And there you have it! Now every time your script checks to see if you are in a random, it will also use the "SomeoneTalked" function to see if anyone has spoken in the chat (most of the time, it's to you), and if so it will then play the loud file you choose to alert you! This is also particularly helpful because a good majority of randoms cause your character to autorespond like "uh-oh!". It will also detect this, so you can manually solve the random if you wish.
Congrats , now you can go do other things - just make sure your speakers are turned up nice and loud ^.^!
Note: I am not a very good scripter, just guide writer. I am learning scripting , and this guide was made possible by the help of the SRL member Brandon, and scripting tips from Sir R. M8gic1an. There may be problems when it comes to replacing the "FindNormalRandoms" if your script doesn't have it.. I will be reworking the guide to try to fix that too. Thanks for your consideration!