View Full Version : Im fixing a powermner..
Im fixing a powerminer thats going to be realeased soon but i was wondering how do you drop uncuts?
Thanks
Starblaster100
10-31-2006, 10:08 AM
make bitmaps / dtms of the uncuts. If you find them in your inventory after full load, call a drop procedure
make bitmaps / dtms of the uncuts. If you find them in your inventory after full load, call a drop procedure
So i would have to mine till i get every uncut? I was was thinking of something easier...
Starblaster100
10-31-2006, 09:43 PM
lol, no you mine normally. And after ever full load of coal / iron, you check your inventory if there are any uncuts there. If so, then you drop them.
Procedure DropUncuts;
Begin
While(FindDTM(UncutDTM, x, y, MIX1, MIY1, MIX2, MIY2))do
Begin
Mouse(x, y, 3, 3, False);
Wait(100 + Random(70));
If(FindText(x, y, 'Drop', UpChars, MIX1, MIY1, MIX2, MIY2))then
Begin
Mouse(x, y, 3, 3, True);
Wait(500 + Random(500));
end;
end;
end;
Something i quickly whipped together ;) May need a little editting, and you have to create the DTM
Junior
10-31-2006, 11:34 PM
Star i was wondering... Whats the difference of using 'While' 'Do' instead of 'If' 'Then'?
Boreas
10-31-2006, 11:51 PM
While does it multiple times. If does it once. Repeat if is the same as while. However I like repeat if better because it offers more flexibilty in the until condition.
program New;
const
booger=2; //dont touch
whichone='whiledo'; //choose 'whiledo' or 'ifthen' or 'repeatifthen'
begin
case whichone of
'whiledo':
begin
while booger=2 do
begin
writeln('lala');
end;
end;
'ifthen':
begin
if booger =2 then writeln('lala');
end;
'repeatifthen':
begin
repeat
if booger =2 then writeln('lala');
until not(booger=2);
end;
end;
end.
Similiarly, I like
repeat
i:=i+1;
dostuff;
until i=some number;
//better than
for i= 0 to some number do
dostuff;
end;
lol, no you mine normally. And after ever full load of coal / iron, you check your inventory if there are any uncuts there. If so, then you drop them.
Procedure DropUncuts;
Begin
While(FindDTM(UncutDTM, x, y, MIX1, MIY1, MIX2, MIY2))do
Begin
Mouse(x, y, 3, 3, False);
Wait(100 + Random(70));
If(FindText(x, y, 'Drop', UpChars, MIX1, MIY1, MIX2, MIY2))then
Begin
Mouse(x, y, 3, 3, True);
Wait(500 + Random(500));
end;
end;
end;
Something i quickly whipped together ;) May need a little editting, and you have to create the DTM
Thanks stary i will give you credit too :D
And please unblock me on msn for whatever reason i did which i dont know.
Thanks
Starblaster100
11-01-2006, 03:32 PM
np,
As Boreas said above:
While See_DTM do
Begin
...
end;
Is the same as:
Repeat
...
Until not(See_DTM)
Wizzup?
11-01-2006, 04:03 PM
Not totally true.
From SCAR Manual :
Repeat loop is very similar, except the condition is checked at the end of the loop and it's exit condition (if it's true, the loop ends), so it always go through repeat-until loop at least 1 time.
While-Do, won't go through the loop at least once. ;)
Boreas
11-01-2006, 05:04 PM
Then you can wrap everything in the repeat with an if then to check it before going through. Repeat until FTW!!
Ok, i made the dtm for a uncut and puted it in, renamed it, changed the procedure a little bit star :P and put the procedure in the main loop, it compiles but it still just does the ores:eek: , any ideas?:confused:
Ok i made the dtm, changed ur procedure a little bit star to fix the dtm and added the drop uncuts into the main line and it compiles but doesnt drop the uncuts still any ideas?
Starblaster100
11-01-2006, 09:04 PM
it hasnt found the dtm, simple as that. Remake it
Powered by vBulletin® Version 4.2.1 Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.