Here is my miner, theres no debug. its alright for my first script thogh, please post your comments
I just started it, and after a few minutes, it froze my screen.... that usually happens to me when theres a loop going on, with no, or little wait times. I'll look into that...
One sugestion I have:
You have the script writing lines when it finds, or doesnt find a rock; Personaly, I dont like seeing all the 'found rock, found rock, found rock' stuff.
For my scripts, I use Status('Found Rock') instead of Writeln('Found Rock')
But that's just a matter of preference.
Update:
When your searching for the rock colors, you have it searching in the box (0,0,600,600), Thats almost the entire game screen, including the chat window, and a bit of the inventory.
It just needs to look in the play window, because thats where the rocks are.
so, something like (0,0,515,337) would do fine. That will also prevent the script from clicking in the inventory, or chat window by accicent, when it thinks theres a rock there.
Another Update:
Its freezing my game window, only when it doesnt find a rock on the screen. It's doing this because your telling to repeat the search almost immediatly. Thats simple to fix;
Line:23 originally was;
Writeln('Didnt find rock');
add atiny little wait right after that command:
Writeln('Didnt find rock');
wait(5+random(5));
That will give the script a little pause, and allow the Runescage game to catch up with the script.
Yet another suggestion:
It does it's job, yes. but if you'd use 'FindColorSpiralTolerance' instead of 'FindColorTolerance'
it'll find the rock that is closest to you.
add : x:=256;y:=174;
to the line right above the FindColorSpiralTolerance line. This will reset where the script starts searching from. Those Co-Ords are near the middle of the onscreen character, so the script will search for the rock closest to you.
It'll look like:
x:=256;y:=174;
if(FindColorspiralTolerance(x, y, RockColour, 0, 0, 515, 337, 2))then
Other than those few small things, that are really just to make it suit my preference;
Nicely made, short script. It does what you want it to do, and it does it rather fast. It's alot better than any of the first scripts that I made when I started learning. Very Good work!
You got the idea down on how to make it do things, now you have to learn how to make it do them perfectly.
I'm just trying to give you some advice for the next version.![]()
I'll open it up and take a look.
One thing though. What DaDj said about the screen size...
There are several SRL commands that are preset with the coords for the MS (main screen), MM (mini map), and Inventory. You can just use those.
yeah, i just edit the move to rock to 10 - 30 milli seconds so while the char is moving it clicks on the rock (the time between getting onto the rock and clicking it)
SCAR Code:Function MoveMouseToRock: Boolean;
begin
Repeat
if (FindRock) then
begin
Result := True;
MMouse(x, y, 2, 2);
Wait(10+random(100));
Exit;
end;
until (False)
end;
procedure ClickRock;
begin
if (MoveMouseToRock = true) then
begin
Mouse(x, y, 2, 2, True)
Wait(1500+random(100));
end;
end;
MMouse moves the mouse.
Mouse moves and clicks the mouse.
Those two procedures can be condensed into one, if you want to.
It's also very easy to add Multi Player and AntiRandoms to your script, I suggest putting those in your next version![]()
now i have added that color spiral it doesnt go for inventory
editeed the speeds so it goes straight to rock and doesntclick to often
Those two procedures can be condensed into one, if you want to. - i did it seperate so it helped me if i needed to edit it
Just a note: At first I thought multiplayer was pretty scary and it'd be hard to implement into my script...when I tried it, it turned out to be waaay easier than I expected...
Interested in C# and Electrical Engineering? This might interest you.
There are currently 1 users browsing this thread. (0 members and 1 guests)