SRL Archive - OSR Help

First Script: -keeps clicking, needs to stop-


castrovalva

2012-04-03 07:44:27

Hello all,

I have just made my first script using tutorials on internet.
now I have a question:

I want to run the procedure mineCopper one time, then when I have got something in the inventory I want to run the procedure dropInventory and when I have the ore it has to run the mineCopper again..

What it does now is this:
It mines, it keeps clicking which I dont want and between these clicks it drops the ores.


So I want to let it mine then when I mined it it needs to drop, then again mining.. without clicking about each 500 ms.

Im happy that I made it so far!
Hope you can help me out with my first script!

Castrovalva

program CastroScript;
{$DEFINE SMART}
{$DEFINE PAINT}
{$i srl/srl/misc/smart.simba}
{$i SRL/srl.simba}
{$i SRL\SRL\Misc\PaintSmart.simba}
{$i ObjectDTM\ObjDTMInclude.simba}

procedure login;
var email, x, y:integer;
begin
email := DTMFromString('mQwAAAHicY2aAABMglmJABWlJSXDMCuTDMCMSBgIAiuAD4g==');
if FindDTM(email, x, y, MSX1, MSY1, MSX2, MSY2)then
begin
MMouse(312, 185, 1, 1);
Mouse(x, y, 312, 185, true);
TypeSend(''); //Username
wait(5000 +random(200));
MMouse(312, 232, 1, 1);
Mouse(x, y, 312, 232, true);
TypeSend(''); //Password
wait(5000 +random(200));
MMouse(373, 461, 1, 1);
Mouse(x, y, 373, 461, true);
end;
end;
procedure mineCopper;
var
copper, copperInventory, x, y:integer;
begin
copper := DTMFromString('mLgAAAHicY2KAAD4gZoSyyxqrGG7VODGwAtnKUHGIHABLKQNF');
copperInventory := DTMFromString('m6wAAAHic42ZgYHBhYmDwA+JAIHYFYkcgtgBiYyhtxwRR4wvET4DqbwHxQyB+BcSfgPgNED8D4rtAfBWIb0DFdmZbAUkmojArkCQWM5KAkQAAts4OdA==');

repeat
if FindDTM(copper, x, y, MSX1, MSY1, MSX2, MSY2) then
begin
writeln('Found ore!');
MMouse(x, y, 7, 7);
end;
if IsUpText('opper') then
begin
Mouse(x, y, 7, 7, true);
wait(500 + random(500));
end;
until(FindDTM(copperInventory, x, y, MIX1, MIY1, MIX2, MIY2));
end;

procedure dropInventory;
var
copperInventory, x, y:integer;
begin
copperInventory := DTMFromString('m6wAAAHic42ZgYHBhYmDwA+JAIHYFYkcgtgBiYyhtxwRR4wvET4DqbwHxQyB+BcSfgPgNED8D4rtAfBWIb0DFdmZbAUkmojArkCQWM5KAkQAAts4OdA==');

if FindDTM(copperInventory, x, y, MIX1, MIY1, MIX2, MIY2) then
begin
MMouse(x,y, 10,10)
Mouse(x,y,10,10,false)
ChooseOption('rop')
wait(150 + random(500))
end;
end;

var i:integer;
begin
SetUpSRL;
login;
for i:= 0 to 200 do //aantal keer dat je dit wilt doorlopen
begin
mineCopper;
dropInventory;
end
end.

Abu

2012-04-03 07:51:13

First of all, put your script in
 Tags

Secondly, use this: [URL="http://villavu.com/forum/showthread.php?t=74090&highlight=Pixelshift"]PixelShift[/URL]

castrovalva

2012-04-03 09:13:36

From: abu_jwka
First of all, put your script in
 Tags

Secondly, use this: [URL="http://villavu.com/forum/showthread.php?t=74090&highlight=Pixelshift"]PixelShift[/URL]



Hey

I have changed in the forum.
Thanks for your hint! im sure Im going to use it, but im now at school
Perhaps its now readable..

Wyn

2012-04-03 09:34:54

Take that login out since your using srl.

Instead put this in and add DeclarePlayers after SetupSrl

procedure DeclarePlayers;
begin

HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;

with Players[0] do
begin
Name := '';
Pass := '';
Nick := '';
Pin := '';
Member := True;
Active := True;
end;
end;

Also for the spam clicking seeing this…

  repeat
if FindDTM(copper, x, y, MSX1, MSY1, MSX2, MSY2) then
begin
writeln('Found ore!');
MMouse(x, y, 7, 7);
end;
if IsUpText('opper') then
begin
Mouse(x, y, 7, 7, true);
wait(500 + random(500));
end;
until(FindDTM(copperInventory, x, y, MIX1, MIY1, MIX2, MIY2));

Says its gonna spam click the dtm it finds till no tomorrow until its in the inventory. It would stop already if the ore is in the inventory though, so it's only gonna do it once.

castrovalva

2012-04-03 10:36:55

Thanks for your reply!

Yes I know that it does that, I changed the login. (I couldt do this because smart didnt work until last night)
Isnt there any easy way to dont spam clicking?
I know I can fix it by adding just a longer wait, but I want to mine my fast.
like until(IsMoving) or something until(IsMining)

Wyn

2012-04-03 11:12:59

You could add a marktime to check if the inventory has changed after so much time, if not find a ore.

Basic why I can think of. Look in the inventory file within srl.

castrovalva

2012-04-03 12:29:23

How do I do that with this script?

Valithor

2012-04-03 23:32:50

function MineOre;
var //declaring a few variables locally
plusOne, miningTime: integer;

begin
plusOne:= InvCount + 1; //Telling the script what I want "plusOne" to be

if FindOre then // "FindOre" is my way of describing the method you are using to find your ore
begin
ClickOre; // "ClickOre" is my way of describing the method you are using to click your ore
if DidRedClick then //DidRedClick is a function in SRL
Exit;

MarkTime(miningTime); // SRL function to tell the script to start keeping time
repeat
Wait(Random_Wait_Here); //Random Wait
Antiban; //Your Antiban Function called here
until (InvCount = plusOne) or (TimeFromMark(miningTime) > 7000) or (InvFull)
//If the Inventory Count increased, or if it is full, or if MiningTime runs out then it will result true
Result:= true;
end;
end;

I'm pretty sure that will work. Most of this stuff is pretty basic stuff. A good place to learn some other basic stuff for RS botting is here. If you want to add that function to trigger your Dropping Procedure then do something like…

procedure Dropping;
begin
if MineOre then
begin
DropOre;
end;
end;