Log in

View Full Version : Need help with adding movements while waiting



Mahatna
05-05-2012, 01:36 PM
Hey guys my fletch bot is nearly done :D. just adding my Anti-Ban last thing i cant figure out is how to implement the mouse moving or an Anti-Ban feature while the bot is fletching, which is 52000 mili secs or 52 seconds!
Procedure ClickFletch;
Var
X, Y:integer;
Begin
Wait(900+Random(254));
If FindColorSpiralTolerance(X, Y, 2004731, 269, 435, 313, 454, 20) Then
Begin
Mouse(X, Y, 20, 20, 1);
Wait(50000+random(4000));
End;
If FindColorSpiralTolerance(X, Y, 2004731, 269, 435, 313, 454, 20) Then
Begin
Mouse(X, Y, 20, 20, 1);
Wait(50000+random(4000));
End;
End;

Thats the code, so i just need to know how to do operations while the script is waiting to finish the fletching.

putonajonny
05-05-2012, 02:00 PM
Don't have a 52 second wait, if it misclicks and doesn't actually do anything 52 seconds is a long time to stand there...
What is is doing for the 52 seconds? is the amount of items in the invent changing? if so it would be very easy to write a function for this,

Have a look at this:
Procedure AntiBan;
begin

Case Random(500) of
0 : DoThis; //This is where you add whatever you want it to do while it is fletching
1 : DoThat;
2 : DoADifferentThing;
end;

end;

Function DoFeltch : Boolean;
Var
Time, InventCount : integer;
begin

MouseItem(UnstrungBowSpot, mouse_Left);
Wait(150+Random(550));
MouseItem(BowStringSpot, mouse_Left);

MarkTime(Time);
InventCount := InvCount;

Repeat

if(InvCount <> InventCount)then
begin
MarktTime(Time);
InventCount := InvCount;
end;

if(InvCount = 14)then
break;

if(TimeFromMark(Time) > 10000)then
exit;

AntiBan;

Wait(1000+Random(1000));

Until(false);

Result := True;

end;

If you don't understand any of it just ask, feel free to PM me :)

Mahatna
05-05-2012, 02:20 PM
the 52 seconds is the time it takes to fletch the whole inventory, so 28 logs takes 50 seconds+ i like the look of your function there but it doesnt solve my problem, what i need is during the 52 seconds its fletching is it possible to implement AntiBan while my script is waiting for the fletching to finish??

Thanks alot.

NKN
05-05-2012, 02:53 PM
Yeah.

You could set it in a loop, and then after you start fletching, call Antiban or something?

Also, to check when done, you should have it count items, then when Items > Items started with, repeat it.

P1ng
05-07-2012, 01:27 PM
I've been working on a yew stringer just to get myself started in scripting

repeat
if not LoggedIn then
Exit;
Inc(Counter);
LvlInc;
AntiBan;
Wait(RandomRange(500,510));
until not FindDTM(BS,x,y,MIX1,MIY1,MIX2,MIY2) or (counter > 50);

if it's not logged in it will break out of the procedure
it will wait, check for a level increase and perform the actions i have set for antiban until all of my bows are fletched and it can't find the bowstring DTM or its been through more than 50 times.

The counter really helps in case something has gone wrong and it isn't fletching then it won't just sit there making random movements forever when the bowstring DTM will obviously never disappear.

Abu
05-07-2012, 01:37 PM
Ok first of all why are you searching for the same colour twice?

Secondly, look to create a DTM for your log and then look into this function:
(*
ExistsItemDTM
~~~~~~~~~~~~~

.. code-block:: pascal

function ExistsItemDTM(dtm: Integer; var x, y: Integer): Boolean;

Checks if the dtm is in the inventory. Returns the item's coordinates.

.. note::

by NCDS

Example:

.. code-block:: pascal

if ExistsItemDTM(OreDTM, x, y) then
MMouse(x, y, 3, 3);

*)


Thirdly, once you understand the above function, you can do

procedure ClickFletch;
Var
X, Y: Integer;
begin
Wait(900+Random(254));
If FindColorSpiralTolerance(X, Y, 2004731, MIX1, MIY1, MIX2, MIY2, 20) Then
Mouse(X, Y, 20, 20, 1);
while ExistsItemDTM(logDTM, x, y) do
AntiBan;
end;

Sin
05-07-2012, 02:00 PM
Wow, tbh I never had any idea that ExistsItemDTM was in the repo.
I had one made a while back :s

Abu
05-08-2012, 04:58 AM
Wow, tbh I never had any idea that ExistsItemDTM was in the repo.
I had one made a while back :s

LOL!

SRL Include = My Best Friend

Oh well, life goes on I guess :p