SRL Archive - SRL Archives

DropFast


YoHoJo

2006-11-22 19:06:06

Well i realized that most scripts after dropping an item wait 500 or more milliseconds before dropping another.
This is because the script must wait for the item to disappear from the inventory so it wont click the item again because it takes rs some time to process that you wanted to drop it.
I realized this could be fixed by instead of looking for a color, bitmap, or DTM of an item in the inventory, just take it one slot at a time.

So i got the idea to do that, look for items ONE SLOT AT A TIME =)
First i took a picture of the inventory and divided the slots:

Next i got the cords of each box (using the red dots i made) and set them up similar to the globals in SRL:

const
I1X1=560;
I1Y1=212;
I1X2=608;
I1Y2=252;

I2X1=609;
I2Y1=213;
I2X2=650;
I2Y2=252;

I3X1=650;
I3Y1=213;
I3X2=693;
I3Y2=253;

I4X1=693;
I4Y1=211;
I4X2=739;
I4Y2=253;

I5X1=559;
I5Y1=252;
I5X2=609;
I5Y2=290;

I6X1=609;
I6Y1=252;
I6X2=650;
I6Y2=290;

I7X1=650;
I7Y1=252;
I7X2=693;
I7Y2=290;

I8X1=693;
I8Y1=253;
I8X2=739;
I8Y2=290;

I9X1=560;
I9Y1=290;
I9X2=609;
I9Y2=326;

I10X1=610;
I10Y1=290;
I10X2=650;
I10Y2=325;

I11X1=650;
I11Y1=290;
I11X2=650;
I11Y2=325;

I12X1=693;
I12Y1=290;
I12X2=738;
I12Y2=325;

I13X1=561;
I13Y1=326;
I13X2=609;
I13Y2=361;

I14X1=609;
I14Y1=326;
I14X2=650;
I14Y2=361;

I15X1=650;
I15Y1=325;
I15X2=692;
I15Y2=361;

I16X1=692;
I16Y1=325;
I16X2=738;
I16Y2=361;

I17X1=560;
I17Y1=361;
I17X2=608;
I17Y2=398;

I18X1=609;
I18Y1=361;
I18X2=651;
I18Y2=398;

I19X1=650;
I19Y1=361;
I19X2=691;
I19Y2=398;

I20X1=693;
I20Y1=362;
I20X2=736;
I20Y2=397;

I21X1=560;
I21Y1=398;
I21X2=609;
I21Y2=435;

I22X1=609;
I22Y1=399;
I22X2=650;
I22Y2=436;

I23X1=650;
I23Y1=398;
I23X2=693;
I23Y2=435;

I24X1=692;
I24Y1=398;
I24X2=738;
I24Y2=436;

I25X1=560;
I25Y1=435;
I25X2=609;
I25Y2=468;

I26X1=609;
I26Y1=435;
I26X2=650;
I26Y2=468;

I27X1=651;
I27Y1=435;
I27X2=693;
I27Y2=469;

I28X1=694;
I28Y1=434;
I28X2=739;
I28Y2=469;

Here is what i stands for:
I1X1

I1 meaning "Inventory 1" aka slot 1
X1 meaning the X1 of the square

So i did this for all 28 slots

Next i made a few procedures look in a slot, drop the item, and then move to the next disregarding when the item was actually out of the inventory thus greatly increasing the dropping of items.
If the speed seems to fast some waits can be added.

These functions are huge and i bet there is some simple way to make them loop though all of the slots but i don't know how.
Maybe someone can situate a for to do loop or somethings to shorten them.
everyone feel free to edit them to make them smaller or better =)
Ill just make it an attachment because they are so large.

Boreas

2006-11-22 19:43:09

Nice job.

Yea theres a way. It would have saved you the trouble of making that list. Check out my FCCG. It takes a box of size dictated by params and divides into smaller boxes with width in params. Would have saved you some time. I'll find the link. Edit: found it http://www.villu-reborn.com/showthread.php?t=3841
it's the top part of FCCG. I did the type record thing so that it had active, so you can ignore it when you're done looking at it.

YoHoJo

2006-11-22 19:44:29

Yea i knew there was an easier way somehow
but i was really bored today so it gave me something to do =)
You should try it out its pretty fast =)

WhiteShadow

2006-11-22 23:48:06

Pwns, you should realize though.

{*******************************************************************************
function ItemCoords(i: Integer): TPoint;
By: RsN
Description: Returns X and Y of Specified Inventory Spot
*******************************************************************************}
function ItemCoords(i: Integer): TPoint;
var
row, col: Integer;
begin
row := i div 4;
col := i - (row * 4) - 1;
if (col < 0) then
begin
col := 3;
row := row - 1;
end;
Result.x := 536 + ((col + 1) * 42) + Random(7);
Result.y := 184 + ((row + 1) * 36) + Random(7);
end;

^ 14 lined procedure. (;

then :

program New;
{.include SRL/SRL.Scar}

procedure DropColorFast(iColor, iTol : Integer);
var
c : TPoint;
i, b1, b2, b3, b4 : Integer;
begin
for i := 1 to 28 do
begin
c:= ItemCoords(i);
b1 := c.x + 5; //Not sure if this is accurate basically makes a
b2 := c.y + 5; //box around the inv spot coord.
b3 := c.x - 5;
b4 := c.y - y;
if(FindColorTolerance(x, y, iColor, b1, b2, b3, b4, itol))then
begin
Mouse(x, y, 3, 3, false);
Wait(100 + random(50));
ChooseOption(x, y, 'Drop');
end;
end;
end;

!! Good job though. (:

Boreas

2006-11-22 23:58:08

Ah thats even better.

YoHoJo

2006-11-23 03:40:21

too bad item cords looks for any item and will drop antyhing
this drops only by color, bitmap, or DTM

but yea what you made is nice after that
but i dont think 5 pixels is enough for a dtm.
remember most dtms are ourlines of items
making it the entire item
and items arent only 5X5 pixles

pwn you back

and mines still sooper fast!
and all those invencors i got could be used for other things too! =)
i still pwn!

WhiteShadow

2006-11-23 16:13:40

From: yohojo8
too bad item cords looks for any item and will drop antyhing
this drops only by color, bitmap, or DTM

but yea what you made is nice after that
but i dont think 5 pixels is enough for a dtm.
remember most dtms are ourlines of items
making it the entire item
and items arent only 5X5 pixles

pwn you back

and mines still sooper fast!
and all those invencors i got could be used for other things too! =)
i still pwn!


a. I know I was just showing you ItemCoords since you can just use it to make a box..
(b1, b2)----------------+
| |
| |
|----------------(b3, b4)
b. 2 lazy to make a color, bitmap, and DTM one, just showing you the basis. Pretty easy to then just replace the line with if(FindDTM(…))then, if(FindBitmapToleranceIn(…))then
c. I chose 5 because I was to lazy to sign on to get accurate coords, :P as I have mentioned in my comments. I kind of made that in 30 seconds too… :P
d. Those inventory coords you got can be replaced by ItemCoords with +, - to form a box.

YoHoJo

2006-11-23 16:40:20

well is still pwn!
and… Tiffany!