Torrent of Flame
03-23-2008, 08:36 PM
Original my PLM found here: http://www.villavu.com/forum/showthread.php?t=24726
If you liked my tutorial please Rep++ or Rank The Thread. If you actually read it, please comment!
Credits to PLM for providing the outline to this tutorial.
This needed updating as there was alot of errors on that Tutorial, and I feel it is time to get a new one out there for people to use to stop people asking about obsolete items of errors they recieve.
Anyway....
Welcome to Torrent's Updated Power Miner Guide!
This Tutorial will cover:
- AntiBan
- AntiRandoms
- Mining
- FailSafes
- Constants
- Variables
- Loops
- Declare Players
To Start we should name the the program that we are going to use, calling it something significant to the program you are going to make:
program MyFirstPowerMiner;
Then you HAVE to include this part, as it controls everything that we need to use in this script (FindObjCustom, etc.)
{.include SRL/SRL.scar}
The we include our constants. Constants are basically what they say they are, something that is ALWAYS the same, like RockColours, TreeColours, SMART Worlds, etc.
const
RockColour1= 111111;
RockColour2= 222222;
These Rock Colours would be picked from the Rock You wish to mine, so Iron and Rune would be different, The example colours are obviousley false for any type of rock [Prove me wrong on that one ;) ]
Then we have to declare our variables, not variables again explain themselves, something that is a variable, can constantly change. The variables in this case are the x and the y, the co-ordinates on the game screen. It is an "integer" as they are co-ordinates, which are numerical. Tries will be explained later.
var x, y, Tries: integer;
Then we have our first procedure. I will explain the procedure after we see the overview.
procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer:= 0
Players[0].Name := 'Username';
Players[0].Pass := 'Password';
Players[0].Nick := 'erna';
Players[0].Active := True;
end;
Procedure DeclarePlayers tells us the name of the procedure that we are using. Begin starts the procedure [Every "Begin" has an "End", Every "Repeat" has an "Until" and Every "If" has a "Then" - Follow this and it should stop "Idenfitifer Expected ;)]. How Many Players means how many players we are going to use, and Current player tells us which player to start with. Username, Password are pretty basic, but the Nickname HAS to be 3-4 letters of non-capital or without a space of your Username, like mine is. The Active = True tells us if the player is to be run in the script or not.
Now we have our next procedure, our AntiRandoms:
Procedure AntiRandoms;
begin
If(FindFight)then
RunAway('N', True,1,15000);
FindNormalRandoms;
FindLamp('Mining');
end;
And our AntiBan:
procedure AntiBan;
begin
if not LoggedIn then Exit;
case Random(30) of
1: RandomRClick;
2: HoverSkill('Woodcutting', False);
3: RandomMovement;
4: BoredHuman;
5: AlmostLogout;
6: DoEmote(400 +Random(90));
end;
end;
Im Not going to explain AntiBan or AntiRandoms, but you can find a tutorial on them found here: http://www.villavu.com/forum/showthread.php?t=27515
Now onto our actual mining procedure. This part will be merged with an explanation of Fail Safes:
procedure RockMining;
begin
if not LoggedIn then
Exit;
if (not (FindObjCustom(x, y, ['Mi', 'ne'], [RockColour1, RockColour2], 7))) then
Wait(100+random(100));
Tries := Tries + 1;
if(Tries = 20)then
begin
Logout;
Exit;
end else
if FindObjCustom(x, y, ['Min', 'ine'], [RockColour1, RockColour2], 7) then
repeat
case (Random(2)) of
1: Mouse(x, y, 4, 4,false);
ChooseOption('ine');
2: Mouse(x, y, 4, 4, True);
end;
until (InvFull)
end;
From the Start:
procedure RockMining;
begin
if not LoggedIn then
Exit;
We name our procedure, and then it begins. We have our first Fail Safe. If our character is not logged in, the script will exit.
if (not (FindObjCustom(x, y, ['Mi', 'ne'], [RockColour1, RockColour2], 7))) then
Wait(100+random(100));
Tries := Tries + 1;
if(Tries = 20)then
begin
Logout;
Exit;
end else
Well first, if it doesnt find the Object that says "Mine" when hovered over, including a Tolerance of 7, so it can search 7 pixels either side, it will wait 0.2 seconds, add 1 to the number of tries, and try again. If it Tries 20 times with no success, it will logout your character, to stop you standing there like an idiot, and then exit the script, and Ends ELSE - IE, otherwise..
if FindObjCustom(x, y, ['Min', 'ine'], [RockColour1, RockColour2], 7) then
repeat
case (Random(2)) of
1: Mouse(x, y, 4, 4,false);
ChooseOption('ine');
2: Mouse(x, y, 4, 4, True);
end;
until (InvFull)
end;
If it actually finds the Rock to mine, it will repeat a random of these 2, it will hover over the rock and Choose "Mine" or it will automatically click on the rock, to make it more human like. It then ends the case, and the repeat goes with the until, like I said earlier, so it will repeat mining until it has a full inventory, then ends the procedure.
Onto our final procedure before the loop, the dropping of the mined material:
Procedure DropRocks;
begin
if FindObjCustom(x, y, ['Ore'], [RockColour1, RockColour2], 7) then
DropTo(2,28);
end;
So, it begins, and if it finds the Object "Ore" with the colours you have picked (The Ore colour is generally the same as the rock colour) then it will drop ores from inventory position 2, to inventory position 28.
Now for our Loop.
We begin by setting up SRL, then repeating the Mine Procedure & Drop procedure:
begin
SetupSRL;
repeat
RockMining;
DropRocks;
AntiBan;
until (False)
end.
So it begins, sets up SRL, repeats Rock Mining, Drop Rocks and AntiBanning, until it is stopped manually.
NOTE: If someone could do the Drop procedure - Greatly appreciated.
Thanks :spongebob:
If you liked my tutorial please Rep++ or Rank The Thread. If you actually read it, please comment!
Credits to PLM for providing the outline to this tutorial.
This needed updating as there was alot of errors on that Tutorial, and I feel it is time to get a new one out there for people to use to stop people asking about obsolete items of errors they recieve.
Anyway....
Welcome to Torrent's Updated Power Miner Guide!
This Tutorial will cover:
- AntiBan
- AntiRandoms
- Mining
- FailSafes
- Constants
- Variables
- Loops
- Declare Players
To Start we should name the the program that we are going to use, calling it something significant to the program you are going to make:
program MyFirstPowerMiner;
Then you HAVE to include this part, as it controls everything that we need to use in this script (FindObjCustom, etc.)
{.include SRL/SRL.scar}
The we include our constants. Constants are basically what they say they are, something that is ALWAYS the same, like RockColours, TreeColours, SMART Worlds, etc.
const
RockColour1= 111111;
RockColour2= 222222;
These Rock Colours would be picked from the Rock You wish to mine, so Iron and Rune would be different, The example colours are obviousley false for any type of rock [Prove me wrong on that one ;) ]
Then we have to declare our variables, not variables again explain themselves, something that is a variable, can constantly change. The variables in this case are the x and the y, the co-ordinates on the game screen. It is an "integer" as they are co-ordinates, which are numerical. Tries will be explained later.
var x, y, Tries: integer;
Then we have our first procedure. I will explain the procedure after we see the overview.
procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer:= 0
Players[0].Name := 'Username';
Players[0].Pass := 'Password';
Players[0].Nick := 'erna';
Players[0].Active := True;
end;
Procedure DeclarePlayers tells us the name of the procedure that we are using. Begin starts the procedure [Every "Begin" has an "End", Every "Repeat" has an "Until" and Every "If" has a "Then" - Follow this and it should stop "Idenfitifer Expected ;)]. How Many Players means how many players we are going to use, and Current player tells us which player to start with. Username, Password are pretty basic, but the Nickname HAS to be 3-4 letters of non-capital or without a space of your Username, like mine is. The Active = True tells us if the player is to be run in the script or not.
Now we have our next procedure, our AntiRandoms:
Procedure AntiRandoms;
begin
If(FindFight)then
RunAway('N', True,1,15000);
FindNormalRandoms;
FindLamp('Mining');
end;
And our AntiBan:
procedure AntiBan;
begin
if not LoggedIn then Exit;
case Random(30) of
1: RandomRClick;
2: HoverSkill('Woodcutting', False);
3: RandomMovement;
4: BoredHuman;
5: AlmostLogout;
6: DoEmote(400 +Random(90));
end;
end;
Im Not going to explain AntiBan or AntiRandoms, but you can find a tutorial on them found here: http://www.villavu.com/forum/showthread.php?t=27515
Now onto our actual mining procedure. This part will be merged with an explanation of Fail Safes:
procedure RockMining;
begin
if not LoggedIn then
Exit;
if (not (FindObjCustom(x, y, ['Mi', 'ne'], [RockColour1, RockColour2], 7))) then
Wait(100+random(100));
Tries := Tries + 1;
if(Tries = 20)then
begin
Logout;
Exit;
end else
if FindObjCustom(x, y, ['Min', 'ine'], [RockColour1, RockColour2], 7) then
repeat
case (Random(2)) of
1: Mouse(x, y, 4, 4,false);
ChooseOption('ine');
2: Mouse(x, y, 4, 4, True);
end;
until (InvFull)
end;
From the Start:
procedure RockMining;
begin
if not LoggedIn then
Exit;
We name our procedure, and then it begins. We have our first Fail Safe. If our character is not logged in, the script will exit.
if (not (FindObjCustom(x, y, ['Mi', 'ne'], [RockColour1, RockColour2], 7))) then
Wait(100+random(100));
Tries := Tries + 1;
if(Tries = 20)then
begin
Logout;
Exit;
end else
Well first, if it doesnt find the Object that says "Mine" when hovered over, including a Tolerance of 7, so it can search 7 pixels either side, it will wait 0.2 seconds, add 1 to the number of tries, and try again. If it Tries 20 times with no success, it will logout your character, to stop you standing there like an idiot, and then exit the script, and Ends ELSE - IE, otherwise..
if FindObjCustom(x, y, ['Min', 'ine'], [RockColour1, RockColour2], 7) then
repeat
case (Random(2)) of
1: Mouse(x, y, 4, 4,false);
ChooseOption('ine');
2: Mouse(x, y, 4, 4, True);
end;
until (InvFull)
end;
If it actually finds the Rock to mine, it will repeat a random of these 2, it will hover over the rock and Choose "Mine" or it will automatically click on the rock, to make it more human like. It then ends the case, and the repeat goes with the until, like I said earlier, so it will repeat mining until it has a full inventory, then ends the procedure.
Onto our final procedure before the loop, the dropping of the mined material:
Procedure DropRocks;
begin
if FindObjCustom(x, y, ['Ore'], [RockColour1, RockColour2], 7) then
DropTo(2,28);
end;
So, it begins, and if it finds the Object "Ore" with the colours you have picked (The Ore colour is generally the same as the rock colour) then it will drop ores from inventory position 2, to inventory position 28.
Now for our Loop.
We begin by setting up SRL, then repeating the Mine Procedure & Drop procedure:
begin
SetupSRL;
repeat
RockMining;
DropRocks;
AntiBan;
until (False)
end.
So it begins, sets up SRL, repeats Rock Mining, Drop Rocks and AntiBanning, until it is stopped manually.
NOTE: If someone could do the Drop procedure - Greatly appreciated.
Thanks :spongebob: