PDA

View Full Version : PLM's how to make a simple power miner tut useing srl!



poolikemax
01-23-2008, 08:26 PM
PLM's simple power miner tut!


today im going to show you how to make a simple power miner with SRL, anti randoms and antiban. PLEASE REP++ ME IF YOU LIKE IT

well start off with scar open and the first step is to include SRL
program powerminer;

{.include SRL/SRL.scar}

begin
end.



now let declair vairables VAR and we want to declair "X, Y" as varables and the two colors of the rock were going to mine but were going to declair the colors as a const
so here goes
program powerminer;

{.include SRL/SRL.scar}

const
rockcolor1= 472123;//set the color of the rock
rockcolor2= 567243;//set color of rock (these aren't the real colors)

var x,y: integer;

begin
end.

Step 1:
makeing our first procedure. our first procedure is going to be a SRL one:
declair players(you should know what it means as its in almost every script)

Procedure DeclarePlayers; // this procedure is used to logg players in
begin
HowManyPlayers :=1; // Set Number of Players here.
NumberOfPlayers(HowManyPlayers); // Sets the Players Array Length;
CurrentPlayer:=0; // CurrentPlayer = Array Index

Players[0].Name :='username';//USERNAME
Players[0].Pass :='pass';//PASS
Players[0].Nick :='ser';//3 LETTERS OF YOUR USERNAME NOT THE FIRST ONE
Players[0].Active:=True;//PLAYER IN USE OR NOT


end;


now we want to put it in the main loop but we also want to setupSRL so we have to write these commands in the main loop:
SetupSRL; -so the script knows that we are useing SRL
DeclarePlayers; -used to tell the script the name of the player to loggin
LoginPlayer; -Simple loginplayer
so lets do that
begin
SetupSRL;
DeclarePlayers;
LoginPlayer;

end.


Step 2
adding anti randoms
this is one of the most important things your script needs to have a good working script this is the procedure i use:

Procedure Randoms;
Begin
FindTalk; //finds talkin randoms
FindNormalRandoms; //finds normal randoms
SolveChatRandom; //sloves chat randoms
FindLamp('Woodcutting'); //solves lamp and then choses a skill to update
SolvePinball; //solves pinball random
DwarfItem; //dropes dawalf items
If(FindFight)Then //runs away from fight
Begin
MakeCompass('N');
RunTo('E', True);
Wait(7000 +Random(3000));
RunTo('W', True);
End;
End;



Step 3
adding a antiban
we need this to stop the user getting there account baned. the antiban makes it look like its a real person playing. So here goes
we need a few different antiban procedures you will see what i mean.
before we make the procedure we need to declare randomm as a varable so your varables should now look like this:

var x,y,randomm: integer;

now the anti ban:

procedure antiban;
begin
randomm := Random(4)
case randomm of


0: begin

Wait(3591+(random(287)));
RandomRClick;
Wait(3591+(random(287)));
HighestAngle;
RandomlyChosenSkill;
Randoms
end;

1: begin
Wait(3694+(random(791)));
GameTab(random(13)+1);
Randoms;
Wait(3694+(random(791)));
GameTab(4);
end;

2: begin
Wait(3294+(random(873)));

Randoms;
HoverSkill('Woodcutting' ,false);

Wait(3294+(random(873)));

end;

3: begin
Wait(3694+(random(791)));
GameTab(random(13)+1);
Randoms;
Wait(3694+(random(791)));
GameTab(4);
end;
end;
end;

Step 4
now we have done antiban and anti randoms we can now do the part of the script that makes the player mine a rock. for this we use a fuction called findobject. what it dose is it looks for the given color(the colors we gave as const) and moves the mouse there and checks up the top to see if its the object were looking for!

Procedure minerock;
begin

if not LoggedIn then
Exit;

repeat
if FindObjCustom(x, y, ['Min', 'ine'], [rockcolor1, rockcolor2], 7) then
begin

Mouse(x,y,0,0,false);
Wait(500+(random(150)));

ChooseOption('ine')
randoms
antiban;
writeln('found rock');

end else
writeln('couldnt find rock');
randoms;
antiban;
antiban;
antiban;

until( InvFull )
end;

that loop will keep mineing till the inventery is full

Step 5
dropping the ore

we need to drop the ore so we need to drop everything from iventory spot no2 - spot 28 so here goes

procedure drop;
begin
antiban;
DropToPosition(2,28);;
antiban;
end;

Step 6
adding every thing to the main loop and finnishing things off

so we need to add the following procedure to the main loop:
minerock;
drop;
also we need to make it repeat but we only want to repeat the mine rock and drop procedures. So heres what your main loop should look like

begin
SetupSRL;
DeclarePlayers;
LoginPlayer;
repeat
minerock;
drop;
until (IsFKeyDown(3));


end.

now you should have made a working powerminer now all you need is to add your own sig and instructions. oh finnished script should look somthing like this:

program powerminer;

{.include SRL/SRL.scar}

const
rockcolor1= 472123;//set the color of the rock
rockcolor2= 567243;//set color of rock (these aren't the real colors)

var x,y,randomm: integer;


Procedure DeclarePlayers; // this procedure is used to logg players in
begin
HowManyPlayers :=1; // Set Number of Players here.
NumberOfPlayers(HowManyPlayers); // Sets the Players Array Length;
CurrentPlayer:=0; // CurrentPlayer = Array Index

Players[0].Name :='username';//USERNAME
Players[0].Pass :='pass';//PASS
Players[0].Nick :='ser';//3 LETTERS OF YOUR USERNAME NOT THE FIRST ONE
Players[0].Active:=True;//PLAYER IN USE OR NOT


end;

Procedure Randoms;
Begin
FindTalk; //finds talkin randoms
FindNormalRandoms; //finds normal randoms
SolveChatRandom; //sloves chat randoms
FindLamp('Woodcutting'); //solves lamp and then choses a skill to update
SolvePinball; //solves pinball random
DwarfItem; //dropes dawalf items
If(FindFight)Then //runs away from fight
Begin
MakeCompass('N');
RunTo('E', True);
Wait(7000 +Random(3000));
RunTo('W', True);
End;
End;


procedure antiban;
begin
randomm := Random(4)
case randomm of


0: begin

Wait(3591+(random(287)));
RandomRClick;
Wait(3591+(random(287)));
HighestAngle;
Randoms;
end;

1: begin
Wait(3694+(random(791)));
GameTab(random(13)+1);
Randoms;
Wait(3694+(random(791)));
GameTab(4);
end;

2: begin
Wait(3294+(random(873)));
Randoms;
HoverSkill('Woodcutting' ,false);
Wait(3294+(random(873)));
end;

3: begin
Wait(3694+(random(791)));
GameTab(random(13)+1);
Randoms;
Wait(3694+(random(791)));
GameTab(4);
end;
end;
end;



Procedure minerock;
begin

if not LoggedIn then
Exit;

repeat
if FindObjCustom(x, y, ['Min', 'ine'], [rockcolor1, rockcolor2], 7) then
begin

MoveMouseSmoothEx(x,y, 20,40,45,25,20);
FTWait(1);
clickmouse(x,y,false);
Wait(500+(random(150)));

ChooseOption('ine')
randoms
antiban;
writeln('found rock');

end else
writeln('couldnt find rock');
randoms;
antiban;
antiban;
antiban;

until( InvFull )
end;
procedure drop;
begin
antiban;
DropToPosition(2,28);;
antiban;
end;


begin
SetupSRL;
DeclarePlayers;
LoginPlayer;
repeat
minerock;
drop;
until(IsFKeyDown(3));



I hope you liked my tut and i wish you happy scripting

Im sorry for the poor spelling im crap at spelling lol

i 69 ur nan
01-23-2008, 09:10 PM
Holy shit this tut is gr8 rep++ i learnt loads! ty poolikemax

benny999
01-26-2008, 03:10 AM
thank you so much im gonna use this if it's ok as a base and add walk back auto colour pick and buying or withdrawing pick's that would be good but first i have to learn it all

poolikemax
01-27-2008, 08:50 AM
yer its fine glad you liked

MasterKill
01-27-2008, 08:53 AM
um you should ad standaards. couse else they'll never learn it.

JuKKa
01-27-2008, 09:20 AM
those standards are whicked.................bad..... But else the tut is good i guess.

poolikemax
01-27-2008, 09:21 AM
ok i will update it soon i have learnt alot since i published this tut

Heavenzeyez1
01-27-2008, 09:23 AM
This is very simple..but you should explain to them some commands..beginners won't understand it 100%. :) But it's still something. :)
Eerik.

cj_404
01-29-2008, 01:33 AM
Thank you, thank you, thank you!!! Rep++ for this, I've wanted to script like this for weeks and didn't know how till now. Thank you!

poolikemax
01-29-2008, 07:30 AM
ok cheers will update wen finnish my flaxpicker

the smith400
01-30-2008, 11:36 AM
was this because of my advise?

IM LOVIN IT! bua-bua-buaaa-buuuaaa-buaaaaaaaa

really awesome tut, poolikemax you rock my world

Sir R. M8gic1an
01-30-2008, 02:19 PM
Your randoms procedure could really be shortened to FindNormalRandoms, it already does all those things ;)

~RM

Barda4
02-01-2008, 06:10 PM
I understand a bit of the coding, and this is a good tutorial but i have one problem. Is there way to make the auto miner mine only iron, and if so then where?

poolikemax
02-02-2008, 09:27 PM
just pick the color of the iron rock and fill it in at the const pm if u need explaned more

malotthouse
02-08-2008, 01:51 AM
Nice tut... shouldn't you have an end. in your main loop?

TheChineseMan
02-08-2008, 02:36 AM
hey nice tut but i tried to run on scar 3.14 but it wont work what version of scar and REV to use on?

poolikemax
02-08-2008, 11:52 AM
scar 3.12 dont no y it wont work on scar 3,14 also rev 4.10

Doggie
02-08-2008, 11:54 AM
hi there seems to be an error.
unknonw identifier 'NickNameBMP' in script:confused:

poolikemax
02-08-2008, 03:11 PM
ok to get rid of that message you have to deleat the line under delear players:
NickNameBMP := CreateBitmapMaskFromText(Players[CurrentPlayer].Nick, UpChars); then should work!

srl person
02-08-2008, 08:49 PM
thanks this script rox
helped me alot :)

Jmbyrom1
02-17-2008, 10:59 AM
I had the same problem with the "NickNameBMP" bit but now it says the "RunBack" bit is unknown as well plz help:confused:

Griff
02-20-2008, 01:15 AM
great tut man I think I finally might be getting the hang of this scripting buisiness :D

bubbagump
02-21-2008, 09:15 AM
I knew a little already, but this only cleared things up some...time to scare down a few more to teach my bad self.

kaslim
02-21-2008, 12:55 PM
Nice tutorial pretty short and to the point. But what does this do?FindObjCustom(x, y, ['Min', 'ine'], [rockcolor1, rockcolor2], 7)

poolikemax
02-23-2008, 05:06 PM
it moves the mouse to a given color and checks if at the top it says the given word "mi,ne"

ryanbaron
03-01-2008, 05:51 AM
I had the same problem with the "NickNameBMP" bit but now it says the "RunBack" bit is unknown as well plz help:confused:

I have this problem too.. plz tell us how to fix.

Torrent of Flame
03-02-2008, 09:39 PM
People posting "Great Tut" are just upping their count because "RunBack" doesnt work anymore, and you dont need "SolvePinball" or anything because its all under FindNormalRandoms now.

poolikemax
03-03-2008, 04:23 AM
im updateing kk and just del the line that says
NickNameBMP

851man
03-05-2008, 12:46 AM
whenever i try this script, or any other auto miner, it says this:

Failed when compiling
Line 1: [Error] (1:1): Unable to register function function FindGapsTPA(TPA : TPointArray; MinPixels: Integer): T2DPointArray; in script

what does this mean? (im new)

Codester93
03-09-2008, 03:33 AM
i used this tut to make a script and got my mining up 12 lvls not much but good! thanx, i never really looked into the tut section, but there is alot of quality tuts in here

zipzone
03-09-2008, 06:27 AM
well I did everything you said in the same order you said and it logs me in and then just stops and nothing happens so can someone tell me what I might of done wrong or what I need to do

zipzone
03-09-2008, 06:34 AM
Heres the script I made through this:

program powerminer;

{.include SRL/SRL.scar}

const
rockcolor1= 1120794;//set the color of the rock

var x,y: integer;

Procedure DeclarePlayers; // this procedure is used to logg players in
begin
HowManyPlayers :=1; // Set Number of Players here.
NumberOfPlayers(HowManyPlayers); // Sets the Players Array Length;
CurrentPlayer:=0; // CurrentPlayer = Array Index

Players[0].Name :='';//USERNAME
Players[0].Pass :='';//PASS
Players[0].Nick :='lor';//3 LETTERS OF YOUR USERNAME NOT THE FIRST ONE
Players[0].Active:=True;//PLAYER IN USE OR NOT


end;

begin
SetupSRL;
DeclarePlayers;
LoginPlayer;

end.

Procedure Randoms;
Begin
FindTalk; //finds talkin randoms
FindNormalRandoms; //finds normal randoms
SolveChatRandom; //sloves chat randoms
FindLamp('Prayer'); //solves lamp and then choses a skill to update
SolvePinball; //solves pinball random
DwarfItem; //dropes dawalf items
If(FindFight)Then //runs away from fight
Begin
MakeCompass('N');
RunTo('E', True);
Wait(7000 +Random(3000));
RunTo('W', True);
End;
End;

var x,y,randomm: integer;

procedure antiban;
begin
randomm := Random(4)
case randomm of


0: begin

Wait(3591+(random(287)));
RandomRClick;
Wait(3591+(random(287)));
HighestAngle;
RandomlyChosenSkill;
Randoms
end;

1: begin
Wait(3694+(random(791)));
GameTab(random(13)+1);
Randoms;
Wait(3694+(random(791)));
GameTab(4);
end;

2: begin
Wait(3294+(random(873)));

Randoms;
HoverSkill('Mining' ,false);

Wait(3294+(random(873)));

end;

3: begin
Wait(3694+(random(791)));
GameTab(random(13)+1);
Randoms;
Wait(3694+(random(791)));
GameTab(4);
end;
end;
end;

Procedure minerock;
begin

if not LoggedIn then
Exit;

repeat
if FindObjCustom(x, y, ['Min', 'ine'], [rockcolor1, rockcolor2], 7) then
begin

Mouse(x,y,0,0,false);
Wait(500+(random(150)));

ChooseOption('ine')
randoms
antiban;
writeln('found rock');

end else
writeln('couldnt find rock');
randoms;
antiban;
antiban;
antiban;

until( InvFull )
end;

procedure drop;
begin
antiban;
DropToPosition(2,28);;
antiban;
end;

begin
SetupSRL;
DeclarePlayers;
LoginPlayer;
repeat
minerock;
drop;
until (IsFKeyDown(3));


end.

Doesnt say any errors, successfully executed but its not mining any of the rocks or moving or anything after it logs in. Is there something else I have to do to get the player to move from rock to rock or something? Someone help me please.

Et0h
03-09-2008, 11:49 AM
This tut is great. Helped a lot understanding basic scripts.

Blaze
03-16-2008, 06:02 PM
Whats the difference between FindObjCustom and FindObj exactly?

Pwnt by Pwnt
03-18-2008, 05:07 AM
good tut for beginners, which I seem to be now that S.M.A.R.T. is out... could you explain how to make S.M.A.R.T. scripts work and how to make a script with S.M.A.R.T. ? thanks :]

Dgby714
03-21-2008, 12:29 AM
Great Tut

Gold
03-23-2008, 07:12 PM
Im Gonna Make A script with this Guys make sure to give him cred when u use this holy work Props+++++


A few Problems i Just Tried Compiling the script you gave at end and got these errors

Line 55: [Error] (12634:1): Unknown identifier 'HighestAngle' in script
Line 117: [Error] (12696:1): Unknown identifier 'DropToPosition' in script

kil8er
04-16-2008, 04:37 PM
whenever i try this script, or any other auto miner, it says this:

Failed when compiling
Line 1: [Error] (1:1): Unable to register function function FindGapsTPA(TPA : TPointArray; MinPixels: Integer): T2DPointArray; in script

what does this mean? (im new)

I know this error when i used Scar 3.12
Now I'm using Scar 3.15 and it don't gives the error

Sorry for my English i'm from the netherlands

Torrent of Flame
04-16-2008, 07:37 PM
http://www.villavu.com/forum/showthread.php?t=27850

Use this one. Its the updated one.

jacka scar MASTER
04-24-2008, 12:20 AM
thanks for the script tut helped me heaps and now i am only part noob to scar
u rock

spartan6934
04-24-2008, 04:08 AM
thanks. been looking for one of these

1-DUB
04-24-2008, 04:25 AM
nice tut, i loved it.. man srl has come a long way since i last used it...

hooligan-2oo8
05-09-2008, 01:12 PM
Thanks going to have to try and use this

Griff
05-09-2008, 10:37 PM
Great tut its perfect for me cause I'm just getting past the beginner stage, but I still don't understand much of the intermediate stuff. Hopefully this will help me out

Zlakata
05-15-2008, 04:09 PM
Great tut but i get Line 55: [Error] (12709:1): Unknown identifier 'HighestAngle' in script as an error :\\

But nice tut

dver
05-22-2008, 11:22 AM
Great tut but i get Line 55: [Error] (12709:1): Unknown identifier 'HighestAngle' in script as an error :\\

But nice tut

Use SetAngle(True); instead

insanomano
06-29-2008, 07:24 PM
ok, that was great, work on standards, show progress report, show how to make it multiplayer, you can shorten some of those procs and stuff like antirandoms and antiban but other than that great tutorial. :D

MetalancA
07-01-2008, 02:33 AM
I keep getting


"Line 52: [Error] (12694:1): Unknown identifier 'RandomlyChosenSkill' in script"
and
"Line 116: [Error] (12759:1): Unknown identifier 'DropToPosition' in script"

Though I downloaded the latest SRL o.0

Can anyone tell me whats wrong?

fuxnix
09-24-2008, 05:01 PM
nice tutorial it its gonna confusing but worth reading it ill to make scripts someday

poolikemax
11-16-2008, 05:44 PM
cool thnks 4 feed bak