View Full Version : What's wrong with this proecdure?
KeepBotting
06-17-2012, 08:02 PM
It doesn't work. Doesn't do anything.
procedure MineRock1; //Credits to Siel of Villavu for this.
var x, y, PlusOne, RockCounter: integer;
begin
if InvFull then
WriteLn('Status: Our inventory is full! No need to mine ore #1!');
exit;
MakeCompass('N');
SetAngle(SRL_ANGLE_HIGH);
repeat
FindNormalRandoms;
PlusOne:= InvCount + 1
WriteLn('Status: Finding a rock to mine.');
if FindObj(x, y, 'ocks', 6517094, 10) then //This finds the object, records the X and Y values, and tells the script to find the option "Rocks".
WriteLn('Status: Mining rock.');
Mouse(x, y, 0, 0, mouse_Right);
ChooseOption('ine Adam'); //This tells the script to right-click on the object and select "Mine Adamant".
MarkTime(RockCounter);
AntiBanSm;
Wait(15000+random(5000));
FindNormalRandoms;
until (InvCount=PlusOne)
if (InvCount=PlusOne) then
WriteLn('Status: Rock has been mined. Proceeding to next rock.');
Inc(OresMined);
WriteLn('Status: We have mined 1 ore so far on this World.');
end;
Recursive
06-17-2012, 08:09 PM
if InvFull then
begin
WriteLn('Status: Our inventory is full! No need to mine ore #1!');
exit;
end
repeat
FindNormalRandoms;
PlusOne:= InvCount + 1
WriteLn('Status: Finding a rock to mine.');
if FindObj(x, y, 'ocks', 6517094, 10) then //This finds the object, records the X and Y values, and tells the script to find the option "Rocks".
begin
WriteLn('Status: Mining rock.');
Mouse(x, y, 0, 0, mouse_Right);
ChooseOption('ine Adam'); //This tells the script to right-click on the object and select "Mine Adamant".
MarkTime(RockCounter);
AntiBanSm;
Wait(15000+random(5000));
FindNormalRandoms;
end;
until (InvCount=PlusOne)
if (InvCount=PlusOne) then
begin
WriteLn('Status: Rock has been mined. Proceeding to next rock.');
Inc(OresMined);
WriteLn('Status: We have mined ' + OresMined + 'ores so far on this World.');
end;
The problem was that you forgot to use begin and end. The script is read from top to bottom and each line is executed as seeming fit. Paste the parts I edited into your script and it should work now...I think
KeepBotting
06-25-2012, 02:24 AM
if InvFull then
begin
WriteLn('Status: Our inventory is full! No need to mine ore #1!');
exit;
end
repeat
FindNormalRandoms;
PlusOne:= InvCount + 1
WriteLn('Status: Finding a rock to mine.');
if FindObj(x, y, 'ocks', 6517094, 10) then //This finds the object, records the X and Y values, and tells the script to find the option "Rocks".
begin
WriteLn('Status: Mining rock.');
Mouse(x, y, 0, 0, mouse_Right);
ChooseOption('ine Adam'); //This tells the script to right-click on the object and select "Mine Adamant".
MarkTime(RockCounter);
AntiBanSm;
Wait(15000+random(5000));
FindNormalRandoms;
end;
until (InvCount=PlusOne)
if (InvCount=PlusOne) then
begin
WriteLn('Status: Rock has been mined. Proceeding to next rock.');
Inc(OresMined);
WriteLn('Status: We have mined ' + OresMined + 'ores so far on this World.');
end;
The problem was that you forgot to use begin and end. The script is read from top to bottom and each line is executed as seeming fit. Paste the parts I edited into your script and it should work now...I thinkOoh, thank you. I shall test this sexy-ass piece of work you have provided for me.
Any if then statement will only perform the following line if the statement results true.
If the statement results false it will skip the next line and continue on doing the rest of the procedure.
EG.
if FindObj(x, y, 'ocks', 6517094, 10) then //This finds the object, records the X and Y values, and tells the script to find the option "Rocks".
WriteLn('Status: Mining rock.');
Mouse(x, y, 0, 0, mouse_Right);
This will try to find the object specified in FindObj and if it does it will write the line 'Status: Mining rock.' then go on to perform the right click.
If this doesn't find the object specified in FindObj it will not write the line but it will still perform a right click where the mouse already is.
Any if then statement you create where you want more than one task to be performed afterwards should be written with a begin and end.
EG.
if FindThis then
begin
WriteLn('We found it!');
Mouse(x,y,0,0,mouse_Right);
end else
WriteLn('We did not find it.');
The same applies for if you want it to do multiple things if the statement results false
EG.
if FindThis then
begin
WriteLn('We found it!');
Mouse(x,y,0,0,mouse_Right);
end else
begin
WriteLn('We did not find it.');
FindSomethingElse;
end;
Powered by vBulletin® Version 4.2.1 Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.