Log in

View Full Version : Can someone tell me why this won't work?



Bobarkinator
02-25-2007, 09:04 PM
This is for my Varrock miner. I'm adding a couple of things to it before I work on my eye of newt buyer.

I have this:
procedure DoMine;
begin
Case Random(5) of
0: MineStuff1;
1: MineStuff2;
2: MineStuff1;
3: MineStuff2;
4: MineStuff1;
end;
end;

This is so that MineStuff1=It will click the rock normally(e.g. LeftClick)
MineStuff2=It will right click the rock then click mine so its random but it only ever does the first option and I'm wondering how I can get it to do all the options randomly.

Jason2gs
02-25-2007, 09:18 PM
Lemme check...

The Case is set up fine.

Would you mind showing us a little more of the script?

Bobarkinator
02-25-2007, 10:28 PM
What do you want to see? The mining procedures or the main loop?

omgh4x0rz
02-25-2007, 11:11 PM
The mining procedures. The cases are setup fine, so as long as your mining procedures are actually different, you should end up doing the different things randomly.

Bobarkinator
02-25-2007, 11:22 PM
Here are the mining procedures. I think that is has something to do with not repeating the case. Like it selects the number at the beginning of the script then doesn't do it again until the next time around.
procedure MineStuff1;
begin
repeat
if (TypeofOre='Tin') then
begin
if (InvFull=True) then
Exit;
else
if (FindObj(x,y,'ine',Tin,0)) then
begin
Mouse(x,y,4,4,true);
Wait(1350);
WaitwhileMining;
end;
end
else
if (TypeofOre='Copper') then
begin
if(InvFull=True) then
Exit;
else
if (FindObj(x,y,'ine',Copper,0)) then
begin
Mouse(x,y,4,4,true);
Wait(1350);
WaitwhileMining;
end;
end
else
if(TypeofOre='Iron') then
begin
if(InvFull=True) then
Exit;
else
if(FindObj(x,y,'ine',Iron,0)) then
begin
Mouse(x,y,4,4,true);
Wait(1350);
WaitwhileMining;
end;
end;
until(InvFull=True);
end;

procedure MineStuff2;
begin
repeat
if (TypeofOre='Tin') then
begin
if (InvFull=True) then
Exit;
else
if (FindObj(x,y,'ine',Tin,0)) then
begin
Mouse(x,y,4,4,false);
PopUp('ine');
Wait(1350);
WaitwhileMining;
end;
end
else
if (TypeofOre='Copper') then
begin
if(InvFull=True) then
Exit;
else
if (FindObj(x,y,'ine',Copper,0)) then
begin
Mouse(x,y,4,4,false);
PopUp('ine');
Wait(1350);
WaitwhileMining;
end;
end
else
if(TypeofOre='Iron') then
begin
if(InvFull=True) then
Exit;
else
if(FindObj(x,y,'ine',Iron,0)) then
begin
Mouse(x,y,4,4,false);
PopUp('ine');
Wait(1350);
WaitwhileMining;
end;
end;
until(InvFull=True);
end;

There you go:D

Yep I figured it out. I just did this:
procedure DoMine;
begin
repeat
Case Random(5) of
0: MineStuff1;
1: MineStuff2;
2: MineStuff1;
3: MineStuff2;
4: MineStuff1;
end;
until(InvFull=True)
end;

and took the repeats out of the mining procedures

whales
02-25-2007, 11:28 PM
That looks pretty good, basic but efficient. The case random thing remeber is random so it may not produce the exact desired result every time but on average it should be 60% 40%. Try addind some anti-ban for while you wait to mine the ore, rotation of screen possibly. Stuff you do when you mine legit.

Bobarkinator
02-25-2007, 11:45 PM
Ya I have some anti ban in the Procedure WaitwhileMining which does antiban findsnormalrandoms and all the stuff while waiting for manage to pop up in the message box

WhiteShadow
02-25-2007, 11:54 PM
Dude instead of doing your mining like that just do something like this

const
RockT = 'copper'; //copper, tin, iron

procedure LoadColors;
begin
CopperColor:= 0;
IronColor := 0;
TinCOlor:= 0;
end;

procedure RockColor;
begin
case Lowercase(RockT) of
'copper' : RockColor:= CopperColor;
'tin' : RockColor:= TinColor;
end;
end;

Then just use FindObj or whatever with RockColor. Get me?

Bobarkinator
02-26-2007, 03:47 AM
What is RockColor? where is it in SRL?

WhiteShadow
02-26-2007, 04:11 AM
What is RockColor? where is it in SRL?

No no it's just a global variable I used in my example. I guess you don't get me. I'll try to elaborate. So instead of using your Find function with every single color (several if thens.. ), you declare what one variable color(see above RockColor it should be named to something else sorry!) is and always find the ore with that one color. So it's FindObj( RockColor) v.s FindObj (tin) FindObj(copper) FindObj(iron) does that make more sense? Sorry i'm in a hurry to finish my math hw.