Jupar
07-01-2008, 12:35 PM
program Powerminer;
{.include SRL\SRL.scar}
{.include SRL\SRL\Skill\Mining.scar}
////////////////////////////////////////////////////////////
// [SRL4] QuickPowerMiner by Timothegreat //
// //
// Version 1.5 //
// //
// ------------ //
// Instructions //
// ------------ //
// //
// 1. Setup your players by the ore you want to mine //
// 2. Fill out lines 22-60 //
// 3. Hit the play button //
// 4. Enjoy! //
// Autoresponder by Jukka //
// Gas Detection by Wizzup? //
////////////////////////////////////////////////////////////
const
SRLStatsID = ''; // SRL Stats ID Number
SRLStatsPW = ''; // SRL Stats Password
GasTol = 15; // Change if find you broken pickaxes!
MinGasChange = 200; // 100+ About 200-300 and more. Basically tolerance.
UseResponder = True; // Use autoresponder?
RunDir = 'S'; // direction to run if in fight
// N for north, S for south, etc.
Procedure DeclarePlayers;
Begin
HowManyPlayers := 4;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
Players[0].Name :='';
Players[0].Pass :='';
Players[0].Nick :=''; //3-4 letters from name
Players[0].Active:= True;
Players[0].Booleans[1]:= True; // True if new rocks. False if old.
Players[0].Booleans[2]:= False; // Pick equipped?
Players[0].Strings[1]:= 'Copper'; // type of ore
Players[0].Integers[1]:= 5; // # of loads
Players[1].Name :='';
Players[1].Pass :='';
Players[1].Nick :=''; //3-4 letters from name
Players[1].Active:= True;
Players[1].Booleans[1]:= True; // True if new rocks. False if old.
Players[1].Booleans[2]:= False; // Pick equipped?
Players[1].Strings[1]:= 'Tin'; // type of ore
Players[1].Integers[1]:= 5; // # of loads
Players[2].Name :='';
Players[2].Pass :='';
Players[2].Nick :=''; //3-4 letters from name
Players[2].Active:= True;
Players[2].Booleans[1]:= True; // True if new rocks. False if old.
Players[2].Booleans[2]:= False; // Pick equipped?
Players[2].Strings[1]:= 'Tin'; // type of ore
Players[2].Integers[1]:= 5; // # of loads
Players[3].Name :='';
Players[3].Pass :='';
Players[3].Nick :=''; //3-4 letters from name
Players[3].Active:= True;
Players[3].Booleans[1]:= True; // True if new rocks. False if old.
Players[3].Booleans[2]:= False; // Pick equipped?
Players[3].Strings[1]:= 'Tin'; // type of ore
Players[3].Integers[1]:= 5; // # of loads}
End;
{---------------------DO NOT TOUCH BELOW THIS---------------------------}
const
oldclay = 5212840;
oldcopper = 4483472;
oldtin = 8553100;
oldiron = 2437455;
oldgold = 2081517;
oldcoal = 2636603;
oldmith = 6636869;
oldaddy = 5202510;
newclay = 5212840;
newcopper = 5010848; //
newtin = 7829376; //
newiron = 3030370; //
newgold = 2081517; // from rimmington
newcoal = 2636603;
newmith = 6636869;
newaddy = 5202510;
var
x,y,cx,cy,orecolor,TLoads,Gasses,attempts,tol,leve ls,BrokenPicks,
loads,ores,ResponseTime,CurrentResponse,RespondedT imes,TRespond:integer;
done:boolean;
Mincount:byte;
LastChatterString: String;
procedure SetupScript;
begin
if (Players[CurrentPlayer].Booleans[1])then
begin
Mincount:= 1;
tol:= 5;
case lowercase(Players[CurrentPlayer].Strings[1]) of
'clay' : orecolor:= newclay;
'copper' : orecolor:= newcopper;
'tin' : orecolor:= newtin;
'iron' : orecolor:= newiron;
'coal' : orecolor:= newcoal;
'mithril' : orecolor:= newmith;
'mith' : orecolor:= newmith;
'adamant' : orecolor:= newaddy;
'addy' : orecolor:= newaddy;
end;
end else
begin
Mincount:= 4;
tol:= 5;
case lowercase(Players[CurrentPlayer].Strings[1]) of
'clay' : orecolor:= oldclay;
'copper' : orecolor:= oldcopper;
'tin' : orecolor:= oldtin;
'iron' : orecolor:= oldiron;
'coal' : orecolor:= oldcoal;
'mithril' : orecolor:= oldmith;
'mith' : orecolor:= oldmith;
'adamant' : orecolor:= oldaddy;
'addy' : orecolor:= oldaddy;
end;
end;
end;
////////////////////////////////////////////////// By Jukka
function InString(Text1, Text2: String): Boolean;
Begin
Result:= (Pos(LowerCase(Text2), LowerCase(Text1)) <> 0);
End;
function Responder: Boolean;
var
Response: Array [0..9] of String;
NewLine: String;
label
ResponseLabel;
begin
if(not Loggedin)then Exit;
if(invfull)then Exit;
if(not UseResponder)then Exit;
if(TimeFromMark(ResponseTime)<1000)then Exit;
MarkTime(ResponseTime);
if(not LastChatter(LastChatterString))then Exit;
if(InString(LastChatterString, Players[CurrentPlayer].Nick))then Exit;
OldLine:= TheLine;
GetLastChatText(TheLine);
NewLine:= TheLine;
if(OldLine = TheLine)then Exit;
if(InString(TheLine, 'hi')) Or (InString(TheLine, 'ello')) Or (InString(TheLine, 'yo')) Or (InString(TheLine, 'hey'))Then
begin
Response[0]:= 'Hi';
Response[1]:= 'Hello';
Response[2]:= 'ello';
Response[3]:= 'hi lol';
Response[4]:= 'Hi there';
Response[5]:= 'yo';
Response[6]:= 'hi there!';
Response[7]:= 'Yo wazzap';
Response[8]:= 'lol hi';
Response[9]:= 'Hi there';
Result:= True;
goto ResponseLabel;
end;
if(InString(TheLine, 'macro'))Then
begin
Response[0]:= 'Im not one :)';
Response[1]:= 'who is?';
Response[2]:= 'no way';
Response[3]:= 'whats that?';
Response[4]:= 'macroers are stupid';
Response[5]:= 'get rid of em';
Response[6]:= 'omg too many of them';
Response[7]:= 'im not a macro';
Response[8]:= 'whoever macroes will get shot';
Response[9]:= 'wow... chinese bot noobs need to stop this';
Result:= True;
goto ResponseLabel;
end;
if(InString(TheLine, 'autoer'))Then
begin
Response[0]:= 'I am not one :)';
Response[1]:= 'who is?';
Response[2]:= 'no way jose';
Response[3]:= 'what is that?';
Response[4]:= 'autoers are stupid';
Response[5]:= 'get rid of all of em';
Response[6]:= 'omg too much of them';
Response[7]:= 'im not an autoer';
Response[8]:= 'whoever autos will get shot by rick james';
Response[9]:= 'geez.. chineese bot noobs need to stop this';
Result:= True;
goto ResponseLabel;
end;
if(InString(TheLine, 'mining lvl')) Or (InString(TheLine, 'mine lev')) Or (InString(TheLine, 'ing lvl')) Or (InString(TheLine, 'lvl'))Then
begin
Response[0]:= IntToStr(Players[CurrentPlayer].Level[15]);
Response[1]:= IntToStr(Players[CurrentPlayer].Level[15]) +', You?';
Response[2]:= IntToStr(Players[CurrentPlayer].Level[15])+ ' lol';
Response[3]:= 'Currently ' +IntToStr(Players[CurrentPlayer].Level[15]);
Response[4]:= 'right now ' +IntToStr(Players[CurrentPlayer].Level[15]);
Response[5]:= 'soon to be ' +IntToStr(Players[CurrentPlayer].Level[15]+1);
Response[6]:= 'very soon ' +IntToStr(Players[CurrentPlayer].Level[15]+1);
Response[7]:= 'secret';
Response[8]:= 'ask me later';
Response[9]:= 'ill tell when i get level';
Result:= True;
goto ResponseLabel;
end;
if(InString(TheLine, 'lol')) Or (InString(TheLine, 'ha')) Or (InString(TheLine, 'he'))Or
(InString(TheLine, 'lmao')) Or (InString(TheLine, 'rofl')) Or (InString(TheLine, 'omg'))Then
begin
Response[0]:= 'lol';
Response[1]:= 'lmao';
Response[2]:= 'haha';
Response[3]:= '*****';
Response[4]:= 'rofl';
Response[5]:= 'hehe';
Response[6]:= 'ahah';
Response[7]:= 'lmao haha';
Response[8]:= 'hehe lol';
Response[9]:= 'haha lol lmao rofl';
Result:= True;
goto ResponseLabel;
end;
if(InString(TheLine, Players[CurrentPlayer].Nick)) or (InString(TheLine, Players[CurrentPlayer].Name))Then
begin
Response[0]:= 'yes?';
Response[1]:= 'what?';
Response[2]:= 'umm yes?';
Response[3]:= 'yes what?';
Response[4]:= 'not now..';
Response[5]:= 'nty not now';
Response[6]:= 'what now?';
Response[7]:= 'what?';
Response[8]:= 'yes?!';
Response[9]:= 'yessir?';
Result:= True;
goto ResponseLabel;
end;
ResponseLabel:
if(Result)then
begin
Writeln('Responded: '+Response[CurrentResponse]+' To: '+ TheLine);
TypeSend(Response[CurrentResponse]);
CurrentResponse:= CurrentResponse + 1;
RespondedTimes:= RespondedTimes + 1;
TRespond:= TRespond + 1;
If(CurrentResponse = 9)Then
CurrentResponse:= 0;
End;
End;
var Mx, My, Ux, Uy : integer;
MyTPoint1, MyTPoint2: TPoint;
function PointOnCubicBezier(cp: TPointArray; t: Extended): TPoint;
var
ax, ay, bx, by, cx, cy,
tSquared, tCubed, Curve: Extended;
begin
Curve:= 3.0; //average curve.
cx := Curve * (cp[1].x - cp[0].x);
bx := Curve * (cp[2].x - cp[1].x) - cx;
ax := cp[3].x - cp[0].x - cx - bx;
cy := Curve * (cp[1].y - cp[0].y);
by := Curve * (cp[2].y - cp[1].y) - cy;
ay := cp[3].y - cp[0].y - cy - by;
tSquared := t * t;
tCubed := tSquared * t;
result.x := Round((ax * tCubed) + (bx * tSquared) + (cx * t) + cp[0].x);
result.y := Round((ay * tCubed) + (by * tSquared) + (cy * t) + cp[0].y);
end;
function Spline(ex, ey: integer; CTRLP1, CTRLP2: TPoint): TPointArray;
var
theta, theta_Inc: extended; sx, sy: integer;
Dist: integer;
CtrlPoints: Array [1..4] of TPoint; //Added, Control Points array.
begin
GetMousePos(sx, sy);
Dist:= Distance(sx, sy, ex, ey);
CtrlPoints[1]:= Point(sx, sy);
CtrlPoints[2]:= CtrlP1;
CtrlPoints[3]:= CtrlP2;
CtrlPoints[4]:= Point(ex, ey);
theta_inc:= 1.0 div Dist;
theta:= 0.0;
repeat
theta_Inc:= MinE(1.0 - theta, theta_Inc); //This is the line to stop theta over 1.0
theta:= theta + theta_Inc;
SetLength(Result,Length(Result)+1);
Result[High(result)]:= PointOnCubicBezier(ctrlpoints, theta);
until(Theta >= 1.0);
result[High(result)]:= Point(ex, ey); //This is a failsafe. High = Length - 1.
end;
procedure TimoMouse(x, y, rx, ry: integer; left, justmove:boolean);
var
P: TPointArray;
I, tempx, tempy, b, c: integer;
begin
GetMousePos(mx,my);
x:= x+random(rx);
y:= y+random(ry);
ux:=x;
uy:=y;
tempy:= my + y;
tempx:= mx + x;
if (mx > x) then
begin
if (my > y) then
begin
MyTPoint1.y:= tempy/2;
MyTPoint1.x:= tempx/2;
MyTPoint2.y:= tempy/3;
MyTPoint2.x:= tempx/3;
end else
begin
MyTPoint1.y:= tempy/3;
MyTPoint1.x:= tempx/2;
MyTPoint2.y:= tempy/2;
MyTPoint2.x:= tempx/3;
end;
end else
begin
if (my > y) then
begin
MyTPoint1.y:= tempy/2;
MyTPoint1.x:= tempx/3;
MyTPoint2.y:= tempy/3;
MyTPoint2.x:= tempx/2;
end else
begin
MyTPoint1.y:= tempy/3;
MyTPoint1.x:= tempx/3;
MyTPoint2.y:= tempy/2;
MyTPoint2.x:= tempx/2;
end;
end;
P:= Spline(x, y, MyTPoint1, MyTPoint2);
for i:= 0 to High(P) do
begin
MoveMouse(P[i].x, P[i].y);
wait(randomrange(0, 2));
end;
if justmove then exit;
Wait(60 + Random(30));
GetMousePos(b, c);
HoldMouse(b + 1, c, left);
repeat
Wait(20 + Random(30));
I := I + 1;
until (I > 4);
GetMousePos(b, c);
ReleaseMouse(b, c, left);
Wait(100 + Random(100));
end;
procedure setchats;
begin
if not(LoggedIn)then exit;
if findcolortolerance(x,y,65280,138,490,155,499,2)the n
begin
TimoMouse(x,y,2,2,false,false);
ChooseOption('Off');
end;
end;
function GetMessage:string;
begin
Result := Trim(GetTextAtEx(30, 443 , 0, SmallChars, False,
False, 0, 1, 0, 80, False, tr_AllChars));
end;
function WhichLevel:string;
Var TheLevel:string;
begin
if FindColor(x, y, 8388608, 14, 372, 495, 389) then
begin
TheLevel := GetTextAtEx(x + 4, y - 1, 0, NPCChars, false, false, 0, 2, 8388608, 60, false, tr_AllChars)
Result := Trim(Between('ced a','evel',TheLevel))
end;
end;
Function Level:boolean;
begin
Result:=FindColor(x, y, 8388608, 14, 372, 495, 389)
if (result) then
begin
WriteLn('******** Advanced A '+WhichLevel+' Level ********');
WriteFileString(TheFile, '******** Advanced A '+WhichLevel+' Level ********'
+ Chr(13))
clicktocontinue;
wait(2000)
clicktocontinue;
levels:=levels+1;
end;
end;
/////////////////////// by JAD
function ChooseOptionFast(x, y, Over: Integer; txt: string): Boolean;
var
x1, y1, x2, y2, LeftCorner, RightCorner: Integer;
begin
LeftCorner := BitmapFromString(4, 4, 'z78DA33753135313137C5' +
'411A600064715CEA914500CACE13F0');
RightCorner := BitmapFromString(4, 4, 'z78DA33753135313137' +
'C5200D30002E35F8C501C9C013F0');
if (FindBitmap(LeftCorner, x1, y1)) and (FindBitmap(RightCorner, x2, y2)) then
begin
if (FindText(x, y, txt, upchars, x1, y1, x2, 502)) then
begin
Result := True;
Mouse(x + Length(txt) * 3 + (Over)+random(5), y + 3, 2, 2, True);
end
else if (FindText(x, y, 'Cancel', upchars, x1, y1, x2, 502)) then
Mouse(x + 9, y + 3, 2, 2, True);
end;
FreeBitmap(LeftCorner);
FreeBitmap(RightCorner);
end;
{************************************************* ********************
procedure DropToFast(StartSlot, EndSlot: Integer);
By: JAD
Description: A re-make of SRL's function DropTo. This drops items just
like DropTo does, but it does it much faster! It drops downward, and
when the mouse clicks drop, the mouse is ready to click on the next
item. The inventory numbers are numbered top left and down. So
Inventory slot 1 is 1, Inventory slot 5 is 2, Inventory slot 9 is 3...
etc.
************************************************** *******************}
procedure DropToFast(StartSlot, EndSlot: Integer);
var FastSlot: array[1..28] of Integer;
DropSlot: array[1..28] of TPoint;
I, Q, T, F: Integer;
begin
if not(LoggedIn)then exit;
T := 1;
for I := 1 to 28 do
begin
FastSlot[i] := T + Q;
Q := Q + 4;
if(Q > 24)then
begin
T := T + 1;
Q := 0;
end;
end;
GameTab(4);
Q := 0;
for F := 1 to 2 do
begin
for I := StartSlot to EndSlot do
begin
if(ExistsItem(FastSlot[i]))then
begin
DropSlot[i] := ItemCoords(FastSlot[i]);
Mouse(DropSlot[i].x,DropSlot[i].y,10,10,false);
if(I > 7)then
ChooseOptionFast(x,y,30,'Drop') else
ChooseOptionFast(x,y,4,'Drop');
end;
end;
end;
end;
Function DetectGas(Gx, Gy: Integer): Boolean;
Var
GasTPA: Array [0..6] Of TPointArray;
GasColor: Array [0..6] Of Integer;
H, Count: Integer;
Begin
GasColor[0] := 6123901;
GasColor[1] := 5795704;
GasColor[2] := 5270391;
GasColor[3] := 5599613;
GasColor[4] := 5136998;
GasColor[5] := 6321275;
For H:= 0 To 5 Do
Begin
FindColorsTolerance(GasTPA[H], GasColor[H], Gx-40, Gy-40, Gx+40, Gy+40, GasTol);
Count:= Count + GetArrayLength(GasTPA[H])-1;
End;
If(Count > MinGasChange)And(Count < 2000)Then
Begin
Result := FindGas(Gx, Gy);
End;
End;
function w_GasCheck(gx, gy: integer): boolean;
Var
x1, y1, x2, y2, I, time, c: Integer;
R, G, B: Integer;
H, S, L: ExtEnded;
X, Y, Z: ExtEnded;
Gas, Gas2: TPointArray;
Colors, C2: TIntegerArray;
begin
Try
x1 := gx - 35;
If x1 < 0 Then
x1 := 0;
y1 := gy - 35;
If y1 < 0 Then
y1 := 0;
x2 := gx + 35;
If x2 > 515 Then
x2 := 515;
y2 := gy + 35;
If y2 > 336 Then
y2 := 336;
Time := GetSystemTime;
Result := False;
c := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2ModIfiers(0.2, 0.2);
FindColorsTolerance(Gas, 8886170, x1, y1, x2, y2, 20);
ColorToleranceSpeed(c);
If length(Gas) < 10 Then
Exit;
Colors := GetColors(Gas);
C2 := Colors;
ClearSameIntegers(C2);
//writeln('w_Colors Length: ' + inttostr(length(colors)));
// writeln('w_C2 Length: ' + inttostr(length(C2)));
If Length(C2) < 40 Then
Exit;
For I := 0 To High(Gas) Do
Begin
ColorToRGB(Colors[I], R, G, B);
If Abs(R - G) <= 10.0 Then
Begin
ColorToHSL(Colors[I], H, S, L);
If (H > 11.5) And (H < 16.0) And (S < 12.0) Then
Begin
ColorToXYZ(Colors[I], X, Y, Z);
If (Abs(X - Y) < 5.0) And (Abs(X - Z) < 5.0) And (Abs(Y - Z) < 5.0) Then
Begin
SetLength(Gas2, Length(Gas2) + 1);
Gas2[High(Gas2)] := Gas[I];
End;
End;
End;
End;
WriteLn('w_time: ' + IntToStr(GetSystemTime - Time));
WriteLn('w_gas2 length: ' + IntToStr(Length(Gas2)));
Result := (Length(Gas2) > 30); // The only number you might want to tweak.
//debugtpa(Gas2, '');
If Result Then
Begin
WriteLn('*** GAS FOUND ***');
End;
Except WriteLn('w_gasCheck ERROR: No window selected'); End;
End;
function noore:boolean;
begin
result:= (pos('no ore',GetMessage)<>0)
end;
function swing:boolean;
begin
result:= (pos('swing',GetMessage)<>0)
end;
function manage:boolean;
begin
result:= (pos('manage',GetMessage)<>0)
end;
function higherlvlrock:boolean;
begin
case lowercase(Players[CurrentPlayer].Strings[1]) of
'clay' : result:= false;
'copper' : result:= false;
'tin' : result:= false;
'iron' : result:= false;
'coal' : result:= true;
'mithril' : result:= true;
'mith' : result:= true;
'adamant' : result:= true;
'addy' : result:= true;
end;
end;
{- CREDIT TO JUKKA FOR CHECKING IF
PICK IS THERE AND FINDING A LOST ONE -}
var
LostHead:integer;
PickHeadColors: Array Of Integer;
Function LoadPick(Style: String; Int: Integer): Integer;
Begin
Case LowerCase(Style) Of
'dtm':
Begin
Case Int Of //Bronze - Rune DTMS!
1: Result := DTMFromString('78DA63DCC0C0C0A0C9800618914820BD194 86' +
'81350B38A0835AB81843E11E6E8A2AA30D39264104156B306 BF1A' +
'16200600A5500645');
2: Result := DTMFromString('78DA63BCCFC0C050CA800618914820FD084 89' +
'4135073134854A2AAB0B3B464E04256731BBF1A269839D5B8 ED62' +
'06D1B7F0BB07A406007C420985');
3: Result := DTMFromString('78DA63CC616460286540038C4824904E05B 22' +
'A5155448786328820ABC9C0AF068CD38164356EBB98606ACA 09A8' +
'C927AC0600C71D0796');
4: Result := DTMFromString('78DA636C646060D06440038C482490AE061 2B' +
'AA82A0C0CDC184490D5D4E257C30833471FB75D4C20BA8208 3520' +
'73B409A86921AC06009DB10633');
5: Result := DTMFromString('78DA638C676060B06740038C4824904E021 24' +
'E04D44403096754154676460C5CC86A22F1AB6102D11140C2 15B7' +
'5DCC30358EF8D5000060E40523');
6: Result := DTMFromString('78DA6394636460F06440038C4824909604B 27' +
'C515518397B317021AB11C3AF068CC581A43F6EBB9840B404 90E5' +
'4D408D226135000BAF0415');
End
End;
'colors':
Begin
Case Int Of //Bronze - Rune
1: Result:= 1649206;
2: Result:= 3750206;
3: Result:= 5592411;
4: Result:= 4599856;
5: Result:= 3292722;
6: Result:= 5590329;
End
End;
End;
End;
function InIntArr(Num: Integer; I: TIntegerArray): Boolean;
var
C: Integer;
begin
for C:= 0 to Length(I) - 1 do
if(I[C] = Num)then
begin
Result:= True;
exit;
end;
end;
procedure ShrinkArray(var Arr: TIntegerArray);
var
Used: TIntegerArray;
I, Index: Integer;
begin
SetLength(Used, Length(Arr));
if(InIntArr(0, Arr))then
Inc(Index);
for I:= 0 to Length(Arr) - 1 do
if(not(InIntArr(Arr[i], Used)))then
begin
Used[Index]:= Arr[i];
Inc(Index);
end;
SetLength(Used, Index);
Arr:= Used;
end;
Function GetPickHeadColors: Boolean;
Var
FailedPick, I, II, PickDTM, PickStyle: Integer;
ColorTPA: TPointArray;
Label
GetPickColors;
Begin
if not(LoggedIn)then exit;
FindNormalRandoms;
GetPickColors:
If(Not Loggedin)Then Exit;
If(Players[CurrentPlayer].Booleans[2])Then
GameTab(5)
Else GameTab(4);
Wait(500+Random(500));
For I:= 6 DownTo 1 Do
Begin
PickDTM:= LoadPick('DTM', I);
If(FindDTM( PickDTM, X, Y, MIX1, MIY1, MIX2, MIY2))Then
Begin
FindColorsTolerance(ColorTPA, LoadPick('Colors', I), X, Y, X+30, Y+30, 10);
For II:= 0 To GetArrayLength(ColorTPA)-1 Do
Begin
SetArrayLength(PickHeadColors, GetArrayLength(PickHeadColors)+1);
PickHeadColors[II]:= GetColor(ColorTPA[II].X, ColorTPA[II].Y);
End;
PickStyle:= I;
Break;
End;
End;
ShrinkArray(PickHeadColors);
For II:= 0 To GetArrayLength(PickHeadColors)-1 Do
Begin
//Writeln('PickHeadColor['+IntToStr(II)+']:= '+IntToStr(PickHeadColors[II])+';');
If( PickHeadColors[II] <> 0)Then
Result:= True;
End;
If(Not Result)Then
Begin
Writeln('Getting NEW pickcolors, Failed');
FailedPick:= FailedPick + 1;
If(FailedPick > 4)Then
Begin
Writeln('Coudlnt get pickcolors');
Players[CurrentPlayer].Loc:='Couldnt get pickcolors';
Logout;
Players[CurrentPlayer].Active:= False;
Exit;
End;
GoTo GetPickColors;
End;
Writeln('Picked '+IntToStr(GetArrayLength(PickHeadColors)) + ' Colors');
Case I Of
1: Writeln('You have a Bronze pick axe');
2: Writeln('You have a Iron pick axe');
3: Writeln('You have a Steel pick axe');
4: Writeln('You have a Mith pick axe');
5: Writeln('You have a Addy pick axe');
6: Writeln('You have a Rune pick axe');
End
FreeDTM( PickDTM );
End;
Procedure AttachPick;
Var
Handle, AxeHead: Integer;
Begin
if not(LoggedIn)then exit;
Handle := DTMFromString('78DA63DCC1C0C0E0C38002CCD51818FE036 94' +
'620FE0F048CFB800C170634C0884402E93D40C289809A8D40 2282' +
'809A2D402212BF1A003B1D0A81');
AxeHead := DTMFromString('78DA637466626078C280024C9D4D19FE036 94' +
'620FE0F048CD640352F18D000231209A42D816A9E1150E388 6917' +
'861A27A09AC704D4B800D53C24A0C60DA8E63901359E44A87 1256' +
'C1700B0451030');
GameTab(4);
If(FindDTM(Handle, X, Y, MIX1, MIY1, MIX2, MIY2))Then
Begin
TimoMouse(X, Y, 4, 4, False, False);
ChooseOption('Use');
Wait(300+Random(400));
If(FindDTM(AxeHead, X, Y, MIX1, MIY1, MIX2, MIY2))Then
Begin
TimoMouse(X, Y, 3, 3, True, False);
Writeln('Pick Attached!');
End;
Wait(300+Random(400));
End;
FreeDTM(Handle);
FreeDTM(AxeHead);
End;
Procedure WalkToDropDot;
Begin
if not(LoggedIn)then exit;
X:= MMCX; Y:= MMCY; //Red Drop Dot!
If(FindColorSpiralTolerance(X, Y, 3553023, MMX1, MMY1, MMX2, MMY2, 20))Then
Begin
Case 1+Random(4) Of
1: TimoMouse(X - 5, Y, 3, 3, True, False);
2: TimoMouse(X + 5, Y, 3, 3, True, False);
3: TimoMouse(X, Y + 5, 3, 3, True, False);
4: TimoMouse(X, Y - 5, 3, 3, True, False);
End
Flag;
End;
End;
Function FindLostPick: Boolean;
Var
PickHandle, BrokenPick, PickDTM, I, II, Tol, Pick: Integer;
PickTPA: TPointArray;
Begin
If(Not Loggedin)Then Exit;
If(InvFull)Then
DropToPosition(1, 2);
BrokenPick := DTMFromString('78DA63DCCBC0C0D0CD800618914820BD1D4 8F' +
'412A166220135078830E73890984C849AA9F8D50000C33207 EA');
PickHandle := DTMFromString('78DA63DCC1C0C0E0C38002CCD51818FE036 94' +
'620FE0F048CFB800C170634C0884402E93D40C289809A8D40 2282' +
'809A2D402212BF1A003B1D0A81');
If not(Players[CurrentPlayer].Booleans[2])Then
Begin
GameTab(5);
Wait(400+Random(300));
If(FindDTM(BrokenPick, X, Y, MIX1, MIY1, MIX2, MIY2))Then
Begin
TakeOff(5);
NoPick:= True;
Writeln('***** Pick broken *****');
BrokenPicks := BrokenPicks + 1;
FreeDTM( BrokenPick );
FreeDTM(PickHandle);
Exit; //Exit Because Broken Pick nothing we can do here..
End Else
If(FindDTM(PickHandle, X, Y, MIX1, MIY1, MIX2, MIY2))Then
Begin
Writeln('***** Lost PickHead *****');
TakeOff(5);
FreeDTM(BrokenPick);
FreeDTM(PickHandle);
NoPick := True;
End Else
Begin
NoPick := True;
TakeOff(5);
Writeln('Error, Tell Jukka to update his DTMS');
FreeDTM(BrokenPick);
FreeDTM(PickHandle);
Exit;
End;
End Else
Begin
GameTab(4);
Wait(400+Random(300));
If(FindDTM(BrokenPick, X, Y, MIX1, MIY1, MIX2, MIY2))Then
Begin
NoPick:= True;
Writeln('***** Pick broken *****');
BrokenPicks := BrokenPicks + 1;
FreeDTM( BrokenPick );
FreeDTM(PickHandle);
Exit;
//Exit Because Broken Pick nothing we can do here..
End Else
If(FindDTM(PickHandle, X, Y, MIX1, MIY1, MIX2, MIY2))Then
Begin
Writeln('***** Lost PickHead *****');
FreeDTM(BrokenPick);
FreeDTM(PickHandle);
NoPick := True;
End Else
Begin
Writeln('Error, Tell Jukka to update his DTMS');
FreeDTM(BrokenPick);
FreeDTM(PickHandle);
Exit;
End;
End;
GameTab(4);
WalkToDropDot;
Flag;
Wait(500+Random(400));
MarkTime(Pick);
Repeat
For I:= 0 To GetArrayLength(PickHeadColors)-1 Do
If(PickHeadColors[I] <> 0)Then
FindColorsSpiralTolerance(X, Y, PickTPA, PickHeadColors[I], MSX1, MSY1, MSX2, MSY2, Tol);
For I:= 0 To GetArrayLength(PickTPA)-1 Do
Begin
X:= PickTPA[I].X; Y:= PickTPA[I].Y;
TimoMouse(X, Y, 0, 0, false, true);
Wait(10);
If(IsUpText('ake'))Then
Begin
TimoMouse(X, Y, 0, 0, True, False);
Wait(10);
writeln('Found Pick');
Flag;
Wait(500+Random(400));
AttachPick;
GameTab(4);
Wait(500+Random(300));
For II:= 1 To 6 Do
Begin
PickDTM:= LoadPick('DTM', II);
If(FindDTM( PickDTM, X, Y, MIX1, MIY1, MIX2, MIY2))Then
Begin
If(Players[CurrentPlayer].Booleans[2])Then
TimoMouse(X+8, Y+8, 5, 5, True, False);
NoPick:= False;
Result:= True;
writeln('Pick Attached');
Writeln('***** Found Pick *****');
AxeAttaches := AxeAttaches + 1;
ReportVars[2] := ReportVars[2] + 1;
SRLRandomsReport;
FreeDTM(PickDTM);
Exit; //EXIT EVERYTHING!
End Else FreeDTM(PickDTM);
End;
End;
End;
WalkToDropDot;
Flag;
Wait(500+Random(400));
Until(TimeFromMark(Pick)>60000)Or(Result)Or(Not Loggedin);
writeln('CantFindHead');
Writeln('***** Lost Head *****');
LostHead := LostHead + 1;
End;
function PickCheck: Boolean;
begin
if not(LoggedIn)then exit;
If(FindColor(X, Y, 16711680, 192, 442, 204, 454))Then
begin
If(FindText(X, Y, 'Pickax', NPCChars, 122, 373, 181, 395))Then
begin
Writeln('NoPick!');
Result:= True;
if(FindLostPick)then
Result:= False
else NoPick:= True;
end;
end;
end;
{-------------- END OF JUKKAS STUFF ------------------}
procedure waitrock;
var
oretime:LongInt;
begin
MarkTime(oretime);
if swing then
begin
repeat
if NoPick then exit;
if findfight then
begin
RunTo(rundir,True);
end;
wait(1);
Responder;
if not(LoggedIn)then exit;
FindNormalRandoms;
if level then exit;
ClickToContinue;
if higherlvlrock then
begin
if (TimeFromMark(oretime) > 15000)then exit;
end else
begin
//if (TimeFromMark(oretime) > 7500)then exit;
if (TimeFromMark(oretime) > 10000)then exit;
end;
if manage then exit;
if level then exit;
if manage then exit;
if level then exit;
if manage then exit;
if level then exit;
if w_GasCheck(x,y)then
begin
MouseFindFlag(648,83,5,5);
Gasses:= Gasses + 1;
FTWait(36+random(4));
Status('Found Gas!');
exit;
end;
if manage then exit;
if level then exit;
if noore then exit;
wait(1);
until(manage)
end;
if noore then exit;
end;
procedure powermine;
begin
if not(LoggedIn)then exit;
if NoPick then exit;
FindNormalRandoms;
SetChats;
wait(1);
if PickCheck then
begin
logout;
Players[CurrentPlayer].Active:= false;
end;
Responder;
if FindObjOre2(cx,cy,'ocks',orecolor,tol,mincount)the n
begin
GetMousePos(cx,cy);
end else
begin
exit;
end;
if DetectGas(cx,cy)then
begin
Gasses:= Gasses + 1;
FTWait(36+random(4));
Status('Found Gas!');
exit;
end;
if (isuptext('ine'))then
begin
case(random(6))of
0,1,2,3,4:Mouse(cx,cy,0,0,true);
5:begin
Mouse(cx,cy,0,0,false);
ChooseOption('Mine');
end;
end;
attempts:= attempts + 1;
FFlag(0);
FTWait(6);
end;
WaitRock;
end;
procedure SetupPick;
begin
if not(LoggedIn)then exit;
{if(GetCombatLevel < 10)Then
begin
Writeln('Please Level Up Your Charachters in Combat');
Logout;
Players[CurrentPlayer].Loc := 'Too Low Level';
Players[CurrentPlayer].Active:= False;
Exit;
end;}
if(not GetPickHeadColors)then
begin
Writeln('Couldnt get pick colors, Equip or have in inventory.');
Players[CurrentPlayer].Loc := 'Couldnt Get PickColors';
Logout;
Players[CurrentPlayer].Active:= False;
end else
begin
done:= true;
end;
HighestAngle;
end;
procedure ProgressReport;
var Sec:integer;
begin
Sec := GetTimeRunning div 1000+1;
writeln('~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~' )
writeln(' [SRL4] QuickPowerminer 1.5 by Timothegreat ')
writeln('----------------------------------------')
writeln(' Time Running: '+TimeRunning)
writeln(' Ores Mined: '+inttostr(ores))
writeln(' Loads: '+inttostr(loads))
writeln(' Ores/hr: '+IntToStr(Round(3600*Ores/Sec)))
writeln(' Responded: '+inttostr(RespondedTimes)+' Times')
writeln(' Broken Picks: '+inttostr(BrokenPicks));
writeln('~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~' )
end;
procedure setup;
begin
SetupSRL;
ScriptID := '513';
if ((SRLStatsID = '') or (SRLStatsPW = ''))then
begin
SRLID:='3936';
SRLPassword:='leechme';
writeln('Stupid leecher...');
end else
begin
SRLID := SRLStatsID;
SRLPassword := SRLStatsPW;
end;
SRLRandomsReport;
end;
begin
Setup;
DeclarePlayers;
Done:= False;
LoginPlayer;
Repeat
if not(LoggedIn)then
begin
TLoads:=0;
Done:= False;
NextPlayer(false);
end;
if NoPick then
begin
TLoads:=0;
Done:= False;
NextPlayer(false);
end;
SetupScript;
if not(done) then
begin
SetupPick;
end;
Powermine;
if (invfull) then
begin
Done:= False;
TLoads:= TLoads + 1;
loads:= loads + 1;
ReportVars[1] := ReportVars[1] + 1;
if (Players[CurrentPlayer].Booleans[2])then
begin
DropToFast(1,28);
ores:= ores + 28;
ReportVars[0] := ReportVars[0] + 28;
end else
begin
DropToFast(2,28);
ores:= ores + 27;
ReportVars[0] := ReportVars[0] + 27;
end;
ProgressReport;
end;
if (TLoads = Players[CurrentPlayer].Integers[1])then
begin
Done:= False;
TLoads:=0;
NextPlayer(true);
end;
until(false);
end.
{.include SRL\SRL.scar}
{.include SRL\SRL\Skill\Mining.scar}
////////////////////////////////////////////////////////////
// [SRL4] QuickPowerMiner by Timothegreat //
// //
// Version 1.5 //
// //
// ------------ //
// Instructions //
// ------------ //
// //
// 1. Setup your players by the ore you want to mine //
// 2. Fill out lines 22-60 //
// 3. Hit the play button //
// 4. Enjoy! //
// Autoresponder by Jukka //
// Gas Detection by Wizzup? //
////////////////////////////////////////////////////////////
const
SRLStatsID = ''; // SRL Stats ID Number
SRLStatsPW = ''; // SRL Stats Password
GasTol = 15; // Change if find you broken pickaxes!
MinGasChange = 200; // 100+ About 200-300 and more. Basically tolerance.
UseResponder = True; // Use autoresponder?
RunDir = 'S'; // direction to run if in fight
// N for north, S for south, etc.
Procedure DeclarePlayers;
Begin
HowManyPlayers := 4;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
Players[0].Name :='';
Players[0].Pass :='';
Players[0].Nick :=''; //3-4 letters from name
Players[0].Active:= True;
Players[0].Booleans[1]:= True; // True if new rocks. False if old.
Players[0].Booleans[2]:= False; // Pick equipped?
Players[0].Strings[1]:= 'Copper'; // type of ore
Players[0].Integers[1]:= 5; // # of loads
Players[1].Name :='';
Players[1].Pass :='';
Players[1].Nick :=''; //3-4 letters from name
Players[1].Active:= True;
Players[1].Booleans[1]:= True; // True if new rocks. False if old.
Players[1].Booleans[2]:= False; // Pick equipped?
Players[1].Strings[1]:= 'Tin'; // type of ore
Players[1].Integers[1]:= 5; // # of loads
Players[2].Name :='';
Players[2].Pass :='';
Players[2].Nick :=''; //3-4 letters from name
Players[2].Active:= True;
Players[2].Booleans[1]:= True; // True if new rocks. False if old.
Players[2].Booleans[2]:= False; // Pick equipped?
Players[2].Strings[1]:= 'Tin'; // type of ore
Players[2].Integers[1]:= 5; // # of loads
Players[3].Name :='';
Players[3].Pass :='';
Players[3].Nick :=''; //3-4 letters from name
Players[3].Active:= True;
Players[3].Booleans[1]:= True; // True if new rocks. False if old.
Players[3].Booleans[2]:= False; // Pick equipped?
Players[3].Strings[1]:= 'Tin'; // type of ore
Players[3].Integers[1]:= 5; // # of loads}
End;
{---------------------DO NOT TOUCH BELOW THIS---------------------------}
const
oldclay = 5212840;
oldcopper = 4483472;
oldtin = 8553100;
oldiron = 2437455;
oldgold = 2081517;
oldcoal = 2636603;
oldmith = 6636869;
oldaddy = 5202510;
newclay = 5212840;
newcopper = 5010848; //
newtin = 7829376; //
newiron = 3030370; //
newgold = 2081517; // from rimmington
newcoal = 2636603;
newmith = 6636869;
newaddy = 5202510;
var
x,y,cx,cy,orecolor,TLoads,Gasses,attempts,tol,leve ls,BrokenPicks,
loads,ores,ResponseTime,CurrentResponse,RespondedT imes,TRespond:integer;
done:boolean;
Mincount:byte;
LastChatterString: String;
procedure SetupScript;
begin
if (Players[CurrentPlayer].Booleans[1])then
begin
Mincount:= 1;
tol:= 5;
case lowercase(Players[CurrentPlayer].Strings[1]) of
'clay' : orecolor:= newclay;
'copper' : orecolor:= newcopper;
'tin' : orecolor:= newtin;
'iron' : orecolor:= newiron;
'coal' : orecolor:= newcoal;
'mithril' : orecolor:= newmith;
'mith' : orecolor:= newmith;
'adamant' : orecolor:= newaddy;
'addy' : orecolor:= newaddy;
end;
end else
begin
Mincount:= 4;
tol:= 5;
case lowercase(Players[CurrentPlayer].Strings[1]) of
'clay' : orecolor:= oldclay;
'copper' : orecolor:= oldcopper;
'tin' : orecolor:= oldtin;
'iron' : orecolor:= oldiron;
'coal' : orecolor:= oldcoal;
'mithril' : orecolor:= oldmith;
'mith' : orecolor:= oldmith;
'adamant' : orecolor:= oldaddy;
'addy' : orecolor:= oldaddy;
end;
end;
end;
////////////////////////////////////////////////// By Jukka
function InString(Text1, Text2: String): Boolean;
Begin
Result:= (Pos(LowerCase(Text2), LowerCase(Text1)) <> 0);
End;
function Responder: Boolean;
var
Response: Array [0..9] of String;
NewLine: String;
label
ResponseLabel;
begin
if(not Loggedin)then Exit;
if(invfull)then Exit;
if(not UseResponder)then Exit;
if(TimeFromMark(ResponseTime)<1000)then Exit;
MarkTime(ResponseTime);
if(not LastChatter(LastChatterString))then Exit;
if(InString(LastChatterString, Players[CurrentPlayer].Nick))then Exit;
OldLine:= TheLine;
GetLastChatText(TheLine);
NewLine:= TheLine;
if(OldLine = TheLine)then Exit;
if(InString(TheLine, 'hi')) Or (InString(TheLine, 'ello')) Or (InString(TheLine, 'yo')) Or (InString(TheLine, 'hey'))Then
begin
Response[0]:= 'Hi';
Response[1]:= 'Hello';
Response[2]:= 'ello';
Response[3]:= 'hi lol';
Response[4]:= 'Hi there';
Response[5]:= 'yo';
Response[6]:= 'hi there!';
Response[7]:= 'Yo wazzap';
Response[8]:= 'lol hi';
Response[9]:= 'Hi there';
Result:= True;
goto ResponseLabel;
end;
if(InString(TheLine, 'macro'))Then
begin
Response[0]:= 'Im not one :)';
Response[1]:= 'who is?';
Response[2]:= 'no way';
Response[3]:= 'whats that?';
Response[4]:= 'macroers are stupid';
Response[5]:= 'get rid of em';
Response[6]:= 'omg too many of them';
Response[7]:= 'im not a macro';
Response[8]:= 'whoever macroes will get shot';
Response[9]:= 'wow... chinese bot noobs need to stop this';
Result:= True;
goto ResponseLabel;
end;
if(InString(TheLine, 'autoer'))Then
begin
Response[0]:= 'I am not one :)';
Response[1]:= 'who is?';
Response[2]:= 'no way jose';
Response[3]:= 'what is that?';
Response[4]:= 'autoers are stupid';
Response[5]:= 'get rid of all of em';
Response[6]:= 'omg too much of them';
Response[7]:= 'im not an autoer';
Response[8]:= 'whoever autos will get shot by rick james';
Response[9]:= 'geez.. chineese bot noobs need to stop this';
Result:= True;
goto ResponseLabel;
end;
if(InString(TheLine, 'mining lvl')) Or (InString(TheLine, 'mine lev')) Or (InString(TheLine, 'ing lvl')) Or (InString(TheLine, 'lvl'))Then
begin
Response[0]:= IntToStr(Players[CurrentPlayer].Level[15]);
Response[1]:= IntToStr(Players[CurrentPlayer].Level[15]) +', You?';
Response[2]:= IntToStr(Players[CurrentPlayer].Level[15])+ ' lol';
Response[3]:= 'Currently ' +IntToStr(Players[CurrentPlayer].Level[15]);
Response[4]:= 'right now ' +IntToStr(Players[CurrentPlayer].Level[15]);
Response[5]:= 'soon to be ' +IntToStr(Players[CurrentPlayer].Level[15]+1);
Response[6]:= 'very soon ' +IntToStr(Players[CurrentPlayer].Level[15]+1);
Response[7]:= 'secret';
Response[8]:= 'ask me later';
Response[9]:= 'ill tell when i get level';
Result:= True;
goto ResponseLabel;
end;
if(InString(TheLine, 'lol')) Or (InString(TheLine, 'ha')) Or (InString(TheLine, 'he'))Or
(InString(TheLine, 'lmao')) Or (InString(TheLine, 'rofl')) Or (InString(TheLine, 'omg'))Then
begin
Response[0]:= 'lol';
Response[1]:= 'lmao';
Response[2]:= 'haha';
Response[3]:= '*****';
Response[4]:= 'rofl';
Response[5]:= 'hehe';
Response[6]:= 'ahah';
Response[7]:= 'lmao haha';
Response[8]:= 'hehe lol';
Response[9]:= 'haha lol lmao rofl';
Result:= True;
goto ResponseLabel;
end;
if(InString(TheLine, Players[CurrentPlayer].Nick)) or (InString(TheLine, Players[CurrentPlayer].Name))Then
begin
Response[0]:= 'yes?';
Response[1]:= 'what?';
Response[2]:= 'umm yes?';
Response[3]:= 'yes what?';
Response[4]:= 'not now..';
Response[5]:= 'nty not now';
Response[6]:= 'what now?';
Response[7]:= 'what?';
Response[8]:= 'yes?!';
Response[9]:= 'yessir?';
Result:= True;
goto ResponseLabel;
end;
ResponseLabel:
if(Result)then
begin
Writeln('Responded: '+Response[CurrentResponse]+' To: '+ TheLine);
TypeSend(Response[CurrentResponse]);
CurrentResponse:= CurrentResponse + 1;
RespondedTimes:= RespondedTimes + 1;
TRespond:= TRespond + 1;
If(CurrentResponse = 9)Then
CurrentResponse:= 0;
End;
End;
var Mx, My, Ux, Uy : integer;
MyTPoint1, MyTPoint2: TPoint;
function PointOnCubicBezier(cp: TPointArray; t: Extended): TPoint;
var
ax, ay, bx, by, cx, cy,
tSquared, tCubed, Curve: Extended;
begin
Curve:= 3.0; //average curve.
cx := Curve * (cp[1].x - cp[0].x);
bx := Curve * (cp[2].x - cp[1].x) - cx;
ax := cp[3].x - cp[0].x - cx - bx;
cy := Curve * (cp[1].y - cp[0].y);
by := Curve * (cp[2].y - cp[1].y) - cy;
ay := cp[3].y - cp[0].y - cy - by;
tSquared := t * t;
tCubed := tSquared * t;
result.x := Round((ax * tCubed) + (bx * tSquared) + (cx * t) + cp[0].x);
result.y := Round((ay * tCubed) + (by * tSquared) + (cy * t) + cp[0].y);
end;
function Spline(ex, ey: integer; CTRLP1, CTRLP2: TPoint): TPointArray;
var
theta, theta_Inc: extended; sx, sy: integer;
Dist: integer;
CtrlPoints: Array [1..4] of TPoint; //Added, Control Points array.
begin
GetMousePos(sx, sy);
Dist:= Distance(sx, sy, ex, ey);
CtrlPoints[1]:= Point(sx, sy);
CtrlPoints[2]:= CtrlP1;
CtrlPoints[3]:= CtrlP2;
CtrlPoints[4]:= Point(ex, ey);
theta_inc:= 1.0 div Dist;
theta:= 0.0;
repeat
theta_Inc:= MinE(1.0 - theta, theta_Inc); //This is the line to stop theta over 1.0
theta:= theta + theta_Inc;
SetLength(Result,Length(Result)+1);
Result[High(result)]:= PointOnCubicBezier(ctrlpoints, theta);
until(Theta >= 1.0);
result[High(result)]:= Point(ex, ey); //This is a failsafe. High = Length - 1.
end;
procedure TimoMouse(x, y, rx, ry: integer; left, justmove:boolean);
var
P: TPointArray;
I, tempx, tempy, b, c: integer;
begin
GetMousePos(mx,my);
x:= x+random(rx);
y:= y+random(ry);
ux:=x;
uy:=y;
tempy:= my + y;
tempx:= mx + x;
if (mx > x) then
begin
if (my > y) then
begin
MyTPoint1.y:= tempy/2;
MyTPoint1.x:= tempx/2;
MyTPoint2.y:= tempy/3;
MyTPoint2.x:= tempx/3;
end else
begin
MyTPoint1.y:= tempy/3;
MyTPoint1.x:= tempx/2;
MyTPoint2.y:= tempy/2;
MyTPoint2.x:= tempx/3;
end;
end else
begin
if (my > y) then
begin
MyTPoint1.y:= tempy/2;
MyTPoint1.x:= tempx/3;
MyTPoint2.y:= tempy/3;
MyTPoint2.x:= tempx/2;
end else
begin
MyTPoint1.y:= tempy/3;
MyTPoint1.x:= tempx/3;
MyTPoint2.y:= tempy/2;
MyTPoint2.x:= tempx/2;
end;
end;
P:= Spline(x, y, MyTPoint1, MyTPoint2);
for i:= 0 to High(P) do
begin
MoveMouse(P[i].x, P[i].y);
wait(randomrange(0, 2));
end;
if justmove then exit;
Wait(60 + Random(30));
GetMousePos(b, c);
HoldMouse(b + 1, c, left);
repeat
Wait(20 + Random(30));
I := I + 1;
until (I > 4);
GetMousePos(b, c);
ReleaseMouse(b, c, left);
Wait(100 + Random(100));
end;
procedure setchats;
begin
if not(LoggedIn)then exit;
if findcolortolerance(x,y,65280,138,490,155,499,2)the n
begin
TimoMouse(x,y,2,2,false,false);
ChooseOption('Off');
end;
end;
function GetMessage:string;
begin
Result := Trim(GetTextAtEx(30, 443 , 0, SmallChars, False,
False, 0, 1, 0, 80, False, tr_AllChars));
end;
function WhichLevel:string;
Var TheLevel:string;
begin
if FindColor(x, y, 8388608, 14, 372, 495, 389) then
begin
TheLevel := GetTextAtEx(x + 4, y - 1, 0, NPCChars, false, false, 0, 2, 8388608, 60, false, tr_AllChars)
Result := Trim(Between('ced a','evel',TheLevel))
end;
end;
Function Level:boolean;
begin
Result:=FindColor(x, y, 8388608, 14, 372, 495, 389)
if (result) then
begin
WriteLn('******** Advanced A '+WhichLevel+' Level ********');
WriteFileString(TheFile, '******** Advanced A '+WhichLevel+' Level ********'
+ Chr(13))
clicktocontinue;
wait(2000)
clicktocontinue;
levels:=levels+1;
end;
end;
/////////////////////// by JAD
function ChooseOptionFast(x, y, Over: Integer; txt: string): Boolean;
var
x1, y1, x2, y2, LeftCorner, RightCorner: Integer;
begin
LeftCorner := BitmapFromString(4, 4, 'z78DA33753135313137C5' +
'411A600064715CEA914500CACE13F0');
RightCorner := BitmapFromString(4, 4, 'z78DA33753135313137' +
'C5200D30002E35F8C501C9C013F0');
if (FindBitmap(LeftCorner, x1, y1)) and (FindBitmap(RightCorner, x2, y2)) then
begin
if (FindText(x, y, txt, upchars, x1, y1, x2, 502)) then
begin
Result := True;
Mouse(x + Length(txt) * 3 + (Over)+random(5), y + 3, 2, 2, True);
end
else if (FindText(x, y, 'Cancel', upchars, x1, y1, x2, 502)) then
Mouse(x + 9, y + 3, 2, 2, True);
end;
FreeBitmap(LeftCorner);
FreeBitmap(RightCorner);
end;
{************************************************* ********************
procedure DropToFast(StartSlot, EndSlot: Integer);
By: JAD
Description: A re-make of SRL's function DropTo. This drops items just
like DropTo does, but it does it much faster! It drops downward, and
when the mouse clicks drop, the mouse is ready to click on the next
item. The inventory numbers are numbered top left and down. So
Inventory slot 1 is 1, Inventory slot 5 is 2, Inventory slot 9 is 3...
etc.
************************************************** *******************}
procedure DropToFast(StartSlot, EndSlot: Integer);
var FastSlot: array[1..28] of Integer;
DropSlot: array[1..28] of TPoint;
I, Q, T, F: Integer;
begin
if not(LoggedIn)then exit;
T := 1;
for I := 1 to 28 do
begin
FastSlot[i] := T + Q;
Q := Q + 4;
if(Q > 24)then
begin
T := T + 1;
Q := 0;
end;
end;
GameTab(4);
Q := 0;
for F := 1 to 2 do
begin
for I := StartSlot to EndSlot do
begin
if(ExistsItem(FastSlot[i]))then
begin
DropSlot[i] := ItemCoords(FastSlot[i]);
Mouse(DropSlot[i].x,DropSlot[i].y,10,10,false);
if(I > 7)then
ChooseOptionFast(x,y,30,'Drop') else
ChooseOptionFast(x,y,4,'Drop');
end;
end;
end;
end;
Function DetectGas(Gx, Gy: Integer): Boolean;
Var
GasTPA: Array [0..6] Of TPointArray;
GasColor: Array [0..6] Of Integer;
H, Count: Integer;
Begin
GasColor[0] := 6123901;
GasColor[1] := 5795704;
GasColor[2] := 5270391;
GasColor[3] := 5599613;
GasColor[4] := 5136998;
GasColor[5] := 6321275;
For H:= 0 To 5 Do
Begin
FindColorsTolerance(GasTPA[H], GasColor[H], Gx-40, Gy-40, Gx+40, Gy+40, GasTol);
Count:= Count + GetArrayLength(GasTPA[H])-1;
End;
If(Count > MinGasChange)And(Count < 2000)Then
Begin
Result := FindGas(Gx, Gy);
End;
End;
function w_GasCheck(gx, gy: integer): boolean;
Var
x1, y1, x2, y2, I, time, c: Integer;
R, G, B: Integer;
H, S, L: ExtEnded;
X, Y, Z: ExtEnded;
Gas, Gas2: TPointArray;
Colors, C2: TIntegerArray;
begin
Try
x1 := gx - 35;
If x1 < 0 Then
x1 := 0;
y1 := gy - 35;
If y1 < 0 Then
y1 := 0;
x2 := gx + 35;
If x2 > 515 Then
x2 := 515;
y2 := gy + 35;
If y2 > 336 Then
y2 := 336;
Time := GetSystemTime;
Result := False;
c := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2ModIfiers(0.2, 0.2);
FindColorsTolerance(Gas, 8886170, x1, y1, x2, y2, 20);
ColorToleranceSpeed(c);
If length(Gas) < 10 Then
Exit;
Colors := GetColors(Gas);
C2 := Colors;
ClearSameIntegers(C2);
//writeln('w_Colors Length: ' + inttostr(length(colors)));
// writeln('w_C2 Length: ' + inttostr(length(C2)));
If Length(C2) < 40 Then
Exit;
For I := 0 To High(Gas) Do
Begin
ColorToRGB(Colors[I], R, G, B);
If Abs(R - G) <= 10.0 Then
Begin
ColorToHSL(Colors[I], H, S, L);
If (H > 11.5) And (H < 16.0) And (S < 12.0) Then
Begin
ColorToXYZ(Colors[I], X, Y, Z);
If (Abs(X - Y) < 5.0) And (Abs(X - Z) < 5.0) And (Abs(Y - Z) < 5.0) Then
Begin
SetLength(Gas2, Length(Gas2) + 1);
Gas2[High(Gas2)] := Gas[I];
End;
End;
End;
End;
WriteLn('w_time: ' + IntToStr(GetSystemTime - Time));
WriteLn('w_gas2 length: ' + IntToStr(Length(Gas2)));
Result := (Length(Gas2) > 30); // The only number you might want to tweak.
//debugtpa(Gas2, '');
If Result Then
Begin
WriteLn('*** GAS FOUND ***');
End;
Except WriteLn('w_gasCheck ERROR: No window selected'); End;
End;
function noore:boolean;
begin
result:= (pos('no ore',GetMessage)<>0)
end;
function swing:boolean;
begin
result:= (pos('swing',GetMessage)<>0)
end;
function manage:boolean;
begin
result:= (pos('manage',GetMessage)<>0)
end;
function higherlvlrock:boolean;
begin
case lowercase(Players[CurrentPlayer].Strings[1]) of
'clay' : result:= false;
'copper' : result:= false;
'tin' : result:= false;
'iron' : result:= false;
'coal' : result:= true;
'mithril' : result:= true;
'mith' : result:= true;
'adamant' : result:= true;
'addy' : result:= true;
end;
end;
{- CREDIT TO JUKKA FOR CHECKING IF
PICK IS THERE AND FINDING A LOST ONE -}
var
LostHead:integer;
PickHeadColors: Array Of Integer;
Function LoadPick(Style: String; Int: Integer): Integer;
Begin
Case LowerCase(Style) Of
'dtm':
Begin
Case Int Of //Bronze - Rune DTMS!
1: Result := DTMFromString('78DA63DCC0C0C0A0C9800618914820BD194 86' +
'81350B38A0835AB81843E11E6E8A2AA30D39264104156B306 BF1A' +
'16200600A5500645');
2: Result := DTMFromString('78DA63BCCFC0C050CA800618914820FD084 89' +
'4135073134854A2AAB0B3B464E04256731BBF1A269839D5B8 ED62' +
'06D1B7F0BB07A406007C420985');
3: Result := DTMFromString('78DA63CC616460286540038C4824904E05B 22' +
'A5155448786328820ABC9C0AF068CD38164356EBB98606ACA 09A8' +
'C927AC0600C71D0796');
4: Result := DTMFromString('78DA636C646060D06440038C482490AE061 2B' +
'AA82A0C0CDC184490D5D4E257C30833471FB75D4C20BA8208 3520' +
'73B409A86921AC06009DB10633');
5: Result := DTMFromString('78DA638C676060B06740038C4824904E021 24' +
'E04D44403096754154676460C5CC86A22F1AB6102D11140C2 15B7' +
'5DCC30358EF8D5000060E40523');
6: Result := DTMFromString('78DA6394636460F06440038C4824909604B 27' +
'C515518397B317021AB11C3AF068CC581A43F6EBB9840B404 90E5' +
'4D408D226135000BAF0415');
End
End;
'colors':
Begin
Case Int Of //Bronze - Rune
1: Result:= 1649206;
2: Result:= 3750206;
3: Result:= 5592411;
4: Result:= 4599856;
5: Result:= 3292722;
6: Result:= 5590329;
End
End;
End;
End;
function InIntArr(Num: Integer; I: TIntegerArray): Boolean;
var
C: Integer;
begin
for C:= 0 to Length(I) - 1 do
if(I[C] = Num)then
begin
Result:= True;
exit;
end;
end;
procedure ShrinkArray(var Arr: TIntegerArray);
var
Used: TIntegerArray;
I, Index: Integer;
begin
SetLength(Used, Length(Arr));
if(InIntArr(0, Arr))then
Inc(Index);
for I:= 0 to Length(Arr) - 1 do
if(not(InIntArr(Arr[i], Used)))then
begin
Used[Index]:= Arr[i];
Inc(Index);
end;
SetLength(Used, Index);
Arr:= Used;
end;
Function GetPickHeadColors: Boolean;
Var
FailedPick, I, II, PickDTM, PickStyle: Integer;
ColorTPA: TPointArray;
Label
GetPickColors;
Begin
if not(LoggedIn)then exit;
FindNormalRandoms;
GetPickColors:
If(Not Loggedin)Then Exit;
If(Players[CurrentPlayer].Booleans[2])Then
GameTab(5)
Else GameTab(4);
Wait(500+Random(500));
For I:= 6 DownTo 1 Do
Begin
PickDTM:= LoadPick('DTM', I);
If(FindDTM( PickDTM, X, Y, MIX1, MIY1, MIX2, MIY2))Then
Begin
FindColorsTolerance(ColorTPA, LoadPick('Colors', I), X, Y, X+30, Y+30, 10);
For II:= 0 To GetArrayLength(ColorTPA)-1 Do
Begin
SetArrayLength(PickHeadColors, GetArrayLength(PickHeadColors)+1);
PickHeadColors[II]:= GetColor(ColorTPA[II].X, ColorTPA[II].Y);
End;
PickStyle:= I;
Break;
End;
End;
ShrinkArray(PickHeadColors);
For II:= 0 To GetArrayLength(PickHeadColors)-1 Do
Begin
//Writeln('PickHeadColor['+IntToStr(II)+']:= '+IntToStr(PickHeadColors[II])+';');
If( PickHeadColors[II] <> 0)Then
Result:= True;
End;
If(Not Result)Then
Begin
Writeln('Getting NEW pickcolors, Failed');
FailedPick:= FailedPick + 1;
If(FailedPick > 4)Then
Begin
Writeln('Coudlnt get pickcolors');
Players[CurrentPlayer].Loc:='Couldnt get pickcolors';
Logout;
Players[CurrentPlayer].Active:= False;
Exit;
End;
GoTo GetPickColors;
End;
Writeln('Picked '+IntToStr(GetArrayLength(PickHeadColors)) + ' Colors');
Case I Of
1: Writeln('You have a Bronze pick axe');
2: Writeln('You have a Iron pick axe');
3: Writeln('You have a Steel pick axe');
4: Writeln('You have a Mith pick axe');
5: Writeln('You have a Addy pick axe');
6: Writeln('You have a Rune pick axe');
End
FreeDTM( PickDTM );
End;
Procedure AttachPick;
Var
Handle, AxeHead: Integer;
Begin
if not(LoggedIn)then exit;
Handle := DTMFromString('78DA63DCC1C0C0E0C38002CCD51818FE036 94' +
'620FE0F048CFB800C170634C0884402E93D40C289809A8D40 2282' +
'809A2D402212BF1A003B1D0A81');
AxeHead := DTMFromString('78DA637466626078C280024C9D4D19FE036 94' +
'620FE0F048CD640352F18D000231209A42D816A9E1150E388 6917' +
'861A27A09AC704D4B800D53C24A0C60DA8E63901359E44A87 1256' +
'C1700B0451030');
GameTab(4);
If(FindDTM(Handle, X, Y, MIX1, MIY1, MIX2, MIY2))Then
Begin
TimoMouse(X, Y, 4, 4, False, False);
ChooseOption('Use');
Wait(300+Random(400));
If(FindDTM(AxeHead, X, Y, MIX1, MIY1, MIX2, MIY2))Then
Begin
TimoMouse(X, Y, 3, 3, True, False);
Writeln('Pick Attached!');
End;
Wait(300+Random(400));
End;
FreeDTM(Handle);
FreeDTM(AxeHead);
End;
Procedure WalkToDropDot;
Begin
if not(LoggedIn)then exit;
X:= MMCX; Y:= MMCY; //Red Drop Dot!
If(FindColorSpiralTolerance(X, Y, 3553023, MMX1, MMY1, MMX2, MMY2, 20))Then
Begin
Case 1+Random(4) Of
1: TimoMouse(X - 5, Y, 3, 3, True, False);
2: TimoMouse(X + 5, Y, 3, 3, True, False);
3: TimoMouse(X, Y + 5, 3, 3, True, False);
4: TimoMouse(X, Y - 5, 3, 3, True, False);
End
Flag;
End;
End;
Function FindLostPick: Boolean;
Var
PickHandle, BrokenPick, PickDTM, I, II, Tol, Pick: Integer;
PickTPA: TPointArray;
Begin
If(Not Loggedin)Then Exit;
If(InvFull)Then
DropToPosition(1, 2);
BrokenPick := DTMFromString('78DA63DCCBC0C0D0CD800618914820BD1D4 8F' +
'412A166220135078830E73890984C849AA9F8D50000C33207 EA');
PickHandle := DTMFromString('78DA63DCC1C0C0E0C38002CCD51818FE036 94' +
'620FE0F048CFB800C170634C0884402E93D40C289809A8D40 2282' +
'809A2D402212BF1A003B1D0A81');
If not(Players[CurrentPlayer].Booleans[2])Then
Begin
GameTab(5);
Wait(400+Random(300));
If(FindDTM(BrokenPick, X, Y, MIX1, MIY1, MIX2, MIY2))Then
Begin
TakeOff(5);
NoPick:= True;
Writeln('***** Pick broken *****');
BrokenPicks := BrokenPicks + 1;
FreeDTM( BrokenPick );
FreeDTM(PickHandle);
Exit; //Exit Because Broken Pick nothing we can do here..
End Else
If(FindDTM(PickHandle, X, Y, MIX1, MIY1, MIX2, MIY2))Then
Begin
Writeln('***** Lost PickHead *****');
TakeOff(5);
FreeDTM(BrokenPick);
FreeDTM(PickHandle);
NoPick := True;
End Else
Begin
NoPick := True;
TakeOff(5);
Writeln('Error, Tell Jukka to update his DTMS');
FreeDTM(BrokenPick);
FreeDTM(PickHandle);
Exit;
End;
End Else
Begin
GameTab(4);
Wait(400+Random(300));
If(FindDTM(BrokenPick, X, Y, MIX1, MIY1, MIX2, MIY2))Then
Begin
NoPick:= True;
Writeln('***** Pick broken *****');
BrokenPicks := BrokenPicks + 1;
FreeDTM( BrokenPick );
FreeDTM(PickHandle);
Exit;
//Exit Because Broken Pick nothing we can do here..
End Else
If(FindDTM(PickHandle, X, Y, MIX1, MIY1, MIX2, MIY2))Then
Begin
Writeln('***** Lost PickHead *****');
FreeDTM(BrokenPick);
FreeDTM(PickHandle);
NoPick := True;
End Else
Begin
Writeln('Error, Tell Jukka to update his DTMS');
FreeDTM(BrokenPick);
FreeDTM(PickHandle);
Exit;
End;
End;
GameTab(4);
WalkToDropDot;
Flag;
Wait(500+Random(400));
MarkTime(Pick);
Repeat
For I:= 0 To GetArrayLength(PickHeadColors)-1 Do
If(PickHeadColors[I] <> 0)Then
FindColorsSpiralTolerance(X, Y, PickTPA, PickHeadColors[I], MSX1, MSY1, MSX2, MSY2, Tol);
For I:= 0 To GetArrayLength(PickTPA)-1 Do
Begin
X:= PickTPA[I].X; Y:= PickTPA[I].Y;
TimoMouse(X, Y, 0, 0, false, true);
Wait(10);
If(IsUpText('ake'))Then
Begin
TimoMouse(X, Y, 0, 0, True, False);
Wait(10);
writeln('Found Pick');
Flag;
Wait(500+Random(400));
AttachPick;
GameTab(4);
Wait(500+Random(300));
For II:= 1 To 6 Do
Begin
PickDTM:= LoadPick('DTM', II);
If(FindDTM( PickDTM, X, Y, MIX1, MIY1, MIX2, MIY2))Then
Begin
If(Players[CurrentPlayer].Booleans[2])Then
TimoMouse(X+8, Y+8, 5, 5, True, False);
NoPick:= False;
Result:= True;
writeln('Pick Attached');
Writeln('***** Found Pick *****');
AxeAttaches := AxeAttaches + 1;
ReportVars[2] := ReportVars[2] + 1;
SRLRandomsReport;
FreeDTM(PickDTM);
Exit; //EXIT EVERYTHING!
End Else FreeDTM(PickDTM);
End;
End;
End;
WalkToDropDot;
Flag;
Wait(500+Random(400));
Until(TimeFromMark(Pick)>60000)Or(Result)Or(Not Loggedin);
writeln('CantFindHead');
Writeln('***** Lost Head *****');
LostHead := LostHead + 1;
End;
function PickCheck: Boolean;
begin
if not(LoggedIn)then exit;
If(FindColor(X, Y, 16711680, 192, 442, 204, 454))Then
begin
If(FindText(X, Y, 'Pickax', NPCChars, 122, 373, 181, 395))Then
begin
Writeln('NoPick!');
Result:= True;
if(FindLostPick)then
Result:= False
else NoPick:= True;
end;
end;
end;
{-------------- END OF JUKKAS STUFF ------------------}
procedure waitrock;
var
oretime:LongInt;
begin
MarkTime(oretime);
if swing then
begin
repeat
if NoPick then exit;
if findfight then
begin
RunTo(rundir,True);
end;
wait(1);
Responder;
if not(LoggedIn)then exit;
FindNormalRandoms;
if level then exit;
ClickToContinue;
if higherlvlrock then
begin
if (TimeFromMark(oretime) > 15000)then exit;
end else
begin
//if (TimeFromMark(oretime) > 7500)then exit;
if (TimeFromMark(oretime) > 10000)then exit;
end;
if manage then exit;
if level then exit;
if manage then exit;
if level then exit;
if manage then exit;
if level then exit;
if w_GasCheck(x,y)then
begin
MouseFindFlag(648,83,5,5);
Gasses:= Gasses + 1;
FTWait(36+random(4));
Status('Found Gas!');
exit;
end;
if manage then exit;
if level then exit;
if noore then exit;
wait(1);
until(manage)
end;
if noore then exit;
end;
procedure powermine;
begin
if not(LoggedIn)then exit;
if NoPick then exit;
FindNormalRandoms;
SetChats;
wait(1);
if PickCheck then
begin
logout;
Players[CurrentPlayer].Active:= false;
end;
Responder;
if FindObjOre2(cx,cy,'ocks',orecolor,tol,mincount)the n
begin
GetMousePos(cx,cy);
end else
begin
exit;
end;
if DetectGas(cx,cy)then
begin
Gasses:= Gasses + 1;
FTWait(36+random(4));
Status('Found Gas!');
exit;
end;
if (isuptext('ine'))then
begin
case(random(6))of
0,1,2,3,4:Mouse(cx,cy,0,0,true);
5:begin
Mouse(cx,cy,0,0,false);
ChooseOption('Mine');
end;
end;
attempts:= attempts + 1;
FFlag(0);
FTWait(6);
end;
WaitRock;
end;
procedure SetupPick;
begin
if not(LoggedIn)then exit;
{if(GetCombatLevel < 10)Then
begin
Writeln('Please Level Up Your Charachters in Combat');
Logout;
Players[CurrentPlayer].Loc := 'Too Low Level';
Players[CurrentPlayer].Active:= False;
Exit;
end;}
if(not GetPickHeadColors)then
begin
Writeln('Couldnt get pick colors, Equip or have in inventory.');
Players[CurrentPlayer].Loc := 'Couldnt Get PickColors';
Logout;
Players[CurrentPlayer].Active:= False;
end else
begin
done:= true;
end;
HighestAngle;
end;
procedure ProgressReport;
var Sec:integer;
begin
Sec := GetTimeRunning div 1000+1;
writeln('~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~' )
writeln(' [SRL4] QuickPowerminer 1.5 by Timothegreat ')
writeln('----------------------------------------')
writeln(' Time Running: '+TimeRunning)
writeln(' Ores Mined: '+inttostr(ores))
writeln(' Loads: '+inttostr(loads))
writeln(' Ores/hr: '+IntToStr(Round(3600*Ores/Sec)))
writeln(' Responded: '+inttostr(RespondedTimes)+' Times')
writeln(' Broken Picks: '+inttostr(BrokenPicks));
writeln('~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~' )
end;
procedure setup;
begin
SetupSRL;
ScriptID := '513';
if ((SRLStatsID = '') or (SRLStatsPW = ''))then
begin
SRLID:='3936';
SRLPassword:='leechme';
writeln('Stupid leecher...');
end else
begin
SRLID := SRLStatsID;
SRLPassword := SRLStatsPW;
end;
SRLRandomsReport;
end;
begin
Setup;
DeclarePlayers;
Done:= False;
LoginPlayer;
Repeat
if not(LoggedIn)then
begin
TLoads:=0;
Done:= False;
NextPlayer(false);
end;
if NoPick then
begin
TLoads:=0;
Done:= False;
NextPlayer(false);
end;
SetupScript;
if not(done) then
begin
SetupPick;
end;
Powermine;
if (invfull) then
begin
Done:= False;
TLoads:= TLoads + 1;
loads:= loads + 1;
ReportVars[1] := ReportVars[1] + 1;
if (Players[CurrentPlayer].Booleans[2])then
begin
DropToFast(1,28);
ores:= ores + 28;
ReportVars[0] := ReportVars[0] + 28;
end else
begin
DropToFast(2,28);
ores:= ores + 27;
ReportVars[0] := ReportVars[0] + 27;
end;
ProgressReport;
end;
if (TLoads = Players[CurrentPlayer].Integers[1])then
begin
Done:= False;
TLoads:=0;
NextPlayer(true);
end;
until(false);
end.