SRL Archive - General Botting Help

conversationBox question


Spaceblow

2014-08-08 06:22:34

Unfortunately, I have another problem. I'm making a procedure that makes the player run from the bank to a place where it can pick up redberries. Because it's just a level 3 account it gets a message when it wants to go through the door at Varrock east because it may be dangerous out there. I want to make it continue so it can run to its destination. My plan is to make it run from the bank to just behind the door so the conversation box would show up. Make it click continue and everything it needs to disappear. Then make a new path to the redberries so it can run further from there. This is what I have so far:

procedure runToRedberries();
var
pathToRedberries: TPointArray;
begin
if not isLoggedIn() then
exit;

pathToRedberries := [Point(100, 70), Point(101, 47), Point(112, 38), Point(127, 38), Point(142, 40), Point(159, 39), Point(172, 39), Point(192, 39)];
SPS.walkPath(pathToRedberries);
if conversationBox.findChat(['you are now leaving the starting area. Outside the starting area, things can get more dangerous.']) then
begin
wait(randomRange(350, 750));
conversationBox.continue(true, true);
writeLn('We continued');
end;
// and then some stuff to make it run to its destination
end;

So it has to continue when the following shows up, but it doesn't:



I've recently installed the Direct-X plugin but I don't think that would be causing the problem, would it? I hope anyone could help me as fast as possible so I could get to work again, thanks in advance. :)

The Mayor

2014-08-08 06:25:59

From: Spaceblow
Unfortunately, I have another problem. I'm making a procedure that makes the player run from the bank to a place where it can pick up redberries. Because it's just a level 3 account it gets a message when it wants to go through the door at Varrock east because it may be dangerous out there. I want to make it continue so it can run to its destination. My plan is to make it run from the bank to just behind the door so the conversation box would show up. Make it click continue and everything it needs to disappear. Then make a new path to the redberries so it can run further from there. This is what I have so far:

procedure runToRedberries();
var
pathToRedberries: TPointArray;
begin
if not isLoggedIn() then
exit;

pathToRedberries := [Point(100, 70), Point(101, 47), Point(112, 38), Point(127, 38), Point(142, 40), Point(159, 39), Point(172, 39), Point(192, 39)];
SPS.walkPath(pathToRedberries);
if conversationBox.findChat(['you are now leaving the starting area. Outside the starting area, things can get more dangerous.']) then
begin
wait(randomRange(350, 750));
conversationBox.continue(true, true);
writeLn('We continued');
end;
// and then some stuff to make it run to its destination
end;

So it has to continue when the following shows up, but it doesn't:


I've recently installed the Direct-X plugin but I don't think that would be causing the problem, would it? I hope anyone could help me as fast as possible so I could get to work again, thanks in advance. :)


I doubt it will be able to read that whole string of text exactly. Do you even need to check the text? If the convo box is open can't you just assume you need to click continue?


if conversationBox.isOpen(5000) then
begin
writeLn('Found open conversation box');
if conversationBox.continue(true, true) then
writeLn('We continued');
end;

Spaceblow

2014-08-08 06:35:46

From: The Mayor
I doubt it will be able to read that whole string of text exactly. Do you even need to check the text? If the convo box is open can't you just assume you need to click continue?


if conversationBox.isOpen(5000) then
begin
writeLn('Found open conversation box');
if conversationBox.continue(true, true) then
writeLn('We continued');
end;
Yep, that was the problem. Thank you very much for the quick reply, you've already helped me so much since the moment I registered on this website.

But now I'm wondering what the '5000' in 'conversationBox.isOpen(5000)' does. I guess it's going to wait 5s before continuing but I tried it out with replacing it with 10000 and it doesn't wait 10s to continue.

The Mayor

2014-08-08 06:40:51

From: Spaceblow
Yep, that was the problem. Thank you very much for the quick reply, you've already helped me so much since the moment I registered on this website.

But now I'm wondering what the '5000' in 'conversationBox.isOpen(5000)' does. I guess it's going to wait 5s before continuing but I tried it out with replacing it with 10000 and it doesn't wait 10s to continue.


It is the max time to keep looking E.g:


conversationBox.isOpen(5000)

If the convo box is found after 2 seconds, it will exit and return true. If it's not found it will keep looking for 5 seconds. You can do the same with the other interfaces too. E.g:


bankScreen.isOpen(5000)
depositBox.isOpen(5000)


For example, if I clicked a banker, I would want to wait a few sec for me to run to the bank and for the bank screen to pop up.

Spaceblow

2014-08-08 06:51:15

From: The Mayor
It is the max time to keep looking E.g:


conversationBox.isOpen(5000)

If the convo box is found after 2 seconds, it will exit and return true. If it's not found it will keep looking for 5 seconds. You can do the same with the other interfaces too. E.g:


bankScreen.isOpen(5000)
depositBox.isOpen(5000)


For example, if I clicked a banker, I would want to wait a few sec for me to run to the bank and for the bank screen to pop up.
I'm a little bit confused and also embarrassed that I don't fully understand it. Is this used by many scripters?

sdf

2014-08-08 07:45:42

From: Spaceblow
I'm a little bit confused and also embarrassed that I don't fully understand it. Is this used by many scripters?


A maximum waiting time is often given for boolean functions such that the function doesn't get stuck in an infinite loop. So the answer to your question is yes, it is a very handy failsafe.

Spaceblow

2014-08-08 08:24:12

From: sdf
A maximum waiting time is often given for boolean functions such that the function doesn't get stuck in an infinite loop. So the answer to your question is yes, it is a very handy failsafe.
So for example, if I would be using this:

bankScreen.isOpen(5000)

And the bankscreen doesn't open for some reason, it would wait 5 seconds and then the script would just stop, right? And then it would just wait until the player logs out and that's it?

sdf

2014-08-08 08:28:30

From: Spaceblow
So for example, if I would be using this:

bankScreen.isOpen(5000)

And the bankscreen doesn't open for some reason, it would wait 5 seconds and then the script would just stop, right? And then it would just wait until the player logs out and that's it?


Not quite, since bankScreen.isOpen() returns true or false, it'd be more like this is you want it to log out and terminate if it fails.

if bankScreen.isOpen(5000) then
begin
//procedures to complete if the bankscreen is open before maxwait
end else
begin
//procedures to complete if the bankscreen is not open after maxwait
writeln('Something went wrong, bank screen not found after maxwait! Attempting to log out and terminate!');
if players[currentPlayer].logout() then
terminateScript;
end;

Spaceblow

2014-08-08 08:53:40

From: sdf
Not quite, since bankScreen.isOpen() returns true or false, it'd be more like this is you want it to log out and terminate if it fails.

if bankScreen.isOpen(5000) then
begin
//procedures to complete if the bankscreen is open before maxwait
end else
begin
//procedures to complete if the bankscreen is not open after maxwait
writeln('Something went wrong, bank screen not found after maxwait! Attempting to log out and terminate!');
if players[currentPlayer].logout() then
terminateScript;
end;
Hmm alright, but for other than that, what would maxwait be used for?

KeepBotting

2014-08-08 08:56:02

From: Spaceblow
Hmm alright, but for other than that, what would maxwait be used for?


Any sort of time-based failsafe.

if x doesn't happen after y time, then do z which will help us recover from x's failure

think of it like that

Spaceblow

2014-08-08 09:19:49

From: KeepBotting
Any sort of time-based failsafe.

if x doesn't happen after y time, then do z which will help us recover from x's failure

think of it like that
Now I understand it a bit more. I think I'm going to make a simple script first, after I'm done with that I'll probably look more into antibans and failsafes as they are pretty important for not getting detected.

Everyone who replied on this thread, thank you so much. I appreciate it, I really do.