Mr. Doctor
2009-10-24 15:33:12
Boreas and I made a function together. MouseInvRandom.
This can either examine, drag or do a random of both using 0,1,2.
Description=
Function=
Test=
Thanks.
This can either examine, drag or do a random of both using 0,1,2.
Description=
{*******************************************************************************
Procedure MouseInvRandom(SlotArray: TIntegerArray; Option: integer);
By: Boreas & Junkj
Description:Goes to specified inventory slot and either examines,drags or
random of both at the slot.
0-examine spot
1-drag(to other spot ex [1,2] 1 being dragged from, 2 being dragged to
2-random
ex:
MouseInvRandom([1,2],0);
*******************************************************************************}
Function=
function MakeIntArray(SInt, EInt:integer): TIntegerArray;
var i,i2:integer;
begin
setarraylength(result, 1+EInt-SInt);
for i:=SInt to EInt do
begin
result[i2]:=i;
inc(i2);
end;
end;
{*******************************************************************************
Procedure MouseInvRandom(SlotArray: TIntegerArray; Option: integer);
By: Boreas & Junkj
Description:Goes to specified inventory slot and either examines,drags or
random of both at the slot.
0-examine spot
1-drag(to other spot ex [1,2] 1 being dragged from, 2 being dragged to
2-random
ex:
MouseInvRandom([1,2],0);
*******************************************************************************}
procedure MouseInvRandom(SlotArray: TIntegerArray; Option: integer);
var tmpoption, s1,s2,MINVRANBU: integer;
begin
tmpoption:=option;
if tmpoption=2 then tmpoption:=random(2);
case tmpoption of
0: begin
mouseitem(SlotArray[random(length(SlotArray))], false);
waitoption('xamine',1000);
end;
1: begin
s1:=SlotArray[random(length(SlotArray))];
repeat
s2:=SlotArray[random(length(SlotArray))];
until (s1<>s2)
Mousespeed:= MINVRANBU;
Mousespeed:= 10;
DragItem(s1,s2);
mousespeed := MINVRANBU;
end;
end;
end;
Test=
program MIR;
{.include srl/srl.scar}
function MakeIntArray(SInt, EInt:integer): TIntegerArray;
var i,i2:integer;
begin
setarraylength(result, 1+EInt-SInt);
for i:=SInt to EInt do
begin
result[i2]:=i;
inc(i2);
end;
end;
{*******************************************************************************
Procedure MouseInvRandom(SlotArray: TIntegerArray; Option: integer);
By: Boreas & Junkj
Description:Goes to specified inventory slot and either examines,drags or
random of both at the slot.
0-examine spot
1-drag(to other spot ex [1,2] 1 being dragged from, 2 being dragged to
2-random
ex:
MouseInvRandom([1,2],0);
*******************************************************************************}
procedure MouseInvRandom(SlotArray: TIntegerArray; Option: integer);
var tmpoption, s1,s2,MINVRANBU: integer;
begin
tmpoption:=option;
if tmpoption=2 then tmpoption:=random(2);
case tmpoption of
0: begin
mouseitem(SlotArray[random(length(SlotArray))], false);
waitoption('xamine',1000);
end;
1: begin
s1:=SlotArray[random(length(SlotArray))];
repeat
s2:=SlotArray[random(length(SlotArray))];
until (s1<>s2)
Mousespeed:= MINVRANBU;
Mousespeed:= 10;
DragItem(s1,s2);
mousespeed := MINVRANBU;
end;
end;
end;
begin
setupsrl;
activateclient;
mouseinvrandom([2,25],1)
end.
Thanks.