SRL Archive - Research & Development Lounge

Script test


Marco40

2009-05-11 17:56:08

I need somebody to run this script until a full inv of gold at the Falador/Draynor Mine



Program Gold_Digga_0_1;
{.include SRL\SRL.scar}
{.include SRL\SRL\Skill\Mining.scar}
//////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////
/////////////////////////////Gold Digga V.01//////////////////////////
///////////////////////////// By Marco 40/////////////////////////////
/////////////////////////////Enjoy and get////////////////////////////
////////////////////////////////GP!!!!!!!/////////////////////////////
////////////////////////////////Like it?//////////////////////////////
////////////////////////////////Rep+++++//////////////////////////////
////////////////////////////////Marco40///////////////////////////////
////////////////////////////////For Script////////////////////////////
////////////////////////////////Senrath///////////////////////////////
////////////////////////////////For help//////////////////////////////
////////////////////////////////Without him///////////////////////////
////////////////////////////////No script/////////////////////////////

Const
MineColor = 1343130;

Var //Var= variable(Put all your Letters that represent numbers under here)
x, y, MyTime: Integer; // (Like This. x, y, are both Integers(Numbers) in this script) Edit: Added MyTime because that is another variable that represents a number, this one is time, instead of coords. x, y.)

function Wheresmymine : Boolean;
begin
if FindColor(x, y, MineColor, MSX1, MSY1, MSX2, MSY2) then
begin
GetMousePos(x, y);
MMouse(x, y, 0, 0);
Result := True; //This tells the script that it has found the color (True).
end;
end;

procedure mineOre;
begin
if(Wheresmymine = True)then //Since "Wheresmymine" is a boolean, we have to make it equal to true or false (We want true cause, if it doesn't find the mine then it will log out, that's good)
repeat
Wait(2000 + Random(500));
Mouse(x, y, 3, 3, True);
until(InvFull);
end;

begin
repeat //A simple repeat, can be changed later
SetupSRL;
MarkTime(MyTime) // I wouldn't do this but you get the idea. This Marks the time for the variable (MyTime) and starts counting in miliseconds. (So we can call it later)
Wheresmymine;
mineOre;
until(TimeFromMark(MyTime) > 3500000); //This tells it to wait until the Variable, MyTime, is greater than 3,500 seconds (About 6 Hours), or Until (false) it "f**ks up".
end.

Dont got a acc with 50 mining, Just need to know if it works.

Rich

2009-05-11 20:00:43

It won't work, as
function Wheresmymine : Boolean;
begin
if FindColor(x, y, MineColor, MSX1, MSY1, MSX2, MSY2) then
begin
GetMousePos(x, y); //Problem
MMouse(x, y, 0, 0);
Result := True; //This tells the script that it has found the color (True).
end;
end;

That's getting the position of the mouse before it has even moved to the colour. It would need to be
function Wheresmymine : Boolean;
begin
if FindColor(x, y, MineColor, MSX1, MSY1, MSX2, MSY2) then
begin
MMouse(x, y, 5, 5); //added randomness
GetMousePos(x, y); //switched them around
MMouse(x, y, 0, 0);// ^
Result := True; //This tells the script that it has found the color (True).
end;
end;

If you don't get it, just post again,
Richard

Marco40

2009-05-11 20:07:31

Well oke i change that, BUt as you know it could you test it ?.

Rich

2009-05-11 20:20:57

Unfortunately I can't, but I thought that I would just point that out anyway. :)

Shuttleu

2009-05-11 20:54:29

From: NaumanAkhlaQ
R1ch his one is fine, son.
FindColor already stores the co-ords of the color otherwise how else would it be able to move the mouse :p

because
function Wheresmymine : Boolean;
begin
if FindColor(x, y, MineColor, MSX1, MSY1, MSX2, MSY2) then // gets the color
begin
GetMousePos(x, y); //changes the mouse position to where it already is
MMouse(x, y, 0, 0); // doesnt move it because it is already there
Result := True; //This tells the script that it has found the color (True).
end;
end;
so no it wasnt already correct

~shut

Naum

2009-05-11 20:59:31

You have no proof shut!!!

Infidels must die!!

Rich

2009-05-11 21:05:15

:) He has some proof in his post…A quote, maybe…Lol ;)

Naum

2009-05-12 11:22:44

lol :p.

The quote doesn't work :confused:

http://villavu.com/forum/showthread.php?p=566452#post566452

can't find it…

BobboHobbo

2009-05-12 11:54:30


function Wheresmymine : Boolean;
begin
if FindColor(x, y, MineColor, MSX1, MSY1, MSX2, MSY2) then
begin
GetMousePos(x, y);
MMouse(x, y, 0, 0);
Result := True; //This tells the script that it has found the color (True).
end;
end;

To make that function faster do this:

function Wheresmymine : Boolean;
begin
Result := FindColor(x, y, MineColor, MSX1, MSY1, MSX2, MSY2);
If (Result) then
begin
GetMousePos(x, y);
MMouse(x, y, 0, 0);
end;
end;


procedure mineOre;
begin
if(Wheresmymine)then
begin
repeat
Wait(2000 + Random(500));
Mouse(x, y, 3, 3, True);
until(InvFull);
end;
end;