Bionicle
2010-01-29 21:55:29
Well I made this function for my script, and I realized that SRL could use a function that would drop items by DTMs.
What it does:
E: Fixed something
E2: Shortened, thanks R!ch!e :p
What it does:
- Drops a certain item in your inventory with five different patterns.
- If an item is missed for some reason or another (probably lag), the procedure will look back after dropping the next item to see if that one was dropped or not, and if it was not, drops it.
- If any items were missed, at the end the procedure will look at the inventory and drop any other items.
- One every forty times the script will 'accidentally' hit the "Use" option and click the item to un-highlight it, or hit the "Examine" option.
{*******************************************************************************
procedure DropDTM(DTM: Integer; DropPattern: Integer);
By: bionicle1800
Description: Drops an item by the DTM specified by the user. There is five
different dropping patterns, specified in the integer DropPattern
as 1, 2, 3, 4 or 5. 0 is a random pattern. If an item is missed
due to lag, it will go back and drop it. After the inventory is
dropped, it will search for items it may have missed before ending.
Also has AntiBan where the function will 'accidentally' click 'use'
or 'examine' one every forty times.
*******************************************************************************}
Procedure DropDTM(DTM: Integer; DropPattern: Integer);
Var
I, K, DropTime: Integer;
InvSlot, InvSlot2: TBox;
WayDrop: TIntegerArray;
Begin
If Not LoggedIn Then
Exit;
GameTab(Tab_Inv);
If InRange(DropPattern, 0, 6) Then
Begin
Srl_Warn('DropDTM', 'DropPattern ' + IntToStr(DropPattern) + ' is not a valid number.', warn_AllVersions);
Exit;
End;
If DropPattern = 0 Then
DropPattern := RandomRange(1, 6);
Case DropPattern Of
1: WayDrop := [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
20, 21, 22, 23, 24, 25, 26, 27, 28];
2: WayDrop := [1, 5, 9, 13, 17, 21, 25, 2, 6, 10, 14, 18, 22, 26, 3, 7, 11, 15,
19, 23, 27, 4, 8, 12, 16, 20, 24, 28];
3: WayDrop := [1, 5, 9, 13, 17, 21, 25, 26, 22, 18, 14, 10, 6, 2, 3, 7, 11, 15,
19, 23, 27, 28, 24, 20, 16, 12, 8, 4];
4: WayDrop := [4, 3, 8, 2, 7, 12, 1, 6, 11, 16, 5, 10, 15, 20, 9, 14, 19, 24, 13,
18, 23, 28, 17, 22, 27, 21, 26, 25];
5: WayDrop := [4, 2, 7, 12, 5, 10, 15, 20, 13, 18, 23, 28, 21, 26, 25, 17, 22,
27, 9, 14, 19, 24, 1, 6, 11, 16, 3, 8];
End;
For I := 0 To 27 Do
Begin
InvSlot := InvBox(WayDrop[I]);
If FindDTM(DTM, X, Y, InvSlot.X1, InvSlot.Y1, InvSlot.X2, InvSlot.Y2) Then
Begin
Case Random(40) Of
0: Begin
Mouse(X, Y, 3, 3, false);
WaiOption('xamine', 30+Random(30));
End;
19: Begin
Mouse(X, Y, 3, 3, false);
WaitOption('Use', 30+Random(30));
Wait(30+Random(30));
Mouse(X, Y, 4, 4, true);
End;
End;
Mouse(X, Y, 3, 3, false);
WaitOption('rop', 30+Random(30));
Wait(50+Random(50));
If (I > 0) Then
Begin
K := I - 1;
InvSlot2 := InvBox(WayDrop[K]);
If FindDTM(DTM, X, Y, InvSlot2.X1, InvSlot2.Y1, InvSlot2.X2, InvSlot2.Y2) Then
Begin
Mouse(X, Y, 3, 3, false);
WaitOption('rop', 30+Random(30));
Wait(50+Random(50));
End Else
Wait(10+Random(5));
End;
End;
End;
MarkTime(DropTime);
Repeat
If FindDTM(DTM, X, Y, MIX1, MIY1, MIX2, MIY2) Then
Begin
Mouse(X, Y, 3, 3, false);
WaitOption('rop', 30+Random(30));
Wait(300+Random(300));
End Else
Break;
Until(TimeFromMark(DropTime) > 20000)
Writeln('Dropped all items.');
End;E: Fixed something
E2: Shortened, thanks R!ch!e :p