Log in

View Full Version : DropProcedures



TheGodfather
02-08-2007, 02:27 AM
Hey,
I'm currently working on a powerminer, and I'm wondering what would be a basic way of dropping the ores, and having a boolean const for DroppingGems.
Say if you dont want to drop gems, but only the ores you power mine.

If someone can post a basic way of scripting something like that. What I thought might work was using bitmap
E.g
If findbitmap(blabla,x,y);
then
blablabla
*the blabla functions as skip in the drop procedure.
---------
Only problem in my point of view, you'd need a bitmap for every gem from saph - diamond, and in some of my cases bitmaps lagg the script and have a rate of malfucntioning.

Thanks if you help me guys.

Hey321
02-08-2007, 12:12 PM
DropTo(2,28); Drops everything but the first inventory slot.


DropAll; Self explanatory


If (FindBitmap(Ore,x,y) Then
ChooseOption(x,y,'Drop')

That's a list of useful drop commands. Although, DTM's are better and faster BMP's are easier to use I find.

whales
02-09-2007, 01:02 AM
I would definitely use DTM's for all the gems I can make you a DTM for diamonds right now if you want an example..

Diamond:= DTMFromString('78DA633CC5C4C0D0CFC8800CCE9F3801A66 1A' +
'28C97806A7A50D5C064E16A2E03D54C21A00664D70C026AF6 03D5' +
'4C20A0E630504D0B013517806A5AF1AB010079080BF4');

I would say this is what you need DropExcept(I: Array of Integer);

But I'm not exactly sure if it would work right becuase it is based off of inventory location.. To use it you may need to first have a procedure that clicks the gem based off finding the DTM and then holds mouse and moves to 1,2,3... inv position. And then after that drop all items except inv position of gem! Sounds like some work but if you put in the time it can happen.

pwnaz0r
02-09-2007, 01:34 AM
lol


function DropOres : boolean;
var Orex, Orey : integer;
begin
repeat
if(FindItemName((OreName)))then
begin
GetMousePos(Orex,Orey);
MMouse(Orex,Orey,0,0);
wait(600);
Mouse(Orex,Orey,0,0,false);
wait(600);
ChooseOption(x,y,'rop');
until(not(FindItemName((OreName)))or(etc..);
end;

simple as that ?

whales
02-09-2007, 02:17 AM
Eek major :duh: .. lol yea use that.

[

Boreas
02-09-2007, 04:23 AM
GetMousePos(Orex,Orey);
MMouse(Orex,Orey,0,0);
wait(600);

What's that for???


Make a DTM of any ore (not clay), by clicking the black (65536) outline in about 10 places, with the first dot being near the top. Test it to make sure it picks up on ores but not gems. You'll have to add in clay separately if you want to.

function CoordsToInvSpot(gx,gy:integer):integer;
var col,row:integer;
begin
if ((gx>569) and(gx<600)) then col:=1;
if ((gx>611) and(gx<642)) then col:=2;
if ((gx>653) and(gx<684)) then col:=3;
if ((gx>695) and(gx<723)) then col:=4;

if ((gy>213) and(gy<244)) then row:=1;
if ((gy>249) and(gy<280)) then row:=2;
if ((gy>285) and(gy<316)) then row:=3;
if ((gy>322) and(gy<352)) then row:=4;
if ((gy>357) and(gy<387)) then row:=5;
if ((gy>393) and(gy<424)) then row:=6;
if ((gy>429) and(gy<459)) then row:=7;

result:=((row-1)*4)+col;
end;

procedure DropOres;
var ex,ey:integer;
begin
repeat
if finddtm(dtmOre,ex,ey,MIX1, MIY1, MIX2, MIY2) then
begin
mouseitem(coordstoinvspot(ex,ey+10),false);
chooseoption(x,y,'rop');
end;
until not(finddtm(dtmOre,ex,ey,MIX1, MIY1, MIX2, MIY2));
end;

whales
02-09-2007, 02:35 PM
GetMousePos(Orex,Orey);
MMouse(Orex,Orey,0,0);
wait(600);

What's that for???


Lol I think he just wanted his own vars... But x, y would work fine too. Nice procedure Boreas!

Boreas
02-09-2007, 05:08 PM
No the point is, its moving to where it is already, doing nothing. ty

pwnaz0r
02-09-2007, 09:56 PM
lol i know but i like to make sure it gets there :p I Have a habit of doin that, and i prefer names over DTM's because i believe names are reliable longer

Boreas
02-09-2007, 11:36 PM
lol i know but i like to make sure it gets there

But the whole point of getmousepos is that is is already there.