PDA

View Full Version : Help with making it more efficiency.



The Legendary
04-30-2015, 12:56 AM
So in my mining script. I have a little problem where the script sees the coal rock but when it click on it at the edge of the rock, it didn't register. This cause my script to keep clicking on that rock, making it not efficient. So I had added a safe fail like so below.
Is there another way to make it works better when it click on the rock and it didn't register then it clicks on another rock?
http://i60.tinypic.com/ruqznk.png


Procedure MiningSkill;
begin
Case Lowercase(Mining) of
'1' :
Begin
repeat
repeat
CheckEverything;
existinguser;
if not ores then begin turnscreen; end;
Failed := Failed + 1;
until (fullinventoryOres) or (Failed >=20);
Failed:=0;
if fullinventoryOres then begin bankingtheores; end;
cleardebug;
repeat
Failed:=Failed+1; until (failed>=15);
if failed>=15 then begin (turnscreen); end;
Failed:=0;
until(false);
End;end;end;

rj
04-30-2015, 01:27 AM
show us the whole script

The Legendary
04-30-2015, 01:49 AM
show us the whole script

I can't do that since I have 6 skills total in this script and I don't want it to be public just yet. Mining is just one of them and yes it did bank when full inventory =D.

I was thinking about adding animation to check if my character is doing mining animation if not then turn screen and click on rock again....but I don't know if this code will do the job as i said^. I also don't know how to implement this code into my script-.-.
playerAnimating := Animating(box, 5000, 2000);

rj
04-30-2015, 01:53 AM
I can't do that since I have 6 skills total in this script and I don't want it to be public just yet. Mining is just one of them and yes it did bank when full inventory =D.

I was thinking about adding animation to check if my character is doing mining animation if not then turn screen and click on rock again....but I don't know if this code will do the job as i said^. I also don't know how to implement this code into my script-.-.
playerAnimating := Animating(box, 5000, 2000);

Get the inventory count and make it wait until the inventory count has increased by 1.

The Legendary
04-30-2015, 04:42 AM
Get the inventory count and make it wait until the inventory count has increased by 1.
Maybe you misunderstand me. I want to make a function somehow check after the click on coal rock and if it miss click the rock then it will click the other rocks around there. Here is a video, look closely at 1sec-30sec ish. you will see that it miss click the rock and just stand there for a good 9 second before the random of x,y I just added kick in. Mouse(X+Random(3),Y+Random(8),2,2,True);
Sorry for the bad quality --->http://tinypic.com/player.php?v=2ijrssg%3E&s=8#.VUGjqI5Viko

Ps. What does this do? I don't quite understand it.
Animating
function Animating(B: TBox; Time, MinCount: Integer): Boolean;
//Finds constant animation in boxes B during time T. If PixelShift in box is smaller than MinCount, it’s considered not animating.

//Note Author: marpis Last Modified: Nov. 29, 2009
//Example:

playerAnimating := Animating(box, 5000, 2000);

The Mayor
04-30-2015, 04:48 AM
Do you check for mouse over text before you click? You could also just add

didClick()

To check it actually did a red click. If not, then look for another rock.

The Legendary
04-30-2015, 05:25 AM
Do you check for mouse over text before you click? You could also just add

didClick()

To check it actually did a red click. If not, then look for another rock.
No i don't check text before the click because it makes the script slower =]

It gives me a error: "Invalid number of parameters at line 1840.
Case Lowercase(Mining) of
'1' :
Begin
repeat
repeat
CheckEverything;
existinguser;
if not ores then begin turnscreen; end;
if not didclick then ores;
Failed := Failed + 1;
until (fullinventoryOres) or (Failed >=20);
Failed:=0;
if fullinventoryOres then begin bankingtheores; end;
cleardebug;
repeat
Failed:=Failed+1; until (failed>=15);
if failed>=15 then begin (turnscreen); end;
Failed:=0;
until(false);
End;end;end;
I love the idea of checking for redclick :D Might just well make a custom one for it.

The Mayor
04-30-2015, 05:50 AM
No i don't check text before the click because it makes the script slower =]

It gives me a error: "Invalid number of parameters at line 1840.
Case Lowercase(Mining) of
'1' :
Begin
repeat
repeat
CheckEverything;
existinguser;
if not ores then begin turnscreen; end;
if not didclick then ores;
Failed := Failed + 1;
until (fullinventoryOres) or (Failed >=20);
Failed:=0;
if fullinventoryOres then begin bankingtheores; end;
cleardebug;
repeat
Failed:=Failed+1; until (failed>=15);
if failed>=15 then begin (turnscreen); end;
Failed:=0;
until(false);
End;end;end;
I love the idea of checking for redclick :D Might just well make a custom one for it.

It takes True/False, and a waitTime parameter (default 2000ms). Sometihng like:


procedure clickARock();
var
i: Integer;
TPA: TPointArray;
ATPA: T2DPointArray;
begin
//Find rock colours
// Put all into an ATPA

for i := 0 to high(ATPA) do
begin
mouse(ATPA[i].getBounds().getRandomPoint());
if isMouseOverText(['ine Co']) then
if didClick(True, 2000) then // True = red click, 2000 = wait time
break();
end;

end;

The Legendary
04-30-2015, 06:32 AM
Thanks :D I got it working very efficient now with little waste time if it miss click.
if didClick(True, 2000) then // True = red click, 2000 = wait time
break();

rj
04-30-2015, 03:31 PM
The Legendary; you should take out the randomness for a RSPS

The Legendary
04-30-2015, 06:32 PM
The Legendary; you should take out the randomness for a RSPS

Can't do that :D
This rsps I play on can detect same pattern mouse movement. Mods/Admin will come to you in no time if you use ghost mouse.

rj
04-30-2015, 06:44 PM
Can't do that :D
This rsps I play on can detect same pattern mouse movement. Mods/Admin will come to you in no time if you use ghost mouse.

I highly doubt that. Even if you don't have randomness you will still click in different spots.