PDA

View Full Version : [Mining] Ideas for my amazing mining script?



RedIce
03-17-2010, 06:50 PM
:stirthepot:Miner Ideas Wanted!:stirthepot:

So far, I have so basic power-mining stuff, it can power mine and bank.

I want this script to have extensive user options, and I'll be adding a form so it is easy to use. I think I will also release a non-bank version for the freeforall forum

Ill add good ideas into a code-box so no one repeats.


Check to see if someone is mining rock before I click it.

Please dont spam this

Coh3n
03-17-2010, 06:58 PM
Multi-location? You'd have to be careful though since some walking paths would be hard to do in color.

You should make your main locations, ones that aren't common. By that I mean ones that haven't been scripted (i.e. Crafting guild, Edgeville dungeon, etc.). Those would be hard with color walking, but you could always use reflection. :)

It seems like you're pretty determined, good luck!

Cheers,
Coh3n

RedIce
03-17-2010, 07:01 PM
I am, haha, I have always like scar but never enough to write a nice script. And I am planning on learning reflection, except I hear it is down right now... am I wrong?? I hope so :P

Coh3n
03-17-2010, 07:03 PM
I am, haha, I have always like scar but never enough to write a nice script. And I am planning on learning reflection, except I hear it is down right now... am I wrong?? I hope so :P
It is and it isn't. There are certain things that work, but I know for sure the walking works. To be honest, you should do everything you can in color, that way you have less to update if reflection breaks. :)

RedIce
03-17-2010, 07:04 PM
Yea. Good idea, I think I could have the script only check itself with reflection, but not ever having used it I probably make that sound easy.

Coh3n
03-17-2010, 07:08 PM
Yea. Good idea, I think I could have the script only check itself with reflection, but not ever having used it I probably make that sound easy.
I'm not sure I know what you mean.

RedIce
03-17-2010, 07:10 PM
Lol, i mean that my script would primarily search for colors, but then use reflection to make sure its going to click what i want. Do i make sense?

Coh3n
03-17-2010, 07:11 PM
Lol, i mean that my script would primarily search for colors, but then use reflection to make sure its going to click what i want. Do i make sense?
Ohh, yes you do. :)

And that's a very smart idea. You can use defines so you can enable/disable reflection by commenting one line. This way, if the hooks are outdated (you'll learn about hooks when you learn about reflection), the script can still run. :)

RedIce
03-17-2010, 07:14 PM
OK, still making it sound easy, is reflection really that simple though?

Coh3n
03-17-2010, 07:15 PM
OK, still making it sound easy, is reflection really that simple though?
Reflection overall is very simple, but it is a little more complicated for what you mentioned above, but I'm sure it's nothing you can't handle.

Timer
03-17-2010, 07:16 PM
Reflection is as simple as:
WalkTo(Point(3164, 3486), MinutesBeforeFail*60*1000);

RedIce
03-17-2010, 07:19 PM
Haha, that is one of the things I dont understand about reflection, how does it find where a tile is in x,y screen coordinates, and how far can reflection travel?

Coh3n
03-17-2010, 07:23 PM
Haha, that is one of the things I dont understand about reflection, how does it find where a tile is in x,y screen coordinates, and how far can reflection travel?
As far as you tell it. And, you have to look through the reflection include to understand how each function works. ;)

Timer
03-17-2010, 07:25 PM
Haha, that is one of the things I dont understand about reflection, how does it find where a tile is in x,y screen coordinates, and how far can reflection travel?

Reflection can travel everywhere. :)
To get a tile-- run this. Let smart load, etc etc. Hit F2 to print your tile.
{.include SRL\SRL\Misc\Smart.scar}
{.include SRL\SRL.scar}

const
MyPlayer = 'f.U';
BaseX = 'sc.h';
BaseY = 'pr.e';
CurrentX = 'r';
CurrentY = 'h';

function GetMyPos:TPoint;
var
me: Integer;
begin
me := SmartGetFieldObject(0, MyPlayer);
Result.x := SmartGetFieldInt(0, BaseX) + SmartGetFieldInt(me, CurrentX) shr 7;
Result.y := SmartGetFieldInt(0, BaseY) + SmartGetFieldInt(me, CurrentY) shr 7;
SmartFreeObject(me);
end;

begin
SetupSRL;
repeat
Wait(100);
if (IsFKeyDown(2)) then
begin
Writeln('Tile is: Point(' + IntToStr(GetMyPos.x) + ', ' + IntToStr(GetMyPos.y) + ')');
while (IsFKeyDown(2)) do
Wait(50);
end;
until False;
end.

RedIce
03-17-2010, 07:25 PM
As far as you tell it. And, you have to look through the reflection include to understand how each function works. Yea, but aren't plug-ins compiled? Obviously not(since i can look in it), but isn't being compiled what makes things faster?

Timer
03-17-2010, 07:26 PM
Yea, but aren't plug-ins compiled? Obviously not(since i can look in it), but isn't being compiled what makes things faster?

Reflection is a include. You gotta download it via SVN.

RedIce
03-17-2010, 07:28 PM
If reflection is an include, then how does it see all the info in rs2?

Timer
03-17-2010, 07:31 PM
If reflection is an include, then how does it see all the info in rs2?

Reflection calls functions that are built into SMART. SMART can read the client.
;)

I.E.
me := SmartGetFieldObject(0, 'f.U');

mysterious123
03-17-2010, 07:32 PM
I know I'm not much of pro scripter, but I advise you to first have it mine fast and very stable. Enhance it with time as most scripters do - though don't give up.
Since what good does one script with many features have if it only lasts 30 mins?

Other than that, if you want it to generally mine anywhere and everything then making it mine in the guild and bank would be very nice.

A great feature for mine-scripts is to check if someone is mining a certain rock and then make sure not to click it. Or go to a different rock if too many people are on one, or to switch worlds if more than X miners are around.

But as I said - I suggest to have it super stable and will be able to run for hours before continuing. A simple but affective script is better than a complicated but less affective one.

RedIce
03-17-2010, 07:32 PM
Ohhhh, wow, should have known, ha-ha, that means reflection only works if i use smart though, right?

Timer
03-17-2010, 07:33 PM
Ohhhh, wow, should have known, ha-ha, that means reflection only works if i use smart though, right?

Correct.

RedIce
03-17-2010, 07:36 PM
I know I'm not much of pro scripter, but I advise you to first have it mine fast and very stable. Enhance it with time as most scripters do - though don't give up.
Since what good does one script with many features have if it only lasts 30 mins?

Other than that, if you want it to generally mine anywhere and everything then making it mine in the guild and bank would be very nice.

A great feature for mine-scripts is to check if someone is mining a certain rock and then make sure not to click it. Or go to a different rock if too many people are on one, or to switch worlds if more than X miners are around.

But as I said - I suggest to have it super stable and will be able to run for hours before continuing. A simple but affective script is better than a complicated but less affective one.


Yea, that is how I plan on making it, but i want to know how everything will be integrated into it. I have already started making it, lol.


You also mention that I should check rocks for other miners, I have thought of that, but it doesn't seem easy, but maybe reflection can handle that.

As an anti-ban I could reverse that effect and annoy people every once in a while, haha:P. I would speak to make it un-botlike.

Timer
03-17-2010, 07:38 PM
IsInteracting()
with the rock index.
...Maybe.

RedIce
03-17-2010, 07:40 PM
lol, im gonna read a tut on reflection right now, it cant be this easy:P.

mysterious123
03-17-2010, 07:45 PM
Yea, that is how I plan on making it, but i want to know how everything will be integrated into it. I have already started making it, lol.


You also mention that I should check rocks for other miners, I have thought of that, but it doesn't seem easy, but maybe reflection can handle that.

As an anti-ban I could reverse that effect and annoy people every once in a while, haha:P. I would speak to make it un-botlike.

Speaking isn't so good since people will start answering and once it will seem you ignore them and keep muttering to yourself - they will report you. Because it would seem too obvious.

Annoying others would cause people to talk to you as well, so I think you should omit from doing it.

RedIce
03-17-2010, 07:52 PM
OK, im in rs2 right now, in the guild.

What is a very successful way of finding ore, but not clicking the black and not clicking the ground? Is it possible to use a 2 point dtm and find a point to the side of the black line?

RedIce
03-17-2010, 07:59 PM
Yea, your probably right, that talking is a big way to alert people I'm botting

Dynamite
03-17-2010, 08:05 PM
Use a TPA to find the color of the vein :)

RedIce
03-17-2010, 08:10 PM
i just searched forum tuts, no tpa, but im sure i have heard of it and it is something i should know, lol. Where can i learn it?

Frement
03-17-2010, 08:13 PM
http://villavu.com/forum/showthread.php?t=49067

Read that tutorial.

silor
03-17-2010, 08:14 PM
Auto coloring with FindObjTPA ftw. :) http://villavu.com/forum/showpost.php?p=695053&postcount=3

RedIce
03-17-2010, 08:15 PM
Thank you both

RedIce
03-17-2010, 08:21 PM
...I looked at both those, and i have learned that a TPA is an array of points, so whats the difference between a DTM and TPA? I searched the whole site and got no hits for tpa...

Frement
03-17-2010, 08:24 PM
...I looked at both those, and i have learned that a TPA is an array of points, so whats the difference between a DTM and TPA? I searched the whole site and got no hits for tpa...

Well, DTM has many other values in the points too, TPA has just the points.

For example, heres my AttackGuard function.
function AttackGuard( GuardColor: Integer ): Boolean;
var GuardTP: TPoint;
GuardTPA: TPointArray;
GuardATPA: T2DPointArray;
i, GuardHigh: Integer;
begin
if ( FindColorsSpiralTolerance( x, y, GuardTPA, GuardColor, MSX1, MSY1, MSX2, MSY2, 3 ) ) then
begin
SortTPAFrom( GuardTPA, Point( MSCX, MSCY ) );
GuardATPA := TPAtoATPAEx( GuardTPA, 20, 20 );
GuardHigh := High( GuardATPA );
for i := 0 to GuardHigh do
begin
GuardTP := MiddleTPA( GuardATPA[i] );
MMouse( GuardTP.X, GuardTP.Y, 3, 3 );
if ( IsUpTextMultiCustom( ['ttack', 'uard', 'ck Gu'] ) ) then
begin
GetMousePos( x, y );
if not ( IsFightAt( x, y ) ) then begin
Mouse( x, y, 0, 0, True );
Flag;
Wait( 200 + Random( 500 ) );
Result := True;
Break;
end else begin
Result := False;
Break;
end;
end;
end;
end;
end;

RedIce
03-17-2010, 08:29 PM
Oh, OK. I have been thinking of DTMs as TPAs. haha. that makes sense, but how would i click the brwn part of a coal rock... since with shadows and camera movement the rocks colors change

Frement
03-17-2010, 08:35 PM
There are several things you should have the basic idea of, TPoint, TPointArray, T2DPointArray, TIntegerArray, TStringArray. Prefer using those instead of "Array of String" or "Array of Integer".

For the color i would recommend getting all the colors with some tolerance, lets say 5-10 and store them into TPA. And work with that, the tutorial i already linked here will teach you on that and you can check my function for guidance.

RedIce
03-17-2010, 08:45 PM
How do I find a point perpendicular to a DTM?( so i can click beside the color line in a rock instead of on it)

Frement
03-17-2010, 08:47 PM
I dont understand what you want exactly.

WT-Fakawi
03-17-2010, 08:48 PM
A good idea would be to print out scripts that work for you to examine the flow. Some good old outdated scripts to print out maybe:

Wizzup/Fakawi's MultiMiner (http://villavu.com/forum/showthread.php?t=28430)

Wizzup's Powerminer (http://villavu.com/forum/showthread.php?t=1264) (5k downloads!)

or perhaps even our old Mining Guild Miner (http://villavu.com/forum/showthread.php?t=2225) (4k downloads!)

Also: it is vital to become in sync with runescape. Once you have a script up and running you need to watch it for a loooong time and iron out all the little things that go wrong that lead to disaster. Been there many times :)

Start small, dont overdo it. Make something beautiful ;)

RedIce
03-17-2010, 08:50 PM
For a first script, I'm making this something to be proud of, lol, thanks for the links/idea. I'll do that now. Thanks

Frement
03-17-2010, 08:55 PM
I would recommend like making power miner or miner that banks for some place.

RedIce
03-17-2010, 09:03 PM
Can I get the rotation of a dtm in the main-screen? I want this so I can click the area beside the vein after finding the direction the vein is pointing.

This script, still in its infancy, is confined to the mining guild. I will worry about banking after I finish it as a powerminer

grats
03-18-2010, 04:20 AM
A good iron miner for al kharid up north mining zone that banks would be nice

Coh3n
03-18-2010, 06:23 AM
Can I get the rotation of a dtm in the main-screen? I want this so I can click the area beside the vein after finding the direction the vein is pointing.

This script, still in its infancy, is confined to the mining guild. I will worry about banking after I finish it as a powerminer
I highly doubt you're going to get a DTM to work for object finding on the main screen. If you're talking about not clicking the "vein" of ore in the rocks every time, just have it click an offset of the TPA found (i.e. increase the randomness of the MMouse procedure):

MMouse(x, y, 10, 10);

RedIce
03-18-2010, 11:25 AM
if I use offset and if the vein color is picked at the edge of the rock then wont it move the mouse over the ground next to the vein, instead of straight to the rock?

Frement
03-18-2010, 02:26 PM
if I use offset and if the vein color is picked at the edge of the rock then wont it move the mouse over the ground next to the vein, instead of straight to the rock?

Read the tutorial i linked, it really helps you on this subject.

Coh3n
03-18-2010, 03:37 PM
if I use offset and if the vein color is picked at the edge of the rock then wont it move the mouse over the ground next to the vein, instead of straight to the rock?
It's possible, but since you'll have an uptext check, it won't click. It will just move the mouse to the next point in the TPA.

RedIce
03-18-2010, 04:08 PM
You dont think jagex will notice the mouse go near a rock then leave?

Coh3n
03-18-2010, 04:51 PM
You dont think jagex will notice the mouse go near a rock then leave?
No, they don't track mouse movements. But even if they did, people misclick/move all the time, I wouldn't really say that it's signs of a bot. You could even make it only click with a lot of randomness once ever 10 times or something.

RedIce
03-18-2010, 06:06 PM
...I like that idea. couldnt be a every 10 times though, because then its repetitive.. like every 4 + random(10) clicks.

Coh3n
03-18-2010, 09:04 PM
...I like that idea. couldnt be a every 10 times though, because then its repetitive.. like every 4 + random(10) clicks.
Well if you did Random(10), chances are it's not going actually misclick it once every 10 times.

g0tp0t
03-18-2010, 09:20 PM
But it still seems traceable, because every misclick is on every tenth twentieth thirtieth click ect. so i could maybe start at 10? Then add random to that?

Coh3n
03-18-2010, 09:26 PM
But it still seems traceable, because every misclick is on every tenth twentieth thirtieth click ect. so i could maybe start at 10? Then add random to that?
It wouldn't do it like that. Run this:

program New;

var
i: Integer;
begin
repeat
Inc(i);
Writeln(i);
if (Random(10) = 1) then
Writeln('Random = 1')
else
Writeln('Random != 1');
until(i = 100);
end.

Take a look at when "Random = 1" comes up in the debug. Sometimes it'll come up after 7 "Random != 1", sometimes 3, sometimes 12. That's how the random command works. It's completely random. :)

g0tp0t
03-18-2010, 09:34 PM
haha, ya, I understand that, but how I didn't realize that....:duh:

I want to add a check through reflection to make sure no one who is better at mining than me is mining my rock, can I do that without modifying Runescape?

you could make that simpler and use a for loop :P

mysterious123
03-23-2010, 09:33 PM
haha, ya, I understand that, but how I didn't realize that....:duh:

I want to add a check through reflection to make sure no one who is better at mining than me is mining my rock, can I do that without modifying Runescape?

you could make that simpler and use a for loop :P

I don't think you can unless you look him (it) in the high scores.
Well, you'd know also by the picaxe, but that doesn't say much except for "My mining is over 40" or "Under 40" (since people usually use other kinds of pics very temporarily - or only for a short amount of time until they get their lvls up)...

But it doesn't really matter. There is a certain percentage for a player to mine a rock. While your levels rises, that percentage rises with it (by a certain percentage), so basically, someone with a lvl 30 mining could get a rock of a lvl 70 mining.

And that means that you should just look if the player started mining after you or before you. (That would be done with reflection I assume)

Heavenguard
03-23-2010, 10:06 PM
I dun think a Miner has to be complicated xD, i mean this is runescape, and to me its not really a big thing when your training a skill. But since were all scripters i guess we could just make it fancy :D why not make a checklist.
-What type of Rocks can you mine?
-Where can you mine?
-does it cover most of the things we need when we mine? [pickaxe or w/e]
-can it eat when you have low hp?
-can it switch to weapons if you engage into a fight?
-can it run if that fight is going bad for you?
-where can it walk?
-how does it walk?
-is the walking safe and reliable?

whenever i think of making a script, my mind just jumbles up and it gets confusing when i really try to concentrate on things im missing. So a list just helps you narrow it down a bit, its just a suggestion :P

g0tp0t
03-23-2010, 10:22 PM
That is an amazing suggestion, lol its common sense :tongue: apparently i have none. lol. +rep

mysterious123
03-24-2010, 07:54 AM
That is an amazing suggestion, lol its common sense :tongue: apparently i have none. lol. +rep

Buddy, it's better if you add more features to your script later on than give everything in one go. People usually expect the scripter to add - they want to see change in a script. So I'd suggest that instead of replying to this thread of suggestions you start working on it. ;)

As they say - actions are bigger than words.:o

g0tp0t
03-25-2010, 12:03 AM
LOL, i have been working on it. I have also been pushing myself into corners, because im not amazing at scripting yet. :/ i just started a thread to see if anyone was willing to help me make this script.


As they say - actions are bigger than words.

What action do you mean?

mysterious123
03-25-2010, 05:25 AM
LOL, i have been working on it. I have also been pushing myself into corners, because im not amazing at scripting yet. :/ i just started a thread to see if anyone was willing to help me make this script.



What action do you mean?

Actions as in scripting. Easy to think of new things, harder to script them.
Even if we suggested something like "Check which rocks the other players mined so you know that if they mined a much better rock their levels are much higher" - That would be almost impossible (Checking 10 other players for a whole 6 hours or so - if this script actually lasts that long).

That's why no one - or most people - don't make these threads.
These suggestions happen on the script's thread, AFTER it's already scripted.

Just get mIRC and people will help you, I know they help me. ;)