// -->
// --> Name: Ultra Miner
// --> Version: 0.6_134_01
// --> Author: BadAhr
// --> Email: badahr@gmail.com
// --> Date: 09/12/05
// *****************************************************************************
// ---------------------- IMPORTANT - READ ME - IMPORTANT ----------------------
// *****************************************************************************
// --> 1) Face a Wall in a Cave! Tilt the angle you mine!
// --> 2) Only eats Steak!! Expand it!
// --> 3) Open Invetory, Sort so Water is ABOVE Steak
// --> 4) Start with FULL food + water
// --> 4) IMPORTANT: SEE CONFIG AREA! Go to line 82 to set them
// --> 5) Start the script, then leave the computer
// *****************************************************************************
// ---------------------- IMPORTANT - READ ME - IMPORTANT ----------------------
// *****************************************************************************
// --> If you enjoy my scripts, please support me by
// --> donating. I can be contacted by email.
// -->
// --> Special Thanks to those that have supported me. You know
// --> who you are.
// -->
// --> Known BUGS!: Please READ the Revision History!
// -->
// --> Email:
// --> All emails directed to me should be in ENGLISH. That means
// --> spelling, puncuation, and grammar are a must.
// -->
// --> Please email any bugs you find, be sure to
// --> include the following in your email:
// --> 1) Script Name + Version
// --> 2) Description of bug
// -->
// --> Email me any Questions/Comments/Suggestions.
// -->
// --> If you enjoy my scripts. Please support me. Email me to inquire.
// -->
// --> Revision History:
// --> v0.1_132 = Initial Release 10/11/2005
// --> v0.2_132 = Bug Fixes 11/11/2005
// --> Features: Added some basic Statistics to Report Box
// --> Resolved: Pickaxe stuck Anti Random
// --> Regressions: No known Regressions
// --> v0.3_132 = Bug Fixes 11/11/2005
// --> Features: Added automation of Water and Food Coords.
// --> you can still set them manually if you wish
// --> Added Time Procedure. For now is only implemented
// --> in statistics.
// --> Resolved: Failing to detect Stamina/Food/Water Bar
// --> Regressions: No known regressions.
// --> v0.3_132r2 = Bug Fix 11/11/2005
// --> Resolved: Will find Steak and Water now
// --> v0.4_132 = Bug Fix 12/11/2005
// --> Features: Faster :D And more reliable.
// --> Auto finds everything... no setting coords
// --> Resolved: Not moving forward
// --> Freeing pickaxe should be more optimized
// --> Fixed issue with custom window themes
// --> Regressions: Mining anything other than rock is broken.
// --> v0.5_133 = Improvements Features 17/11/05
// --> Features: More optimizations/Finds everything automatically
// --> Option to set Error Level, see config area.
// --> Option to Mine + Prospect, see config area.
// --> Option to Logout if you run out of fatigue.
// --> Resolved: Mining any ore type, up to 8 Tile types. Including
// --> rock outside a cave.
// --> v0.6_134_01 = Includes!!! 09/12/05
// --> Features: Too many to list, but check out the includes to make your
// --> own scripts.. Tonnes of pre written functions and procedures
// --> Script is only like 25 lines long now :)
// -->
program UltraMiner;
const
// *****************************************************************************
// ---------------------- USER CONFIG AREA - CHANGE THESE ----------------------
// *****************************************************************************
Client = 'Wurm Online 1.3.4_01'; //Set Client Name
OreLimit = 500; //0 = Infinite;
TileType = 1; //0 = Rock; 1 = Cave Wall; 2 = Iron; 3 = Silver; 4 = Gold; 5 = Lead; 6 = Zinc; 7 = Tin; 8 = Copper;
MinePath = 1; //1 = Straight; 2 = Down; 3 = Up;
ErrorLvl = 1; //0 = Halt Script; 1 = Retry Once; 2 = Retry Indefinatly;
Prospect = False; //False = No; True = Mine/Prospect/Mine/Prospect;
Logout = True; //True = will log out once done mining. Or run out of fat.
// *****************************************************************************
// ---------------------- SCRIPT AREA - DONT CHANGE BELOW ----------------------
// *****************************************************************************
var
pbarx, pbary, miny, minx, wax, way, stx, sty, dx, dy, x, y, Count, Chars,
wbarx, wbary, fbarx, fbary, nbarx, nbary: Integer;
Tile, ErrorMsg, MineAngle: String;
Error: Boolean;
ST: LongInt;
{.include BAI.scar}
begin
ClearDebug;
ClearReport;
Init(dx, dy, Chars, Error, ErrorMsg, Client);
case TileType of
0 : Tile := 'Rock';
1 : Tile := 'Cave wall';
2 : Tile := 'Iro';
3 : Tile := 'Silver';
4 : Tile := 'Gold';
5 : Tile := 'Lead';
6 : Tile := 'Zi';
7 : Tile := 'Ti';
8 : Tile := 'Copper';
end;
FindTile(minx, miny, dx, dy, Chars, Tile);
FindBars(pbarx, pbary, nbarx, nbary, fbarx, fbary, wbarx, wbary, dx, dy);
ST := GetSystemTime;
ClearDebug;
Changereportwidth(400);
repeat
if(Error)then
begin
status('Error! Halting.');
writeln(ErrorMsg);
case ErrorLvl of
1 : Init(dx, dy, Chars, Error, ErrorMsg, Client);
2 : while(Error)do Init(dx, dy, Chars, Error, ErrorMsg, Client);
end;
if(Error)then TerminateScript;
end;
if not(FindColorTolerance(x, y, 10971947, wbarx, wbary + 2, wbarx, wbary + 2, 5))then GetMenu(ErrorMsg, Error, wax, way, pbarx, pbary, nbarx, nbary, 6, 0, Chars, 'water', False, False);
if not(FindColorTolerance(x, y, 3043228, fbarx, fbary + 3, fbarx, fbary + 3, 5))then GetMenu(ErrorMsg, Error, stx, sty, pbarx, pbary, nbarx, nbary, 5, 0, Chars, 'steak', False, False);
GetMenu(ErrorMsg, Error, minx, miny, pbarx, pbary, nbarx, nbary, 6, MinePath, Chars, Tile, True, True);
if(Prospect)then GetMenu(ErrorMsg, Error, minx, miny, pbarx, pbary, nbarx, nbary, 6, 4, Chars, Tile, True, True);
if(IsEvent(dx, dy, 6, 0, Chars, 'You have to'))then FreeItem(dx, dy, 6, 0, Chars, 'free your pickaxe');
if(IsEvent(dx, dy, 6, 0, Chars, 'You are too far away'))then SendArrowSilentWait(0, 2000);
// ReportStatistics;
Count := Count + 1;
if(Logout)and(IsEvent(dx, dy, 6, 0, Chars, 'fatigue'))then Count := OreLimit;
until(Count = OreLimit);
if(Logout)then ExitOut;
FreeChars2(Chars);
LoadCharsFromFont2('Arial', 8, False, False, False, False);
IsTextInAreaEx(250, 50, 450, 200, x, y, 'What', 0, Chars, False, False, 0, 1, $FFFFFF);
Writeln(IntToStr(x) + ' ' + IntToStr(y));
end.