skilld u
2008-06-10 11:49:10
the whole script:
The Functions:
The Problem is that after it mines a rock then it just sits there and then logs out due to inactivity. Why does it do that? I'm pretty sure that the functions should work.
{ skilld gilld v.1
by: skilld u
Works In The Mining Guild.
_______ _ _________ _ _ ______
( ____ \| | /\\__ __/ ( \ ( \ ( __ \
| ( \/| | / / ) ( | ( | ( | ( \ )
| (_____ | (_/ / | | | | | | | | ) |
(_____ )| _ ( | | | | | | | | | |
) || ( \ \ | | | | | | | | ) |
/\____) || / \ \__) (___ | (____/\ | (____/\ | (__/ )
\_______)|_/ \/\_______/(_______/(_______/ (______/
_______ _________ _ _ ______
( ____ \\__ __/( \ ( \ ( __ \
| ( \/ ) ( | ( | ( | ( \ )
| | | | | | | | | | ) |
| | ____ | | | | | | | | | |
| | \_ ) | | | | | | | | ) |
| (___) |___) (___| (____/\| (____/\| (__/ )
(_______)\_______/(_______/(_______/(______/
}
program SkilldGilld;
{.include SRL/SRL.scar}
{.include SRL/SRL/misc/WorldSwitcher.scar}
var
Loads, rx, ry, coal, pick, bankers, mith, LBS, gassy, b, mx, my: integer;
ChangeWorlds2, Mining: boolean;
const
LoadsPerPlayer = 5; //3 - 5 is good, automatically adds random 5
ChangeWorlds = True; //Change Worlds if the guild is crowded?
SRLStatsID = '';
SRLStatsPW = '';
procedure DeclarePlayers;
begin
CurrentPlayer := 0;
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
Players[0].Name :='';
Players[0].Pass :='';
Players[0].Nick :='';
Players[0].Strings[0] := 'Both'; //Coal, Mith, Both
Players[0].Active :=True;
{Players[1].Name :='';
Players[1].Pass :='';
Players[1].Nick :='';
Players[1].Strings[0] := 'Both'; //Coal, Mith, Both
Players[1].Active :=False;
Players[2].Name :='';
Players[2].Pass :='';
Players[2].Nick :='';
Players[2].Strings[0] := 'Both'; //Coal, Mith, Both
Players[2].Active :=False;}
end;
procedure LoadDTMs;
begin
coal := DTMFromString('78DA63D4616460D8CA80022C2DD519B880345' +
'086E13F10305A02591B19D000231209A4D581AC1504D4C800599B' +
'08A85105B20E1350630264EDC2AF0600D87A09F5');
pick := DTMFromString('78DA631461646038C080020C14D818B880345' +
'086E13F1030CA00599B18D000231209A4B981ACAD04D4F0025927' +
'09A85105B27613502300649DC1AF06007C6B0968');
bankers := DTMFromString('78DA63346166607060644006FFFFFF676005D' +
'28C10F67F4675A01A0F54357FFE30C1D58000A33E116ACC895063' +
'0D54E38E5F0D004DD71174');
mith:=DTMFromString('78DA637465626090636440065EDEF90CFC401' + //i took this from
'A24FA1F08181D816AE451D54064612490B627428D09116ABC8950' + //munk's script <3
'130C5423895F0D00CFC5077D');
end;
procedure FreeDTMs;
begin
FreeDTM(coal);
FreeDTM(Pick);
FreeDTM(Bankers);
FreeDTM(mith);
end;
procedure PlayerReport;
var i: Integer;
begin
AddToReport(' ');
AddToReport(' # Nick Loc Time M Lvl Coal Mith ');
for I := 0 to HowManyPlayers - 1 do
AddToReport(' ' + Inttostr (i) + Players[i].Nick + Players[i].Loc + IntToStr(Players[i].Integers[0]) + IntToStr(Players[i].Level[15]) + IntToStr(Players[i].Integers[1]) + IntToStr(Players[i].Integers[2]));
end;
procedure Report;
begin
SRLRandomsReport;
AddToReport(' ');
AddToReport(' skilld gilld ');
AddToReport(' . Ran For : ' + TimeRunning);
AddToReport(' . Loads Completed : ' + IntToStr(Loads));
AddToReport(' . Gas Avoided : ' + IntToStr(gassy));
PlayerReport;
end;
procedure ScriptTerminate;
begin
WriteLn(' ');
WriteLn('Post Your Progress Report On The Thread!');
Disguise('N1ke is awesome, he let me use his account.');
FreeDTMs;
Report;
end;
procedure RandomMoveMouse;
var
a, b, aa, bb, aaa, bbb, c, d: integer;
begin
GetMousePos(a, b);
case random(2) of
0: begin
aa := a + random(250);
bb := b + random(250);
end;
1: begin
aa := a - random(250);
bb := b - random(250);
end;
end;
MMouse(aa, bb, 1, 1);
Wait(500 + random(500));
GetMousePos(c, d);
case random(2) of
0: begin
aaa := c + random(200);
bbb := d + random(200);
end;
1: begin
aaa := c - random(200);
bbb := d - random(200);
end;
end;
MMouse(aaa, bbb, 1, 1);
end;
procedure AlmostLogout2;
var
e, f, Tab: Integer;
begin
Tab := GetCurrentTab;
GameTab(14);
e := 2 + Random(3);
for f := 0 to e do
begin
MouseBox(576, 364, 705, 387, 3);
Wait(500 + random(2500));
case Random(3) of
0, 1: begin
MouseBox(576, 364, 705, 387, 3);
Wait(500 + random(2500));
end;
2: begin
case Random(6) of
0, 4, 5: SleepAndMoveMouse(300 + random(150));
1, 2, 3: RandomMoveMouse;
end;
end;
end;
FTwait(2 + Random(1));
end;
GameTab(Tab);
end;
procedure RandomRightClick;
var
m, xxx, yyy, xx, yy: Integer;
begin
if (not (LoggedIn)) then Exit;
m := MouseSpeed;
MouseSpeed := 7;
xxx := Random(700);
yyy := Random(700);
xx := Random(700);
yy := Random(700);
Mouse(xxx, yyy, 1, 1, false);
MMouse(xx, yy, 1, 1);
MouseSpeed := m;
end;
procedure AntiBan;
begin
case Random(31) of
0, 1, 2: AlmostLogout2;
3, 4: RandomMoveMouse;
5: RandomRightClick;
6: PickUpMouse;
7: RandomMovement;
8..30: FindNormalRandoms;
end;
end;
function TileWalk(ntw: integer; direction: string; reverse: boolean): boolean;
var
wx, wy, dx, dy, tmpX, tmpY: integer;
pcy: boolean;
begin
if not reverse then
begin
case lowercase(direction) of
'n': begin
MakeCompass('n');
tmpX := MMCx - (8);
tmpY := MMCy - (ntw * 8);
pcy := True;
end;
's': begin
MakeCompass('n');
tmpX := MMCx + (8);
tmpY := MMCy + (ntw * 8);
pcy := True;
end;
'e': begin
MakeCompass('n');
tmpX := MMCx + (ntw * 8);
tmpY := MMCy + (8);
pcy := True;
end;
'w': begin
MakeCompass('n');
tmpX := MMCx - (ntw * 8);
tmpY := MMCy - (8);
pcy := True;
end;
'ne': begin
MakeCompass('n');
wx := MMCx - Random(5); //n
wy := MMCy - (ntw * 8);
dx := MMCx + (ntw * 8);
dy := MMCy + Random(5); //e
tmpX := dx;
tmpY := wy;
pcy := True;
end;
'nw': begin
MakeCompass('n');
wx := MMCx - Random(5); //n
wy := MMCy - (ntw * 8);
dx := MMCx - (ntw * 8);
dy := MMCy - Random(5); //w
tmpX := wx;
tmpY := dy;
pcy := true;
end;
'se': begin
MakeCompass('n');
wx := MMCx + Random(5); //s
wy := MMCy + (ntw * 8);
dx := MMCx + (ntw * 8);
dy := MMCy + Random(5); //e
tmpX := dx;
tmpY := wy;
pcy := true;
end;
'sw': begin
MakeCompass('n');
wx := MMCx + Random(5); //s
wy := MMCy + (ntw * 8);
dx := MMCx - (ntw * 8);
dy := MMCy - Random(5); //w
tmpX := dx;
tmpY := wy;
pcy := true;
end;
else
begin
WriteLn('Incorrect Direction, n, e, s, w, ne, nw, se, sw');
end;
end;
end;
if reverse then
begin
case lowercase(direction) of
'n': begin
MakeCompass('n');
tmpX := MMCx + (8);
tmpY := MMCy + (ntw * 8);
pcy := True;
end;
's': begin
MakeCompass('n');
tmpX := MMCx - (8);
tmpY := MMCy - (ntw * 8);
pcy := True;
end;
'e': begin
MakeCompass('n');
tmpX := MMCx - (ntw * 8);
tmpY := MMCy - (8);
pcy := True;
end;
'w': begin
MakeCompass('n');
tmpX := MMCx + (ntw * 8);
tmpY := MMCy + (8);
pcy := True;
end;
'ne': begin
MakeCompass('n');
wx := MMCx + Random(5); //n
wy := MMCy + (ntw * 8);
dx := MMCx - (ntw * 8);
dy := MMCy - Random(5); //e
tmpX := dx;
tmpY := wy;
pcy := true;
end;
'nw': begin
MakeCompass('n');
wx := MMCx + Random(5); //n
wy := MMCy + (ntw * 8);
dx := MMCx + (ntw * 8);
dy := MMCy + Random(5); //w
tmpX := dx;
tmpY := wy;
pcy := true;
end;
'se': begin
MakeCompass('n');
wx := MMCx - Random(5); //s
wy := MMCy - (ntw * 8);
dx := MMCx - (ntw * 8);
dy := MMCy - Random(5); //e
tmpX := wx;
tmpY := dy;
pcy := true;
end;
'sw': begin
MakeCompass('n');
wx := MMCx - Random(5); //s
wy := MMCy - (ntw * 8);
dx := MMCx + (ntw * 8);
dy := MMCy + Random(5); //w
tmpX := dx;
tmpY := wy;
pcy := True;
end;
else
begin
WriteLn('Incorrect Direction, n, e, s, w, ne, nw, se, sw');
end;
end;
end;
if pcy then
begin
if rs_OnMinimap(tmpX, tmpY) then
begin
Mouse(tmpX, tmpY, 5, 5, true);
FFlag(0);
Result := True;
end;
end;
end;
function WeAreCrowded: boolean;
begin
Result := CountColor(16777215, mmx1, mmy1, mmx2, mmy2) > 20;
end;
function GetRandomWorld: integer;
begin
case random(79) of
1: Result := 109;
2: Result := 63;
3: Result := 62;
4: Result := 154;
5: Result := 133;
6: Result := 134;
7: Result := 123;
8: Result := 107;
9: Result := 108;
10: Result := 61;
11: Result := 80;
12: Result := 119;
13: Result := 30;
14: Result := 15;
15: Result := 153;
16: Result := 149;
17: Result := 32;
18: Result := 47;
19: Result := 29;
20: Result := 117;
21: Result := 21;
22: Result := 13;
23: Result := 19;
24: Result := 11;
25: Result := 155;
26: Result := 16;
27: Result := 118;
28: Result := 105;
end;
end;
procedure ChangeOurWorlds;
begin
ChangeWorlds2 := ChangeWorlds;
if (WeAreCrowded) then
if (ChangeWorlds) then
begin
Logout;
SelectWorld(GetRandomWorld);
Wait(2000 + random(3000));
LoginPlayer;
end;
end;
function SkilldGas : boolean;
var
x, y: integer;
begin
if FindColorTolerance(x, y, 4679279, MSX1, MSY1, MSX2, MSY2, 10) then
begin
Wait(500 + random(500));
if FindColorTolerance(x, y, 4679279, MSX1, MSY1, MSX2, MSY2, 10) then
begin
repeat
Wait(2000 + random(1230));
until not (FindColorTolerance(x, y, 4679279, MSX1, MSY1, MSX2, MSY2, 10));
end;
end;
Result := True;
Inc(Gassy);
Inc(ReportVars[3]);
end;
procedure SkilldPickAttacher;
var
TehPickColor: TIntegerArray;
i, x, y: integer;
begin
TehPickColor := [2110788, 4473930, 6645357, 5059636, 3227185, 5656122]
for i := 0 to High(TehPickColor) do
if FindColorTolerance(x, y, TehPickColor[i], MSX1, MSY1, MSX2, MSY2, 20) then
begin
Mouse(x, y, 3, 3, false);
if ChooseOption('ake') then
begin
GameTab(5);
TakeOff(5);
GameTab(4);
for i := 0 to 5 do
if FindColorTolerance(x, y, TehPickColor[i], MIX1, MIY1, MIX2, MIY2, 10) then
begin
MMouse(x, y, 3, 3);
if IsUpText('Use') then
begin
Mouse(x, y, 3, 3, true);
Wait(250);
end;
for i := 1 to 28 do
begin
MMouseItem(i);
if (IsUpText('Pickaxe handle')) then
begin
GetMousePos(x, y);
Mouse(x, y, 3, 3, true);
Wait(500 + random(500));
end;
end;
end;
end;
end;
end;
//I stole this from The[Cheese]'s VEM.
function ChatCheck: boolean;
var
LastChat: String;
begin
if not(LoggedIn)then Exit;
Result := true;
Mining := True;
LastChat := GetBlackChatMessage;
case LastChat of
'There is no ore currently available in this rock.': Mining := false;
'You manage to mine some coal.': Mining := false;
'You manage to mine some mithril.': Mining := false;
'The blast damages your pickaxe!':Mining := false;
end;
end;
function FindRock(color: TIntegerArray; var mx, my: integer): boolean;
var
k, x, y: integer;
begin
if not LoggedIn or FindDead then Exit;
for k := 0 to High(color) do
if FindColorSpiralTolerance(mx, my, color[k], MSX1, MSY1, MSX2, MSY2, 15) then
begin
MMouse(mx, my, 5, 5);
if IsUpText('ine') then
begin
Result := True;
GetMousePos(x, y);
case random(2) of
0, 1: Mouse(x, y, 5, 5, true);
2: begin
Mouse(x, y, 5, 5, false);
ChooseOption('ine');
end;
end;
mx := x;
my := y;
FFlag(0);
end;
end;
end;
procedure MineThem(Kind: string);
var
Time: integer;
begin
Players[currentPlayer].Loc := 'Mining...';
Status('Mining...');
case Lowercase(Kind) of
'coal' : begin
//if FindObjCustom(mx, my, ['ocks', 'ine'], [3097925, 2372661, 1911595], 15) then
if FindRock([1780009, 2043438, 3098183], mx, my) then
begin
SkilldGas;
SkilldPickAttacher;
FFlag(0);
ChatCheck;
MarkTime(Time)
repeat
ChatCheck;
Wait(500 + Random(500));
AntiBan;
if FindFight then RunAway('E', true, 1, 5000 + Random(5000));
until not (Mining) or (TimeFromMark(Time) > 10000);
Time := 0;
end;
end;
'mith' : begin
//if FindObjCustom(mx, my, ['ocks', 'ine'], [5913917, 8739675, 7951186], 15) then
if FindRock([5913917, 8739675, 7951186], mx, my) then
begin
SkilldGas;
SkilldPickAttacher;
FFlag(0);
ChatCheck;
MarkTime(Time)
repeat
ChatCheck;
Wait(500 + Random(500));
AntiBan;
if FindFight then RunAway('E', true, 1, 5000 + Random(5000));
until not (Mining) or (TimeFromMark(Time) > 10000);
Time := 0;
end;
end;
'both' : begin
if (FindRock([5913917, 8739675, 7951186], mx, my)) or (FindRock([3098183, 2043438, 1780009], mx, my)) then
//if (FindObjCustom(mx, my, ['ocks', 'ine'], [3097925, 2372661, 1911595], 15)) or (FindObjCustom(mx, my, ['ocks', 'ine'], [5913917, 8739675, 7951186], 15)) then
begin
SkilldGas;
SkilldPickAttacher;
FFlag(0);
ChatCheck;
MarkTime(Time)
repeat
ChatCheck;
Wait(500 + Random(500));
AntiBan;
if FindFight then RunAway('E', true, 1, 5000 + Random(5000));
until not (Mining) or (TimeFromMark(Time) > 10000);
Time := 0;
end;
end;
end;
end;
function ToGuildDDTM: integer;
var
dtmMainPoint: TDTMPointDef;
dtmSubPoints: Array [0..3] of TDTMPointDef;
ToGuild: TDTM;
LdderColor: integer;
begin
LdderColor := FindLadderColor
dtmMainPoint.x := 645;
dtmMainPoint.y := 152;
dtmMainPoint.AreaSize := 1;
dtmMainPoint.AreaShape := 0;
dtmMainPoint.Color := LdderColor;
dtmMainPoint.Tolerance := 1;
dtmSubPoints[0].x := 641;
dtmSubPoints[0].y := 131;
dtmSubPoints[0].AreaSize := 1;
dtmSubPoints[0].AreaShape := 0;
dtmSubPoints[0].Color := LdderColor;
dtmSubPoints[0].Tolerance := 1;
dtmSubPoints[1].x := 611;
dtmSubPoints[1].y := 151;
dtmSubPoints[1].AreaSize := 1;
dtmSubPoints[1].AreaShape := 0;
dtmSubPoints[1].Color := LdderColor;
dtmSubPoints[1].Tolerance := 1;
dtmSubPoints[2].x := 604;
dtmSubPoints[2].y := 134;
dtmSubPoints[2].AreaSize := 1;
dtmSubPoints[2].AreaShape := 0;
dtmSubPoints[2].Color := 241;
dtmSubPoints[2].Tolerance := 10;
dtmSubPoints[3].x := 641;
dtmSubPoints[3].y := 147;
dtmSubPoints[3].AreaSize := 1;
dtmSubPoints[3].AreaShape := 0;
dtmSubPoints[3].Color := 15722982;
dtmSubPoints[3].Tolerance := 10;
ToGuild.MainPoint := dtmMainPoint;
ToGuild.SubPoints := dtmSubPoints;
Result := AddDTM(ToGuild);
end;
function MithRocksDDTM: integer;
var
dtmMainPoint: TDTMPointDef;
dtmSubPoints: Array [0..3] of TDTMPointDef;
MithRocks: TDTM;
begin
dtmMainPoint.x := 625;
dtmMainPoint.y := 93;
dtmMainPoint.AreaSize := 1;
dtmMainPoint.AreaShape := 0;
dtmMainPoint.Color := 7170664;
dtmMainPoint.Tolerance := 25;
dtmSubPoints[0].x := 611;
dtmSubPoints[0].y := 99;
dtmSubPoints[0].AreaSize := 1;
dtmSubPoints[0].AreaShape := 0;
dtmSubPoints[0].Color := 6446684;
dtmSubPoints[0].Tolerance := 25;
dtmSubPoints[1].x := 616;
dtmSubPoints[1].y := 100;
dtmSubPoints[1].AreaSize := 1;
dtmSubPoints[1].AreaShape := 0;
dtmSubPoints[1].Color := 7170664;
dtmSubPoints[1].Tolerance := 25;
dtmSubPoints[2].x := 631;
dtmSubPoints[2].y := 82;
dtmSubPoints[2].AreaSize := 1;
dtmSubPoints[2].AreaShape := 0;
dtmSubPoints[2].Color := 7170664;
dtmSubPoints[2].Tolerance := 25;
dtmSubPoints[3].x := 640;
dtmSubPoints[3].y := 78;
dtmSubPoints[3].AreaSize := 1;
dtmSubPoints[3].AreaShape := 0;
dtmSubPoints[3].Color := 7170664;
dtmSubPoints[3].Tolerance := 25;
MithRocks.MainPoint := dtmMainPoint;
MithRocks.SubPoints := dtmSubPoints;
Result := AddDTM(MithRocks);
end;
function InGilld:boolean;
begin
Result := CountColor(65536,mmx1,mmy1,mmx2,mmy2) > 1000;
end;
function FindEntranceColor: Integer;
var
H,S,L,X,Y,Z : Extended;
R,G,B,P,A,TestColor,xx,xy : Integer;
TPA : TPointArray;
begin
if Not(LoggedIn) then Exit;
xx:= MMCX;
xy := MMCY;
FindColorsSpiralTolerance(xx, xy, TPA, 6583678, MMX1, MMY1, MMX2, MMY2, 60)
P := High(TPA);
for A := 0 to P do
begin
if RS_OnMinimap(TPA[A].X, TPA[A].Y) then
begin
TestColor := GetColor(TPA[A].X, TPA[A].Y);
if SimilarColors(TestColor, 6583678, 50) then
begin
ColorToRGB(TestColor, R, G, B);
ColorToHSL(TestColor, H, S, L);
ColorToXYZ(TestColor, X, Y, Z);
if InRange(R - G, -11, 29) then
if InRange(R - B, 6, 46) then
if InRange(G - B, -3, 37) then
if InRange(Round(S) - Round(H), -14, 48) then
if InRange(Round(L) - Round(H), 18, 0) then
if InRange(Round(S) - Round(L), -47, -17) then
if InRange(Round(X) - Round(Y), -8, 6) then
if InRange(Round(Y) - Round(Z), -4, 10) then
if GetColor(TPA[A].X + 2, TPA[A].Y + 2) = TestColor then
if GetColor(TPA[A].X + 1, TPA[A].Y + 1) = TestColor then
begin
Result := TestColor;
Exit;
end;
end;
end;
end;
Writeln('Couldnt find Color!');
Result := 0;
end;
function LadderWalk: boolean;
var
LadderColor, px, py: integer;
begin
LadderColor := FindLadderColor;
if FindColor(px, py, LadderColor, 635, 136, 663, 149) then
begin
Mouse(px, py, 5, 5, true);
Flag;
Wait(1000 + random(500));
FFlag(0);
Result := True;
end;
end;
procedure WalkToGuild;
begin
if not LoggedIn or FindDead then Exit;
SetRun(True);
GameTab(4);
if FindDTM(ToGuildDDTM, rx, ry, mmx1, mmy1, mmx2, mmy2) then
begin
Mouse(rx, ry, 5, 5, true);
Flag;
Wait(1000 + random(500));
FFlag(0);
WriteLn('DDTM');
Players[CurrentPlayer].Loc := 'Guild Entrance';
end else
begin
if not RadialWalk(FindEntranceColor, 173, 166, 61, 5, 5) then
begin
if not LadderWalk then
begin
Mouse(641 + Random(10 + random(5)), 147 + Random(10 + Random(5)), 5, 5, true);
Flag;
Wait(1000 + random(500));
FFlag(0);
Players[CurrentPlayer].Loc := 'Guild Entrance';
end;
end;
end;
Players[CurrentPlayer].Loc := 'Guild Entrance';
end;
procedure GetInGuild;
var
x, y, k, mx, my: integer;
rere: TIntegerArray;
begin
if not LoggedIn or FindDead then Exit;
begin
rere := [2774644, 12617, 2575977, 2642285, 871268];
for k := 0 to High(rere) do
if FindColorSpiralTolerance(mx, my, rere[k], MSX1, MSY1, MSX2, MSY2, 10) then
begin
Inc(B);
MMouse(mx, my, 5, 5);
if IsUpText('down') then
begin
GetMousePos(x, y);
case random(2) of
0, 1: Mouse(x, y, 5, 5, true);
2: begin
Mouse(x, y, 5, 5, false);
ChooseOption('down');
end;
end;
FFlag(0);
Players[CurrentPlayer].Loc := 'In Guild';
end;
end;
end;
end;
procedure GetToSpot;
var
qx, qy: integer;
begin
if not LoggedIn or FindDead then Exit;
TileWalk(8, 'e', false);
if (Players[currentplayer].Strings[0]='Both') or (Players[CurrentPlayer].Strings[0]='Mith') then
begin
if DTMRotated(MithRocksDDTM, qx, qy, mmx1, mmy1, mmx2, mmy2) then
begin
Mouse(qx, qy, 5, 5, true);
FFlag(2);
end;
if not DTMRotated(MithRocksDDTM, qx, qy, mmx1, mmy1, mmx2, mmy2) then
TileWalk(5, 'e', false);
end;
Players[currentPlayer].Loc := 'Mining Spot';
SetRun(False);
GameTab(4);
end;
procedure GetToLadder;
begin
if not LoggedIn or FindDead then Exit;
if not TileWalk(8, 'e', true) then
begin
TileWalk(9, 'w', false);
TileWalk(5, 'w', false);
end;
end;
procedure GetOutOfGuild;
var
x, y, k, mx, my: integer;
waah: TIntegerArray;
begin
if not LoggedIn or FindDead then Exit;
begin
waah := [4544869, 3427674, 3889255, 3098195];
for k := 0 to High(waah) do
if FindColorSpiralTolerance(mx, my, waah[k], MSX1, MSY1, MSX2, MSY2, 10) then
begin
MMouse(mx, my, 5, 5);
if IsUpText('limb') then
begin
GetMousePos(x, y);
case random(2) of
0, 1: Mouse(x, y, 5, 5, true);
2: begin
Mouse(x, y, 5, 5, false);
ChooseOption('limb');
end;
end;
FFlag(0);
Players[currentPlayer].Loc := 'Out of Guild';
end;
end;
end;
end;
procedure WalkToBank;
var
bx, by: integer;
begin
if not LoggedIn or FindDead then Exit;
if not RadialWalk(FindFallyRoadColor, 40, 50, 60, 5, 5) then
if not RadialWalk(FindFallyRoadColor, 43, 53, 65, 5, 5) then
begin
Mouse(675, 46, 5, 5, true);
FFlag(0);
end;
if not RadialWalk(FindFallyRoadColor, 322, 329, 58, 5, 5) then
begin
Mouse(584, 30, 5, 5, true);
FFlag(0);
end;
if DTMRotated(bankers, bx, by, mmx1, mmy1, mmx2, mmy2) then
begin
Mouse(bx, by, 5, 5, true);
FFlag(0);
Players[CurrentPlayer].loc := 'bank';
end;
Players[CurrentPlayer].Loc := 'bank';
end;
procedure CountOres;
begin
Players[CurrentPlayer].Integers[1] := Players[CurrentPlayer].Integers[1] + CountItemsDTM('inv', coal);//coal
Players[CurrentPlayer].Integers[2] := Players[CurrentPlayer].Integers[2] + CountItemsDTM('inv', mith);
ReportVars[0] := ReportVars[0] + CountItemsDTM('inv', coal);
ReportVars[1] := ReportVars[1] + CountItemsDTM('inv', mith);
end;
procedure TehBankz0r;
var
ix, iy: integer;
begin
if not LoggedIn or FindDead then Exit;
OpenBankFast('feb');
if FindDTM(Mith, ix, iy, mix1, miy1, mix2, miy2) then
begin
Mouse(ix, iy, 5, 5, false);
ChooseOption('All');
end;
if FindDTM(coal, ix, iy, mix1, miy1, mix2, miy2) then
begin
Mouse(ix, iy, 5, 5, false);
ChooseOption('All');
end;
Report;
Inc(LBS);
Inc(Loads);
Inc(ReportVars[2]);
end;
begin
SetupSRL;
ClearReport;
ClearDebug;
ScriptID := '898';
SRLID := SRLStatsID;
SRLPassword := SRLStatsPW;
if (SRLID = '') or (SRLPassword = '')then
begin
WriteLn('LEECHER!');
SRLID := '5561';
SRLPassword := 'ileechlots';
end;
DeclarePlayers;
ActivateClient;
Wait(500 + random(500));
if LoggedIn then Logout;
LoginPlayer;
repeat
MakeCompass('n');
SetAngle(True);
repeat
WalkToGuild;
repeat
GetInGuild;
until (InGilld) or (b >= 10);
B := 0;
if InGilld then
begin
GetToSpot;
ChangeOurWorlds;
repeat
MineThem(Players[CurrentPlayer].Strings[0]);
until InvFull;
GetToLadder;
GetOutOfGuild;
WalkToBank;
CountOres;
TehBankz0r;
end;
until LBS >= LoadsPerPlayer + Random(5);
NextPlayer(True);
LBS := 0;
until False;
ScriptTerminate;
end.The Functions:
function FindRock(color: TIntegerArray; var mx, my: integer): boolean;
var
k, x, y: integer;
begin
if not LoggedIn or FindDead then Exit;
for k := 0 to High(color) do
if FindColorSpiralTolerance(mx, my, color[k], MSX1, MSY1, MSX2, MSY2, 15) then
begin
MMouse(mx, my, 5, 5);
if IsUpText('ine') then
begin
Result := True;
GetMousePos(x, y);
case random(2) of
0, 1: Mouse(x, y, 5, 5, true);
2: begin
Mouse(x, y, 5, 5, false);
ChooseOption('ine');
end;
end;
mx := x;
my := y;
FFlag(0);
end;
end;
end;
procedure MineThem(Kind: string);
var
Time: integer;
begin
Players[currentPlayer].Loc := 'Mining...';
Status('Mining...');
case Lowercase(Kind) of
'coal' : begin
//if FindObjCustom(mx, my, ['ocks', 'ine'], [3097925, 2372661, 1911595], 15) then
if FindRock([1780009, 2043438, 3098183], mx, my) then
begin
SkilldGas;
SkilldPickAttacher;
FFlag(0);
ChatCheck;
MarkTime(Time)
repeat
ChatCheck;
Wait(500 + Random(500));
AntiBan;
if FindFight then RunAway('E', true, 1, 5000 + Random(5000));
until not (Mining) or (TimeFromMark(Time) > 10000);
Time := 0;
end;
end;
'mith' : begin
//if FindObjCustom(mx, my, ['ocks', 'ine'], [5913917, 8739675, 7951186], 15) then
if FindRock([5913917, 8739675, 7951186], mx, my) then
begin
SkilldGas;
SkilldPickAttacher;
FFlag(0);
ChatCheck;
MarkTime(Time)
repeat
ChatCheck;
Wait(500 + Random(500));
AntiBan;
if FindFight then RunAway('E', true, 1, 5000 + Random(5000));
until not (Mining) or (TimeFromMark(Time) > 10000);
Time := 0;
end;
end;
'both' : begin
if (FindRock([5913917, 8739675, 7951186], mx, my)) or (FindRock([3098183, 2043438, 1780009], mx, my)) then
//if (FindObjCustom(mx, my, ['ocks', 'ine'], [3097925, 2372661, 1911595], 15)) or (FindObjCustom(mx, my, ['ocks', 'ine'], [5913917, 8739675, 7951186], 15)) then
begin
SkilldGas;
SkilldPickAttacher;
FFlag(0);
ChatCheck;
MarkTime(Time)
repeat
ChatCheck;
Wait(500 + Random(500));
AntiBan;
if FindFight then RunAway('E', true, 1, 5000 + Random(5000));
until not (Mining) or (TimeFromMark(Time) > 10000);
Time := 0;
end;
end;
end;
end;The Problem is that after it mines a rock then it just sits there and then logs out due to inactivity. Why does it do that? I'm pretty sure that the functions should work.