SRL Archive - First Scripts

Eternal Lands - Coal miner


AzulDrake

2010-06-14 04:33:53

Here is my Coal miner for Eternal Lands. There are some bitmaps used in the script, wich I added to the post as well.

Any comments or suggestions of how to improve would be appreciated :)

{\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\}
{------------------------------------------------------------------------------}
{//\\//\\//\\//\\//\\//\\// Starting Location \\//\\//\\//\\//\\//\\//\\//}
{------------------------------------------------------------------------------}
{\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\}
{//\\//\\//\\ Start in Nordcarn Storage. \\//\\//\\//}
{\\//\\//\\// Compass needs to point North. //\\//\\//\\}
{//\\//\\//\\ Use BloodSucker's maps. \\//\\//\\//}
{//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//}
{------------------------------------------------------------------------------}

program HarvCoalWS;
{.Include SRL\SRL.SCAR}

var
{Global variable counters used through out the script}
x, y, i, Width, Height, HarvEvents, Loads,
UDLFile,LastX, LastX2, Tries : integer;

{DTMs used through out the script}
var
dtmStoExitMap, dtmArriveAtStoExit, dtmStoMap,
dtmWSExitMap, dtmArriveAtWSExit, dtmWSCaveMap,
dtmArriveWSCaveMap, dtmCaveCoalMap,
dtmArriveAtCaveCoal, dtmNordcarnMap, dtmWSMap,
dtmCoalCaveMap,dtmCoalMap, dtmArriveCoalMap,
dtmCaveExitMap, dtmArriveCaveExitMap,
dtmNExitMap, dtmArriveNExitMap, dtmNStoMap,
dtmArriveNStoMap, dtmPickAxe : integer;
{Strings used through out the script}
Text, DebugText : string;
{TPAs used through out the script for color searching}
tpaStoExit, tpaWSExit, tpaStoril : TPointArray;
ATPA : T2DPointArray;

const
{Player X color on map}
PlayerMap = 16711680;
{Script details}
Version = '1.0';
Title = 'WhiteStone Coal Miner';

function CheckHarving: Boolean; forward;
procedure ExitSto; forward;
procedure GotoWSExit; forward;

procedure LoadDTMs;
begin
dtmStoExitMap := DTMFromstring('78DA63FCC6C4C010C68002FEFFFF0FA619A17' +
'CC6B74035AEA86A440AB551D5A803D504A1AA61F0154055B31EA8' +
'E63FAA9262252E543527816A6632A2A8E1E0B886A20600E8000BA' +
'C');
dtmArriveAtStoExit := DTMFromstring('78DA63FCC8C4C010CC8006FE834946288FF13' +
'B504D189A8AFF686A34806ABC51D58839F3A1AAD90754F317554D' +
'A21C17AA9AE34035331951D470705C4355C3C6CCC0E0C08015C0D' +
'4000088D90C52');
dtmStoMap := DTMFromstring('78DA633CC0C4C060C180023E7FFE04A619A17' +
'CC6EB403521A86AAE5D3C86AA660B50CD4C4614351C1CD750D5C8' +
'0059CDA8E664AE504055F301C8B2614251F3FFFF7F143500DC050' +
'FAA');
dtmWSExitMap := DTMFromString('78DA636C61646058CDC4800CD8D998C134239' +
'4CFF817C85AC288A2E6F9670E5435654033D250D5043D16405573' +
'05A8660EAA5D4B533551D58401E57FA02861785FCB80AA663B908' +
'84235E7FFFFFF286A006C74106B');
dtmArriveAtWSExit := DTMFromString('78DA636C60646058C5C4800AFE834946288FF' +
'12A507E3EAA9AA5A99AA86ACA81F2698C286A821E0BA0AA0903AA' +
'F98E6AD3FB5A0654357F81AC25A8E63CFFCC81AA661B90884475C' +
'FFFFFA86E0600C5411157');
dtmWSCaveMap := DTMFromString('78DA633CC8C8C0A0C98002DEBF7B0BA619A17' +
'C461E20CB0A55CD8AA4C9A86AB8812C2F543502693350D58058E1' +
'A86A5A759450D570025925A86AF65D54455523006475A2AA99162' +
'88CA20600D28D0BFB');
dtmArriveWSCaveMap := DTMFromString('78DA633CC0C8C0A0C98006FE834946288F911' +
'DC8B24155F1BDEB1AAA1A0E20CB1B558DC4ACE7A86A5881AC6254' +
'35CFDFF3A1AAE106B2BA51D5BC6AE54555630864CD405513F55C0' +
'2450D0097D00D11');
dtmCaveCoalMap := DTMFromString('78DA63B4646460E867624006DEAE7A609A11C' +
'A67BC07244251D5FCFFFF1F55CD5120B1014509032BCB7754352F' +
'81AC5FA86A0C6719A2AAB902B4270955CD39160E543577806A825' +
'1DD33B1C412450D0011DF0FA0');
dtmCoalMap := DTMFromString('78DA63B461646098C8C4800CECAC34C034239' +
'4CF780C486C4151C2E0E21E8AAAE63990F51B558DC95443543597' +
'81F624A2AAB9C5C281AAE60E504D10AA7B625A6550D4000008B20' +
'AFD');
dtmArriveCoalMap := DTMFromString('78DA6334676460E863624005FFC1242394C77' +
'81448AC4353C2F21D55CD0B20EB37AA12C35986A86AAE00ED4942' +
'55738E850355CD5DA09A2054F7CC29B144510300493E0BAE');
dtmNordcarnMap := DTMFromstring('78DA63FCC5C0C07094910119FCFFFF1F4CC34' +
'4196F0289285435A275BB50D57C00B23EA1286190CE5B84AAA68C' +
'8981210DD59CA0C702A86AFE0159CB51D53CFFCC81AAE62AD09CF' +
'94C286A96A66AA2A80100E0E912B1');
dtmWSMap := DTMFromString('78DA6364676460B0664001DFBBAE816946289' +
'FF11D90704655A3B2E811AA1A0E20CB17558DC4ACE7A86A7E0189' +
'705435EF253850D53C0512A9A86ADE5672A1AA390124661330870' +
'DC82A4755F3FC3D9A1A1E20AB0B55CDEB461E5435CA40D67C5435' +
'4B25D0FC650C644D435513F55C02450D00ACB117F8');
dtmCaveExitmap := DTMFromString('78DA637CC0C0C0E0C5C4800C4CF414C034239' +
'4CF781B4838A3AAF9F8F123AA9AA34062038A12065696EFA86A9E' +
'0359BF50D5984C3544557305684F12AA9A732C1CA86AEE00D504A' +
'1BA27A65506450D0008AA0F40');
dtmArriveCaveExitMap := DTMFromString('78DA63BCC5C0C0E0CAC4800AFE834946288FF' +
'12890D880AA8295E53BAA9A9740D62F543586B30C51D55C06DA93' +
'88AAE6160B07AA9A7740D60C461435DFCF67A3AAB903342708D5C' +
'D31AD32286A00BE2B0F86');
dtmNExitMap := DTMFromString('78DA639CC7C8C0A0C28002BE7EF90AA619A17' +
'C464E20CB0A55CDF7AE6BA86AFE0089505435FDF2E2A86AD881AC' +
'12543537EE0BA0AAE107B23A51D53C2A144155A30264CD4455B35' +
'4E2398A1A00039E0F04');
dtmArriveNExitMap := DTMFromString('78DA639CC3C8C0A0C68006FE834946288F911' +
'DC8324755F1ADEB2AAA1A3620CB1D558D58CB615435FF804418AA' +
'9A246D0554359C405609AA9A7D175551D5F001599DA86A5EE573A' +
'0AA5105B266A1AA992C731C450D0028FA0E72');
dtmNStoMap := DTMFromstring('78DA63BCC4C4C030018891407E862B986684F' +
'219AF01E5E7A0AA599CAA89AAE61F90B59C1145CDF3CF1CA86ACA' +
'8066A4A1AA097A2C80AA868F9981E11D03AA391AA8E600000F1F0' +
'CF7');
dtmArriveNStoMap := DTMFromstring('78DA63BCC8C4C030118851C07F30C908E5315' +
'E05CACF4355B334551355CD3F206B19238A9AE79F3950D59402CD' +
'48455513F45800550D1F3303C33B54D73CD740350700FC6E0CDA');
dtmPickAxe := DTMFromstring('78DA638C606660D8C9C8800C4AFC55C0344C9' +
'43115A86615AA9A505B7554359940356B50D5D85A98A1AA4902AA' +
'598AAA46524212554D0650CD325435667A6A286A0071210888');

end;

procedure FreeDTMs;
begin
FreeDTM(dtmStoExitMap);
FreeDTM(dtmArriveAtStoExit);
FreeDTM(dtmStoMap);
FreeDTM(dtmWSExitMap);
FreeDTM(dtmArriveAtWSExit);
FreeDTM(dtmWSCaveMap);
FreeDTM(dtmArriveWSCaveMap);
FreeDTM(dtmCaveCoalMap);
FreeDTM(dtmArriveAtCaveCoal);
FreeDTM(dtmWSMap);
FreeDTM(dtmCoalMap);
FreeDTM(dtmArriveCoalMap);
FreeDTM(dtmCaveExitMap);
FreeDTM(dtmArriveCaveExitMap);
FreeDTM(dtmNExitMap);
FreeDTM(dtmArriveNExitMap);
FreeDTM(dtmNStoMap);
FreeDTM(dtmArriveNStoMap);
FreeDTM(dtmPickAxe);
end;

function Full:Boolean;
begin
result := False;
if(GetColor(544, 726) = 4408182) then //Check to see if EMU bar full for anything 7 or less space is full
result := True
else
result := False;
end;

procedure LookEast;
begin
//AddToReport('DBInf - proc LookEast')
MoveMouse(485, 366);
wait(1000 + random(500));
GetMousePos(x, y)
HoldMouseMid(x, y);
wait(1000 + random(500));
MoveMouse(x+28, y);
wait(1000 + random(500));
ReleaseMouseMid(x,y);
wait(1000 + random(500));
end;

procedure LookNorthFromEast;
begin
//AddToReport('DBInf - proc LookNorthFromEast')
MoveMouse(485, 366);
wait(1000 + random(500));
GetMousePos(x, y)
HoldMouseMid(x, y);
wait(1000 + random(500));
MoveMouse(x-28, y);
wait(1000 + random(500));
ReleaseMouseMid(x,y);
wait(1000 + random(500));
end;

procedure PressTab;
begin
//AddToReport('DBInf - proc PressTab');
TypeSend(chr(9));
Wait(2500 + random(100));
end;

procedure OpenInv;
begin
KeyDown(17); //Ctrl key
Sendkeys(chr(105));
KeyUp(17);
end;

function CheckInventoryOpenBMP:Boolean;
var
bmpInventory : integer;
begin
//AddToReport('DBInf - proc CheckInventoryOpenBMP')
result := False;
bmpInventory := LoadBitmap('.\EL\inventory.bmp');
if FindBitmapTolerance(bmpInventory, x, y, 50) then
begin
result:= True
MMouse(x, y, 0, 0);
end
else
begin
result := false
// WriteLn('Inventory Bitmap not found')
OpenInv
wait(1000 + random(300))
end;
FreeBitmap(bmpInventory);
end;

function CheckInventoryOpenDTM:Boolean;
var
dtmInventory : integer;
begin
//AddToReport('DBInf - proc CheckInventoryOpenDTM')
result := False;
dtmInventory := DTMFromstring('78DA633CC9C4C090C8C8800C9A139DC0344C9' +
'4F12CA69A3857035435A7816A5251D5A47819A3AA3901549389AA' +
'A635C919D32E426A6E00D524A3AA59DF1881AAE636A639693E26A' +
'86A3E02D524A1AAD9D81C85AAE637A63907FA1251D5B031033D8B' +
'AA66797508AA1A2EA09A2C5435330B7D51D40000828B19E3');
if FindDTM(dtmInventory, x, y, 0, 0, Width, Height) then
begin
result:= True
MMouse(x, y, 0, 0)
end
else
begin
result := false
// WriteLn('Inventory dtm not found')
OpenInv
wait(1000 + random(300))
end;
FreeDTM(dtmInventory);
end;

procedure InventoryOpen;
begin
if CheckInventoryOpenBMP then
begin
wait(1000 + random(500));
end
else
if CheckInventoryOpenDTM then
begin
wait(1000 + random(500))
end;
end;

function CheckPickAxeBMP:Boolean;
var
bmpPickAxe : integer;
begin
//AddToReport('DBInf - func CheckPickAxeBMP')
result := False;
bmpPickAxe := LoadBitmap('.\EL\PickAxe.bmp');
if FindBitmapTolerance(bmpPickAxe, x, y, 50) then
begin
result:= True
MMouse(x, y, 0, 0)
WriteLn('Found PickAxe BMP')
end
else
begin
result := false
WriteLn('PickAxe Bitmap not found')
OpenInv
wait(1000 + random(300))
end;
FreeBitmap(bmpPickAxe);
end;

function CheckPickAxe:Boolean;
begin
//AddToReport('DBInf - func CheckPickAxeBMP')
InventoryOpen;
Wait(500 + random(300));
if FindDTM(dtmPickAxe, x, y, 0, 0, Width, Height) then
begin
result := true
WriteLn('Found PickAxe DTM')
end
else
begin
result := false
WriteLn('PickAxe DTM not found, trying BMP')
CheckPickAxeBMP
end;
Wait (400 + random(100));
OpenInv;
end;

procedure MapWalkStoExit;
begin
//AddToReport('DBInf - proc MapWalkStoExit')
if FindDTM(dtmStoExitMap, x, y, 0, 0, Width, Height) then
begin
MMouse(x, y, 1, 1)
Wait(1000 + random(100))
Mouse(x, y, 0, 0, True)
end
else
WriteLn('Storage Exit on map not found!');
end;

function CheckStoMap:Boolean;
begin
//AddToReport('DBInf - func CheckStoMap')
result := false;
if FindDTM(dtmStoMap, x, y, 0, 0, Width, Height) then
begin
result := true
end
else
begin
result := false
PressTab
end;
Wait (100 + random(100));
end;

function ArriveAtStoExit:Boolean;
begin
//AddToReport('DBInf - func ArriveAtIron')
result := false;
if FindDTM(dtmArriveAtStoExit, x, y, 0, 0, Width, Height) then
result := true
else
result := false;
Wait(1000 + random(500));
end;

procedure SearchStoDoor;
begin
//AddToReport('DBInf - proc SearchStoDoor');
Tries := 0;
FindColorsSpiralTolerance(x, y, tpaStoExit, 1383487, 378, 361,554, 480, 10);
// WriteLn('tpaStoExit = ' + IntToStr(Length(tpaStoExit)));
if (Length(tpaStoExit) = 0) then
repeat
if (Length(tpaStoExit) = 0) then
begin
Tries := Tries + 1
FindColorsSpiralTolerance(x, y, tpaStoExit, 2955799, 165, 29, 955, 714, 10)
WriteLn('Tried '+ IntToStr(Tries) +' times to find the door!');
end
else
begin
ATPA := TPAToATPAEx(tpaStoExit, 10, 10)
SortATPASize(ATPA, True)
MMouse(ATPA[0][0].x,ATPA[0][0].y,2,2)
Wait(1000 + random(200))
Mouse(ATPA[0][0].x,ATPA[0][0].y,2,2, True)
Wait(1500 + random(500))
Break
end;
until (Tries > 5)
else
begin
ATPA := TPAToATPAEx(tpaStoExit, 10, 10)
SortATPASize(ATPA, True)
MMouse(ATPA[0][0].x,ATPA[0][0].y,2,2)
Wait(1000 + random(200))
Mouse(ATPA[0][0].x,ATPA[0][0].y,2,2, True)
Wait(1500 + random(500))
end;
if (Tries > 5) then
begin
WriteLn('Door not found :(')
ExitSto;
end;
end;

procedure ExitSto;
begin
Wait(1000 + random(500));
CheckStoMap;
Wait(1000 + random(500));
MapWalkStoExit;
while not (ArriveAtStoExit) do
wait(500 + random(200));
// PressTab;
wait(1000 + random(500));
LookEast;
wait(1000 + random(1000));
SearchStoDoor;
Wait(2000 + random(500));
LookNorthFromEast;
end;

function CheckNordcarnMap:Boolean;
begin
//AddToReport('DBInf - func CheckNordcarnMap')
result := false;
if FindDTM(dtmNordcarnMap, x, y, 0, 0, Width, Height) then
begin
result := true
end
else
begin
result := false
PressTab
end;
Wait (1000 + random(100));
end;

procedure MapWalkWSExit;
begin
//AddToReport('DBInf - proc MapWalkStoExit')
if FindDTM(dtmWSExitMap, x, y, 0, 0, Width, Height) then
begin
MMouse(x, y, 1, 1)
Wait(1000 + random(100))
Mouse(x, y, 0, 0, True)
end
else
WriteLn('WS Exit on map not found!');
end;

function ArriveAtWSExit:Boolean;
begin
//AddToReport('DBInf - func ArriveAtIron')
result := false;
if FindDTM(dtmArriveAtWSExit, x, y, 0, 0, Width, Height) then
result := true
else
result := false;
Wait(1000 + random(500));
end;

procedure ClickWSFlag;
begin
//AddToReport('DBInf - proc ClickWSFlag')
Tries := 0;
FindColorsSpiralTolerance(x, y, tpaWSExit, 5325114, 280, 218, 750, 580, 10);
WriteLn('tpaWSExit = ' + IntToStr(Length(tpaStoExit)));
if (Length(tpaWSExit) = 0) then
repeat
if (Length(tpaWSExit) = 0) then
begin
Tries := Tries + 1
FindColorsSpiralTolerance(x, y, tpaWSExit, 6316645, 280, 218, 750, 580, 10)
WriteLn('Tried '+ IntToStr(Tries) +' times!');
end
else
begin
ATPA := TPAToATPAEx(tpaWSExit, 10, 20)
SortATPASize(ATPA, True)
MMouse(ATPA[0][0].x,ATPA[0][0].y,2,2)
Wait(1000 + random(200))
Mouse(ATPA[0][0].x,ATPA[0][0].y,2,2, True)
Wait(1500 + random(500))
Break
end;
until (Tries > 5)
else
begin
ATPA := TPAToATPAEx(tpaWSExit, 10, 20)
SortATPASize(ATPA, True)
MMouse(ATPA[0][0].x,ATPA[0][0].y,2,2)
Wait(1000 + random(200))
Mouse(ATPA[0][0].x,ATPA[0][0].y,2,2, True)
Wait(1500 + random(500))
end;
if (Tries > 5) then
begin
WriteLn('WhiteStone Flag not found :(')
GotoWSExit
end;
end;

procedure GotoWSExit;
begin
Wait(1000 + random(500));
CheckNordcarnMap;
Wait(1000 + random(500));
MapWalkWSExit;
while not (ArriveAtWSExit) do
wait(500 + random(200));
PressTab;
Wait(1000 + random(500));
ClickWSFlag;
end;

function CheckWSMap:Boolean;
begin
//AddToReport('DBInf - func CheckWSMap')
result := false;
if FindDTM(dtmWSMap, x, y, 0, 0, Width, Height) then
begin
result := true
end
else
begin
result := false
PressTab
end;
Wait (1000 + random(100));
end;

procedure MapWalkCave;
begin
//AddToReport('DBInf - proc MapWalkCave')
if FindDTM(dtmWSCaveMap, x, y, 0, 0, Width, Height) then
begin
MMouse(x, y, 1, 1)
Wait(1000 + random(100))
Mouse(x, y, 0, 0, True)
end
else
WriteLn('WS Coal Cave on map not found!');
end;

function ArriveAtCave:Boolean;
begin
//AddToReport('DBInf - func ArriveAtCave')
result := false;
if FindDTM(dtmArriveWSCaveMap, x, y, 0, 0, Width, Height) then
result := true
else
result := false;
Wait(1000 + random(500));
end;

procedure EnterCave;
begin
//AddToReport('DBInf - proc EnterCave')
FindColorsSpiralTolerance(x, y, tpaStoExit, 2105120, 446, 343, 498, 414, 10);
if Length(tpaStoExit) = 0 then FindColorsSpiralTolerance(x, y, tpaStoExit, 1184274, 446, 343, 498, 414, 10);
ATPA := TPAToATPAEx(tpaStoExit, 10, 10);
SortATPASize(ATPA, True);
MMouse(ATPA[0][0].x,ATPA[0][0].y,2,2);
Wait(1000 + random(200));
Mouse(ATPA[0][0].x,ATPA[0][0].y,2,2, True);
Wait(1500 + random(500));
end;

procedure GotoCave;
begin
Wait(1000 + random(500));
CheckWSMap;
Wait(1000 + random(500));
MapWalkCave;
while not (ArriveAtCave) do
wait(500 + random(200));
PressTab;
Wait(1500 + random(500));
EnterCave;
Wait(500 + random(500));
LookEast;
Wait(500 + random(500));
LookEast;
end;

function CheckCoalCaveMap:Boolean;
begin
//AddToReport('DBInf - func CheckCoalCaveMap')
result := false;
if FindDTM(dtmCoalCaveMap, x, y, 0, 0, Width, Height) then
begin
result := true
end
else
begin
result := false
PressTab
end;
Wait (1000 + random(100));
end;

procedure MapWalkCoal;
begin
//AddToReport('DBInf - proc MapWalkCoal')
if FindDTM(dtmCoalMap, x, y, 0, 0, Width, Height) then
begin
MMouse(x, y, 1, 1)
Wait(1000 + random(100))
Mouse(x, y, 0, 0, True)
end
else
WriteLn('Coal on map not found!');
end;

function ArriveAtCoal:Boolean;
begin
//AddToReport('DBInf - func ArriveAtCoal')
result := false;
if FindDTM(dtmArriveCoalMap, x, y, 0, 0, Width, Height) then
result := true
else
result := false;
Wait(1000 + random(500));
end;

procedure SearchCoal;
begin
//AddToReport('DBInf - proc SearchCoal')
FindColorsSpiralTolerance(x, y, tpaStoExit, 2040096, 433, 343, 555, 479, 10);
if Length(tpaStoExit) = 0 then FindColorsSpiralTolerance(x, y, tpaStoExit, 2893615, 433, 343, 555, 479, 10);
ATPA := TPAToATPAEx(tpaStoExit, 10, 10);
SortATPASize(ATPA, True);
MMouse(ATPA[0][0].x,ATPA[0][0].y,2,2);
Wait(1000 + random(200));
Mouse(ATPA[0][0].x,ATPA[0][0].y,2,2, True);
repeat
wait(100)
until (Full = true) or (CheckHarving = true);
end;

procedure GotoCoal;
begin
Wait(1000 + random(500));
CheckCoalCaveMap;
Wait(1000 + random(500));
MapWalkCoal;
while not (ArriveAtCoal) do
wait(500 + random(200));
PressTab;
Wait(1000 + random(500));
SearchCoal;
end;

procedure MapWalkExit;
begin
//AddToReport('DBInf - proc MapWalkCoal')
if FindDTM(dtmCaveExitMap, x, y, 0, 0, Width, Height) then
begin
MMouse(x, y, 1, 1)
Wait(1000 + random(100))
Mouse(x, y, 0, 0, True)
end
else
WriteLn('WS Coal Cave on map not found!');
end;

function ArriveAtCaveExit:Boolean;
begin
//AddToReport('DBInf - func ArriveAtCoal')
result := false;
if FindDTM(dtmArriveCaveExitMap, x, y, 0, 0, Width, Height) then
result := true
else
result := false;
Wait(1000 + random(500));
end;

procedure SearchExit;
begin
//AddToReport('DBInf - proc SearchExit')
FindColorsSpiralTolerance(x, y, tpaStoExit, 921102, 417, 302, 529, 352, 10);
if Length(tpaStoExit) = 0 then FindColorsSpiralTolerance(x, y, tpaStoExit, 2566442, 417, 302, 529, 352, 10);
ATPA := TPAToATPAEx(tpaStoExit, 10, 10);
SortATPASize(ATPA, True);
MMouse(ATPA[0][0].x,ATPA[0][0].y,2,2);
Wait(1000 + random(200));
Mouse(ATPA[0][0].x,ATPA[0][0].y,2,2, True);
Wait(1500 + random(500));
end;

procedure GotoExit;
begin
Wait(500 + random(500));
LookNorthFromEast;
Wait(200);
LookNorthFromEast;
Wait(200);
CheckCoalCaveMap;
Wait(1000 + random(500));
MapWalkExit;
while not (ArriveAtCaveExit) do
wait(500 + random(200));
PressTab;
Wait(1000 + random(500));
SearchExit;
end;

procedure MapWalkNExit;
begin
//AddToReport('DBInf - proc MapWalkNExit')
if FindDTM(dtmNExitMap, x, y, 0, 0, Width, Height) then
begin
MMouse(x, y, 1, 1)
Wait(1000 + random(100))
Mouse(x, y, 0, 0, True)
end
else
WriteLn('Nordcarn Exit on map not found!');
end;

function ArriveAtNExit:Boolean;
begin
//AddToReport('DBInf - func ArriveAtNExit')
result := false;
if FindDTM(dtmArriveNExitMap, x, y, 0, 0, Width, Height) then
result := true
else
result := false;
Wait(1000 + random(500));
end;

procedure ClickNExit;
begin
//AddToReport('DBInf - proc ClickNExit')
FindColorsSpiralTolerance(x, y, tpaStoExit, 6509390, 267, 350, 358, 427, 10);
if Length(tpaStoExit) = 0 then FindColorsSpiralTolerance(x, y, tpaStoExit, 6509390, 267, 350, 358, 427, 10);
ATPA := TPAToATPAEx(tpaStoExit, 10, 10);
SortATPASize(ATPA, True);
MMouse(ATPA[0][0].x,ATPA[0][0].y,2,2);
Wait(1000 + random(200));
Mouse(ATPA[0][0].x,ATPA[0][0].y,2,2, True);
Wait(1500 + random(500));
end;

procedure GotoNordcarnExit;
begin
Wait(1000 + random(500));
CheckWSMap;
Wait(1000 + random(500));
MapWalkNExit;
while not (ArriveAtNExit) do
wait(500 + random(200));
PressTab;
Wait(1000 + random(500));
ClickNExit;
end;

procedure MapWalkNSto;
begin
//AddToReport('DBInf - proc MapWalkNSto')
if FindDTM(dtmNStoMap, x, y, 0, 0, Width, Height) then
begin
MMouse(x, y, 1, 1)
Wait(1000 + random(100))
Mouse(x, y, 0, 0, True)
end
else
WriteLn('Nordcarn Storage on map not found!');
end;

function ArriveAtNSto:Boolean;
begin
//AddToReport('DBInf - func ArriveAtNSto')
result := false;
if FindDTM(dtmArriveNStoMap, x, y, 0, 0, Width, Height) then
result := true
else
result := false;
Wait(1000 + random(500));
end;

procedure EnterSto;
begin
//AddToReport('DBInf - proc EnterSto')
FindColorsSpiralTolerance(x, y, tpaStoExit, 1781062 , 467, 213, 607, 322, 10);
if Length(tpaStoExit) = 0 then FindColorsSpiralTolerance(x, y, tpaStoExit, 923686 , 467, 213, 607, 322, 10);
ATPA := TPAToATPAEx(tpaStoExit, 10, 10);
SortATPASize(ATPA, True);
MMouse(ATPA[0][0].x,ATPA[0][0].y,2,2);
Wait(1000 + random(200));
Mouse(ATPA[0][0].x,ATPA[0][0].y,2,2, True);
Wait(1500 + random(500));
end;

procedure GotoNSto;
begin
Wait(1000 + random(500));
CheckNordcarnMap;
Wait(1000 + random(500));
MapWalkNSto;
while not (ArriveAtNSto) do
wait(500 + random(200));
PressTab;
Wait(1000 + random(500));
EnterSto;
end;

procedure MapWalkStoril;
var
dtmStorilMap : integer;
begin
//AddToReport('DBInf - proc MapWalkStoril')
dtmStorilMap := DTMFromstring('78DA63BCC9C4C010CE80023A93F5C0342394C' +
'FB80FA8C61F554D9D1937AA9AB74035AEA86A440AB551D5DC02AA' +
'C94455736B9716AA9AEF403561A86AFEFFFF8FA2060041BC0D58');
if FindDTM(dtmStorilMap, x, y, 0, 0, Width, Height) then
begin
MMouse(x, y, 1, 1)
Wait(1000 + random(100))
Mouse(x, y, 0, 0, True)
end
else
WriteLn('Storil not found!');
FreeDTM(dtmStorilMap);
end;

function ArriveAtStoril2: boolean;
begin
result := False;
if FindColorSpiralTolerance(x, y, PlayerMap, 721, 82, 735, 93, 10) then
begin
result := True;
end
else
result := False;
end;

procedure FindStorilTPA;
begin
//AddToReport('DBInf - proc FindStorilTPA')
FindColorsSpiralTolerance(x, y, tpaStoril, 2430483, 378, 361,554, 480, 10);
if Length(tpaStoril) = 0 then
FindColorsSpiralTolerance(x, y, tpaStoril, 2955799, 165, 29, 955, 714, 10);
ATPA := TPAToATPAEx(tpaStoril, 10, 10);
SortATPASize(ATPA, True);
MMouse(ATPA[0][0].x,ATPA[0][0].y,2,2);
Wait(1000 + random(500));
Mouse(ATPA[0][0].x,ATPA[0][0].y,2,2, True);
end;

procedure OpenSto;
var
OpenStoDTM : integer;
begin
//AddToReport('DBInf - proc OpenSto')
OpenStoDTM := DTMFromstring('78DA631466606058C380023E7F86D08C503EA' +
'32890D882AA262A0A4D0D1790C8425563E9A989AAC61A48AC4455' +
'337122AA390052F90750');
if FindDTM(OpenStoDTM, x, y, 0, 0, Width, Height) then
begin
Wait(1500 + random(100))
MMouse(x, y, 0, 0)
Wait(500 + random(50))
Mouse(x, y, 0, 0, True)
end;
Wait(200 + random(50));
FreeDTM(OpenStoDTM);
end;

procedure FindStoAll;
var
bmpStoAll : integer;
begin
//AddToReport('DBInf - proc FindStoAll')
bmpStoAll := LoadBitmap('.\EL\StoAll.bmp');
if FindBitmapTolerance(bmpStoAll, x, y, 100) then
begin
MMouse(x,y,0,0)
Mouse(x, y, 10, 10, True);
end
else
begin
WriteLn('Bitmap not found')
end;
end;

procedure CloseDialogs;
begin
Mouse(936, 368, 10, 10, True);
Mouse(385, 192, 10, 10, True);
Mouse(623, 49, 10, 10, True);
end;

procedure GotoStoril;
begin
//AddToReport('DBInf - proc GotoStoril')
wait(1000 + random(500));
CheckStoMap;
MapWalkStoril;
while not ArriveAtStoril2 do
wait(1000 + random(200));
PressTab;
FindStorilTPA;
Wait(1000 + random(300));
OpenSto;
Wait(1500 + random(500));
FindStoAll;
CloseDialogs;
Loads := Loads + 1;
end;

function CheckHarving:Boolean;
var
y, EmuStart, Emuend, EmuX : integer;

//EMUBar Full = 4408182
begin
//AddToReport('DBInf - func CheckHarving')
result := False
EmuStart := 447;
Emuend := 545;
y := 726;
EmuX := EmuStart
repeat
begin
EmuX := EmuX + 1
end
until (GetColor(EmuX, y) <> 4408182);
Wait(15000);
if (LastX = EmuX) then
begin
// WriteLn('not harvest since last time:(')
LastX := EmuX
LastX2 := EmuX
result := True
HarvEvents := HarvEvents + 1
// PressTab
Wait(1000)
if CheckPickAxe then
GotoCoal
else
begin
GotoExit
GotoNordcarnExit
GotoNSto
end;
end
else
begin
LastX := EmuX
LastX2 := EmuX
end;
exit;
end;

procedure Proggie;
begin
//AddToReport('DBInf - proc Proggie')
Text := '';
X := 148 - Length(TheDate(1));
for I := 1 to X do
Insert(chr(32), Text, Length(Text));
Writeln(Text + '.');
Writeln(Text + '.');
WriteLn(' _Progress Report_________________________________ ');
WriteLn('/ \');
WriteLn('| ' + Title+' |');
WriteLn('|_________________________________________________|');
WriteLn('| | |');
WriteLn('| Time Running | ' + TimeRunning);
WriteLn('| Mining Events | ' + IntToStr(HarvEvents));
WriteLn('| Loads Done | ' + IntToStr(Loads));
WriteLn('|________________|________________________________|');
WriteLn('| |');
WriteLn('| Version '+Version + ' |');
WriteLn('|_________________________________________________|');
Text := '';
Writeln(Text + '.');
UDLFile := OpenFile(ScriptPath + 'WSCoalMiner.txt', False);
ReadFileString(UDLFile, Text, FileSize(UDLFile));
CloseFile(UDLFile);
UDLFile := RewriteFile(ScriptPath + 'WSCoalMiner.txt', False);
Delete(Text, LastPos(TheDate(1), Text) + Length(TheDate(1)) + Length(TheTime) + 3, Length(Text));
DebugText := GetDebugText;
DebugText := Copy(DebugText, LastPos('_Prog', DebugText) - X - 46, Length(DebugText));
Insert(DebugText, Text, Length(Text));
WriteFileString(UDLFile, Text);
CloseFile(UDLFile);
end;

procedure MainLoop;
begin
LoadDTMs;
ExitSto;
GotoWSExit;
GotoCave;
GotoCoal;
GotoExit;
GotoNordcarnExit;
GotoNSto;
GotoStoril;
FreeDTMs;
end;

begin
ClearDebug;
ClearReport;
SetupSRL;
ActivateClient;
GetClientDimensions(Width, Height);
Disguise(Title + ' - ' + Version);
Writeln('Progress Reports saved to ' + ScriptPath + 'WSCoalMiner.txt');
Text := '';
if (FileExists(ScriptPath + 'WSCoalMiner.txt')) then
begin
UDLFile := OpenFile(ScriptPath + 'WSCoalMiner.txt', False);
ReadFileString(UDLFile, Text, FileSize(UDLFile));
CloseFile(UDLFile);
end;
UDLFile := RewriteFile(ScriptPath + 'WSCoalMiner.txt', False);
if (Text <> '') then
WriteFileString(UDLFile, Text);
WriteFileString(UDLFile, TheDate(1) + ', ' + TheTime + ' ');
CloseFile(UDLFile);
MainLoop;
Proggie;
end.

Matsetst

2010-06-14 14:12:45

No comments yet ? I dont know much about scripting so I cant help you with that ^^ I have a question….. it banks right ? Do you already have a progress from it ?

AzulDrake

2010-06-15 02:23:43

It does take the Coal to storage and puts it into storage. I don't usually macro more than an hour, but here is my proggie:
[PHP]June 12th, 2010, 08:05:21 PM .
.
_Progress Report_________________________________
/ \
| WhiteStone Coal Miner |
|_________________________________________________|
| | |
| Time Running | 61 Minutes and 51 Seconds
| Mining Events | 28
| Loads Done | 9
|________________|________________________________|
| |
| Version 1.0 |
|_________________________________________________|
.
[/PHP]

YoHoJo

2010-06-15 03:03:59

What's up with using MoveMouse, that is a very robotic and detectable function, why not only use MMouse/Mouse functions from SRL, not sure if this script is safe.

Also, no random finding, login procedure either?

Anyways… this is a good start to scripting for sure, you still have lots of learn, but you definitely understand the basics! You should read up more about antiban, antirandoms, multiplyer, etc check out the tutorial section for more information.

Never use MoveMouse/MoveMouseSmooth/HoldMouse/RelaseMouse though, check out Mouse.scar in SRL and stick to only using functions in there, most other ones are VERY robotic and jagex can catch you easily if you use them.

i luffs yeww

2010-06-15 03:50:01

^ :p This isn't for RuneScape.

AzulDrake

2010-06-15 04:07:42

Thanx for the feedback YoHoJo, I don't know how the MouseMove snucked in there. I'll change them.

And as i luffs yeww pointed out, it is actually for a game called Eternal Lands :)

YoHoJo

2010-06-15 04:11:08

Super Duper Failz0rs X 9001 :]

Well, still good job then, making scripts for other games is always really fun too :].
Try to see if you like scripting for runescape later on too, it's very fun!

cycrosism

2010-06-15 04:32:53

Very nice.

I've made a fire essence and health essence alcher for EL. Both worked perfectly.

E: Yohojo, don't worry about the mouse functions there is no macro detection in the game (I know from experience), even though i've had issues of being banned heaps of times, the game creator claims there is macro detection, but the ONLY way he found out I macrod is because I told someone I did, (We were good friends) and then we had a fight and he ratted to the admins about what I did and I got banned. I haven't macroed since my ban and I have to use a new account … so all my stats/knowledge is gone.

EE: I might get working on a sulphur/silver miner, or a lilac/blue lupine seller… apparently macro's are allowed on the test server? Sounds like a great place to test how long they will run for

AzulDrake

2010-06-15 04:54:00

Hi cycrosism,

Nice to see another EL player here :) Any chance of sharing your alc scrips?

I'm currently busy with a Lilac Harvester for VOTD and will share as soon as it's done :)

cycrosism

2010-06-15 05:03:27

My alchemy scripts were only made to work on my computer, it uses coord clicking to mix and withdraw bones and essences (The windows on my screen were in a permanent spot), but I can post them here for you.

Oh, and by the way I use to play eternal lands, but I haven't recently because I had to start a new account and I honestly cant be screwed raising all my stats (I had like 67 alchemy and 65 harvesting)

Fire essence script:


program New;
{.Include SRL/SRL.scar}
Var
X,Y, FE:Integer;

//TOP LEFT OF CHANNELS IS 16, 34

Procedure Eat;
Var
Bones, I:Integer;
begin
If FindColorTolerance(X, Y, 3026560, 721, 686, 755, 697, 10) then
begin
Bones := BitmapFromString(7, 9, 'beNpjYGBiYrKztrt5+6aTkwMDD' +
'LCysi5YPDErM6uxodzZ0UFcXBwirqFhHOQfdPnKvmXL5xYV50tLSQ' +
'MFZeV1Fi3q/fHt3stXt06dPqirpcvIyNjdWrd319L3b687OttC9HJ' +
'ycva2N758dOzwkbVwi/S0tXLSst++PTdzRjVcsLqyeOeO5d+/XzM1' +
'NoQLxoYFf35/qbmxCC7CAADhfTtb');
If FindBitmapToleranceIn(Bones, X, Y, 1406, 95, 1436, 276, 10) then
Begin
Repeat
Mouse(X, Y, 1, 1, True);
Wait(100+random(200));
I := I + 1;
Until(I = 5);
end else
begin
Mouse(94, 459, 6, 2, True);
Wait(750+random(750));
Mouse(271, 297, 3, 3, True); //Bones
Mouse(1009, 309, 100, 50, True);
GetMousePos(X, Y);
Wait(100+random(100));
Mouse(X, Y, 0, 0, False);
If FindBitmapToleranceIn(Bones, X, Y, 1406, 95, 1436, 276, 10) then
Begin
Repeat
Mouse(X, Y, 1, 1, True);
Wait(100+random(100));
I := I + 1;
Until(I = 5);
end
end;
FreeBitmap(Bones);
end;
end;

Procedure Mix;
begin
Eat;
If FindColorTolerance(X, Y, 3026560, 489, 669, 516, 684, 10) then
begin
Wait(500+random(500));
Mouse(768, 727, 4, 4, True);
Wait(1000);
end;
end;

Procedure WithdrawIngs;
Var
Sulphur, Fire:Integer;
begin
Sulphur := BitmapFromString(10, 10, 'beNoBLAHT/ncXrXweuIsfu' +
'5MimG0mjF4npXomvpcnz6oow54nnHMguocZuosXuI0TsIUUn24alW' +
'Efs4ge0Kgjx58hoXMbpHAcsYEWtYoQtYoQqXkVpHEcupEexp0gx58' +
'gsYQbqHQbqnkZroETsIQSqHgWpHQYonUZpHYZr4Mbw5YbrXkam2Uc' +
'om8YqXoVp3gWrYAZt4wdt4wduY8duIsbk2YbmGkfqHgjsIEiu4sgu' +
'YoctIIUs4AUt4cVt4oajGEbkWYgn3Ins4MlwJAjvIsdtIMTtIITsn' +
'8SpW8Pl2odn3Ijq30myJYiwJAjuYYcsX0RtYQTsn4SqHERmWwdqns' +
'jsoMlypgiy5kiu4octIITuo8VvZMVtYYYXEcVhWgcrYMd06Ah1KEh' +
'0Z4dz5wX0Z8Xu5AVm1BOgkU=');
If Not FindBitmapToleranceIn(Sulphur, X, Y, 942, 241, 1248, 292, 3) then
begin
Fire := BitmapFromString(11, 17, 'beNpdzz9IAmEYx/G9ISxKTAc9' +
'/FtC5lAWNBQWItSgaIlDJRHmokmQRFtbYVBKRSU0NERLQ1tbUGAS5' +
'lTQ1hJBBafe+V6XndfvekEi+PIM93x87iyFH3Sdn6N61sfwCxYSt0' +
'kbjkbawXsZ1qahPenVz1YNFzEDUFNP2cWYlXPrKbg3tlU8epKw0ei' +
'FWtTKz5lZL0z7ZUeL4GOEZDdNTNnljBMM1/Deirsrb2j9C6S0A2+h' +
'BqDq1d2ZVP8uYAUAhg8DKFhUlQBTi5qQlB7AlDOuX9aPT/qOGW4tK' +
'jaI/2hEJG7FczkzBImJgyTroqAc1FKjbDcVQxl/NEwBF1GO4Of19T' +
'55e7DJAF69atavLSd6ETnw1HbHqmeTSqcTyjzxVJZ6EJt0ctlx8Xo' +
'GcVchxJ77EclP88cjiG6/ivMNdoW/CSNqhFKY5KeQ9JLECsnCmvS2' +
'CFC+CMAAiO+rSCJbzWQuSYrhWiGECdAg+0giO+iTP8SUuWU8byYLO' +
'YQVErhcnd8TH2fpSvqICz9jwEg/');
If FindBitmapToleranceIn(Fire, X, Y, 942, 241, 1248, 292, 3) then
begin
FE := FE + 80;
Mouse(X, Y, 3, 3, True);
Mouse(392, 458, 3, 3, True);
Wait(800+random(800));
//Withdraw part
Mouse(99, 369, 7, 2, True); //Minerals
Wait(750+random(750));
Mouse(268, 331, 3, 3, True); //Sulphur
Mouse(1009, 309, 100, 50, True);
GetMousePos(X, Y);
Wait(100+random(100));
Mouse(X, Y, 0, 0, False);
Mouse(94, 329, 5, 2, True); //Flowers
Wait(750+random(750));
Mouse(362, 300, 3, 3, True); //Rose
Mouse(1009, 309, 100, 50, True);
GetMousePos(X, Y);
Wait(100+random(100));
Mouse(X, Y, 0, 0, False);
Mouse(392, 300, 3, 3, True); //Snap
Mouse(1009, 309, 100, 50, True);
GetMousePos(X, Y);
Wait(100+random(100));
Mouse(X, Y, 0, 0, False);
ClearDebug;
Writeln('We have made '+IntToStr(FE)+ ' Fire essence');
end;
FreeBitmap(Fire);
end;
FreeBitmap(Sulphur);
end;

begin
SetupSRL;
ClearDebug;
Repeat
Mix;
WithdrawIngs;
Until(False);
end.

Health essence script:


program New;
{.Include SRL/SRL.scar}
Var
X, Y, HE:Integer;

//TOP LEFT OF CHANNELS IS 16, 34

Procedure Eat;
Var
Bones, I, Bone_sto:Integer;
begin
If Not FindColorTolerance(X, Y, 3385255, 172, 859, 272, 867, 10) then
begin
Bones := BitmapFromString(7, 9, 'beNpjYGBiYrKztrt5+6aTkwMDD' +
'LCysi5YPDErM6uxodzZ0UFcXBwirqFhHOQfdPnKvmXL5xYV50tLSQ' +
'MFZeV1Fi3q/fHt3stXt06dPqirpcvIyNjdWrd319L3b687OttC9HJ' +
'ycva2N758dOzwkbVwi/S0tXLSst++PTdzRjVcsLqyeOeO5d+/XzM1' +
'NoQLxoYFf35/qbmxCC7CAADhfTtb');
If FindBitmapToleranceIn(Bones, X, Y, 1406, 95, 1436, 276, 10) then
Begin
Repeat
Mouse(X, Y, 1, 1, True);
Wait(50+random(50));
I := I + 1;
Until(I = 5);
end else
begin
Mouse(94, 459, 6, 2, True); //Animal
Bone_sto := BitmapFromString(10, 14, 'beNpjYMAKmJiYrCwtwwP8' +
'sMqKi4n4ejjVVhdgSnFzcdlZmsaE+l8+sw9TVk5WwsneYvvWJV+/v' +
'kWTkpIS11BXrCjJ+vPlyaQpvchSkhKiZqZ68VFhZ07tefHkakJiLF' +
'yKn49fU0MxPiq8f0Lnx0+vVq1fys/PDxTnYOdQVFQ00DcIC/Tr7Wz' +
'98O7FuXMnjAwMgVImhiaRIWGZyakFmdnTp0z+9v35q1f3GxqrmZmZ' +
'gbLVldU2lvYF2dmXz+x+8/ru9ZunHzy8lpOfwcjICJQNDQ2KiYy4d' +
'ePAn++3v39/fv7C4Q8fnpoYGkEcExUZFBkatGf/0u/frwFlT5zc+/' +
'37W6BeiCwPN7eSgpKGmpaTi8Oa1Utu3z4LlM0tyEQLB1ZWVn09HWd' +
'n+9L8/ISIaJC9AHWgeFc=');
Repeat
Wait(50);
Until(FindBitmapToleranceIn(Bone_Sto, X, Y, 227, 290, 419, 482, 2))
If FindBitmapToleranceIn(Bone_Sto, X, Y, 227, 290, 419, 482, 2) then
begin
Mouse(271, 297, 3, 3, True); //Bones
Mouse(1009, 309, 100, 50, True);
GetMousePos(X, Y);
Wait(100+random(100));
Mouse(X, Y, 0, 0, False);
end else
begin
Freebitmap(Bone_sto);
Writeln('Ran out of bones');
TerminateScript;
end;
Freebitmap(Bone_sto);
If FindBitmapToleranceIn(Bones, X, Y, 1406, 95, 1436, 276, 10) then
Begin
Repeat
Mouse(X, Y, 1, 1, True);
Wait(100+random(100));
I := I + 1;
Until(I = 5);
end
end;
FreeBitmap(Bones);
end;
end;

Procedure Mix;
begin
Eat;
If FindColorTolerance(X, Y, 3026560, 489, 669, 516, 684, 10) then
begin
Eat;
Wait(500+random(500));
Mouse(768, 727, 4, 4, True);
Wait(1000);
end;
end;

Procedure WithdrawIngs;
Var
Silver, Health, Silv_sto, Chrys_sto:Integer;
begin
Silver := BitmapFromString(12, 17, 'beNplzltr03AYBnAvd6teuA' +
'nDT+HFPodDEEQvBIeC4AQvdiMMFAU3EYZ0VZnr2rVr0jbN1lOSNmn' +
'TQ0JM03Rt/z2m6WFp1nYdPezk1nVGhTHw4eG9eX4X77OZXJLFN2Gn' +
'2WD5vvxwevrm9RvX/gtLeAOoLehBmYDPYVpd+DD/4P69iVvjV40ft' +
'nk2zD77RgR3ky4kEaNAgpl7NXuVcSSG2a1cJFDMJhIsLYMEG8Ffv3' +
'xxZ3Ly0gjhAOGAEhy9164p9WKIcvMMidiMU1N3Lw1P+ikEBly0VSs' +
'3q1I05JdymX67+Xzm6djY2D/DeD0hBKadsBgM1ECqo+ykxXijKlME' +
'9uTR49vjE3/+IXDAxgATKQk/VamQ5FmfZ4vAPNplQ2Q8HPyh/5JmY' +
'2KIkrfF/q7aVRU2HMymkt1mU+tBa/e4rXZqZaWUa8rSYa97Pjwbnp' +
'0WgUj7nDxN1HOpfkdtN+S6lDk76g9/HY9Go4u/qRTSdqPO61grJbn' +
'enrKrSOV88qS/f3E+PD066qmNQatVSgte2xrpgjSzI4FKMaWZnTw4' +
'ORxo60GnsyeXGd/mun4xiqNKPl0rpLYZmrJDQOQGbXXY21fLORCPY' +
'ZDF74BkIFRzSafVuPTx/ad381yYLGWEbqNSL6Rw1Lq1buRIXCmlK1' +
'kx6nPrPy+8fTNHoDYhRgIhmuEjK7pFo26JD/rjwUDE7dJKIg4Mtoa' +
'wTbdtHTZ8pTEUMa8ghhWXyeS1WNBVAwFB5m/Ls78BEQeWag==');
If Not FindBitmapToleranceIn(Silver, X, Y, 942, 241, 1248, 292, 3) then
begin
Health := BitmapFromString(15, 13, 'beNpbvDuoo0EtPNmgts3pwG' +
'nFO0+krt3RqigyN5aLzNbZ8Sjt3O/iKbsDPfylubmZGRgYzqdpnQu' +
'TmlMRonHwEs/VHyZ7z2a11iyIMFrZaHzxafnt3+2n7uT7xjpz8ksz' +
'MAu/ihL6HsqxtdhNcd8Ftkt/rLYeq+yo25lovr/L7Prz6nu/e64+L' +
'IsuipZSN2LmkNlW5Ly1xK14eovIsbtAxcnTZ6zNcD0cpYOsOL4sTt' +
'fRVUxRb1J2aMHMdoUDF5nPvdHfda68qxFo7LFITbjic6dSYgui7CP' +
'D5bTN5N0r5ebtEL35SfjRH/3VS/SCfHWlJcwMNDvmeR5/W3rxd13z' +
'HBfPqGaHgGmu0VukJhzg33BB7O434WOPlZqqBOQUOJm4hNU0qxf5H' +
'XpffO53deEkWwu7DI+YA4E5d/QufACqlHj6l2f6fjGvQG4eIQ4GDh' +
'kf59o1IXNPRM8/HZPRYa6hbKkk6ecZe8j26T+J5//55h9jju7jFFc' +
'HGisor6QQG1C7LmzK/tD8iTbmIeIyoloSHIaKEj7HPv0/+v1/dMcB' +
'XqsJjNJKTGIcpj5OZTO7Chek5c6LDKjy0fGw4eaTYGUSAKLnX/+//' +
'/3/2pPPMeU7eDU1GGQ47EI9updPz5ub6V8b7FrgL6lvz8wmxMDAAU' +
'QrD9x79OEnRH3v8rleyaE10ztS6wr9ysKAKg0DPPiVbJhYQYo1NS0' +
'Cc9bM334Tov7u5zdnntxefGBj3+rZaZNTPEsD7dN91Rxd9E2co1OK' +
'ZwAABNYCFQ==');
If FindBitmapToleranceIn(Health, X, Y, 942, 241, 1248, 292, 3) then
begin
HE := HE + 80;
Mouse(X, Y, 3, 3, True);
Mouse(392, 458, 3, 3, True);
Repeat
Wait(50);
Until(FindColorTolerance(X, Y, 65944, 88, 429, 155, 444, 5))
end;
//Withdraw part
Mouse(96, 343, 7, 2, True); //Ores
Silv_Sto := BitmapFromString(14, 9, 'beNoBegGF/iwt0MnBhnt6q' +
'qScqqSck4iEg3p2oZGRwLavvbSt3dLI1czE5t/a29LPx7e2v7mxj4' +
'OCoJiTo5yVi4J9YmBZo5aTxr61u7Kr1svE1czE7eji7urmyrq5ta+' +
'nc2RgqaCWo5uQe29rdWhjkYaBpJiTq6CbvrOt2tLK+vTv+PPv+fPv' +
'jIGCm5GLfm1oin92cGVegXdzfXVunpOOvK6rtKqks6mj5NzX1cbD+' +
'PPvs6Wbj4l+j4d+QTAxWExFNi0piH12nZCKw7OywLivvrWturKsxb' +
'224N3Yk4l/j4p+d2pmX1BOGRIOIRoWc2RfdmVgm46Im5GLn5ePp5u' +
'XrqGcz8rDODExjol+h3x2q6abFA4JYFdNVkdAgXFuva6tnpOOdWpn' +
'h3dxtqqlycC5CAcHdG9ompSJpJ2Ta2BZg311dW1rl42KvK6sppeUS' +
'kVCkoqCqZ+XraKaAAAAKiUgZlxVlpCFgXtzkY2GmZGNhXx5oZSTu6' +
'2ofHBvfXNwgXh0Mpq21SE=');
Repeat
Wait(50);
Until(FindBitmapToleranceIn(Silv_Sto, X, Y, 227, 290, 419, 482, 2))
If FindBitmapToleranceIn(Silv_Sto, X, Y, 227, 290, 419, 482, 2) then
begin
Mouse(X, Y, 3, 3, True);
Mouse(1009, 309, 100, 50, True);
GetMousePos(X, Y);
Wait(100+random(100));
Mouse(X, Y, 1, 1, True);
Wait(100+random(100));
Mouse(X, Y, 0, 0, False);
end else
begin
Freebitmap(Silv_Sto);
Writeln('Ran out of silver ore');
TerminateScript;
end;
Freebitmap(Silv_Sto);
Mouse(94, 329, 5, 2, True); //Flowers
Chrys_sto := BitmapFromString(18, 10, 'beNpj4WNABWzMzLlWFnX' +
'O9kDUH+Q/MTiwysN9Y3omSI6FQYhdgIeZm4mBCU0XPwfHgvDwaF3V' +
'GifbalfHBTExQXoGamJiEF2egk6zFXvc+OwVVUyFRZXlNeyZmLg5G' +
'BiACGJQhKOrppoiGwcLKysLxEA1duUVytOnyFa0SGdElc9xCa9Ob9' +
'7Nxi4kJSEP18XMxCQuJgw0n4GRQZxVdIHqhHrp4jSxWFMBVXNBtY6' +
'Fr2Mr14cWL49p2u4eUcrBwsvECDWcR5iLiQ/qhTDhgGzRRFtuCz9Z' +
'5Wpzk6SSHeEpSyMLNya0Hs7u2FQ0ca+ytjNEJTMfM6sUK8RuWx6rO' +
'IEQBx6bVA3lXn9Vl4iJwRnLwnPXAhFQV2HfbhEJVWjQMDFAdAmzCE' +
'+W68kTTvbgdfLiV4mRU1rmJzQ3VCHR1iHbwTq0ZK1P8hwZdQt4kLK' +
'IsTByM4ZI+PertJfJFESJhhWIJiQIhx4NZVwZIdXib5jlYAPUlT/j' +
'vk/uZLguJg4mRj5GOT5ZcyETd36XpRpzeiRL44VDkk2kCgM9Qs1Mo' +
'xLafRInCosZcnKLwHUxsjKyCrMyMAM9yeAm6FgvXy7LrcQFAFXQaY' +
'0=');
Repeat
Wait(50);
Until(FindBitmapToleranceIn(Chrys_Sto, X, Y, 227, 290, 419, 482, 2))
If FindBitmapToleranceIn(Chrys_Sto, X, Y, 227, 290, 419, 482, 2) then
begin
Mouse(X, Y, 3, 3, True); //Chrysanthemum
Mouse(1009, 309, 100, 50, True);
GetMousePos(X, Y);
Wait(100+random(100));
Mouse(X, Y, 0, 0, False);
end else
begin
Freebitmap(Chrys_Sto);
Writeln('Ran out of chrysanthemum');
TerminateScript;
end;
Freebitmap(Chrys_Sto);
ClearDebug;
Writeln('We have made '+IntToStr(HE)+ ' Health essence');
FreeBitmap(Health);
end;
FreeBitmap(Silver);
end;

begin
SetupSRL;
ClearDebug;
Repeat
Mix;
WithdrawIngs;
Until(False);
end.

It's all pretty basic stuff, I made it a while ago. Haven't used it in ages…. (Like, half a year to a year?) I could possible tone them up later on to work on anyones computer. But as I said before I don't really play anymore.

E: These scrips won't work on my new account as I do not have "I eat dead people" perk. I also had like 25k bones on my account and around 250k. I was pretty rich :D

AzulDrake

2010-06-15 05:56:09

Thanx for the scripts cycrosism :)

It sucks to have to up your levels again.

cycrosism

2010-06-15 06:07:32

I am afraid they won't work on your computer. You have to have the windows set up in the exact same spot that I had mine at, and you need to have set your screen resolution to a high size to put them in those places (I have a 22 inch monitor on my desktop)

The part of the script that says "//TOP LEFT OF CHANNELS IS 16, 34"

I put that there because that's where the top left of the blue box (corner) would be in those coords, because I couldn't focus scar to the EL client. It didn't work for some reason… But, as I said I could fix up these scripts to work on other peoples computers and possibly make it work with vegetables and/or fruits. What I really want to make is a harvester, possibly one that harvests iron as it is very profitable, and I don't care about having to make lots of trips because it is heavy. My script will be able to do that.

I have made harvester scripts in the past (But haven't used them) just to see if I could get it to manage harvest events that make you stop harvesting. What I did is I made it find the bitmap "You started to harvest" and set the Y variable to +1 of where it found the "You started to harvest" and if it finds a "You stopped harvesting" bitmap, I would make it click the plant again. That was just a small once off script I made to harvest red roses, as I was doing other stuff at the time and couldn't be bothered going back to my computer to see it stopped harvesting. So I would run the script come back a few minutes later and sto it all. (My script didn't have storage functions, just harvesting). In case you are wondering, when you hit a teleport nexus, it is easy to have your script detect that you have, and reposition yourself in a random position around the tree.

E: I found the script, it is pretty nooby and is incomplete. I only used it a couple of times on the test server to test if it actually worked.


Program New;
Var
X, Y, youstarted, youstopped, energy, packet:Integer;
Const
Debug = True; //True if you want extra debug

Procedure Wl(X:String);
Begin
If Not Debug Then exit;
Writeln(X);
End;

Function Harvesting: Boolean;
Var
STX, STY:Integer;
A:Extended;
Begin
youstarted := BitmapFromString(121, 13, 'beNrtV1tqAzEM7OdCW' +
'/BHbpDfnKC9QW9eeqdSg4uYjDRa2UkfgSxLWNZezWQ8kuXT8eXttd' +
'8PcB1P3y/90P2qXyhjf94O7f3zo99+5ngfDv0t+f57ExA9jmnYn7f' +
'Whuwo6YAbE/6Vq43VTUCYq03qMD692R6fqarg0tvQeEOJs5ZxCsUM' +
'EEJQBEInYp7nAkSOcib1oREEPdPfxNsm2NBYGkqcKZ0JAiOEozjBR' +
'yAdiJjnuQCxKxRJTWqrz8PFMnsYJUqc2cz1EEVX+1EiQMRw8qifOc' +
'SUDjhKUiNVVUx8HpEfkhI0KzXFr8RUmat2K9JwFyLUGYFyl6LUYel' +
'Q6NtTu67UlHphJUxiomPD3M+dU4FQ5YUqEn0bSq2AflNqn3dFqfGT' +
'iqsVsTVXqzRclrpeQBRupYBgb5AvH3Y+RDIhMCV1CKG6r0oBQUf55' +
'N3dDtSWlOTpmi0TlAoBWsGwVcvjKJK+eVM0fq7JqRsbN2XVrYUotP' +
'snBPJmchdC7QihLRWN8OxwYetO55r6iTiByA8puwTyI1LxHDR1UDq' +
'j8QW0NQUU');
youstopped := BitmapFromString(121, 13, 'beNrtV1sKAjEMXCieQ' +
'/z30w/P4HU9gSfTQiEOyeTRCrKCy7JIGpvZ2cmjx9PtcpX7fDxt29' +
'afaGyHNu7tf81cSOMg9nl/yN2N3dKfaNwP1QP8gL3/C2kUYodRqXp' +
'YdqVqQfVbqhbMrbWAauFZVRVUlyzZ+jOlQBvCRhEB0BBFkGsOaQjP' +
'AeWBb6F+I89YVfDTyJKtP3UF0hC4A12lb5GCXHNIQ1AHm4nIMP4de' +
'aYfq6+iA02cqeJQ0YPXyisglc+CQ4UHXLU8KKqHsVOtyLcvTqvoh1' +
'TP7jkFkhal1IHyrOzx/hSYOCPVQZP6nGqVerQSVqieAjnl4FUwBBz' +
'vH9u/TLXNu71RTVWtetwa1bO5GSdOfZCjIqFRbCv/QgHx5pa0gKCi' +
'bPKm7YA2NSrLysDvtcU0ShGk1/VSh6BvBhi8OWdtjgqGnLqwsSnTE' +
'F4UKwlvhzRE6oDDVRGD4oGeHeqnA+qgzjX1Q3cQgkapny/SE1DqsI' +
'DhzcMLy333sA==');
If FindDeformedBitmapToleranceIn(youstarted, STX, STY, 12, 51, 945, 481, 20, 0, False, A) Then
Begin
If FindDeformedBitmapToleranceIn(youstopped, X, Y, STX, STY+1, 945, 481, 20, 0, False, A) Then
Begin
//Send harvest packet
End Else Result := True;
End;
FreeBitmap(YouStarted);
FreeBitmap(YouStopped);
Writeln('Harvesting: '+BoolToStr(Result));
End;

Function TeleNexus: Boolean;
Var
cycrosismjusthit:Integer;
A:Extended;
Begin
cycrosismjusthit := BitmapFromString(198, 10, 'beNrVWEtOxTAM' +
'7LJiVYQ4AUtuwA24EmdnASJSZHk840lf+VXVU1+bTsbOxLW9beN4f' +
'rx7fbqf5/j7+ZsejTvpZotQjk+Y+3EkhPh6OYWghO+2CJH2uIjXm3' +
'FoenGAcKxp5vvbi/aVOObraRX2h8P0ZMthDphnmjTej6zG2SIgCGI' +
'iwngkSApK8T76oUSItBNJc700vThAOHbVTGFvq6hEYNrYelJzKPXG' +
'BpQ7pUWIso9im3eY5uOkYgDuLOEHhsC0xNCcGJVejGaiTxySF8aoa' +
'OCqJzUHrRbhCpSTQMBNmiI/hoIEkkxgU6SoLhTF8Jl12+IhPICBiy' +
'mqJHCaEk6RNGB68sSjlAUJh/sIpXpNDeDnQOzNdmeVCKW6blm+c4p' +
'yzLxKUUv+v+SRCHTltjrn5CVF4Vd1VVEM4U8pSpv5XxSFRROLJGUi' +
't4TQchBfvViFndNnifArisKPmmMmE6GZSn2HorBG1nl1mY3rPE1n5' +
'mZFjDEEZxH5ZJpFI/xwHqVDpTBTg5jlQ8yjcFlbT7YcytqftYPMwp' +
'ytJitL2+5BjJBOzcvqboaga73RJLldUazNgsJmZvrr5bQ4yk6O06B' +
'oOWBTa/86nLzaaYu13b9yDLpRzFJOgTYyBNbbnNeXKIq1glN8MHuM' +
'J1oH+CI2WltPKg4ftljETw==');
If FindDeformedBitmapToleranceIn(cycrosismjusthit, X, Y, 12, 51, 945, 481, 20, 0, False, A) Then
Begin
Result := True;
Wl('We hit a Tele Nexus, repositioning ...');
ClickMouse(423+Random(25), 530+Random(25), True);
//SendKeys('#CLS');
End;
FreeBitmap(cycrosismjusthit);
End;

Function CheckHealth: Integer;
Var
Fruit:Integer;
Begin
If FindColor(X, Y, 28903, 167, 515, 265, 521) Then
Begin
Result := 45;
Exit;
End;
Energy := CountColor(3393479, 167, 515, 265, 521);
If Energy <= 60 Then
Begin
Result := 26;
Wl('Food level lower then 30, eating some food');
fruit := BitmapFromString(16, 7, 'beNotyz1Lw1AUxvELEjiQBC7W' +
'lgOmkkgdYgIaqEgkCCnE0oLYikUrKNJMilWkIDoUkYJTxky+4GJGP' +
'4Xg6Efo2tHR1Se08OPCPfyfm6W4QidOrqYJb0tCsKr6JJz5ORBCxA' +
'3ZGlrxs+0flY6fLPT1Mnly1tttRgytZWWwTohNVtAHp4weskhmoTw' +
'0FTZpRsvnnib2DKXJ4raqRoFa75Wi60XABfGDpyYubVdyMVNzga5c' +
'NQlkEsqzFaXGAhPEdigHDr2EhXGf79b0fYPwppuF7w6PNnTIOrn7S' +
'PcMukxduyrfahLxtAeUnztFmJwz5tP+tSsxacTl5Mv/G/L4gn8fOQ' +
'10wHcyYKx+esWPeuG9rUPWpdGBbhm0+w/TjVGL');
If FindBitmapToleranceIn(Fruit, X, Y, 978, 92, 1008, 273, 3) Then
Begin
MoveMouseSmooth(X+8, Y+3);
Wait(40+random(200));
GetMousePos(X, Y);
ClickMouse(X, Y, True);
Wait(40+random(200));
End Else
Begin
Wl('Did not find vegetables, exiting');
Exit;
End;
End Else Wl('Food level is at an OK level');
End;

Begin
ClearDebug;
End.

AzulDrake

2010-06-15 06:15:47

Did you ever try to use the Fonts from EL to get the console chat? That is something that I'm trying, but it is a hassle :(

I can detect 1 letter, but anything more just messes up :( Been playing with the min & max spacing, but have not found the sweetspot yet.

I'm not big on mixing yet, but harving the ingreds is so tedious, thats why I decided to try and macro it. A sulfur/silver/iron miner would be nice to have :)

cycrosism

2010-06-15 06:35:33

From: AzulDrake
Did you ever try to use the Fonts from EL to get the console chat? That is something that I'm trying, but it is a hassle :(


Nope never tried that, I figured it was easier to make deformed bitmaps (means you make everything but the text black (colour 0)) of the text of me stopping/starting/hitting tele nexus.


I'm not big on mixing yet, but harving the ingreds is so tedious, thats why I decided to try and macro it.


Yeah, I use to order my ingredients of the GenX harvesting group (and any other groups that would harvest) until they started banning me from that because "WE DON'T SERVE CHEATERS". Too bad for them, they are just losing money :). I won't be surprised if most of the people who work in the GenX, and other harvesting groups macro.

A sulfur/silver/iron miner would be nice to have


Agreed. Look, in 2 weeks I got 3 weeks holidays. I might get back into EL and make a harvesting script, a really pro one that works on all screens.

cycrosism

2010-06-15 17:48:09

Post to bump and say:

I decided to try you script, I got the following error:


Storage Exit on map not found!

Just to let you know, the DTM won't work on everyone's computer as when you change the resolution of the game client, the map size also changes so it can fit in the screen.

E: Or you should say what to set the resolution too

Matsetst

2010-06-18 06:41:03

Wow eternal land looks fun playing. for the first time i like the graphics. I hate the WoW graphics :p this reminds me of older games.

It can be more fun the Runescape those days ?

Im going try it out this weekend !!

cycrosism

2010-06-18 07:49:56

From: Matsetst
Wow eternal land looks fun playing. for the first time i like the graphics. I hate the WoW graphics :p this reminds me of older games.

It can be more fun the Runescape those days ?

Im going try it out this weekend !!


It is pretty awesome to macro on. There are many many skills you can macro on, such as alchemy (My favourite), harvesting, potioning, tailoring, manufacturing, crafting (List goes on).

It is pretty fun, but it gets boring pretty quickly … Yeah the graphics are pretty good, and yeah it owns runescape.