SRL Archive - Jr. Member General Help and Discussion

Walk paths and depositing items


newb cheater

2014-03-02 12:57:05

Hi, I am currently trying to get my first script down and going, and thought of adding a little randomness to my walking.

I currently use SPS for walking. However, doing a repeated task, and walking the same path over and over again may not be advisable. So, I thought of creating several paths and having the script randomly choose one of them. I was wondering how could I do this. I have looked through several guides, but did not find any solutions. Also, if there is a method to make SPS walking a little more random, that would be good as well.

Secondly, as for depositing items, assuming I have an item occupying the fifth slow in my inventory. What would be the best method to deposit the item? Currently, I am using a DTM and getting the script to search for the item to deposit it (however this method is not always successful). As such, is there a built in function which deposits items from inventory as how withdrawing from bank works?

Would appreciate any feedback or guidance.

Thanks :)

Olly

2014-03-02 13:00:23

http://docs.villavu.com/srl-6/bankscreen.html#trsbankscreen-deposit



var
walkPath: TPointArray;
begin
case random(3) of
0: walkPath := [point(50, 50), point(100, 100)];
1: walkPath := [point(55, 55), point(110, 110)];
2: walkPath := [point(65, 65), point(120, 120)];
end;

writeln(walkPath);
end;

:)

Frement

2014-03-02 13:03:05

You need a T2DPointArray for the paths, basically the structure is:
Array[0] := [Point, Point, Point];
Array[1] := [Point, Point, Point];
Array[2] := [Point, Point, Point];

You can now randomly select your path with RandomRange(0, High(Array));

You can create a bitmap of the item, and search for it, then deposit from those coordinates. Same for withdrawing from bank.

Sk1nyNerd

2014-03-02 13:15:52

From: newb cheater
Hi, I am currently trying to get my first script down and going, and thought of adding a little randomness to my walking.

I currently use SPS for walking. However, doing a repeated task, and walking the same path over and over again may not be advisable. So, I thought of creating several paths and having the script randomly choose one of them. I was wondering how could I do this. I have looked through several guides, but did not find any solutions. Also, if there is a method to make SPS walking a little more random, that would be good as well.

Secondly, as for depositing items, assuming I have an item occupying the fifth slow in my inventory. What would be the best method to deposit the item? Currently, I am using a DTM and getting the script to search for the item to deposit it (however this method is not always successful). As such, is there a built in function which deposits items from inventory as how withdrawing from bank works?

Would appreciate any feedback or guidance.

Thanks :)


ill answer both your questions with one answer! Case Structures! :D case structures like the one below allow you to use randomness when you want to do one thing in a x amount of different ways for most commonly used anti ban purposes. the case structure below random selects a number from 0 to 19 (it starts at 0 thats why 20) and preforms that depositing action. if you dtm doesnt work all the time try updating it. when you make the dtm the first point should be the middle of the object and then you should make 3-4 or more points on the black ooutline of the object to get its shape

      
case random(20) of
0..4: Deposit(1, 28, True); //deposit inv slots 1 - 28
5..10: MouseBox(431, 293, 456, 317, mouse_left); //click the quick deposit icon
11..19: begin
if FindDTM(ObjectDTM, x, y, MIX1, MIY1, MIX2, MIY2) then //search for the objects dtm in our inv
begin
MMouse(x,y,3,3); //move mouse to dtm with a little randomness
clickmouse2(mouse_right);
ChooseOption('option'); //parts of the text we are looking for
end else
writeln('our object isnt in the inv to deposit!');
CloseWindow;
LogOut;
end;
end;

edit: damn it @Olly :/

newb cheater

2014-03-02 13:36:05

Thanks guys for the quick response and feedback. For me, the item would be static at a certain inventory slot. So Olly's method worked perfectly! I saw that function under the includes, but for some reason it didn't occur to me then.

As for the walking method, I am still figuring it out at the moment. Will report back when done :)


procedure WalkToPool
var
PathBankToPool: TPointArray;
begin
case random(3) of
0: PathBankToPool := [Point(140, 189), Point(141, 194), Point(145, 201), Point(153, 201), Point(162, 205), Point(178, 203), Point(187, 203), Point(193, 217), Point(191, 233), Point(187, 247), Point(191, 257), Point(193, 270), Point(195, 302), Point(199, 312), Point(205, 325), Point(256, 371), Point(269, 388), Point(272, 397), Point(273, 408), Point(274, 418), Point(283, 420), Point(303, 421), Point(314, 419), Point(326, 413), Point(345, 407), Point(357, 405), Point(360, 405), Point(361, 406)];
1: PathBankToPool := [Point(139, 188), Point(138, 194), Point(141, 200), Point(147, 201), Point(176, 205), Point(181, 206), Point(188, 208), Point(192, 224), Point(190, 230), Point(190, 236), Point(190, 245), Point(190, 249), Point(189, 254), Point(189, 266), Point(197, 283), Point(198, 305), Point(212, 328), Point(229, 353), Point(247, 353), Point(239, 353), Point(242, 354), Point(260, 368), Point(270, 386), Point(273, 402), Point(277, 419), Point(302, 414), Point(325, 409), Point(341, 408), Point(344, 408), Point(348, 408), Point(353, 408), Point(360, 408)];
2: PathBankToPool := [Point(140, 188), Point(141, 200), Point(147, 205), Point(170, 205), Point(186, 204), Point(186, 224), Point(190, 239), Point(190, 255), Point(190, 266), Point(193, 288), Point(196, 295), Point(199, 304), Point(201, 322), Point(212, 343), Point(222, 350), Point(232, 353), Point(246, 366), Point(270, 389), Point(274, 410), Point(282, 420), Point(309, 415), Point(330, 403), Point(335, 403), Point(345, 403), Point(351, 403), Point(355, 403), Point(360, 403), Point(363, 404)];
end;

writeln(PathBankToPool);
end;

Tried that, but somehow it isn't working as how I intended. Will try and work out the kinks. Could be my Coordinates or something.

Brotein

2014-03-03 15:16:52

It's hard to tell from looking at it without the SPS picture, but it looks like the coordinates are too similar to each other. I know the 2nd path has more points, but just going by eye here.

0: PathBankToPool := [Point(140, 189), Point(141, 194), Point(145, 201)
1: PathBankToPool := [Point(139, 188), Point(138, 194), Point(141, 200)
2: PathBankToPool := [Point(140, 188), Point(141, 200), Point(147, 205)

I've noticed SPS isn't all that accurate so these minor changes in points would occur naturally with just your original path. I've watched my one bot run a short path of 6 coordinates many times. When it arrives at the final point, it usually ends up clicking on a square in an area of maybe 6x6 squares around the point I had intended(which is more than fine for randomness). This is just a guess, maybe try creating some unnecessarily distinct paths just to see if your code is actually working right.

newb cheater

2014-03-05 04:28:54

Thanks, looks like i decided to do away with the random paths, and instead made some other tweaks. However, thanks to all who responded, especially Olly :)

beefman

2014-07-09 09:07:07

I wish they'd improve the accuracy of sps.Harder said then done i guess.