PDA

View Full Version : Whats With This!?!?!?



Wool
12-17-2006, 05:50 AM
Can anyone tell me if they spot any problems in my script and tell me why it lags so much :confused:

Also I think I set up my loop wrong, can anyone help me with that :D


{ POWER-MINER V 1.0 ___ |
______ _______ | |\\\\\\\ |
\ \ _ / / | |\\\\\\\\\\ |
\ \_/ \_/ / ______ ______ | |\\\\\\\\\\\\\ |
\ __ / | _ | | _ | | |\\\\\\\\\\\\\\\\ |
\ / \ / | |*| | | |*| | | |\\\\\\\\\\\\\\\\\\\ |
\___/ \___/ |______| |______| |___|\\\\\\\\\\\\\\\\\\\\\|
|
1. Set the constants |
2. Set up Username & Password |
2. Make sure character is by rocks you want to mine |
4. Logout |
5. Drag crosshair to the RS Window and play |
Script by WOOL |
__________________________________________________ _________________|
}
program Powerminer;
{.include srl/srl.scar}
{.include SRL/SRL/skill/Mining.scar}

var
oresmined,loadsdroped,gasruns : integer;

//////////////////////////////BEGIN SETUP ////////////////////////////////
//
const //
rockcolor= 4285835; //Pick rock color //
rockcolor2= 3890560; //Pick Second color //
rockcolor3= 3099239; //Pick Third color //
rockcolor4= 4022148; //Pick Final color //
pick= true; //true if picks equipped, false if not //
numberofpicks= 2; //ex. 1 pick = set to 2 picks, 2=3 ect. //
emptyore= 20; //number of times to drop ore before end //
timetowait= 5500; //Amount wait time, ajust to skill level //
run= 'N'; //
//
//////////////////////////////SET PLAYERS/////////////////////////////////
//
Procedure PickPlayers; //
begin //
HowManyPlayers:=1; //
NumberOfPlayers(HowManyPlayers); //
//
Players[0].Name :='Wcking1_1'; //Enter your Username here //
Players[0].Pass :='XXXXX'; //Enter your Password here //
Players[0].Nick :='Wck'; //Enter your Nickname here //
Players[0].Active := true; //
end; //
//
//////////////////////////////END OF SETUP////////////////////////////////

procedure intro;
begin
cleardebug;
wait(500);
writeln('W----');
wait(200);
writeln('0------');
wait(200);
writeln('0--------');
wait(200);
writeln('L-----------');
wait(200);
writeln('S C R I P T S');
wait(100);
writeln('');
writeln('Happy Scripting!');
writeln('');
writeln('');
wait(1000);
end;


//--------------------------------------------------------------------\\

Procedure minerocks;
Begin
if(Findcolor(x,y,rockcolor,5,5,515,340)) or (Findcolor(x,y,rockcolor2,5,5,515,340))or (findcolor(x,y,rockcolor3,5,5,515,340)) or (findcolor(x,y,rockcolor4,5,5,515,340))then
begin
Mouse(x,y,1,1,true)
Wait(timetowait+random(300))
oresmined := oresmined + 1;
antiban;
if(invfull)then
end;
FindNormalRandoms;
end;

//--------------------------------------------------------------------\\

Procedure Dropore;
begin
If (InvFull) Then
begin
If (Pick) Then
DropTo(1,28)
else
DropTo(numberofpicks,28)
loadsdroped := loadsdroped + 1;
antiban;
end;
FindNormalRandoms;
end;

//--------------------------------------------------------------------\\

function GasCheckk:Boolean;
var gasx :integer;
gasy :integer;
RGWT :integer;
TWG :integer;

begin
if (FindColorSpiralTolerance(gasx,gasy,rockcolor,210, 130,300,220,5)) or
(FindColorSpiralTolerance(gasx,gasy,rockcolor2,210 ,130,300,220,5)) then
begin
if not FindGas(gasx,gasy) then
exit;
if FindGas(gasx,gasy) then
begin
writeln('Found gas');
writeln('Running away from rock');
RunAwayDirection(run);
begin
RGWT:=5+random(7);
TWG:=0
repeat
TWG:=TWG+1;
wait (1500+random(500));
until(TWG=RGWT)
Runback;
Result:=True;
gasruns := gasruns + 1;
end;
end;
end;
end;


//--------------------------------------------------------------------\\

procedure Progreport;
begin
writeln('*******************REPORT**************** **********')
writeln('Script ran for : ' + scripttime2 (2))
writeln('Droped ' + inttostr(loadsdroped) + ' load(s)!');
writeln('Found gas and ran away from ' + inttostr(gasruns) + ' Rocks!');
writeln('*******************REPORT**************** **********')
SRLRandomsReport;
end;

//---------------------------------------------------------------------\\

procedure Login;
var
ClickHereToPlay, tx, ty, CHx, CHy, c, tmpMask: Integer;
begin
ClickHereToPlay := BitmapFromString(33, 1, 'z78DA758E510E80300843' +
'AF54C0E2F6E94CB8FF9134123392693FFA41FA4A23A6F0888 443D' +
'26DC000A7DCE7F458F23EE444E721444B6A0F53D58FE44F43 65B7' +
'067D37AC3D95AADF2F50962C79');
if (not (LoggedIn)) then
begin
x := 150;
y := 173;

if ( FindClient ) then
FindWindowBySize ( 766, 504 );

ActivateClient;
Wait(1000);
ClickOption('Cancel', 1);
ClickOption('Exist', 1);

tmpMask := CreateBitmapMaskFromText( 'Username', UpChars);
if (FindBitmapMaskTolerance(tmpMask, x, y, 0, 0, 520, 340, 10, 50)) then
begin
Wait(25 + Random(50));
Mouse(x + 24 , y + 3, 3, 0, True);
Wait(25 + Random(50));

TypeSend(Players[currentplayer].Name);
Wait(100 + Random(100));
Mouse(327, 272, 0, 0, True);
TypeSend(Players[CurrentPlayer].Pass);
Wait(100 + Random(100));
end;

ClickOption('Login', 1);

MarkTime(Mark);
while FindText(tx, ty, '...', UpChars, 240, 180, 530, 240) do
begin
Wait(100);
if TimeFromMark(Mark) > 20000 then break;
end;

MarkTime(Mark);
repeat
Wait(1000);

if FindText(tx, ty, 'nter you', UpChars, 240, 180, 530, 240) then
begin
writeln('Enter your username and Password');
LoginPlayer;
FreeBitmap(ClickHereToPlay);
Exit;
end;

if FindText(tx, ty, 'nvalid', UpChars, 240, 180, 530, 240) then
begin
writeln('Invalid Username.');
Attempts := Attempts + 1;
if Attempts > 3 then
begin
Players[currentplayer].loc := 'L/P ERROR';
NextPlayer(False);
end;
LoginPlayer;
FreeBitmap(ClickHereToPlay);
Exit;
end;

if FindText(tx, ty, 'excee', UpChars, 240, 180, 530, 240) then
begin
writeln('Login attempts exceeded. Please wait 1 minute and try again.');
Wait(60000);
LoginPlayer;
FreeBitmap(ClickHereToPlay);
Exit;
end;

if FindText(tx, ty, 'full', UpChars, 240, 180, 530, 240) then
begin
writeln('World is full.');
Wait(3000);
LoginPlayer;
FreeBitmap(ClickHereToPlay);
Exit;
end;

if FindText(tx, ty, 'offl', UpChars, 240, 180, 530, 240) then
begin
writeln('Unable to connect Login Server offline.');
Wait((6000) + Random(6000));
LoginPlayer;
FreeBitmap(ClickHereToPlay);
Exit;
end;

if FindText(tx, ty, 'rror', UpChars, 240, 180, 530, 240) then
begin
writeln('Error Connecting.');
Wait(10000);
LoginPlayer;
FreeBitmap(ClickHereToPlay);
Exit;
end;

if FindText(tx, ty, 'ontact', UpChars, 240, 180, 530, 240) then
begin
WriteLn('Error loading your profile.');
Wait(2000);
LoginPlayer;
FreeBitmap(ClickHereToPlay);
Exit;
end;

if FindText(tx, ty, 'reject', UpChars, 240, 180, 530, 240) then
begin
writeln('Login server rejected session.');
Wait(1000);
LoginPlayer;
FreeBitmap(ClickHereToPlay);
Exit;
end;

if FindText(tx, ty, 'reload', UpChars, 240, 180, 530, 240) then
begin
writeln('ERROR. RuneScape has been updated. Script Terminated.');
TerminateScript;
end;

if FindText(tx, ty, 'updat', UpChars, 240, 180, 530, 240) then
begin
writeln('The Server is being updated.');
Wait(60000);
LoginPlayer;
FreeBitmap(ClickHereToPlay);
Exit;
end;

if FindText(tx, ty, 'disabled', UpChars, 420, 180, 500, 220) then
begin
writeln('Your account has been disabled');
Players[currentplayer].loc := 'DISABLED';
NextPlayer(False);
FreeBitmap(ClickHereToPlay);
Exit;
end;

if FindText(tx, ty, 'trans', UpChars, 240, 180, 530, 240) then
begin
Writeln('Waiting for your Profile to be Transferred');
Wait(2500);
end;

if FindText(tx, ty, 'member', UpChars, 240, 180, 530, 240) then
begin
Writeln('Waiting for your Profile to be Transferred');
Wait(2500);
end;

if FindText(tx, ty, 'elcom', UpChars, 240, 180, 530, 240) then
begin
writeln('Welcome.');
LoginPlayer;
FreeBitmap(ClickHereToPlay);
Exit;
end;

if TimeFromMark(Mark) > 180000 then
begin
writeln('three minutes have passed');
WriteFileString(TheFile, chr(13) + 'THREE MINUTES HAVE PASSED!!!' + chr(13));
ClickOption('Cancel', 1);
ClickOption('Exist', 1);
end;

until (FindBitmapToleranceIn(ClickHereToPlay, CHx, CHy, 250, 270, 530, 390, 5)) or (LoggedIn);
Wait(1000 + Random(500));
If (FindBitmapToleranceIn(ClickHereToPlay, CHx, CHy, 250, 270, 530, 390, 5))and not(Loggedin) then
Mouse(CHx, CHy, 50, 20, True);

repeat
Wait(1000);
c := c + 1;
until (LoggedIn) or (c >= 600);

end;
FreeBitmap(tmpMask);
if LoggedIn then
begin
PlayerStartTime := (GetSystemTime div 1000);
if NickNameBMP <> 0 then
FreeBitmap(NickNameBMP);
NickNameBMP := CreateBitmapMaskFromText(Players[currentplayer].Nick, UpChars); // Screenname
WriteFileString(TheFile, chr(13) + UpperCase(Players[0].Name) + chr(13)); //* Save NAME to file
end;
FreeBitmap(ClickHereToPlay);
FindNormalRandoms;
end;

//---------------------------------------------------------------------\\


begin
SetUpSRL;
SetUpSRLMining;
intro;
PickPlayers;
login;
repeat
until (loadsdroped = emptyore)
minerocks;
dropore;
If (loadsdroped = emptyore) then
logout;
progreport;
end.

//----------------------------END SCRIPT--------------------------------\\

Boreas
12-17-2006, 05:55 AM
The stuff you want to repeat has to be after the repeat and before the until.

Wool
12-17-2006, 06:32 AM
O, Yea its working now
Thx :D :D :D

Skys Shadow
12-17-2006, 01:32 PM
also you have the login procedure in your script

its included in srl