// // THIS PROGRAM IS not(is) A COMPLETE AUTO ESS MINER! // // This is different from the other ess miners I've seen because // it does not require color picking in the mine. It will find the // ess, mine it, then find the portal without searching for // specific patterns or item colors. // // This is a proof-of-concept program. It will tele from Aubury's // shop to the ess mines, find the ess, mine it, then tele back // to Aubury's. Have a full inventory and it will continually loop, // each time finding the ess and teleporting back, thus proving // the concept works. // // In order for this to go full auto: // // Add code to walk to and from the bank. Write your own, or // leech it from Laura's or Joker's ess miner - your choice. // // Add your favorite banking code into the "BankEss" procedure. // There are lots and lots and lots of them around. Use whatever // you think has the least likely chance of getting you banned. // Leech 'em and use 'em. (Or write your own.) // // You should also add your favorite random events handlers into the // "CheckRandoms" procedure. There are so many different handlers // that I'll let you choose which ones you want to use. Then if // everything hangs up during a random event it'll be your fault, // not mine. // // Oh, and set up the constant on line 53. // // Credits: // Ch33psh33p, Joker, PplSuQBallz, chriz // // Credit is given to whomever wrote the script I took the code // from. If they took it from somewhere else and didn't give // credit, shame on them. // // CREATED AND TESTED ON SCAR 2.01 by Kaitnieks // // // The usual applies: Low-res, V-Bright, highest elevation, // map north as possible (NE slant best) // // Start location: Aubury's shop, with a pick wielded or in inventory // Const RunningCommentary = True; // Good for debugging or boredom Aubry = 2319242; // Aubry's shirt color (yeah, it's Joker's) Var StopTheScript, IAmMining, bPortalFound : boolean; iTrips, ixCoord, iyCoord, iterations, tele, teley, portalx, portaly : integer; sCavern : string; type ary = array[1..21] of extended; arx = array[1..34] of ary; // TPointArray...? //uses OSi.txt v4.011 {.include OSi.txt} ////////////////////////////////////////////// // Here starts the ess stuff by habiabedabi // ////////////////////////////////////////////// // // In a nutshell, this routine will: // (a) Teleport from Aubury's to the ess mine // (b) Look at 4 points on the minimap and see which of the // points fall inside the ess mine (not the black ouside // outside the mine.) // (c) Based on those points it gets a rough idea of where it is // in the mine and looks for ess. // (d) If it finds ess, it mines it. Otherwise it moves to another // location (quasi-intelligently) and starts back at (b) // (e) Once it finds ess, it must be in one of the four caverns // (NW, NE, SE, SW) - so it figures out which it is so the // random handlers know which way to run and it can find the // portal out. // (f) When it's done mining ess (full inventory) it walks near the // portal, does a quick look for it, and teleports back to Aubury's // (g) Starts over again // ////////////////////////////////////////////// // // These "q" functions check to see if the coordinate // on the minimap is in the ess mine or is black (out of the mine) // There were originally 13 coordinates checked but they were boiled // down to the main four in case you wondered about the numbering. // 13 points gave 99% probability of finding ess, 4 points gives about // 90%, but it's easy to compensate for that 9% and the whole thing // runs about 15% faster with only 4 points... (Do the benchmarking // yourself if you feel like it.) // function q3 : boolean ; begin if (getcolor(648,54) <> 0) then result:=true; end; {q3} function q6 : boolean ; begin if (getcolor(618,83) <> 0) then result:=true; end; {q6} function q8 : boolean ; begin if (getcolor(687,83) <> 0) then result:=true; end; {q8} function q11 : boolean ; begin if (getcolor(648,112) <> 0) then result:=true; end; {q11} // The EssTo... functions are separated into the four cardinal // directions to save time looking for ess and to reduce the // chance of being caught autoing- It would strike me as odd to // have the mouse do a lap around the screen after every move. // This way it only checks the most likely places for ess. // // Challenge: combine these 4 functions into one that is more // efficient and/or flexible. function EssToTheEast ( var ix, iy : integer ) : boolean; var bEssFound : boolean; begin iy:=320; bEssFound := False; repeat MoveMouseSmoothEx(490,iy,1,6,20,20,10); wait(100+random(50)); if(IsTextAt2(9,9,'Mine',100))then begin ix:=490; bEssFound := True; result := True exit; end; iy := iy - 50 until (iy < 15) or (bEssFound); if not bEssFound then result :=false; end; function EssToTheWest ( var ix, iy : integer ) : boolean; var bEssFound : boolean; begin iy:=320; bEssFound := False; repeat MoveMouseSmoothEx(35,iy,1,6,20,20,10); wait(100+random(50)); if(IsTextAt2(9,9,'Mine',100))then begin ix:=35; bEssFound := True; result := True exit; end; iy := iy - 50 until (iy < 15) or (bEssFound); if not bEssFound then result :=false; end; function EssToTheNorth (var ix, iy : integer ) : boolean; var bEssFound : boolean; begin ix := 35; bEssFound := False; repeat MoveMouseSmoothEx(ix,20,1,6,20,20,10); wait(100+random(50)); if(IsTextAt2(9,9,'Mine',100))then begin iy:=20; bEssFound := True; result := True; exit; end; ix := ix + 50 until (ix > 490) or (bEssFound); if not bEssFound then result :=false; end; function EssToTheSouth (var ix, iy : integer ) : boolean; var bEssFound : boolean; begin ix := 35; bEssFound := False; repeat MoveMouseSmoothEx(ix,320,1,6,20,20,10); wait(100+random(50)); if(IsTextAt2(9,9,'Mine',100))then begin iy:=320; bEssFound := True; result := True; exit; end; ix := ix + 50 until (ix > 490) or (bEssFound); if not bEssFound then result :=false; end; procedure GetOnTheMap( var ix, iy : integer); // // OK, we either hit a spot where we can't click on- // probably trying to click directly on the ess // in the minimap... can't do it- or are out of the // four main zones with no ess in sight. So start over. // begin repeat ix:=random(108) + 592; iy:=random(82) + 36; until (getcolor(ix,iy) <> 0) if RunningCommentary then writeln('Getting on the map, Jack'); clickmousehuman(ix,iy,1,1,true); mapflag;21982 at (643,82) wait(5000 + random(2000)); end; procedure GoToEss ( var ix, iy : integer ); // // This is a terribly long procedure that I'm sure can be optimised, // but it works and thinking about it right now makes my head hurt. // // Challenge: optimise this in such a way as it will not make // the average person's head hurt. // var iTries : integer; bEssNotFound : boolean; begin bEssNotFound := True; iTries := 0 ; repeat repeat CheckRandoms; iTries:= iTries + 1; if (q3 and q6 and bEssNotFound) then begin if RunningCommentary then writeln('I am in the SE part of somewhere'); // look along edge for some ess if EssToTheWest(ix, iy) then exit; if EssToTheNorth(ix, iy) then exit; if EssToTheSouth(ix, iy) then exit; // if no ess we're probably in the middle - move SE more ix:=700; iy:=118; repeat ix:=ix-3; iy:=iy-3; until (getcolor(ix,iy) <> 0) or (ix < 560) or (iy < 0); if (ix < 592) or (iy <36) then begin if RunningCommentary then writeln('No ess to the SE'); GetOnTheMap(ix, iy); exit; end; clickmousehuman(ix,iy,1,1,true); mapflag; wait(500 + random(200)); break; end else if (q3 and q8 and bEssNotFound) then begin if RunningCommentary then writeln('I am in the SW part of somewhere'); // look along edge for some ess if EssToTheNorth(ix, iy) then exit; if EssToTheEast(ix, iy) then exit; if EssToTheSouth(ix, iy) then exit; // if no ess we're probably in the middle - move SW more ix:=592; iy:=118; repeat ix:=ix+3; iy:=iy-3; until (getcolor(ix,iy) <> 0) or (ix > 700) or (iy < 0); if (ix > 700) or (iy <36) then begin if RunningCommentary then writeln('No ess to the SW'); GetOnTheMap(ix, iy); exit; end; clickmousehuman(ix,iy,1,1,true); mapflag; wait(500 + random(200)); break; end else if (q11 and q6 and bEssNotFound) then begin if RunningCommentary then writeln('I am in the NE part of somewhere'); // look along edge for some ess if EssToTheSouth(ix, iy) then exit; if EssToTheWest(ix, iy) then exit; if EssToTheNorth(ix, iy) then exit; // if no ess we're probably in the middle - move NE more ix:=700; iy:=36; repeat ix:=ix-3; iy:=iy+3; until (getcolor(ix,iy) <> 0) or (ix < 560) or (iy > 118); if (ix < 560) or (iy > 118) then begin if RunningCommentary then writeln('No ess to the NE'); GetOnTheMap(ix, iy); exit; end; clickmousehuman(ix,iy,1,1,true); mapflag; wait(500 + random(200)); break; end else if (q11 and q8 and bEssNotFound) then begin if RunningCommentary then writeln('I am in the NW part of somewhere'); // look along edge for some ess if EssToTheSouth(ix, iy) then exit; if EssToTheEast(ix, iy) then exit; if EssToTheNorth(ix, iy) then exit; // if no ess we're probably in the middle - move NW more ix:=592; iy:=36; repeat ix:=ix+3; iy:=iy+3; until (getcolor(ix,iy) <> 0) or (ix > 700) or (iy > 118); if (ix > 700) or (iy > 118) then begin if RunningCommentary then writeln('No ess to the NW'); GetOnTheMap(ix, iy); exit; end; clickmousehuman(ix,iy,1,1,true); mapflag; wait(500 + random(200)); break; end else if (q3 and bEssNotFound) then begin if RunningCommentary then writeln('I am in the S part of somewhere'); if EssToTheNorth(ix, iy) then exit else GetOnTheMap(ix, iy); break; end else if (q11 and bEssNotFound) then begin if RunningCommentary then writeln('I am in the N part of somewhere'); if EssToTheSouth(ix, iy) then exit else GetOntheMap(ix, iy); break; end else if (q6 and bEssNotFound) then begin if RunningCommentary then writeln('I am in the E part of somewhere'); if EssToTheWest(ix, iy) then exit else GetOnTheMap(ix, iy); break; end else if (q8 and bEssNotFound) then begin if RunningCommentary then writeln('I am in the W part of somewhere'); if EssToTheEast(ix, iy) then exit else GetOnTheMap(ix, iy); break; end else begin if RunningCommentary then writeln('I am in Area 51 - not on my map.'); if RunningCommentary then savescreenshot('Area51.bmp'); if RunningCommentary then writeln('Trying to move to the real world.'); //move somewhere and try again GetOnTheMap(ix, iy); end; until (Not(bEssNotFound)) or (iTries > 4); until (Not(bEssNotFound)) or (iTries > 4); // 4 tries is an arbitrary number (and it's actually // 5 tries because of the repeat..until loop) - it // usually only takes a couple of tries to hit ess if (iTries > 4) then begin iTries:=0; if RunningCommentary then writeln('Boy, am I lost - iTries > 4.'); if RunningCommentary then savescreenshot('Lost.bmp'); GetOnTheMap(ix, iy); //It's scary, but let's recurse! iterations:=iterations+1; if RunningCommentary then writeln('Keptin, we be recursin!'); if RunningCommentary then writeln('Warp speed (well, iteration): ' + inttostr(iterations)); if (iterations <= 5) then gotoess(ix,iy); end; if (iterations > 5) then begin // 5 tries is another arbitrary number. During testing it got hung // up and recursed 364 times without crashing. I stopped it manually // and added the check so it wouldn't just keep going. if RunningCommentary then writeln('Beam me up, Scotty. I am lost! Iterations > 5.'); if RunningCommentary then savescreenshot('Lost.bmp'); logout('I am lost! Procedure GoToEss. Iterations > 5.'); StopTheScript := True; TerminateScript; exit; end; end; {GoToEss} procedure MineTheEss(var sCavern:string; ix, iy : integer); forward; procedure FindCavern(ix, iy : integer; var sCavern:string); // // We've found the ess, now we need to figure out which cavern we're // in so we can do proper random handling and then find the portal out. // Again, not the most compact code I've ever written, but it works. // var iCavern, lx, ly : integer; ry : extended; begin iCavern := 0; sCavern := ''; wait(3000+random(2000)); //stop moving... //Check NW ry:=138; ly:=138; for lx:= 669 to 710 do begin if (getcolor(lx,ly) <> 0) then begin iCavern:=iCavern + 1; sCavern:='NW'; break; end; ry:=ry-0.64; ly:=round(ry); end; //Check SW ry:=55; ly:=55; for lx:= 715 downto 670 do begin if (getcolor(lx,ly) <> 0) then begin iCavern:=iCavern + 1; sCavern:='SW'; break; end; ry:=ry-0.92; ly:=round(ry); end; //Check SE ry:=55; ly:=55; for lx:= 580 to 625 do begin if (getcolor(lx,ly) <> 0) then begin iCavern:=iCavern + 1; sCavern:='SE'; break; end; ry:=ry-0.92; ly:=round(ry); end; //Check NE ry:=138; ly:=138; for lx:= 625 downto 584 do begin if (getcolor(lx,ly) <> 0) then begin iCavern:=iCavern + 1; sCavern:='NE'; break; end; ry:=ry-0.64; ly:=round(ry); end; if (sCavern = '') or (iCavern <> 1) then begin // OK, this is a sticky situation. There's only a few spots // on the minimap where we can't figure out which cavern we're in. // So... we'll move until we find a better spot and hope we // don't get a stack overflow error. I'm sure there's a better // way to handle this, but it's not worth the time to figure out // since I've only had this section of code fire twice in over // 300 runs. repeat if RunningCommentary then writeln('Me no find what cavern me in.'); sCavern := ''; GetOnTheMap(ix,iy); GoToEss(ix,iy); MineTheEss(sCavern,ix,iy); until (sCavern <> '') end; if Runningcommentary then writeln('Found cavern - '+sCavern+'!'); end; {FindCavern} procedure FindPortal(var portalx, portaly : integer; var bPortalFound:boolean); // // OK, here's one stright from the textbook. // The portal is a "pulsating" object, meaning that the screen color // needs to change constantly. Let's just do a quick comparison of // two matrices and see where there's a difference. We'll probably // catch some of the "stars" circling the ess deposits, and any other // miner and movement that's around, but I've found it's usually no // more than ten comparisons (The most I've had was 22 with eight // other miners going - still an acceptable number.) // // The "squares" are 30 pixels high and wide, so checking every // 15th pixel will hit a square that is pulasting at least once. var lx,ly, t:integer; matrixA, matrixB:arx; begin wait(3000+random(2000)); // make sure we're not moving for lx:=1 to 34 do begin for ly:=1 to 21 do begin matrixA[lx][ly]:=GetColor(lx*15,ly*15); end; end; wait(250); for lx:=1 to 34 do begin for ly:=1 to 21 do begin matrixB[lx][ly]:=GetColor(lx*15,ly*15); end; end; t:=0; for lx:=1 to 34 do begin for ly:=1 to 21 do begin if (matrixA[lx][ly] <> matrixB[lx][ly]) then begin t:=t+1; movemousesmooth((lx*15),(ly*15)); wait(500+random(500)); if (istextat2(9,9,'Use',100)) then begin if RunningCommentary then if t = 1 then writeln('Found portal in '+inttostr(t)+' try!') else writeln('Found portal in '+inttostr(t)+' tries!'); bPortalFound:=true; portalx:=lx*15; portaly:=ly*15; exit; end; end end; end; end; // // the Find(North/South/East/West) functions do like they say - // find the location of the cavern wall in the stated direction. // From that we can guesstimate where the portal out should be. // function FindNorth:integer; var i,j: integer; begin for j:=40 to 115 do begin for i:=590 to 700 do begin if (getcolor(i,j) <> 0) then begin result:=j; exit; end; end; end; result:=40; end; function FindSouth:integer; var i,j: integer; begin for j:=115 downto 40 do begin for i:=590 to 700 do begin if (getcolor(i,j) <> 0) then begin result:=j; exit; end; end; end; result:=115; end; function FindWest:integer; var i,j: integer; begin for i:=590 to 700 do begin for j:=40 to 115 do begin if (getcolor(i,j) <> 0) then begin result:=i; exit; end; end; end; result:=590; end; function FindEast:integer; var i,j: integer; begin for i:=700 downto 590 do begin for j:=40 to 115 do begin if (getcolor(i,j) <> 0) then begin result:=i; exit; end; end; end; result:=700; end; procedure MoveToPortalArea(sCavern:string); var ix, iy : integer; begin if RunningCommentary then writeln('looking for portal'); if sCavern = 'NW' then begin ix:=FindWest+10; iy:=FindNorth+30; if getcolor(ix,iy) <> 0 then begin ClickMouseHuman(ix,iy,1,1,true); mapflag; end else begin iy:=40; repeat iy:=iy+5; until (getcolor(ix,iy) <> 0) or (iy>115); ClickMouseHuman(ix,iy,1,1,true); mapflag; end; end else if sCavern = 'SE' then begin ix:=FindEast-15; iy:=FindSouth-25; if getcolor(ix,iy) <> 0 then begin Clickmousehuman(ix,iy,1,1,true); mapflag; end else begin iy:=120; repeat iy:=iy-5; until (getcolor(ix,iy) <> 0); clickmousehuman(ix,iy,1,1,true); mapflag; end; end else if sCavern = 'NE' then begin ix:=findeast-10; iy:=FindNorth+20; if getcolor(ix,iy) <> 0 then begin clickmousehuman(ix,iy,1,1,true); mapflag; end else begin iy:=40; repeat iy:=iy+5; until (getcolor(ix,iy) <> 0); clickmousehuman(ix,iy,1,1,true); mapflag; end; end else if sCavern = 'SW' then begin ix:=findwest+25; iy:=findsouth-20; if getcolor(ix,iy) <> 0 then begin clickmousehuman(ix,iy,1,1,true); mapflag; end else begin ix:=590; repeat ix:=ix+5; until (getcolor(ix,iy) <> 0); clickmousehuman(ix,iy,1,1,true); mapflag; end; end else begin if RunningCommentary then Writeln('Invalid direction sent to GoToPortal!'); logout('Invalid direction sent to GoToPortal!'); StopTheScript:=True; TerminateScript; exit; end; end; procedure LeaveTheCavern(sCavern:string); var iTries:integer; // Uncomment the following variable line to keep looking for a portal // rather than just giving up and going home. // ix, iy:integer; begin if RunningCommentary then writeln('Leaving cavern'); iTries:=1; repeat MoveToPortalArea(sCavern); FindPortal(portalx,portaly,bPortalFound); if bportalfound then begin if (istextat2(9,9,'Use',100)) then ClickMouseHuman(portalx,portaly,1,1,true) else bportalfound:=false; end; iTries:=iTries+1; until (bPortalFound) or (iTries > 3); wait(1000+random(1000)); if (bPortalFound) then begin if (istextat2(9,9,'Use',100)) then ClickMouseHuman(portalx,portaly,1,1,true); wait(2000+random(2000)); end else begin if RunningCommentary then Writeln('I canna find a portal, Keptin'); // Uncomment the following 5 lines ("sCavern:=''" to "LeaveTheCavern") // in order to keep looking for a portal out. Also uncomment the // variables ix and iy at the beginning of this procedure. //sCavern := ''; //GetOnTheMap(ix,iy); //GoToEss(ix,iy); //MineTheEss(sCavern,ix,iy); //LeaveTheCavern(sCavern); // If you uncommented the above 5 lines, you sould comment out // the following 4 lines of code. Logout('No Find Portal in LeaveTheCavern!'); StopTheScript:=True; terminatescript; exit; end; end; //////////////////////////////////////////// // Here ends the ess stuff by habiabedabi // //////////////////////////////////////////// //////////////////////////////////////////////////// // The following are copied from library.txt so I // // didn't have to include the whole darn thing. // // Credit: PplSuQBallz // //////////////////////////////////////////////////// Procedure GameTab(tabnumber:integer); begin case tabnumber of 1:if(GetColor(559,179)=5531511)then Mouse(539,179,29,32,true); 2:if(GetColor(591,176)=5531511)then Mouse(568,168,29,37,true); 3:if(GetColor(618,176)=5531511)then Mouse(597,168,28,37,true); 4:if(GetColor(636,174)=5531511)then Mouse(625,168,31,35,true); 5:if(GetColor(682,174)=5531511)then Mouse(666,168,28,37,true); 6:if(GetColor(683,175)=5531511)then Mouse(694,168,27,37,true); 7:if(GetColor(734,177)=5531511)then Mouse(721,169,37,36,true); end; end; function InventoryCount:integer; var used,i,e:integer; begin e:=0; i:=0; used:=0; GameTab(4); while(i < 6) do begin if (i = 5) and (e < 8) then begin i:= 0; e:= e + 1; end; if (FindColor(x,y,65536,(571+47*i),(215+36*e),(601+47*i),(245+36*e))) then used:=used+1; i:= i + 1; end; result:=used; end; /////////////////////////////////// // End of stuff from library.txt // /////////////////////////////////// procedure MineTheEss(var sCavern:string; ix, iy : integer); // // Modified slightly from Ch33p's ess miner; why reinvent the wheel when // you can leech good code (is it really leeching if you give credit?) // var ic:integer; begin mouse(ix,iy,1,1,true); CheckRandoms; FindCavern(ix, iy, sCavern); repeat Ic:=Ic+1 If(Ic)=200 then begin CheckRandoms; If(istextat2(9,9,'Mine',100)) then begin Getmousepos(ix,iy); Mouse(ix,iy,1,1,true); end else wait(random(10)+5); Ic:=0 end else wait(random(10)+5); Until(inventorycount=28); end; {MineTheEss} Procedure LoadBMPs; // // Straight from Joker's ess miner - use what works // begin tele := BitmapFromString(35, 5, 'FFFFFFFFFFFF0000005A52425A5242FFFFFFFFFFFF0000005A5242' + 'FFFFFFFFFFFF0000005A5242FFFFFFFFFFFF0000005A5242FFFFFF' + 'FFFFFF0000005A5242FFFFFFFFFFFF0000005A5242FFFFFFFFFFFF' + '0000005A5242FFFFFFFFFFFF0000005A5242FFFFFFFFFFFFFFFFFF' + 'FFFFFF0000005A52425A5242FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF' + '0000000000005A5242FFFFFFFFFFFF0000005A5242FFFFFFFFFFFF' + 'FFFFFFFFFFFFFFFFFF0000000000005A5242FFFFFFFFFFFF000000' + '5A5242FFFFFFFFFFFF0000005A5242FFFFFFFFFFFFFFFFFFFFFFFF' + '0000005A52425A5242FFFFFFFFFFFF000000000000000000000000' + '5A52425A5242FFFFFFFFFFFF0000005A5242FFFFFFFFFFFF000000' + '0000000000000000005A52425A5242FFFFFFFFFFFF0000005A5242' + 'FFFFFFFFFFFF0000005A5242FFFFFFFFFFFFFFFFFFFFFFFF000000' + '5A52425A52425A5242FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5A5242' + '5A5242FFFFFFFFFFFF0000005A52425A5242FFFFFFFFFFFFFFFFFF' + 'FFFFFFFFFFFF5A52425A5242FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF' + '0000000000005A52425A5242FFFFFF5A52420000000000005A5242' + '5A52425A52425A52420000000000000000000000000000005A5242' + '5A52420000000000005A52425A52425A5242000000000000000000' + '0000000000005A5242FFFFFFFFFFFF000000000000000000000000' + '5A52425A52425A52425A5242'); teley := BitmapFromString(31, 5, '5A5242FFFF00FFFF000000005A52425A5242FFFF00FFFF00000000' + '5A5242FFFF00FFFF000000005A5242FFFF00FFFF000000005A5242' + 'FFFF00FFFF000000005A5242FFFF00FFFF000000005A5242FFFF00' + 'FFFF000000005A5242FFFF005A5242FFFF00FFFF000000005A5242' + '5A5242FFFF00FFFF00FFFF00FFFF00FFFF000000000000005A5242' + 'FFFF00FFFF000000005A5242FFFF00FFFF00FFFF00FFFF00FFFF00' + '0000000000005A5242FFFF00FFFF000000005A5242FFFF005A5242' + 'FFFF00FFFF000000005A52425A5242FFFF00FFFF00000000000000' + '0000000000005A52425A5242FFFF00FFFF000000005A5242FFFF00' + 'FFFF000000000000000000000000005A52425A5242FFFF00FFFF00' + '0000005A5242FFFF005A5242FFFF00FFFF000000005A52425A5242' + '5A5242FFFF00FFFF00FFFF00FFFF00FFFF005A52425A5242FFFF00' + 'FFFF000000005A52425A5242FFFF00FFFF00FFFF00FFFF00FFFF00' + '5A52425A5242FFFF00FFFF00FFFF00FFFF00FFFF005A52425A5242' + '0000000000005A52425A52425A52425A5242000000000000000000' + '0000000000005A52425A52420000000000005A52425A52425A5242' + '0000000000000000000000000000005A5242FFFF00FFFF00000000' + '000000000000'); end; {LoadBMPs} // If Uberwait throws an 'Unknown identifier' error, you have // a different copy of OSi. (There seems to be 2 versions of // OSi.txt v4.011 floating around...?) // // Uncomment the following to solve the problem. // // procedure UberWait(wai:integer); {Created by GenoDemoN} // var waii:longint; // begin // waii:=wai+random(wai/2)+getsystemtime; // repeat // wait(random(10)); // until(getsystemtime>waii); // end; // procedure TeleToEss; // // From Joker's ess miner. // // This program's about the mining; Joker's got good code to // get us to the ess and thus do the mining. // var lx,ly:integer; begin if RunningCommentary then Writeln('Finding Aubry...') repeat if(FindColorSpiralTolerance(lx,ly,Aubry,5,5,517,338,5))then MMouse(lx,ly,4,4) Uberwait(250+random(250)) //see 30 lines up if this throws an error. if(IsTextAt2(9,9,'Talk',100))then begin if RunningCommentary then Writeln('Found Aubry... Teleporting...') GetMousePos(lx,ly) Uberwait(100+random(50)) Mouse(lx,ly,0,0,false) uberwait(100+random(50)) end; until(findbitmapspiraltolerance(tele,lx,ly,5,5,515,340,25) or (findbitmapspiraltolerance(teley,lx,ly,5,5,515,340,25))) if(findbitmapspiraltolerance(tele,lx,ly,5,5,515,340,25) or (findbitmapspiraltolerance(teley,lx,ly,5,5,515,340,25)))then begin uberwait(250+random(50)) Mouse(lx,ly,3,3,true) end; wait(5000+random(3000)); {Let the tele finish before proceding} end; {TeleToEss} procedure GoToAubury; begin Writeln('Walkin To Aubry...') Writeln('Finding Bank Symbol..') repeat wait(100+random(25)) until(FindColorSpiralTolerance(x,y,BankSymbol,546,0,736,170,25)) if(FindColorSpiralTolerance(x,y,BankSymbol,546,0,736,170,25))then begin SetRun(true) Mouse(684,99,1,1,true) wait(500+random(25)) Mouse(711,482,1,1,true) wait(3000+random(25)) if(FindColorspiraltolerancE(x,y,1579123,561,249,597,284,5))then begin wait(14000+random(2000)) end else begin wait(8000+random(2000)) end; Mouse(616,140,1,1,true) wait(8000+random(1000)) repeat wait(250+random(200)) until(FindColoredAreaTolerance(x,y,RuneFloor,546,0,737,170,3,15)) if(FindColoredAreaTolerance(x,y,RuneFloor,546,0,737,170,3,15))then begin Mouse(x,y,2,2,true) wait(4000+random(2000)) end; end; end; procedure GoToBank; begin setrun(true) Mouse(670,60,4,4,true) wait(9000+random(2000)) repeat loginifneeded; wait(250+random(250)) until(FindColorSpiralTolerance(x,y,BankSymbol,546,0,736,170,25)) if(FindColorSpiralTolerance(x,y,BankSymbol,546,0,736,170,25))then begin Mouse(x,y,5,5,true) MapFlag; end; end; procedure DepositEss; begin Writeln('Looking for bank...') repeat UberWait(2000+random(200)) if(FindColorSpiralTolerance(x,y,BankBooth,5,5,515,340,10))then begin Writeln('Opening Bank...') MMouse(x,y,2,2) if(IsTextAt2(9,9,'Use Bank',100))then begin Mouse(x,y,4,4,False) UberWait(200+random(200)) end; end; end; begin {The Main Event} SetupOSi; LoadBMPs; StopTheScript := False; IAmMining := False iTrips := 0; ixCoord := 0; iyCoord := 0; repeat sCavern := ''; iterations := 0; GoToAubury; TeleToEss; GoToEss (ixCoord, iyCoord); IAmMining := True; MineTheEss(sCavern, ixCoord, iyCoord); LeaveTheCavern(sCavern); IAmMining := False; GoToBank; DepositEss; iTrips := iTrips + 1; Writeln('For lack of a better report: finished trip number ' +inttostr(iTrips)); until stopthescript;//(iTrips > 5) or (StopTheScript); if StopTheScript then logout('Something went horribly wrong. Logging out'); end. program New; begin end.