///////////////////////////////////////////////////////////////////////////////////////////////////// //--------------------------------------------------------------------------------------------------- // MiningMyule MAcro // Somewhat based on Mining.mac and other Mining Macros such as // Hontu's, as well as NowhereMan's Mining Macro // // It should be started in a safe minefield. // It will not do combat, so it must be monitored. // Put one of each type of ore that you want to collect in your hold. This will ensure that // if your hold fills up with ore, you will still be able to pick up those desired ores. // For optimum mining, use a Lazarus, Cat's Paw and Golden Tooth (or similar). // // THIS MACRO REQUIRES EnBObjecTLib.Mac to be included. You may need to change the // Include directive at the end of this file to point to the full path to your ObjecTLib.Mac // //-------------------------------------------------------------------------------------------------------- //------------------------------------------------------------------------------------------------------// ///////////////////////////////////////////////////////////////////////////////////////////////////// Constants Me=me // player name, for error messages / diagnostics Runs=100 // Number of roids to mine before checking to switch ore fields CheckCombat=10 // How many loops to make before checking for attacking mobs WarpInitDelay=5000 // Delay after hitting warp to Asteroid -- including screen shake time. MiningDelay=30 // number of 250ms increments to wait for Prospecting to finish TractorDelay=6000 // time to wait for tractor to pull in ores MouseDelay=100 // How long to wait to click anything after moving mouse there OreScanDelay=100 // how long to linger over empty ore cells. NextRoidDelay=300 // time to wait after selecting next Roid, while in scan for roids function MinEnergy=95 // percent of energy bar to initiate mining EnergyWait=3000 // ms to wait for energy to recharge ToolTipPopUp=300 // time for a tooltip to pop up, varies with opeions->interface setting // 300 corresponds to minimum FindRoidLoopMax=10 // maximum # of roids to look throug before failing FindARoid function. ScanRoids=1 // 2= Left click in target window while scanning through,1=whilewarping there WarpingDelay=2000 // typical time to check to see if warping is on track. ProspectIconDelay=1100 RoidScanSkip=2 // random number of roides to skip forward, in case we are competing with // miners running similar macro... DropTract=0 // set this to 1 and we try to drop tractor on mined ores by quickly starting // and stopping tractor. Provides for trade powerlevelling if we have a grouped // and formed escort running something like LootScavenger.mac // roids to see what ores are there. mostly for attended use MaxRoidSearch=20 // maximum number of targets to search through for a roid // if MineRoids is set to > 1, we move to them, open them, and then // move on, to encourage fast despawning of unwanted resources. MineRoids=0 // Mine Rock Asteroids? MineHydros=0 // Mine Hydrocarbon roids? MineHulks=0 // Mine Hulks? MineClouds=1 // Mine Gas Clouds MineCrystals=0 // Mine Crystalline ASteroids MinRoidLvl=0 // Mine roids of this level or higher. If < 1, ignore roid level MaxRoidLvl=0 // Mine roids of this level or lower. If < 1, Ignore Max Roid Level MinOreLvl=-8 // Mine lvl 1 roids? MaxOreLvl=-9 // Mine ores of this level or lower CheckOreLevel=1 // Check levels of ores before mining (not yet implemented) CheckRoidLevel=0 // Check levels of roids OreFieldMin=7 // which is the first ore field we go through (1-8) OreFieldMax=8 // which is the highest ore field we may mine at (1-8) OreFieldPicked=-1 // which ore field we start at - 1 // These ar ethe ore field navs in order // 1 GP-X30 Roids 6 // 2 Gate to Carpenter Roids 6 // 3 Gate to Slayton Roids 6 // 4 GP-X21 Roids 6-7 // 5 GP-X18 Roids 7-8 // 6 Glenn 1 Roids7-8 // 7 GP-X88 Gases 8-9 // 8 GP-X84 Gases 8-9 Debug=1 // do some mouse movements for debugging DbDelay=2000 // debugging delays //Below are scratch variables used in functions to store stuff in. //defined here because ACTool insists on it. //and to document, and to in case actool needs them pre defined. OreX=0 OreY=0 Y=0 X=0 R=0 DoWait=0=0 GreenPix=0 EnergyOK=0 FoundARoid=0 OrePos=0 Col=0 RoidSearchCount=0 MinedOut=0 MinEnergyBarX=0 PixY=0 Prospecting=0 GetRoidLvl=0 RoidLvl=0 ThereYet=0 Warps=0 LootWindowOpen=0 I=0 // loop/scratch variable J=0 // loop/scratch variable P=0 // loop/scratch variable End // // Main run starts here // SetActiveWindow Earth & Beyond CommandDelay 250 Delay 2000 Keys {HOME} Delay 200 OBJVAR 10 call ComputeStuff // call BuffUp // Procedure to get ready to start mining // Individual Function testing // call WarpToRoid // call SelectARoid // stop // More function testing -- this block takes the tour of Glenn mining sectors (* Loop 20 call WarpToOreField end call WarpToF7 stop *) loop 100000 call DoMining end stop // we're done // derive all computed variables procedure ComputeStuff SetConst GetRoidLvl=0 if $MinRoidLvl>0 SetConst GetRoidLvl=1 end if $MinRoidLvl>0 SetConst GetRoidLvl=1 end end // Mining window is open and $OreX,$OreY stores screen position // of an ore slot that might be occupied with an ore to pull // Check if slot is filled, if so, click on it to grab it, // // if we run out of energy while pulling, wait until refilled to // continue pulling ores. // Then do any post mining procedure. // // Set Value of MinedOut to shoe our status // 1 = pulled ore out of this spot // 0 = didn't pull ore out (yet) // -1 = minging window gone (check for pop-roid/popmob!) // 2 = could not pull ore out (window still open) possibly ore to high a level! // Procedure MineOre SetConst MinedOut=0 if $Debug=1 TimeStamp MineOre: Mining Ore from $OreX, $OreY //Compute X = $OreX+15 //Compute Y = $OreY+15 //MousePos $X, $Y // Note that this is the icon we're checking Delay $MouseDelay end while $MinedOut=0 call CheckLootWindow // check to see if the loot window is still open if $LootWindowOpen=0 TimeStamp MineOre -- exiting due to Loot Window Closed SetConst MinedOut=-1 exit // leave this procedure end //MiningCloseBox // See if we have the energy to mine, if not, wait till we do call CheckEnergy // See if we have enough energy to mine // Make sure mouse pointer icon is out of the center of the ore cell or it will break the IsObject // test IsObject EmptyOre at $OreX, $OreY // Empty ore in set spot SetConst MinedOut=1 if $Debug=1 TimeStamp MineOre: Empty Ore Cell at $OreX,$OreY // MousePos $OreX,$OreY // comment this out when empty slot scan bores you... // Delay $OreScanDelay end Else // EmptyOre call Prospect End // IsObject EmptyOre end // while $MinedOut=0 if $Debug > 0 TimeSTamp MineOre -- exiting ( $MinedOut ) end End //MineOre Procedure // ocuppied ore cell at $OreX,$OreY // click on ore to pull it out // wait for appropriate delays // Return an appropriate value into MinedOut Procedure Prospect Compute X=$OreX + 5 Compute Y=$OreY + 5 MousePos $X, $Y // move to the ore... Delay $MouseDelay // And see that it has checked the various slots LeftClick // start mining SetConst Prospecting=1 Compute X=$OreX+25 Compute Y=$OreY+25 MousePos $X,$Y Delay $MouseDelay // Look for Green Prospect Activated in status window? IsObject ProspectActivated at 256,85 SetConst Prospecting=2 // we definitely could mine if $Debug>1 TimeStamp MineOre: Noticed "Prospecting activated message" end else // Did not see the 'Prospecting // couple of things could have happened: // hold full // insufficent energy (should skip this ore) // tractor beam still in use (just wait) // IsObject YouText at 257,86 // We either got 'you dont have enough energy' message // which suggests the roid is too high a level ( already waited to recharge) // or we got a 'your hold is full' message. // -- not sure how to handle a 'your tractor beam is still in use' message SetConst Prospecting=-1 SetConst MinedOut=2 if $Debug=1 TimeStamp MineOre: 'You...' Error message in prospect end //debug end // YouText end // isObject ProspectActivated if $Prospecting>0 Delay 500 // give the prospecting a moment to start up... Loop $MiningDelay IsObject Prospected at 282,83 call DropTractor // check if we want to drop tractor, and do so if we do break else Delay 250 // wait a short while end end Delay $TractorDelay end call PostProspect // do any post mining functions? end ///////////////////////////////////////////////////////////// // Check if we have enough energy to mine. // if not, just wait for a recharge, or alternatively // if set, activate some recharge device(s) Procedure CheckEnergy SetConst EnergyOK=0 While $EnergyOK=0 // could do this with a object instead but... // can't trust checking just one pixel either, due to // moving 'sparkles' in empty energy bar // SetConst GreenPix=0 Compute MinEnergyBarX = ($MinEnergy * ($EnergyBarMaxX - $EnergyBarMinX))/100 + $EnergyBarMinX Compute PixY = $EnergyBarY +1 IsGreen $MinEnergyBarX, $pixY inc $GreenPix end Compute PixY = $EnergyBarY+2 IsGreen $MinEnergyBarX, $pixY inc $GreenPix end Compute PixY = $EnergyBarY+3 IsGreen $MinEnergyBarX, $pixY inc $GreenPix end if $GreenPix > 2 SetConst EnergyOK=1 else // recharge commands. keys 4 // put your recharge device in slot 4 // if $Debug=1 TimeStamp CheckEnergy: Waiting for recharge to $MinEnergy percent. end Compute Y = $EnergyBarY + 8 // so mouse pos will be below min point. Compute X= $EnergyBarMaxX + 8 MousePos $X, $Y Delay $EnergyWait end end end // Actions to perform after every ore/resource pulled from a roid. Procedure PostProspect // Keys 4 // Put your martyr/chlorosynthesis/energy boost device in slot 4 End // Procedure BuffUp // Initial startup buffs // Keys ` // target self // Delay 500 // wait for game to synchronize // Keys 6 // activate hotkey-- should be buffUp skill // Delay 6000 // wait for it to activate // Keys x // target nearest asteroid end Procedure KillPopMob // //TODO: check if it outclasses us before engaging. might be // better to run!! // // Some nasty is out there, fight it as best we can keys e // target enemy keys [space] // follow it if close keys 3 // fire off shield leech keys f Delay 20000 //it should be dead by now // better procedure: while (critter still alive) keep following // and/or warp to it. // check if critter is still alive, keep following/shooting // check for object (critter health / energy bar in targ screen // end procedure SelectARoid // //Find an astroid target to pull stuff out of. //apply filter for types of roids we want to grab. // SetConst FoundARoid=0 SetConst RoidSearchCount=0 if $Debug>0 TimeStamp SelectARoid starting end // If we have a roid already targeted we might as well mine it! (* Commented out because we test first if the roid is OK ISOBJECT MiningNear at 980, 506 SetConst FoundARoid=1 if $Debug>0 TimeStamp SelectARoid: already had a roid selected end end *) // Scan over targets (starting with currently targeted // to see if it meets our mining criteria while $FoundARoid=0 // Check for Tech Level text, which all minables will have IsObject TechText at 862,719 if $ScanRoids = 2 MousePos 980,600 Delay $MouseDelay Leftclick delay 500 end if $Debug=1 TimeStamp SelectARoid -- FoundRoid Tech Level Text end if $GetRoidLvl=1 call FigureOutRoidLevel if $Debug=1 TimeStamp SelectARoid: Roid level is $RoidLvl end if $RoidLvl = 0 TimeStamp FigureOutRoidLevel: Could not determine roid level else if $RoidLvl < $MinRoidLvl continue end if $RoidLvl > $MaxRoidLvl continue end end end if $MineRoids>0 ISOBJECT AsteroidText at 833,552 SetConst FoundARoid=$MineRoids if $Debug=1 TimeStamp SelectARoid: Asteroid end exit // leave this procedure, we found a roid! end end if $MineHydros>0 ISOBJECT HydroRoid at 833,552 SetConst FoundARoid=$MineHydros if $Debug=1 TimeStamp SelectARoid: Hydrocarbon end exit // leave this procedure, we found a roid! end end if $MineClouds>0 ISOBJECT GasCloud at 834,553 SetConst FoundARoid=$MineClouds if $Debug=1 TimeStamp SelectARoid: GasCloud end exit // leave this procedure, we found a roid! end end if $MineCrystals>0 ISOBJECT CrystalRoid at 834,553 SetConst FoundARoid=$MineCrystals if $Debug=1 TimeStamp SelectARoid: Crystalline Asteroid end exit // leave this procedure, we found a roid! end end if $MineHulks>0 ISOBJECT RuinedHulk at 834, 553 SetConst FoundARoid=$MineHulks if $Debug=1 TimeStamp SelectARoid: Hulk end exit // found something to mine, exit this procedure end end (* if $Debug>0 TimeStamp SelectARoid: Roid not of an interesting type Delay $DbDelay end *) // should crap out that is not a roid. else if $Debug>1 TimeStamp SelectARoid -- Failed to find TechText Delay $DbDelay end end // IsObject TechText keys d // pick next of selected type (should be a roid!) if $RoidScanSkip > 0 compute R = int( Rnd( $RoidScanSkip)) if $Debug > 1 TimeStamp ScanRoids -- skip forward $r end loop $r keys d delay $MouseDelay end end delay $NextRoidDelay if $ScanRoids = 2 MousePos 980,600 Delay $MouseDelay Leftclick Delay 500 end Delay $NextRoidDelay // time to wait after selecting next Roid inc $RoidSearchCount if $RoidSearchCount > $MaxRoidSearch if $Debug>0 TimeStamp SelectARoid -- exceed roid search count $RoidSearchCount > $MaxRoidSearch end SetConst FoundARoid=-1 // default anyway? we could not find a roid! exit end end // while $FoundARoid=0 end // procedure SelectARoid // We have an astroid targetd // there should be a grey tech level number Procedure FigureOutRoidLevel SetConst RoidLvl=0 // initialize it IsObject RoidTL9 at 947,719 SetConst RoidLvl=9 exit end IsObject RoidTL8 at 947,719 SetConst RoidLvl=8 exit end IsObject RoidTL8 at 947,719 SetConst RoidLvl=8 exit end IsObject RoidTL7 at 947,719 SetConst RoidLvl=7 exit end IsObject RoidTL6 at 947,719 SetConst RoidLvl=6 exit end IsObject RoidTL5 at 947,719 SetConst RoidLvl=5 exit end IsObject RoidTL4 at 947,719 SetConst RoidLvl=4 exit end IsObject RoidTL3 at 947,719 SetConst RoidLvl=3 exit end IsObject RoidTL2 at 947,719 SetConst RoidLvl=2 exit end IsObject RoidTL1 at 947,719 SetConst RoidLvl=1 exit end IsObject RoidTL6 at 947,719 SetConst RoidLvl=6 exit end end Procedure MineARoid if $Debug>0 TimeStamp MineARoid Starting end call SelectARoid if $FoundARoid>0 call WarpToRoid if $FoundARoid > 0 // WarpToRoid might have reset this on the way there, if it disappeared call EmptyRoid end end if $Debug=1 TimeStamp MineARoid Ending end end //////////////////////////////////////// // A roid is targeted, warp to it // and once there open mining window. // (due to hotly contested ore fields, speed of attempt to open window is important!) //////////////////////////////////////// procedure WarpToRoid SetConst ThereYet=15 // Need to change this // initiate warp // let warping run a while. // check for MiningNear // if true, check for speed 0 // if true, click on mining icon // exit // check for MiningFar // check for speed > 0 // (still warping, delay) // no miningFar and No MiningNear means // lost target, crap out of this function // (hit q to stop warp then drop , if warping or speed !=0) // if $Debug>0 TimeStamp WarpToRoid starting end IsObject MiningNear at 960,506 call OpenMiningWindow if $Debug>0 TimeStamp WarpToRoid -- MiningNear detected, done here. end exit // already there, drop out. end if $ScanRoids = 1 // we will show what is in the roid as we warp there if $Debug > 0 TimeStamp WarpToRoid -- left click to see what is in ore end MousePos 980,600 Delay $MouseDelay Leftclick end Delay $ProspectIconDelay // need enough time for miningnear/miningfar to show up. IsObject MiningFar at 980,506 else Delay 100 // short delay for distance text IsObject DistText at 818,735 else // Hmm we seem to have no target now. Better drop out of this function if $Debug>0 TimeStamp WarpToRoid -- No target Distance, ergo no target. exiting procedure end SetConst FoundARoid=0 SetConst ThereYet=-1 exit end Delay 1500 // Wait for warp-to icon to show up end SetConst Warps=0 while $ThereYet>0 IsObject SpeedZero at 465,683 ISOBJECT MiningFar at 980, 506 inc Warps if $Warps > 3 exit end Keys q Delay $WarpInitDelay if $Debug>0 TimeStamp WarpToRoid -- speed0+miningfar, initiating warp to target end else ISOBJECT MiningNear at 980, 506 call OpenMiningWindow SetConst ThereYet=1 if $Debug=1 TimeStamp WarpToRoid: Speed0+Miningnear= we are there end else if $Debug=1 TimeStamp WarpToRoid: Waiting for MingNear/Far Icon end IsObject DistText at 818,735 else // Hmm we seem to have no target now. Better drop out of this function if $Debug>0 TimeStamp WarpToRoid -- lost target, dropping out end SetConst FoundARoid=0 SetConst ThereYet=-1 keys q delay $MouseDelay // we hit q twice to make sure we drop warp keys q // if we were warping we stop, if we weren't we dont start Delay $WarpInitDelay // wait for warp to terminate exit end // IsObject DistText delay 1000 // we dont have miningFar or MiningNear, so maybe need to wait for it to appear end // IsObject MiningNear end // IsOjbec t MiningFar else // not speedZero, we are probably moving! Delay $WarpingDelay // probly should check here for target, and drop out of warp if we have none. IsObject DistText at 818,735 else IsObject SpeedZero at 465,683 // double check for lack of SpeedZero if $Debug > 0 TimeStamp WarpToRoid - NoDistance but SpeedZero, wth is going on here? end else if $Debug>0 TimeStamp WarpToRoid -- warping with no target, stopping! end keys q Delay WarpInitDelay SetConst ThereYet=-1 end end end // SpeedZero Dec $ThereYet // So we eventaully give up if we dont get there... end // while $ThereYet>0 if $ThereYet = 0 else isObject SpeedZero at 465,683 else // still warping and didn't get there, beter stop keys q Delay $WarpInitDelay if $Debug>0 TimeStamp WarpToRoid -- had to stop before we got there. end end end end Procedure OpenMiningWindow //IsObject MiningWindow at 990,208 call CheckLootWindow if $LootWindowOpen=0 if $Debug > 0 TimeStamp OpenMiningWindow: Opening end MousePos 987,512 // move mouse to mining icon Delay $MouseDelay // wait for it LeftClick // click on it MousePos 980,600 // move it outa the way Delay 1500 // wait for the window to open end end ////////////////////////////////////////////////////// // We are at a roid, with mining icon indicating // close enough to begin mining ////////////////////////////////////////////////////// procedure EmptyRoid if $Debug=1 TimeStamp EmptyRoid: Starting end SetConst OrePos=1 // we check 8 ore positions, // 1=top-left, 4=bottom-left, 8=bottom-right //click on mining Icon call CheckLootWindow if $LootWindowOpen=0 //IsObject MiningWindow at 990,208 // mining box is already open, dont click again! //else // click on the mining icon to open the window! call OpenMiningWindow end if $FoundARoid > 1 // FoundARoid>1 means we dont really want to mine this thing if $Debug=1 TimeStamp EmptyRoid: Just wanted to touch this Roid. moving on end SetConst OrePos = -1 //SetConst FoundARoid=-1 // this confuses other funtion that determines we are lost... keys d Delay $NextRoidDelay exit end if $LootWindowOpen=1 call EngageWarpRepos // will position us so we can drop tractor by warping if needed end while $OrePos < 9 // We check if mining window is open by looking for the // mining window close icon in upper right corner //IsObject MiningWindow at 990,208 call CheckLootWindow if $LootWindowOpen=1 if $Debug=1 TimeStamp EmptyRoid: MiningWindow still open. Pos $OrePos end // Figure out position OreX,OreY from which ore position // we are looking at. SetConst Col=$OrePos if $OrePos > 4 SetConst OreX = 968 Compute Col=$Col - 4 else SetConst OreX = 906 end Compute OreY = 188 + ( 62 * $Col ) if $Debug=1 TimeStamp EmptyRoid: Calling Mine Ore for $Orex, $OreY end call MineOre if $MinedOut > 0 inc $OrePos // Go to the next ore position if $debug>0 TimeStamp MineOre: MinedOut is $MinedOut, next pos is $OrePos end else if $MinedOut = 0 TimeStamp MineRoe -- MinedOut=0 so roid must be empty.(OrePos= $OrePos) SetConst OrePos =9 // force loop to end else TimeStamp MineOre returned MinedOut= $MinedOut on pos $OrePos exit // strange status from MineOre function end end else // closeBox if $Debug=1 TimeStamp EmptyRoid: MiningCloseBox gone. end SetConst OrePos=9 // Will Cause the loop to end end // CloseWindowButton open end //While OrePos > 0 if $Debug > 0 TimeStamp EmptyRoid done. end // Deselect it. keys d Delay $NextRoidDelay end //////////////////////////////////// // // The main activity loop, just mine roids // procedure DoMining if $Debug>0 TimeSTamp DoMining starting end // See if we started near an ore field keys x // start targeting resources call SelectARoid if $FoundARoid < 0 // not near an orefield, warp to it... call WarpToOreField keys x end loop $Runs call MineARoid call CheckIfOK end call WarpToOreField end Procedure CheckCombat // CheckCombat ISOBJECT NoDamage at 758, 685 else Delay 2000 ISOBJECT NoDamage at 758, 685 else Keys h // Look for a Hostile MOB Delay 1000 Keys f // Fire at the hostile MOB Delay 1000 Keydown {left} 9 sec // Keys ` // Select yourself // Delay 500 // Keys 2 // Buff with Environment shield // Delay 6000 // Keys 5 // Fold space (in case the mob is still alive) // Delay 4000 Keys x End // ISOBJECT NoDamage (2nd) End // ISOBJECT NoDamage (1st) End // Loop Runs // Since simple object checks seem to be difficult for this // I put it in a procedure. // Stores value 1 in LootWindowOpen if it thinks it is open // stores a 0 if not. // We call this LootLootWindow even though we are using it in a // mining context, since the windows are identical Procedure CheckLootWindow SetConst LootWindowOpen=0 // we assumme it is closed.. if $Debug=1 TimeStamp CheckLootWindow start end // Delay 100 // see if a Delay in here helps at all.. IsObject LootWindow at 990,208 //This is the easy test, but it mysteriously fails alot SetConst LootWindowOpen=1 if $Debug=1 TimeStamp CheckLootWindow: foundopen by LootWindow@990 end exit end isObject MiningWindowCloseBox at 983,203 SetConst LootWindowOpen=1 if $Debug=1 TimeStamp CheckLootWindow: foundopen by MiningWindowCloseBox@983 end exit end (* Generates false positives when mining blue gas clouds! // // Look for EmptyOre in the last 2 or 3 positions // since very rarely will we find a roid with all 8 positions filled // IsObject EmptyOre at 968,416 IsBlue 972,420 // this extra test is to try and cut back on false positives SetConst LootWindowOpen=1 if $Debug=1 TimeStamp CheckLootWindow: found open via EmptyOre at 968,416 end exit end end IsObject EmptyOre at 968,354 IsBlue 972,340 SetConst LootWindowOpen=1 if $Debug=1 TimeStamp CheckLootWindow: found open via EmptyOre at 968,354 end exit end end *) (* This code block never seemed to work enough to justify the cpu expense... // This is a bit more extreme, look for the damn object in the Icon by pixel SetConst P=0 // Pixel Count IsWhite 995,212 Inc $P end IsWhite 996,213 Inc $P end IsWhite 988,220 Inc $P end IsWhite 998,210 Inc $P end IsWhite 989,207 Inc $P end IsWhite 1003,205 inc $p end IsWhite 991,217 inc $p end if $Debug>0 TimeStamp CheckLootWindow: White Pixel count $p / 6 end IsBlue 1003,214 Inc $p end IsBlue 1003,213 inc $p end IsBlue 985,215 Inc $P end IsBlue 993,205 Inc $p end if $Debug>0 TimeStamp CheckLootWindow: Grey+blue Pixel count $p / 10 end IsBlack 994,208 Inc $p end IsBlack 1002,216 Inc $p end IsBlack 1002,210 Inc $p end IsBlack 992,206 inc $p end if $p > 7 if $Debug>0 TimeStamp CheckLootWindow -- open via pixel count: $p end SetConst LootWindowOpen=1 else if $Debug>0 TimeStamp CheckLootWindow -- Pixel Count $p inconclusive. end end *) // OK try this test from Montu's mining MAdness. // hover mouse over the close window, and then look for the tooltip to open // mousepos 995, 213 delay $ToolTipPopUp // wait for tooltip popup isobject miningwindow at 922, 194 SetConst LootWindowOpen=1 if $Debug=1 TimeStamp CheckLootWindow: found open by Montu's method (miningwindow@922) end MousePos 980,600 // *get the mouse out of the way* Delay $MouseDelay exit end if $Debug=1 TimeStamp CheckLootWindow -- no tests match, it must not be open after all end end // Check if we've been DESTROYED and need to jumpstart // or if we've gotten hopelessly LOST Procedure CheckIfOK Delay 100 // call CheckIncapacitated isObject DisbandGroup at 598, 350 // weird bug causes us to click on 'disband group' icon // occasionally. // Think this is due to 'lootwindow open' check succeeding when it shouldnt. // problem is if too amny disband group windwos stack up the game cant open // other windows // need to click no to get rid of it MousePos 570,420 Delay $MouseDelay Leftclick Delay $MouseDelay keys x // in case we accidentally targetd something in that space end if $FoundARoid < 0 // We were unable to find a roid, we're likely to be LOST // so pick an Orefield and WARP TO IT. call WarpToOreField end end procedure CheckIncapacitated IsObject TowText at 271,487 call JumpstartSelf // just continue on, or warp to base and return //call WarpToBase //call DockInBase //call ExitBase //call WarpToOreField end end // new code to check if lost // and warp to field procedure CheckLost if $FoundARoid>0 exit end // We weren't able to find a roid, so probbly are lost. // pick an a navpoint and warp to it. call WarpToOreField end procedure WarpToOreField call SelectOreField if $X > 0 call WarpToNav $X,$Y end keys x delay 500 end // Select an ore field, // store its nav coordinates into x,y procedure SelectOreField SetConst X=-1 SetConst Y=-1 // Pick ore field at random?? //Compute R = Int($OreFieldMin + Rnd ( $OreFieldMax - $OreFieldMin)) //SetConst OreFieldPicked=$R // or Cycle through them if $OreFieldPicked < $OreFieldMin SetConst OreFieldPicked =$OreFieldMin else Inc $OreFieldPicked if $OreFieldPicked > $OreFieldMax SetConst OreFieldPicked=$OreFieldMin end end SetConst R= $OreFieldPicked if $Debug > 0 TimeStamp SelectOreField -- picked field # $OreFieldPicked end if $R = 1 // This is GP-X30 in glenn, field of lvl 6 roids SetConst X=395 SetConst Y=430 exit end if $R = 2 // This is Near Carp gate in Glenn, lvl 5-6 roids SetConst X=361 SetConst Y=478 exit end if $R = 3 // This is Near Slayton gate in Glenn, lvl 5-6 roids SetConst X=349 SetConst Y=483 exit end if $R = 4 // This is GP-X21 in Glenn, lvl 5-6 roids SetConst X=318 SetConst Y=487 exit end if $R = 5 // This is asteroid GP-X18 in Glenn, lvl 7-8 roids SetConst X=280 SetConst Y=485 exit end if $R = 6 // This is nav Glenn 1 in Glenn, lvl 7-8 roids SetConst X=237 SetConst Y=471 exit end if $R = 7 // This is Asteroid GP-X88 in Glenn, lvl 8-9 gases SetConst X=211 SetConst Y=390 exit end if $R = 8 // This is Asteroid GP-X84 in Glenn, lvl 8-9 gases SetConst X=235 SetConst Y=375 exit end end // in order to use warp activation to drop tractor, target must be >1k distance away // so in this case we check if diatance is 0k, and if so back up until it is 1k or 2k procedure EngageWarpRepos if $DropTract = 0 // we only do this if we're backing off exit end IsObject DistText at 818,735 else TimeStamp EngateWarpRepos -- no DistText, dropping out. exit end IsObject Dist1x at 853,735 if $Debug > 1 TimeStamp EngageWarpRepos -- Dist1k, exiting end exit end IsObject Dist2x at 853,735 if $Debug > 1 TimeStamp EngageWarpRepos -- Dist2k, exiting end exit end IsObject Dist0x at 853,735 // too close, gotta reposition by backing off SetConst M=0 // to determine if we moved SetConst I=0 while $i < 10 IsObject Dist0x at 853,735 Inc $m // to note that we moved and thus must wait keydown z 1000 // back off for 1 sec else Delay 50 // very short dely to keep loop from spinning IsObject Dist1x at 853,735 SetConst I=100 // distance is ok, lets end this loop end end inc $i end if $I > 50 if $Debug > 1 TimeStamp EngageWarpRepos -- successfully repositioned to 1.X k end end if $M > 0 if $Debug > 1 TimeStamp EngageWarpRepos -- waiting to stop moving end Delay 2000 // wait to get back to zero speed end else if $Debug > 0 TimeStamp EngageWarpRepos -- could not figure out distance. end end end // end of EngageWarpRepos // DropTractor // we're at a distance where we could drop tractor // Wait for the 'Prospected' message, and then quickly // start & stop warp. // Then delay a while and return procedure DropTractor if $DropTract = 0 exit end Delay $MouseDelay keydown q 100 // Initiate warp delay 100 // wait for a moment but not long enuf for warp to start keydown q 100 // break off warp initiation delay 100 end // Warps to F7 Procedure WarpToF7 call WarpToNav 289,405 end // CheckJumpStart // check if we are dead, if so // attempt to jumpstart twice (if no hostiles in area?) // Failing that, tow, and then exit station. // Hopefully we are registered properly at the right station! Constants JumpStarts=0 // how many times we have jumpstarted successfully Incapacitations=0 // how many times we have been killed. // end procedure CheckJumpStart IsObject CallForATow at 100.100 end end //Include EnBObjectLib.mac // Include seems to need full path set. include F:\Documents and Settings\Max Power\My Documents\EBMacros\EnBObjectLib.mac // // The following macro library provides functions to deal with warping around the sector. // include F:\Documents and Settings\Max Power\My Documents\EBMacros\WarpNavLib.mac //include EnBObjectLib.mac //include WarpNavLib.mac //************************************************************************************************* // Stuff that should go in object lib //************************************************************************************************* // Prospected text, 73x15 // 282,83 corresponds to 4th line of text in chat window. Object Prospected // at 282, 83 //:Object Prospected // Test at coords 282, 83 253=41,3| 253=24,4|254=41,4| 253=2,5|254=3,5|254=4,5|254=5,5|253=10,5|254=11,5|254=12,5|253=18,5|254=19,5|254=20,5|253=23,5|255=24,5|253=25,5|253=29,5|254=30,5|254=31,5|253=37,5|254=38,5|254=39,5|254=41,5| 253=1,6|253=6,6|253=9,6|253=13,6|253=17,6|254=24,6|253=28,6|253=32,6|253=36,6|254=41,6| 254=1,7|254=6,7|254=9,7|253=14,7|254=17,7|254=24,7|254=28,7|253=33,7|254=36,7|254=41,7| 254=1,8|254=6,8|254=9,8|254=10,8|254=11,8|254=12,8|254=13,8|255=14,8|254=17,8|254=24,8|254=28,8|254=29,8|254=30,8|254=31,8|254=32,8|255=33,8|254=36,8|254=41,8| 254=1,9|254=6,9|254=9,9|254=17,9|254=24,9|254=28,9|254=36,9|254=41,9| 254=1,10|254=2,10|254=3,10|254=4,10|254=5,10|253=10,10|254=11,10|254=12,10|254=13,10|253=18,10|254=19,10|254=20,10|254=24,10|253=29,10|254=30,10|254=31,10|254=32,10|253=37,10|254=38,10|254=39,10|254=40,10| 254=1,11| 254=1,12| 254=1,13| //:End Object //:Object Prospected // Test at coords 282, 83 0=2,4|0=4,4|0=6,4|0=10,4|0=12,4|0=18,4|0=20,4|0=22,4|0=26,4|0=30,4|0=32,4|0=38,4|0=40,4| 0=0,6|0=8,6|0=16,6|0=22,6|0=26,6|0=34,6|0=40,6| 0=0,8|0=8,8|0=16,8|0=40,8| 0=0,10|0=8,10|0=16,10| 0=0,12| //:End Object End Object