SRL Archive - OSR Help

How to drop a specific item from the inventory?


Ilya

2012-05-21 14:46:07

It can be based on spot number of the item?
And also is there a simple resting function?
Thanks in advance!

Recursive

2012-05-21 14:51:11

You can get a DTM of the item and then use the following function:




ItemName := DTMFromString('enter the DTM here');
If FindDTM(ItemName, pX,pY,MiX1,MiY1,MiX2,MiY2) then
begin
HumanMMouse(pX, pY, 7, 7);
ClickMouse2(False);
MarkTime(T);
Repeat
Wait(25+Random(10));
Until(ChooseOption('rop')Or(TimeFromMark(T)>2000));
end;

Or you can use this function found on SPS that will enable you to drop an item if you enter the slot the item is located in

(*
DropItem
~~~~~~~~

.. code-block:: pascal

procedure DropItem(i: Integer);

Drops item at given position (1-28)

.. note::

by Lorax

Example:

.. code-block:: pascal

DropItem(3);

*)
function DropItem(i: Integer): Boolean;
begin
Result := False;
if ExistsItem(i) then
begin
MouseItem(i, mouse_Right);
if (WaitOptionEx('rop', 'action', ClickLeft, 250)) then
begin
Result := True;
Wait(RandomRange(50, 200));
end;
end;
end;

All you have to do is call the function with the item slot number like this
Dropitem(22);

Also anther option for if you are trying to drop all items in your invent maybe for a powerchopper or something

(*
DropAll
~~~~~~~

.. code-block:: pascal

procedure DropAll;

Drops all items in inventory.

.. note::

by Rasta Magician

Example:

.. code-block:: pascal

DropAll;

*)
procedure DropAll;
var i: integer;
begin
for i:= 0 to 2 do
begin
DropPattern(Random(2) + 1);
if InvCount = 0 then
break;
end;
end;

Google

2012-05-21 14:55:31

From: Ilya
It can be based on spot number of the item?
And also is there a simple resting function?
Thanks in advance!


Is the resting for energy?

And a simple drop spot in inventory I use is.


InvMouse(RandomRange(1,28),3); // This will move a mouse from slot 1-28
ClickMouse2(False);
WaitOption('Drop');
// the 1,28 are the slots so it can range from 1-28


YoHoJo

2012-05-21 14:56:05

DTMs are the way to go!
http://villavu.com/forum/showthread.php?t=68018

Ilya

2012-05-21 14:58:57

From: GOOGLE
Is the resting for energy?

And a simple drop spot in inventory I use is.


InvMouse(RandomRange(1,28),3); // This will move a mouse from slot 1-28
ClickMouse2(False);
WaitOption('Drop');
// the 1,28 are the slots so it can range from 1-28



Exactly what I was looking for, Thanks!
so 28,28 would drop the last item right?

and resting is for energy.

Google

2012-05-21 14:59:44

From: Ilya
Exactly what I was looking for, Thanks!
so 28,28 would drop the last item right?


Yep

Ilya

2012-05-21 15:01:01

From: YoHoJo
DTMs are the way to go!
http://villavu.com/forum/showthread.php?t=68018


I haven't gotten that far. Most of the script i'm working on comes simply from coordinates.

So does a short resting function exist?

Abu

2012-05-21 15:02:58

To rest, you just do:

if RunEnergy(ALowNumber) then
RestUntil(AHighNumber);

litoris

2012-05-21 15:03:40

From: Ilya
I haven't gotten that far. Most of the script i'm working on comes simply from coordinates.


It takes 10 minutes to learn DTMs, and it's definitely worth it.

Ilya

2012-05-21 15:24:08

From: GOOGLE
Is the resting for energy?

And a simple drop spot in inventory I use is.


InvMouse(RandomRange(1,28),3); // This will move a mouse from slot 1-28
ClickMouse2(False);
WaitOption('Drop');
// the 1,28 are the slots so it can range from 1-28


its giving me an invalin number of parameters in the "waitoption drop" line.
here is what i have.


procedure DropShit;
begin
InvMouse(RandomRange(23,23),3);
ClickMouse2(False);
WaitOption('Drop');<——————–HERE!
InvMouse(RandomRange(24,24),3);
ClickMouse2(False);
WaitOption('Drop');
InvMouse(RandomRange(27,27),3);
ClickMouse2(False);
WaitOption('Drop');
end;

Abu

2012-05-21 15:27:18

In WaitOption - after drop put a comma followed by the maximum time you want to wait before dropping. So:
WaitOption('rop', 3000);
// removed the 'D' because it's a capital letter. 3000ms = 3seconds

Ilya

2012-05-21 16:22:52

Working like a charm.
It's so great to have such a supportive and knowledgeable community.



Is there a way at the bankscreen to deposit for example items 1-27 and keep 28?

OR to repeat an action a set amount of times?
for example Repeat…………..
Until (4) or something of that nature.

YoHoJo

2012-05-21 16:51:54

Check out Bank.Simba
 Procedure Deposit(SlotFrom, SlotTo: Integer; vType: Variant);

Deposits from Slot to ToSlot.
vType True = Deposit All. vType False = Deposit one by one.
Any integer is deposit with Deposit X. (except for 5 and 10)

.. note::

Author: WT-Fakawi/PPLSUQBAWLZ/Stupid3ooo/Town
Last Modified: Unknown

Example:

.. code-block:: pascal

Deposit(1, 28, True);
*)
procedure Deposit(SlotFrom, SlotTo: Integer; vType: Variant);

Ilya

2012-05-22 01:29:10

From: YoHoJo
Check out Bank.Simba
 Procedure Deposit(SlotFrom, SlotTo: Integer; vType: Variant);

Deposits from Slot to ToSlot.
vType True = Deposit All. vType False = Deposit one by one.
Any integer is deposit with Deposit X. (except for 5 and 10)

.. note::

Author: WT-Fakawi/PPLSUQBAWLZ/Stupid3ooo/Town
Last Modified: Unknown

Example:

.. code-block:: pascal

Deposit(1, 28, True);
*)
procedure Deposit(SlotFrom, SlotTo: Integer; vType: Variant);


So for example would this deposit items 1-27 and keep 28 out?

procedure Deposit;
begin
Deposit(1, 27, False);
wait (2000);



Edit:that didnt work.
end;

Subliment

2012-05-22 12:19:27

From: Ilya
Working like a charm.
It's so great to have such a supportive and knowledgeable community.



Is there a way at the bankscreen to deposit for example items 1-27 and keep 28?

OR to repeat an action a set amount of times?
for example Repeat…………..
Until (4) or something of that nature.


As for the first question, I still have not approached banking. But for the second question, you use a for loop:
for example:


var
i, j: Integer;
begin
for i := 0 to j do
begin
//Do whatever you want to be repeated (j-i) times here
//When this finishes, it will check if integer i is equal to j, and if it is
//it breaks from the for loop and continues, if it isnt, it will add one unit
//to i, and repeat whatever is in here until i is equal to j
end;
end;

I hope you got that =D

Ilya

2012-05-22 13:57:03

From: Subliment
As for the first question, I still have not approached banking. But for the second question, you use a for loop:
for example:


var
i, j: Integer;
begin
for i := 0 to j do
begin
//Do whatever you want to be repeated (j-i) times here
//When this finishes, it will check if integer i is equal to j, and if it is
//it breaks from the for loop and continues, if it isnt, it will add one unit
//to i, and repeat whatever is in here until i is equal to j
end;
end;

I hope you got that =D


So would i have to specify what j equals to?
for example to repeat 4 times would i have to do J=4 under constants?

Subliment

2012-05-22 16:12:18

From: Ilya
So would i have to specify what j equals to?
for example to repeat 4 times would i have to do J=4 under constants?


It doesn't have to be a constant, but it can.

You can have it be an integer straight out instead such as:

...
for i := 0 to 3 do
...

and to repeat 4 times you would have to make j equal to 3, because the zero counts as one time too. So to eliminate confusion, have it be like this ( with i being one):


...
for i := 1 to 4 do
...

So now, you can have the 4 without subtracting one unit from it.

~Subliment

Ilya

2012-05-22 16:49:21

Trying it now.
Still looking for a way to deposit items 1-27 while bankscreen open.

BigRedJapan

2012-05-31 02:58:36

just add a bank all option!
then add a withdraw item!

Derek-

2012-05-31 23:22:59

From: Ilya
Trying it now.
Still looking for a way to deposit items 1-27 while bankscreen open.


Deposit(1, 27, True);

Andres

2012-06-02 01:37:29

I've had some success with DTMs, which means a lot considering I know so little about scripting.