SRL Archive - Help

Inventory Error; Will not click on first 4 slots.


Dynam0

2013-01-21 07:18:15

I'm trying to make a script which moves to a DTM, right clicks and drop the item. (I'm using this method as I cannot find a DropInv procedure that works on a RSPS.)
The script executes as it should, it moves the mouse to the Iron ore. However, if I place Iron ore in the first 4 horizontal inventory slots, the mouse doesn't pick up the item.

Suggestions? Thanks.


program new;
{$i SRL/SRL.Simba}
var
x, y, IronOre, IronBit:Integer;



procedure DropInv;
begin
If FindBitmapToleranceIn(IronBit, x, y, MIX1, MIY1, MIX2, MIY2, 30) then
begin
MoveMouse(x, y);
WriteLn('We Found Iron');
end;
end;

begin
SetupSRL;
IronOre := DTMFromString('mrAAAAHic42BgYGhgZWCoBeIuIO4D4jYgrgbiIiAuA+JtjAwMR4F4FxBvAOLVULwZiPcBsb2aLNAURjwYP8CnE1k3AHZxCnQ=');
IronBit := BitmapFromString(12, 9, 'meJxdkMEGw0AURdNlF1mULCKMxKi' +
'RRUXIpnQxtDRUS2n0CyJfUfrrPXF5RrlGzDvuO5Pr/BmX7ybLlG1e' +
'7cq28kfXXvb9k/jurlHT9IQPgLIeXIgCwvDiPN0mAefHGyZtAFC4Z' +
'yqA1IfRpiagRZx54Sn5uzcHM1kXhcguA+hHxpjCdZJZE6I5pAzPUQ' +
'9KSqoqBkA9/BAFeYn9AIFQLDs=');
DropInv;
FreeDTM(IronOre);
FreeBitmap(IronBit);
end.

riwu

2013-01-21 09:21:18


However, if I place Iron ore in the first 4 horizontal inventory slots, the mouse doesn't pick up the item.

What do you mean by this?
Also from the code it will merely hover over the first iron ore it found.

Sjoe

2013-01-21 09:50:09

Yep, MoveMouse just move the mouse, still gotta add clickmouse(mouse_right)(I think this is the correct parameter?) and chooseoption('Drop').

doxin

2013-01-21 18:41:55

From: Dynam0
I'm trying to make a script which moves to a DTM, right clicks and drop the item. (I'm using this method as I cannot find a DropInv procedure that works on a RSPS.)
The script executes as it should, it moves the mouse to the Iron ore. However, if I place Iron ore in the first 4 horizontal inventory slots, the mouse doesn't pick up the item.

Suggestions? Thanks.


program new;
{$i SRL/SRL.Simba}
var
x, y, IronOre, IronBit:Integer;



procedure DropInv;
begin
If FindBitmapToleranceIn(IronBit, x, y, MIX1, MIY1, MIX2, MIY2, 30) then
begin
MoveMouse(x, y);
WriteLn('We Found Iron');
end;
end;

begin
SetupSRL;
IronOre := DTMFromString('mrAAAAHic42BgYGhgZWCoBeIuIO4D4jYgrgbiIiAuA+JtjAwMR4F4FxBvAOLVULwZiPcBsb2aLNAURjwYP8CnE1k3AHZxCnQ=');
IronBit := BitmapFromString(12, 9, 'meJxdkMEGw0AURdNlF1mULCKMxKi' +
'RRUXIpnQxtDRUS2n0CyJfUfrrPXF5RrlGzDvuO5Pr/BmX7ybLlG1e' +
'7cq28kfXXvb9k/jurlHT9IQPgLIeXIgCwvDiPN0mAefHGyZtAFC4Z' +
'yqA1IfRpiagRZx54Sn5uzcHM1kXhcguA+hHxpjCdZJZE6I5pAzPUQ' +
'9KSqoqBkA9/BAFeYn9AIFQLDs=');
DropInv;
FreeDTM(IronOre);
FreeBitmap(IronBit);
end.


the coordinates are different on the private server because the globals for SRL moves the coordinates a bit because of the Navigation bar on the real RS, which is nonexistent on ProjectRS06. open /simba/includes/srl/srl/core/globals.simba and see for yourself. you also can't use the variables MIX1, MIY1 etc. for that same reason.