SRL Archive - Test corner

PowerMiner Test


-chaos-

2006-05-21 17:13:38

Yes thats right another powerminer im still learning to script so i tryed to improve my skills my taking on less challenging projects

i need someone to test it and give me feedback on how it works also if you have any suggestions please tell me :cool:

Here it is

[php]{=========================================================================]
| _ _ _ _ _ _ _ _ |
| / | | <===================> _ _ |
| / _ _ _| | |_ _ _ _ _ _ _ _ _ _| | | |
| | / | | | |~SRL MEMBER~ | | | | |
| | | | | |- - - - - - - - - -| _ _ | |_ _ |
| | | | |_ _ _ _ _ _ _ _ _ _ _ _ | _ _ _ _| |
| | \_ _ _| _ | | _ | _ _ _| |_| | | |
| \ | | | | | | | |_| | |_ _ _ _ _ _ _ _ _ _ _ _ _| | |
| \_ _ _ _ _ _|_| |_|_ _|_|_ _ _|_ _ _ | _ _| _ | | | | | |
| _ _ _ | | |_ _| | | | _ _|_ _| |
|<============================>|_ _ _ _ _|_ _ _|_ | |_| | |
| |_| |
[=========================================================================]
[ ]
[ ]
[ NAME : SRL PowerMiner ]
[ WRITER : -Chaos- ]
[ CATEGORY : AutoRanger ]
[ DESCRIPTION : See below. ]
[ USAGE : PowerMining Anywhere ]
[ AUTOCOLOR : Yes ]
[ SRL REV. : SRL Ver. 2.0. ]
[ NOTES : Have angle as high as it goes ]
[=========================================================================]
| Description: This script mines a full inventory of ore then drops it, |
| and repeats. |
| |
| Instructions: |
| 1.Set the Runescape brightness to V-bright, and your computer's |
| resolution to 32bit resolution. |
| 2.Need SCAR version 2.0.3. |
| 3.Stand near the rock you want to mine. |
| 4.Setup the script at lines 49 - 53 |
| 5.Have fun :). |
[=========================================================================}

program PowerMiner;
{.include SRL/SRL.scar}
{.include SRL/SRL/Skill/Mining.scar}

var Mined, Xp, Pc1, Pc2, Pc3, Pc4, Pc5, RColor : integer;

const // _ _ _ _ \\
//[]============================_|_|_|_=================================[]\\
//[] |Setup| []\\
//[]====================================================================[]\\

Skill = 'Mining'; //Skill To Use If Lamp Found

RName = 'Copper'; //[-] Copper, Tin, Iron, Coal [-]\\

Waitx = 1000; //How Long To Wait Before Clicking On Next Rock

//[] End Setup []\\

Function FindRockC : boolean;
begin
if (FindColorTolerance(x, y, RColor, 3, 3, 515, 338, 25)) then Result:=true else result:=false;
end;

Function InventoryF : boolean;
begin
GameTab(4);
if (InvFull) then Result:=true else Result:=false;
end;


function FindPickHeadC : boolean;
begin
GameTab(4);
if(FindBitmapSpiralTolerance(PickAxe, x, y, 546, 198, 745, 468, 100))or
(FindBitmapSpiralTolerance(PickAxeSteel, x, y, 546, 198, 745, 468, 100))then
Result:=True;
if(Result=false)then
begin
if(not(GetColor(681, 173)=2763390))then
begin
Mouse(679, 180, 5, 5, true);
wait(200+random(100)+random(100))
end;
if(FindBitmapSpiralTolerance(PickAxe, x, y, 546, 198 ,745, 468, 100))or
(FindBitmapSpiralTolerance(PickAxeSteel, x, y, 546, 198, 745, 468, 100))then
Result:=True;
end;
if(Result=false)then
begin
writeln('');
writeln('ERROR! cannot find pick in screen, please put pick in inventory or your equip page and restart the script!');
writeln('');
Result:=False;
end;
if(Result=true)then
begin
Pc1:=GetColor(x+6, y+3);
Pc2:=GetColor(x+18, y+7);
Pc3:=GetColor(x+20, y+6);
Pc4:=GetColor(x+19, y+6);
Pc5:=GetColor(x+16, y+5);
end;
writeln('Pick head colors… '+inttostr(Pc1)+' '+inttostr(Pc2)+' '+inttostr(Pc3)+' '+inttostr(Pc4)+' '+inttostr(Pc5));
end;

procedure BanP;
begin
RandomChatEvery(10 + Random(5));
RotateEvery(20 + Random(10));
LeaveScreenEvery(5 + Random(5));
HoverEvery(15 + Random(5),'random');
PickUpMouse;
end;

procedure Setup;
begin
SetupSRL;
SetupSRLMining;
SetChat('Off', 1);
SetChat('Off', 2);
SetChat('Off', 3);
end;

procedure Dropitlikeitshot;
begin
if(InventoryF)then
begin
Writeln('dropping Inventory');
DropToPosition(2, 28);
end;
end;

Procedure MineRocks;
begin
GameTab(4);
BanP;
if(not((GetColor(x,y))= RColor))then
begin
if (FindColorTolerance(x, y, RColor, 3, 3, 515, 338, 25)) then
begin
MMouse (x, y, 1, 1);
if IsUpText('Mine') then
Mouse(x, y, 0, 0, True);
GasCheck(x, y);
wait(Waitx);
while IsChatMessage('You swing') do
begin
repeat
wait(Waitx);
until(IsChatMessage('You manage'));
end;
end;
end;
Dropitlikeitshot;
Mined:=Mined+1
end;

procedure FPick;
begin
GameTab(4);
if IsChatMessage('You need') then
begin
FindPick;
end;
end;

procedure RandomP;
begin
CloseWindow;
ClickToContinue;
FindLamp('Skill');
FindDead;
FindMod;
FindMime;
FindMaze;
FindQuiz;
FindFrog;
FindDemon;
FindNormalRandoms;
if FindNewBox then Logout;
end;

procedure PReport;
begin
ClearDebug;
Writeln(' ~SRL PowerMiner~');
Writeln(' -Chaos-');
Writeln('You Have Mined '+inttostr(Mined)+' Rocks So Far');
Writeln('You Have Gained About '+inttostr(Xp*Mined)+' Xp So Far');
end;

procedure GetRockC;
begin
Case (RName) of
'Tin' : RColor:= 7895169;
'Copper' : RColor:= 4550039;
'Iron' : RColor:= 2371664;
'Coal' : RColor:= 2768446;
end;
end;

procedure GetRockXp;
begin
Case (RName) of
'Tin' : Xp:= (35/2);
'Copper' : Xp:= (35/2);
'Iron' : Xp:=35;
'Coal' : Xp:= 50;
end;
end;

begin
Setup;
RandomP;
BanP;
GetRockXp;
GetRockC;
FindPickHeadC;
repeat
RandomP;
FPick;
MineRocks;
PReport;
until(false);
end.[/php]

thanks
-Chaos-

leader

2006-05-21 17:48:49

Loads up perfectly. Turns the chats off. When it looks for the color of the rock it doesn't always get it for me. I want to mine copper and instead it mines clay.

WhiteShadow

2006-05-21 18:06:29

InventoryF is unnessacary. You used it in the script like this if(InventoryF)then

isn't that just like if(InvFull)then? and it's bad to have the script repeat wait(1000) until ischatmsg(you manage) because if someone stole your rock, you lost pick, then your script is screwed it'll just keep waiting and waiting.

Well, wow great script many parts of it are foreign to me. :p

Just Kidding

2006-05-21 18:39:33

I will test this later. Give a progress report etc. Thanks.

Ok heres what I got

You Have Mined 94 Rocks So Far
You Have Gained About 1598 Xp So Far
Successfully executed

The xp per ore may be off as I think it calculated the ore I had in my inventory after I had started over once. This was on a lvl 1 miner with a bronze pickaxe. The script runs well and it drops the ores great but it gets distracted easily by other colors on the screen when its hunting for ore.

I first tried mining tin in fally mine but the spade in the middle was in view and the cursor tended to go back to it way too much. So then I went to the upper place with the copper. It would also get stuck color hunting on the fence above it. And once a guy came up mining with dark clothing and his clothing made the cursor stick to him till he left then it found the ore.

The biggest problem I had with it is the fact that when I lvled up every time ( i was lvl 1 mining it was frequent) it stopped the script untill i manually closed the window that shows what level you have got. When I closed the you levled screen it would start to mine again. It did this everytime I leveled up.

It talked randomly once but I am not sure if it was your script or the srl random didnt look at script alot. After it randomly talked it forgot to turn chat back onto off instead of hide. Then right after I got a mysterious old man. He wasnt the strange box one but the one you have to talk to. It wouldnt talk to him at all. So i manually took over an talked.

That was the end of my test. I have ran the feather buyer for the last 6 hours or so with no problems prior to this so i know all my srl etc is set up right. Hope all this helps. It will be a great script im sure.

Plus you also got autoranger in the category on it not that it hurts anything just letting you know.

WhiteShadow

2006-05-21 22:21:45

Yea, Chaos set your tolerance much lower, because of the tolerance many colors will get mixed in with the actual ore, try like 5.

As for the script getting stopped at the GetLevevl chatbox is because you have it wait on IsChatMessage or start on IsChatMessage to much. Don't use IsChatMessage in scripts, it usually causes lag and any changes in your ChatBox will cause the script to screw up.

Anyhow, just trying to help. :p Your FindHeadColor thing that uses Bitmap spiral or something is still confusing me.

Edit:

{*******************************************************************************
function FindPickHeadColor: boolean;
By: Stupid3ooo
Description: Finds PickHead colors. Returns hc1,2,3,4 & 5.
*******************************************************************************}
function FindPickHeadColor:boolean;
begin
GameTab(4);
if(FindBitmapSpiralTolerance(PickAxe,x,y,546,198,745,468,100))or
(FindBitmapSpiralTolerance(PickAxeSteel,x,y,546,198,745,468,100))then
Result:=True;
if(Result=false)then
begin
if(not(GetColor(681,173)=2763390))then
begin
Mouse(679,180,5,5,true);
wait(200+random(100)+random(100))
end;
if(FindBitmapSpiralTolerance(PickAxe,x,y,546,198,745,468,100))or
(FindBitmapSpiralTolerance(PickAxeSteel,x,y,546,198,745,468,100))then
Result:=True;
end;
if(Result=false)then
begin
writeln('');
writeln('ERROR! cannot find pick in screen, please put pick in inventory or your equip page and restart the script!');
writeln('');
Result:=False;
end;
if(Result=true)then
begin
hc1:=GetColor(x+6,y+3);
hc2:=GetColor(x+18,y+7);
hc3:=GetColor(x+20,y+6);
hc4:=GetColor(x+19,y+6);
hc5:=GetColor(x+16,y+5);
end;
writeln('Pick head colors... '+inttostr(hc1)+' '+inttostr(hc2)+' '+inttostr(hc3)+' '+inttostr(hc4)+' '+inttostr(hc5));
end;

and I thought you actually made it…

-chaos-

2006-05-21 22:46:48

wow justkidding that was a great report thanks pointed out many wrong things i will try to fix them all :D

next version will be coming out shortly

WhiteShadow

2006-05-21 23:48:08

Also make sure your nextversion doesn't use repeated procedures from SRL that only have edits like chainging the variable names..

-chaos-

2006-05-21 23:53:40

i like it my way :p easier for me to work with

WhiteShadow

2006-05-21 23:56:03

-.-, I cannot really understand why, changing the variables is easier for you.

-chaos-

2006-05-22 00:13:08

people have different ways of remembering things :p

WhiteShadow

2006-05-22 00:17:02

Your not suppose to remember anything, here is an example of how to use it just in case.

//MainLoop

begin
if(not(LoggedIn))then
LoginPlayer;
FindPickHeadColor;
repeat
MineOre;
DropOre;
until(Var1 > LoadsConstants)
end.

You just place it somewhere, then SCAR stores the color. I'm not trying to be mean or anything.

Jagex_Fagex

2006-05-22 04:17:40


NAME :[B] SRL PowerMiner[/B]
WRITER : -Chaos-
CATEGORY : [B]AutoRanger[/B]

looks alright, im just curious as to how the category can be Autoranger :p but, i will try and test later. great start.

XxKanexX

2006-05-22 06:37:35

When it repeats waiting until it finds the text, "You Manage", that could go on forever. If someone steals the ore then it will never say that..

Endless loop ;\

-chaos-

2006-05-22 16:53:34

alright im fixing all the errors in the next version

WhiteShadow

2006-05-22 21:54:35

From: XxKanexX
When it repeats waiting until it finds the text, "You Manage", that could go on forever. If someone steals the ore then it will never say that..

Endless loop ;\


I already said that! :p