SRL Archive - General

Program to help babysit bots?


Luke L

2012-05-07 20:18:42

Hey, I'm not sure if this is even the right section to post this, but I was just having an idea. Basically now that one of my accounts is getting pretty close to max cape, I no longer am so careless botting as I used to be. I used it let it go overnight doing things like runecrafting or soulwars and just hope no one talked to me.

Now I always babysit my bots, and I just look over at my lap top every 5-10 minutes to check and see if anyone has talked to me. Usually i'm botting combat with scripts such as the ghouler or the armoured zombies. Well I was just thinking to myself how sometimes I bot zombies for 4-8 hours and no one EVER talks to me, sometimes even ever comes down there! I was thinking also, man it would be great if I could just leave my bot going overnight, it would just be so much faster.

So then I had this idea. I don't know how hard it would be, but would it be hard to make some kind of program, and all it would have to do is make the computer make a "ding" or loud alarm noise (possible send me a text via free texting services like AOL in the future) if blue text is noticed in the chat window (public chat)

That way I could leave it while I sleep, and if by chance someone DID talk to me (every few days or so i'll have a bot hunter talk to me), the computer would just ding to wake me up, I could respond to the bot hunter, handle the situation, and either hop, or resume if they left.

Is this a crazy/stupid idea, or is it worth looking into? it could be used for a ton of scripts where one is usually alone aside from the occasional bot hunter, from wood cutting in remote areas, to combat scripts like described. Let me know your input, and what you think the plausibility of my idea is. Thanks

edit: also after further development, if it does gain the ability to send a text notification, I could then just teamview my computer via my smartphone, respond to the person, and resume botting. (This would be so I can leave my bot running at home with a safe sound mind while at class, work, etc.)

Neznam

2012-05-07 20:28:23

This is possible…
If text is detected an alarm sounds and warns you.
Ive seen some people incorporating such things in their bots.
Sry I dont know how, I just know its possible.

ShawnjohnSJ

2012-05-07 20:35:52

procedure PlaySound(Sound : string);

Brandon

2012-05-07 20:42:52

Place this wherever you want the script to check talking.. Of course change the location of the file it plays.. and I think it only plays wav files but don't quote me on that. It's been a while since I wrote this.


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;

[XoL]

2012-05-07 20:46:23

If you are using Simba, I wouldn't worry too much.
You could take this a step farther and make it text you :p

Luke L

2012-05-07 20:50:50

From: Brandon
Place this wherever you want the script to check talking.. Of course change the location of the file it plays.. and I think it only plays wav files but don't quote me on that. It's been a while since I wrote this.


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;


Wow you already made it! well brandon, actually - I happen to be using your armoured zombie script - mind telling me what line to put it into :D?

also, not really sure what a wav file is, or how to get a sound wav file onto my computer :o

@guy saying that if I use simba then text wouldn't be hard,

let me know how :D!! If it actually could text, that would be a amazing. first though i'll master the sound thing, that way I can bot overnight. Hopefully brandon shows me some great insight :D!

ShawnjohnSJ

2012-05-07 21:01:17

From: Luke L
Wow you already made it! well brandon, actually - I happen to be using your armoured zombie script - mind telling me what line to put it into :D?

also, not really sure what a wav file is, or how to get a sound wav file onto my computer :o

@guy saying that if I use simba then text wouldn't be hard,

let me know how :D!! If it actually could text, that would be a amazing. first though i'll master the sound thing, that way I can bot overnight. Hopefully brandon shows me some great insight :D!


Just put it in the main loop of the script, and a .wav file is a sound file format - like .mp3.

I found a link to a beep here: http://www.soundjay.com/button/beep-2.wav

Luke L

2012-05-07 21:08:58

From: ShawnjohnSJ
Just put it in the main loop of the script, and a .wav file is a sound file format - like .mp3.

I found a link to a beep here: http://www.soundjay.com/button/beep-2.wav


yeah I knew the file type thing, I did a bit of searching. i'm going to try to find a loud long one :D.

also, how exactly do I put it into the main loop? (I'm just barely learning the basics of scripting at this point :p…) I'm afraid i'm going to put it somewhere that messes something up :p! Also, so how often will it check? (another words, will I have a reasonable response time to any questions if I get on the computer pretty fast)

Sorry for so many questions, I just always want to know a lot of things..thirsty for knowledge I suppose :).

ShawnjohnSJ

2012-05-07 21:14:47

From: Luke L
yeah I knew the file type thing, I did a bit of searching. i'm going to try to find a loud long one :D.

also, how exactly do I put it into the main loop? (I'm just barely learning the basics of scripting at this point :p…) I'm afraid i'm going to put it somewhere that messes something up :p! Also, so how often will it check? (another words, will I have a reasonable response time to any questions if I get on the computer pretty fast)

Sorry for so many questions, I just always want to know a lot of things..thirsty for knowledge I suppose :).


Put it in a while loop and it stop it when a key is pressed, for example:

Code removed

If you put it in the main loop, on any normal good script the sound should play quickly (within a second or two, maybe a few more). I can't help you with exactly where to put it because I don't have the source to the script your using.


Edit: Actually, I wouldn't use that because it would stop the rest of your script. Just use a flag for example:

if(playSound) then
PlaySound(path);
if(IsFKeyDown(6)) then
playSound := false;

Luke L

2012-05-07 21:20:13

From: ShawnjohnSJ
Put it in a while loop and it stop it when a key is pressed, for example:

Code removed

If you put it in the main loop, on any normal good script the sound should play quickly (within a second or two, maybe a few more). I can't help you with exactly where to put it because I don't have the source to the script your using.


Edit: Actually, I wouldn't use that because it would stop the rest of your script. Just use a flag for example:

if(playSound) then
PlaySound(path);
if(IsFKeyDown(6)) then
playSound := false;


you lost me o.o,

But I can tell you this. All I want it to do is play the sound, then I'll click on my laptop so the screen turns on, click to turn the bot off anyways to talk to the person. Then i'll start the script up again after I world hop from them, or just start the script if they leave. So it wouldn't really matter if it stopped the scripts normal actions, so long as It played the sound when it needed it ^.^

Brandon

2012-05-07 21:31:38

This is an example usage. You are not restricted to using it like this.. It can be called at anytime, anywhere. I usually called it everywhere that I called FindNormalRandoms;


{$DEFINE SMART}
{$I SRL/SRL.Simba}

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;


Procedure MainLoop;
begin
//attack zombies;
someonetalked;
//killwaterfiends;
someonetalked;
//do anything
someonetalked;
end;

begin
//Setupsmart stuff here..
SetupSRL;

Repeat
MainLoop;
SomeoneTalked;
Until(false);
end.

Luke L

2012-05-07 21:35:47

From: Brandon
This is an example usage. You are not restricted to using it like this.. It can be called at anytime, anywhere. I usually called it everywhere that I called FindNormalRandoms;


{$DEFINE SMART}
{$I SRL/SRL.Simba}

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;


Procedure MainLoop;
begin
//attack zombies;
someonetalked;
//killwaterfiends;
someonetalked;
//do anything
someonetalked;
end;

begin
//Setupsmart stuff here..
SetupSRL;

Repeat
MainLoop;
SomeoneTalked;
Until(false);
end.


yay brandon is back! Ok I got a .Wav file of a good long alarm. I can replace that in the first code you gave me, but what line of your zombie killer do you recommend that I place it for the best use? and I guess by 'best use' I mean, that will alert me when someone talks relatively quickly (within a minute or two I suppose)?

Thanks brandon :D!! also , I'm using your version 1.94 I believe, the newest one. Just tell me what line to paste that first code into ^.^!

edit: no longer using v1.94 because of crazy camera angle spinning (read about it in your forum post for the bot). But anyways, yeah hope you check this soon - still not sure how to implement this thing. I read the code above you have, but it is all giberish to me :D. (I don't know how to do much scripting wise, besides copy pasting what your first code post was, into what line you say :p)

Sir R. M8gic1an

2012-05-08 13:55:03

If I were you I wouldn't put it in the main loop. Sometimes it can take ages to actually reach the main loop. Best thing to do is to put it inside your randoms procedure. If the script calls FindNormalRandoms you have two options:

Open your SRL Randoms file, and add it to FindNormalRandom's case, or in the script:

procedure FindMyRandoms;
begin
FindNormalRandoms;
SomeoneTalked;
end;

and then substitute all FindNormalRandoms for FindMyRandoms

~RM

Echo_

2012-05-08 15:31:27

This is a cool idea, if you were to write a client/server that sends your phone a notification when someone says something to you ingame (text recognition and Simba's socket functions :)). Then you could send a response back to the server (Simba) whether to send a message from the client to be typed or switch worlds or something.

Recursive

2012-05-08 15:39:08

From: Echo_
This is a cool idea, if you were to write a client/server that sends your phone a notification when someone says something to you ingame (text recognition and Simba's socket functions :)). Then you could send a response back to the server (Simba) whether to send a message from the client to be typed or switch worlds or something.


I like where this is going. That would be pretty cool if simba could incorporate some keywords that would represent procedures in the client. For example if you text "sw80" could mean switch to world 80 or if you text 're "message"' it will type the message you texted from your phone into simba.

But who am I kidding, this will cost come real mullah to implement into the program code and not talking about security issues escalating from the use of mobile devices to communicate with the program. Talk about mass hacking kinda like the story of Gh0st on Pb.

Echo_

2012-05-08 15:44:46

From: Chig
I like where this is going. That would be pretty cool if simba could incorporate some keywords that would represent procedures in the client. For example if you text "sw80" could mean switch to world 80 or if you text 're "message"' it will type the message you texted from your phone into simba.

But who am I kidding, this will cost come real mullah to implement into the program code and not talking about security issues escalating from the use of mobile devices to communicate with the program. Talk about mass hacking kinda like the story of Gh0st on Pb.


The server-sided code could be written in a Simba include using sockets and then included into the script. The client however would have to be written in Java or a language that can be used on the smart phone.

Recursive

2012-05-08 15:52:02

So are you saying that this is do-able? Don't raise my hopes man! I'm fragile

Brandon

2012-05-08 16:06:19

@the guy above yes you can do it..

@Luke do what magician said. Implement it into findrandoms. Follow his exact instructions and it will never fail you.

Luke L

2012-05-08 17:17:00

From: Sir R. M8gic1an
If I were you I wouldn't put it in the main loop. Sometimes it can take ages to actually reach the main loop. Best thing to do is to put it inside your randoms procedure. If the script calls FindNormalRandoms you have two options:

Open your SRL Randoms file, and add it to FindNormalRandom's case, or in the script:

procedure FindMyRandoms;
begin
FindNormalRandoms;
SomeoneTalked;
end;

and then substitute all FindNormalRandoms for FindMyRandoms

~RM


Hey thanks for taking the time to give a detailed answer! I think i'm going to go with the placing it in the SRL random's file. So where exactly do I find that? and so I just put in the procedure "SomeoneTalked" that Brandon posted before? Thanks =)!

Recursive

2012-05-08 17:35:03

He is saying that in your script, add this code to it; it doesn't matter where, you add it just as long as it is somewhere within the majority of the body of code:


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('directory to the sound file');
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('directory to the sound file');
wait(150);
end;
writeln(TheLine);
except end;
end;
end;

And also add this to anywhere in your code but make sure it is below the above:

procedure FindMyRandoms;
begin
FindNormalRandoms;
SomeoneTalked;
end;

Then go through the code and anywhere you see FindNormalRandoms, delete that and instead write in FindMyRandoms.

OR the other option will be to copy the SomeoneTalked procedure and paste it into the FindNormalRandoms procedure; in which case you don't need to do that I did above and can just leave the code as it is.

Brandon

2012-05-08 17:40:04

From: Luke L
Hey thanks for taking the time to give a detailed answer! I think i'm going to go with the placing it in the SRL random's file. So where exactly do I find that? and so I just put in the procedure "SomeoneTalked" that Brandon posted before? Thanks =)!



Magicians Instructions Broken down:

1. Open your favourite script.
2. Put the SomeoneTalked somewhere near the top. Preferably AFTER declareplayers procedure and all variables.

3. After Someone Talked, Create a Procedure exactly like Magicians.
4. Press Ctrl + R. Type "FindNormalRandoms" And Replace it with FindMyRandoms;

Examples:


Procedure DeclarePlayers;
begin
//yeah yeah script asks for username and stuff here usually.
end;

//script has some variables or whatever else..

Function ScriptsFirstFunction: ReturnValue;
begin
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\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;

Procedure FindMyRandoms;
begin
//All the stuff magician said goes here.
end;

//Press Ctrl + R and Replace FindNormalRandoms With FindMyRandoms; Press Yes To Replace ALL.
//Check that FindMyRandomsProcedure has random checking.

Luke L

2012-05-08 17:58:28

From: Brandon
Magicians Instructions Broken down:

1. Open your favourite script.
2. Put the SomeoneTalked somewhere near the top. Preferably AFTER declareplayers procedure and all variables.

3. After Someone Talked, Create a Procedure exactly like Magicians.
4. Press Ctrl + R. Type "FindNormalRandoms" And Replace it with FindMyRandoms;

Examples:


Procedure DeclarePlayers;
begin
//yeah yeah script asks for username and stuff here usually.
end;

//script has some variables or whatever else..

Function ScriptsFirstFunction: ReturnValue;
begin
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\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;

Procedure FindMyRandoms;
begin
//All the stuff magician said goes here.
end;

//Press Ctrl + R and Replace FindNormalRandoms With FindMyRandoms; Press Yes To Replace ALL.
//Check that FindMyRandomsProcedure has random checking.


ok perfect, I can do that :D! I'll try to implement all that now. Only question, what do you mean at the bottom by checking that FindMyRandomsProcedure has random checking? How do I check that :)? thanks! I'll get crackin on this other stuff.

Brandon

2012-05-08 18:02:43

From: Luke L
ok perfect, I can do that :D! I'll try to implement all that now. Only question, what do you mean at the bottom by checking that FindMyRandomsProcedure has random checking? How do I check that :)? thanks! I'll get crackin on this other stuff.


Ahh you see when your press CTRL + R, it replaces all occurrences of whatever you are replacing.

Basically after replacing all of them via CTRL + R.. Just go back to the FindMyRandoms Procedure and make sure that FindNormalRandoms is in there.

Luke L

2012-05-08 18:21:25

From: Brandon
Ahh you see when your press CTRL + R, it replaces all occurrences of whatever you are replacing.

Basically after replacing all of them via CTRL + R.. Just go back to the FindMyRandoms Procedure and make sure that FindNormalRandoms is in there.

Ok i think I did it! I did the CTRL R thing and replaced them all, and doubled checked. It replaced them all, besides in the part where he gave me I guess. Here is what I did… i put those procedures after InitializeVariables procedure (it's your zombies script). Here is what I did…

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;

does that look right o.o?

Brandon

2012-05-08 18:25:58

Looks fine to me. Everytime SOS is called, it will check who talked. If someone did, it will play that sound. Now do that for all the scripts you want..

Luke L

2012-05-08 18:34:38

From: Brandon
Looks fine to me. Everytime SOS is called, it will check who talked. If someone did, it will play that sound. Now do that for all the scripts you want..


ok wow cool, I'll see if it actually works. I may have did something wrong with that file name - we shall see.

Either way….Just thanks a lot. I know this is probably really taxing, and I am such a total scripting noob that you even had to explain the most basics. I promise I'll keep doing my research lol, just know it's much appreciated :D.

sm321

2012-05-09 05:47:31

What not just use a "read text box" type function, that if it detects speaking, use the quick chat saying something like "I am training Strength.", "My strength level is 99.", "What is your level in Strength?". Just things like that, and if there is one, one that says something like "I will be AFK." or "I am unable to speak.".

Sir R. M8gic1an

2012-05-09 07:17:32

The other way, where you'll never have to edit your scripts again is going to your core/anti-randoms/antirandoms.simba and editing FindNormalRandoms itself.

https://github.com/SRL/SRL-5/blob/master/srl/core/antirandoms/antirandoms.simba

That way, this change will be applied to all your scripts without you ever having to worry about it again. (Do notice that if you update your SRL it'll be overwritten, so I suggest you keep it in a separate file too).

Considering the overwriting issue, there is no real easier or harder solution imo. But the AntiRandoms file doesn't get updated that often, so it might last a long time ;)

-RM

Luke L

2012-05-09 12:49:23

From: Sir R. M8gic1an
The other way, where you'll never have to edit your scripts again is going to your core/anti-randoms/antirandoms.simba and editing FindNormalRandoms itself.

https://github.com/SRL/SRL-5/blob/master/srl/core/antirandoms/antirandoms.simba

That way, this change will be applied to all your scripts without you ever having to worry about it again. (Do notice that if you update your SRL it'll be overwritten, so I suggest you keep it in a separate file too).

Considering the overwriting issue, there is no real easier or harder solution imo. But the AntiRandoms file doesn't get updated that often, so it might last a long time ;)

-RM


wellllll actually - here is the problem with what your saying. (which btw I did it the other way you suggested to edit the script itself, and it's working great!, see example below :D )

but the problem with that is, I only want this function in scripts that I never see anyone besides from the occasional bot hunter, or very rare curious legitter. For example, fighting ghould, or cutting trees in remote areas. I don't want it to be on everything, because then scripts like runecrafters who often bank, would make the alarm go crazy from people talking amongst themselves at the bank.

So Yup I elected to go with implementing it just in the script I wanted, and it works like a charm! just a few minutes ago it worked for the first time (no one had talked until today :p), and i was making breakfast, when I heard "WAHHH-WAHHHH" so I went into my room to check the computer, and some guy was like "hey, what are you training?" so I just stopped the bot, and told him, talked for him for a bit, and then said gtg, and world hopped. Wa-lah :)!

Syntax

2012-05-30 20:02:06

Alarm sounds like a good idea, while your awake though and away from the computer you can use teamviewer if u have a android or ios device.