SRL Archive - OSR Help

Help on MouseItem


swisspking

2010-04-03 16:59:02

Okay, I need to do something which moves the mouse to inv slots and clicks them. There is MouseItem, I know. I could do it like

for i := 1 to 28 do
MouseItem(i,True);

But I need something which doesn't click from 1-28 but like

function ClickFromTopToBottomAndBack;
begin
MouseItem(1,True);
MouseItem(5,True);
MouseItem(9,True);
MouseItem(13,True);
MouseItem(17,True);
MouseItem(21,True);
MouseItem(25,True);
MouseItem(26,True);
MouseItem(22,True);
MouseItem(18,True);
MouseItem(14,True);
MouseItem(10,True);
MouseItem(6,True);
MouseItem(2,True);
MouseItem(3,True);
MouseItem(7,True);
MouseItem(11,True);
MouseItem(15,True);
MouseItem(19,True);
MouseItem(23,True);
MouseItem(27,True);
MouseItem(28,True);
MouseItem(24,True);
MouseItem(20,True);
MouseItem(16,True);
MouseItem(12,True);
MouseItem(8,True);
MouseItem(4,True);
end;
How would I do this? Thanks for your help! :)

YoHoJo

2010-04-03 17:02:29

Some snippits from my powerminer.

Var RockPattern: Array Of TIntegerArray;

Procedure BasicSetup;
Begin
SetArrayLength(RockPattern, 2);
RockPattern[0]:=[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];
RockPattern[1]:=[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];
End;


For I:=0 to 27 Do
Begin
If Not(LoggedIn) Then Break;
StatsGuise('Dropping Ores: ' + IntToStr(InvCount));
RT:=GetSystemTime;
If FindNormalRandoms Then
IncEx(WeMined, GetSystemTime - RT);
SlotBox:=InvBox(RockPattern[R][I]);
If FindDTm(OreMid, x, y, SlotBox.X1, SlotBox.Y1, SlotBox.X2, SlotBox.Y2) Then
Begin
MouseItem(RockPattern[R][I], False);

Is how I did it, let me know if you need any more clarification about the code.

Timer

2010-04-03 17:02:41

only other way I can think of is..
procedure ClickFromTopToBottomAndBack;
var
Clicks: TIntegerArray;
i, h: Integer;
begin
Clicks := [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];
h := High(Clicks);
for i := 0 to h do
MouseItem(i, True);
end;

EDIT:
:ninja:

YoHoJo

2010-04-03 17:06:21

Timer, that doesn't work correctly actually :p
Run this and see:
Program Bla;

var
Clicks: TIntegerArray;
i, h: Integer;
begin
Clicks := [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];
h := High(Clicks);
for i := 0 to h do
WriteLn(IntToStr(i));
end.

You want it like this
Program Bla;

var
Clicks: TIntegerArray;
i, h: Integer;
begin
Clicks := [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];
h := High(Clicks);
for i := 0 to h do
WriteLn(IntToStr(Clicks[i]));
end.

:D

swisspking

2010-04-03 17:11:54

Okay, Timer, your Code seems to do the same as
for i := 1 to 28 do
MouseItem(i,True);

And YoHoJo, let me try to catch you on irc or something :) (Are you online atm?)
(setting up the stoof now)

Thanks for the fast responses
~Swiss

i luffs yeww

2010-04-03 17:18:04

DropPattern is already in SRL, isn't it?

swisspking

2010-04-03 17:56:58

Okay, woot thanks alot :P

I just had an epicly funny moment as I saw the result! :D

~Swiss

Timer

2010-04-03 21:35:42

Sorry, i meant Clicks, not just i.. shit. :(