begin
//
// For help using/configuring this bot, please refer to
http://www.blueeye-macro.com/viewtopic.php?f=269&t=885 //
// Note: Make sure to ALWAYS set the location of the "Coordinates Assistant" to the top left corner before starting the macro!
// The location of the dialog will be remembered the next time you start the game, so you just need to do this once
//
// USER CONFIGURATION START
//
// Key bindings: Set your key bindings in the lower left corner variables
// Example: To set a keybinding to the F1-Key, enter: {<F1>}
// Example: To set a keybinding to the numeric 1-key, enter: 1
//
// The filepath to your leveling paths file e.g. c:\leveling path.txt (See/share examples of this file at
http://www.blueeye-macro.com)
Variable.Set("LevelPath", "c:\Perfect World Path.txt")
// If you die this many times, the macro will automatically abort
Variable.Set("StopMacroIfDeadTimes", "10")
// Only run the macro for the following amount of minutes (How long does your armor and weapon durability last? (if you care))
Variable.Set("WarpToTownAndStopMacroAfterMinutes", "120")
// How often (in %) should a a single pre-attack spell be cast, before finishing off the monster with your primary attack (Good for a slowing spell)
Variable.Set("PreAttackPercentage", "90")
// How often (in %) should a human-like pause be inserted between monsters? (Makes you appear less bot-like)
Variable.Set("HumanPausePercentage", "5")
// At which percentage of your full HP / MP should meditation begin (Set HP to 0 if you dont want to use meditation for HP regen (if you have healing spell))
Variable.Set("MeditateAtHPPercentage", "40")
Variable.Set("MeditateAtMPPercentage", "30")
// Between each monster, use healing spell if your HP gets bellow this percentage
Variable.Set("UseHealingSpellAtHPPercentage", "85")
// If you have a healing spell, how long does it take to cast? (in ms. 1000 ms = 1 sec. 1500 ms = 1,5 sec etc.)
Variable.Set("HealingSpellCastTime", "1000")
// During fights, at which HP / MP percentage should potions be used
Variable.Set("UseHealthPotionAtHPPercentage", "35")
Variable.Set("UseManaPotionAtMPPercentage", "70")
//
// USER CONFIGURATION END
//
// Static configuration
Variable.Set("processName", "elementclient")
Variable.Set("windowName", "Element Client")
// Store memory addresses / window name in variables, to make it easier to update if the memory addresses change with a game update
Variable.Set("maxHPMemoryAddress", "elementclient.exe+65BFCC,20,4b4")
Variable.Set("maxMPMemoryAddress", "elementclient.exe+65BFCC,20,4b8")
Variable.Set("currentHPMemoryAddress", "elementclient.exe+65BFCC,20,474")
Variable.Set("currentMPMemoryAddress", "elementclient.exe+65BFCC,20,478")
Variable.Set("currentLevelMemoryAddress", "elementclient.exe+65BFCC,20,46c")
Variable.Set("currentLocationXMemoryAddress", "elementclient.exe+65bfcc,20,384,3c")
Variable.Set("currentLocationYMemoryAddress", "elementclient.exe+65bfcc,20,384,44")
Variable.Set("currentLocationHeightMemoryAddress", "elementclient.exe+65bfcc,20,384,40")
Variable.Set("hasTargetMemoryAddress", "elementclient.exe+65BFCC,20,1088,38")
Variable.Set("topMostDialogLocationXMemoryAddress", "elementclient.exe+0065BFCC,4,8,70,98")
Variable.Set("topMostDialogLocationYMemoryAddress", "elementclient.exe+0065BFCC,4,8,70,9c")
Variable.Set("deathDialogLocationXMemoryAddress", "elementclient.exe+0065BFCC,4,8,4a0,98")
Variable.Set("deathDialogLocationYMemoryAddress", "elementclient.exe+0065BFCC,4,8,4a0,9c")
Variable.Set("reachDestinationCheckBoxMemoryAddress", "elementclient.exe+65BFE4,270,2bc,1f0,119")
Variable.Set("windowActiveMemoryAddress", "elementclient.exe+65B90C,48c")
// Adjust variables
Variable.Set("deathCount", "0")
Variable.Set("killCount", "0")
Variable.Add (Math)("HealingSpellCastTime", "750")
// Convert minutes into milliseconds
Variable.Multiply (Math)("WarpToTownAndStopMacroAfterMinutes", "60000")
// Make sure the required key bindings have been set
Function.Execute("Check keybindings")
// Make sure the window doesnt freeze when it looses focus (to support playing with the game minimized and without focus)
Memory.Freeze value("{processName}", "{windowActiveMemoryAddress}", "4", "1")
// Make sure to reset targets when starting the bot by pressing escape
Window.Send press keys("{windowName}", "yes", "0", "{<esc>}")
Macro.Pause("750")
if Memory.Value is("{processName}", "{hasTargetMemoryAddress}", "1", "1")
begin
Window.Display message box("Please make sure you dont have an npc targeted when starting the Macro! the Macro will now exit", "no")
Macro.Abort()
end
// Activate our buffs before starting, and start the stop watches, keeping track of the buff durations
Function.Execute("Init buffs")
begin loop()
Function.Execute("Output status")
Function.Execute("Use potions")
Function.Execute("Ensure buffs are still active")
Function.Execute("Release corpse, heal and fly back if dead")
Function.Execute with timeout("Ensure within specified hunting ground", "300000")
Function.Execute("Output status")
Function.Execute("Release corpse, heal and fly back if dead")
Function.Execute("Perform healing if required")
Function.Execute("Output status")
Function.Execute with timeout("Get target", "2500")
if Function.Did not timeout("Get target")
begin
Function.Execute("Release corpse, heal and fly back if dead")
Function.Execute with timeout("Kill target", "60000")
Function.Execute("Perform healing if required")
if Function.Did timeout("Kill target")
begin
// If the target does not die within 1 minute, the monster probably cant get to us, so it cant die, select a new target
Window.Send press keys("{windowName}", "yes", "0", "{targetKey}")
Macro.Pause("250")
Function.Execute with timeout("Kill target", "60000")
Function.Execute("Perform healing if required")
end
end
Function.Execute with timeout("Get loot", "10000")
Function.Execute("Output status")
Function.Execute("Release corpse, heal and fly back if dead")
Function.Execute("Output status")
Function.Execute("Meditate if required")
Function.Execute("Simulate human pause")
if Macro.Execution time has exceeded("{WarpToTownAndStopMacroAfterMinutes}")
begin
Window.Send press keys("{windowName}", "yes", "0", "{<esc>}")
Macro.Pause("1000")
Window.Send press keys("{windowName}", "yes", "0", "{TownPortalKey}")
Macro.Pause("500")
Macro.Abort()
end
end
end
function("Simulate human pause")
if Random.Maybe("{HumanPausePercentage}")
begin
Variable.Set random number("pauseTimes", "5", "15")
begin loop("{pauseTimes}")
Macro.Pause("500")
// If we are attacked, abort human pause to be able to defend ourselves first
if Memory.Value is("{processName}", "{hasTargetMemoryAddress}", "1", "1")
begin
Function.Abort()
end
end
end
function
function("Use potions")
if Variable.Is not empty("HealthPotionKey")
begin
Function.Execute("Calculate current HP percentage")
if Variable.Is less than (Math)("currentHPpercentage", "{UseHealthPotionAtHPPercentage}")
begin
Window.Send press keys("{windowName}", "yes", "0", "{HealthPotionKey}")
end
end
if Variable.Is not empty("ManaPotionKey")
begin
Function.Execute("Calculate current MP percentage")
if Variable.Is less than (Math)("currentMPpercentage", "{UseManaPotionAtMPPercentage}")
begin
Window.Send press keys("{windowName}", "yes", "0", "{ManaPotionKey}")
end
end
function
function("Check keybindings")
if Variable.Is empty("AttackKey")
or
Variable.Is empty("LootKey")
or
Variable.Is empty("MeditateKey")
or
Variable.Is empty("TownPortalKey")
or
Variable.Is empty("TargetKey")
begin
Window.Display message box("Please 'Right click' --> 'Edit Macro' and make sure to specify key bindings for at least: Target, Attack, Loot, Town portal and Meditation", "no")
Macro.Abort()
end
function
function("Init buffs")
if Variable.Is not empty("Buff1Key")
and
Variable.Is not empty("Buff1Duration")
begin
Window.Send press keys("{windowName}", "yes", "0", "{Buff1Key}")
if Variable.Is less than (Math)("Buff1Duration", "1000")
begin
// Convert the duration from minutes to milliseconds
Variable.Evaluate (Math)("({Buff1Duration}*60)*1000", "Buff1Duration")
end
Macro.Restart stopwatch("Buff1Watch")
Macro.Pause("2000")
end
if Variable.Is not empty("Buff2Key")
and
Variable.Is not empty("Buff2Duration")
begin
Window.Send press keys("{windowName}", "yes", "0", "{Buff2Key}")
if Variable.Is less than (Math)("Buff2Duration", "1000")
begin
Variable.Evaluate (Math)("({Buff2Duration}*60)*1000", "Buff2Duration")
end
Macro.Restart stopwatch("Buff2Watch")
Macro.Pause("2000")
end
if Variable.Is not empty("Buff3Key")
and
Variable.Is not empty("Buff3Duration")
begin
Window.Send press keys("{windowName}", "yes", "0", "{Buff3Key}")
if Variable.Is less than (Math)("Buff3Duration", "1000")
begin
Variable.Evaluate (Math)("({Buff3Duration}*60)*1000", "Buff3Duration")
end
Macro.Restart stopwatch("Buff3Watch")
Macro.Pause("2000")
end
if Variable.Is not empty("Buff4Key")
and
Variable.Is not empty("Buff4Duration")
begin
Window.Send press keys("{windowName}", "yes", "0", "{Buff4Key}")
if Variable.Is less than (Math)("Buff4Duration", "1000")
begin
Variable.Evaluate (Math)("({Buff4Duration}*60)*1000", "Buff4Duration")
end
Macro.Restart stopwatch("Buff4Watch")
Macro.Pause("2000")
end
if Variable.Is not empty("Buff5Key")
and
Variable.Is not empty("Buff5Duration")
begin
Window.Send press keys("{windowName}", "yes", "0", "{Buff5Key}")
if Variable.Is less than (Math)("Buff5Duration", "1000")
begin
Variable.Evaluate (Math)("({Buff5Duration}*60)*1000", "Buff5Duration")
end
Macro.Restart stopwatch("Buff5Watch")
Macro.Pause("2000")
end
function
function("Ensure buffs are still active")
// If we are attacked, abort to be able to defend ourselves first
if Memory.Value is("{processName}", "{hasTargetMemoryAddress}", "1", "1")
begin
Function.Abort()
end
if Macro.Stopwatch exists("Buff1Watch")
begin
Macro.Read stopwatch("Buff1Watch", "buff1Time")
if Variable.Is greater than (Math)("buff1Time", "{Buff1Duration}")
begin
Window.Send press keys("{windowName}", "yes", "0", "{Buff1Key}")
Macro.Restart stopwatch("Buff1Watch")
Macro.Pause("2000")
end
end
if Macro.Stopwatch exists("Buff2Watch")
begin
Macro.Read stopwatch("Buff2Watch", "buff2Time")
if Variable.Is greater than (Math)("buff2Time", "{Buff2Duration}")
begin
Window.Send press keys("{windowName}", "yes", "0", "{Buff2Key}")
Macro.Restart stopwatch("Buff2Watch")
Macro.Pause("2000")
end
end
if Macro.Stopwatch exists("Buff3Watch")
begin
Macro.Read stopwatch("Buff3Watch", "buff3Time")
if Variable.Is greater than (Math)("buff3Time", "{Buff3Duration}")
begin
Window.Send press keys("{windowName}", "yes", "0", "{Buff3Key}")
Macro.Restart stopwatch("Buff3Watch")
Macro.Pause("2000")
end
end
if Macro.Stopwatch exists("Buff4Watch")
begin
Macro.Read stopwatch("Buff4Watch", "buff4Time")
if Variable.Is greater than (Math)("buff4Time", "{Buff4Duration}")
begin
Window.Send press keys("{windowName}", "yes", "0", "{Buff4Key}")
Macro.Restart stopwatch("Buff4Watch")
Macro.Pause("2000")
end
end
if Macro.Stopwatch exists("Buff5Watch")
begin
Macro.Read stopwatch("Buff5Watch", "buff5Time")
if Variable.Is greater than (Math)("buff5Time", "{Buff5Duration}")
begin
Window.Send press keys("{windowName}", "yes", "0", "{Buff5Key}")
Macro.Restart stopwatch("Buff5Watch")
Macro.Pause("2000")
end
end
function
function("Output status")
begin
Memory.Get value("{processName}", "{currentLevelMemoryAddress}", "4", "outputLvl")
Memory.Get value("{processName}", "{currentHPMemoryAddress}", "4", "outputHP")
Memory.Get value("{processName}", "{currentMPMemoryAddress}", "4", "outputMP")
Variable.Evaluate (Text)("Level: {outputLvl}, Kills: {killCount}, Deaths: {deathCount}, HP: {outputHP}, MP: {outputMP}", "statusOutput")
Macro.Report progress("{statusOutput}")
end
function
function("Calculate current HP percentage")
begin
Memory.Get value("{processName}", "{currentHPMemoryAddress}", "4", "currentHP")
Memory.Get value("{processName}", "{maxHPMemoryAddress}", "4", "maxHP")
Variable.Evaluate (Math)("({currentHP}/{maxHP})*100", "currentHPpercentage")
end
function
function("Calculate current MP percentage")
begin
Memory.Get value("{processName}", "{currentMPMemoryAddress}", "4", "currentMP")
Memory.Get value("{processName}", "{maxMPMemoryAddress}", "4", "maxMP")
Variable.Evaluate (Math)("({currentMP}/{maxMP})*100", "currentMPpercentage")
end
function
function("Meditate if required")
// If we are attacked, abort to be able to defend ourselves
if Memory.Value is("{processName}", "{hasTargetMemoryAddress}", "1", "1")
begin
Function.Abort()
end
begin
Function.Execute("Calculate current HP percentage")
Function.Execute("Calculate current MP percentage")
end
if Variable.Is less than (Math)("currentHPpercentage", "{MeditateAtHPPercentage}")
or
Variable.Is less than (Math)("currentMPpercentage", "{MeditateAtMPPercentage}")
begin
Window.Send press keys("{windowName}", "yes", "0", "{MeditateKey}")
begin loop()
Macro.Pause("750")
Function.Execute("Output status")
Memory.Get value("{processName}", "{currentHPMemoryAddress}", "4", "hpCheckCurrent")
// If we are attacked, or at 100% HP / MP then abort meditation
if Memory.Value is("{processName}", "{hasTargetMemoryAddress}", "1", "1")
or
Memory.Value is("{processName}", "{currentHPMemoryAddress}", "4", "{maxHP}")
and
Memory.Value is("{processName}", "{currentMPMemoryAddress}", "4", "{maxMP}")
begin
Window.Send press keys("{windowName}", "yes", "0", "{MeditateKey}")
Macro.Pause("1000")
Window.Send press keys("{windowName}", "yes", "0", "{LootKey}")
Function.Abort()
end
end
end
function
function("Perform healing if required")
// If we specified a key for the spell "Iron heart" (or another healing spell)
if Variable.Is not empty("HealingKey")
begin
Function.Execute("Calculate current HP percentage")
if Variable.Is less than (Math)("currentHPpercentage", "{UseHealingSpellAtHPPercentage}")
begin
Macro.Pause("250")
Window.Send press keys("{windowName}", "yes", "0", "{HealingKey}")
Macro.Pause("{HealingSpellCastTime}")
end
end
function
function("Release corpse, heal and fly back if dead")
if Memory.Value is("{processName}", "{currentHPMemoryAddress}", "4", "0")
begin
Variable.Increment (Math)("deathCount")
// Move the "You are dead" box to coordinate 0,0
Memory.Set value("{processName}", "{deathDialogLocationXMemoryAddress}", "4", "0")
Memory.Set value("{processName}", "{deathDialogLocationYMemoryAddress}", "4", "0")
Macro.Pause("1000")
// Click "Release corpse"
Window.Send mouse click("{windowName}", "yes", "0", "125", "71", "left")
Macro.Pause("10000")
if Variable.Is equal to("deathCount", "{StopMacroIfDeadTimes}")
begin
Variable.Evaluate (Text)("The bot was aborted because you died {deathCount} times", "output")
Window.Display message box("{output}", "no")
Macro.Abort()
end
Function.Execute("Use potions")
Function.Execute("Meditate if required")
Macro.Pause("1000")
Function.Execute("Init buffs")
Function.Execute with timeout("Ensure within specified hunting ground", "300000")
end
function
function("Get target")
begin loop()
if Memory.Value is("{processName}", "{hasTargetMemoryAddress}", "1", "1")
begin
// If we already have a target, abort
Function.Abort()
end
Window.Send press keys("{windowName}", "yes", "0", "{TargetKey}")
Macro.Pause("250")
Function.Execute("Use potions")
end
function
function("Get loot")
begin
Function.Execute("Get player location")
Variable.Evaluate (Text)("{x}{y}{z}", "locationHash")
Macro.Pause("200")
// If we are being attacked, dont waste any time picking up drops
if Memory.Value is("{processName}", "{hasTargetMemoryAddress}", "1", "1")
begin
Function.Abort()
end
begin loop()
begin loop("8")
Window.Send press keys("{windowName}", "yes", "0", "{LootKey}")
Macro.Pause("200")
end
Function.Execute("Use potions")
Function.Execute("Get player location")
Variable.Evaluate (Text)("{x}{y}{z}", "newLocationHash")
if Variable.Is equal to("locationHash", "{newLocationHash}")
or
Memory.Value is("{processName}", "{hasTargetMemoryAddress}", "1", "1")
begin
// Abort if we finished picking up drops (stopped moving), or if we are under attack.
Function.Abort()
end
Variable.Set("locationHash", "{newLocationHash}")
end
end
function
function("Kill target")
if Variable.Is not empty("PreAttackKey")
and
Random.Maybe("{PreAttackPercentage}")
begin
Function.Execute("Get player location")
Variable.Evaluate (Text)("{x}{y}{z}", "locationHash")
Window.Send press keys("{windowName}", "yes", "0", "{PreAttackKey}")
Macro.Pause("750")
Function.Execute("Get player location")
Variable.Evaluate (Text)("{x}{y}{z}", "newLocationHash")
if Variable.Is not equal to("locationHash", "{newLocationHash}")
begin loop("7")
// If we had to move to get close enough to our target, wait a bit while casting the PreAttack spell
Variable.Set("locationHash", "{newLocationHash}")
Macro.Pause("750")
Function.Execute("Get player location")
Variable.Evaluate (Text)("{x}{y}{z}", "newLocationHash")
if Variable.Is equal to("locationHash", "{newLocationHash}")
begin
Macro.Break from loop()
end
end
end
begin loop()
Window.Send press keys("{windowName}", "yes", "0", "{AttackKey}")
Macro.Pause("40")
Function.Execute("Use potions")
Macro.Pause("40")
// If our target is dead or we died ourselves, stop attacking
if Memory.Value is("{processName}", "{hasTargetMemoryAddress}", "1", "0")
or
Memory.Value is("{processName}", "{currentHPMemoryAddress}", "4", "0")
begin
Variable.Increment (Math)("killCount")
// Quickly press esc to avoid wasting MP on a monster that is already dead.
Window.Send press keys("{windowName}", "yes", "0", "{<esc>}")
Macro.Pause("100")
Function.Abort()
end
end
function
function("Ensure within specified hunting ground")
// If we are attacked, abort to be able to defend ourselves before flying anywhere
if Memory.Value is("{processName}", "{hasTargetMemoryAddress}", "1", "1")
begin
Function.Abort()
end
begin
Function.Execute("Get desired location")
Function.Execute("Get player location")
Variable.Evaluate (Math)("{x} - {desiredX}", "rangeX")
if Variable.Is less than (Math)("rangeX", "0")
begin
Variable.Multiply (Math)("rangeX", "-1")
end
Variable.Evaluate (Math)("{y} - {desiredY}", "rangeY")
if Variable.Is less than (Math)("rangeY", "0")
begin
Variable.Multiply (Math)("rangeY", "-1")
end
if Variable.Is less than (Math)("rangeX", "{desiredRange}")
and
Variable.Is less than (Math)("rangeY", "{desiredRange}")
begin
// If we are already within the specified range of our prefered hunting ground, dont go anywhere
Function.Abort()
end
Variable.Evaluate (Text)("{desiredX} {desiredY}", "location")
Window.Get size("{windowName}", "yes", "width", "unused")
Variable.Subtract (Math)("width", "35")
// If we are able to fly, activate wings, to help avoiding getting stuck
if Variable.Is not empty("FlyKey")
begin
Window.Send press keys("{windowName}", "yes", "0", "{FlyKey}")
end
Macro.Pause("50")
// Open the Path dialog
Window.Send mouse click("{windowName}", "yes", "0", "{width}", "110", "left")
Macro.Pause("750")
Window.Send mouse click("{windowName}", "yes", "0", "293", "381", "left")
Macro.Pause("250")
Window.Send press keys("{windowName}", "yes", "0", "{<enter>}")
Macro.Pause("250")
Window.Send mouse click("{windowName}", "yes", "0", "270", "40", "left")
Macro.Pause("250")
begin loop("25")
// Delete whatever has already been entered
Window.Send press keys("{windowName}", "yes", "0", "{<backspace>}")
Macro.Pause("5")
end
Window.Send press keys("{windowName}", "yes", "0", "{location}")
Macro.Pause("50")
Window.Send press keys("{windowName}", "yes", "0", "{<enter>}")
Macro.Pause("200")
Window.Send press keys("{windowName}", "yes", "0", "{location}")
Macro.Pause("50")
Window.Send press keys("{windowName}", "yes", "0", "{<enter>}")
Macro.Pause("200")
Window.Send mouse double click("{windowName}", "yes", "0", "250", "60", "left")
Macro.Pause("250")
// Make sure the Auto-Path-Height box is located at coordinate 0,0
Memory.Set value("{processName}", "{topMostDialogLocationXMemoryAddress}", "4", "0")
Memory.Set value("{processName}", "{topMostDialogLocationYMemoryAddress}", "4", "0")
// Enable "Reach Destination"
Memory.Set value("{processName}", "{reachDestinationCheckBoxMemoryAddress}", "1", "1")
Macro.Pause("25")
Window.Send mouse click("{windowName}", "yes", "0", "145", "43", "left")
Macro.Pause("150")
begin loop("15")
// Delete whatever "Height" previously entered
Window.Send press keys("{windowName}", "yes", "0", "{<backspace>}")
Macro.Pause("5")
end
Window.Send press keys("{windowName}", "yes", "0", "{desiredHeight}")
Macro.Pause("50")
Window.Send mouse click("{windowName}", "yes", "0", "108", "106", "left")
Variable.Set("locationHash", "0")
begin loop()
// Wait for our character to stop moving, meaning we reached our destination
Macro.Pause("2500")
Function.Execute("Get player location")
Variable.Evaluate (Text)("{x}{y}{z}", "newLocationHash")
if Variable.Is equal to("locationHash", "{newLocationHash}")
begin
// if the location "hash" is unchanged, meaning we reached our destination, close the Path window
Window.Send mouse click("{windowName}", "yes", "0", "108", "106", "left")
Macro.Pause("250")
Window.Send press keys("{windowName}", "yes", "0", "{<esc>}")
Macro.Pause("250")
Function.Abort()
end
Variable.Set("locationHash", "{newLocationHash}")
end
end
function
function("Get desired location")
// If this is the first run, we will load the hunting ground paths in to memory
if Variable.Does not exist("paths")
begin
File.Read text("{LevelPath}", "paths")
if Variable.Does not exist("paths")
begin
Variable.Evaluate (Text)("A level path file was not found at {LevelPath}, the macro will now quit (for help please visit
http://www.blueeye-macro.com)", "errorOutput")
Window.Display message box("{errorOutput}", "no")
Macro.Abort()
end
Variable.Extract partial text (Regex)("paths", "(?s)-{25,}(.*)", "1", "paths")
if Variable.Is not match (Regex)("paths", ":1:(?: [0-9]+){4}")
begin
Variable.Evaluate (Text)("A level path file was found, but it does not contain a leveling path for at least level 1. The macro will now quit, for help please visit
http://www.blueeye-macro.com)", "errorOutput")
Window.Display message box("{errorOutput}", "no")
Macro.Abort()
end
end
begin
// Find the area coordinate that applies to our current level (or go with the nearest level path lower than our current level)
Memory.Get value("{processName}", "{currentLevelMemoryAddress}", "4", "lvl")
begin loop()
Variable.Evaluate (Text)(":{lvl}: ([0-9]+) ([0-9]+) ([0-9]+) ([0-9]+)", "pattern")
if Variable.Is match (Regex)("paths", "{pattern}")
begin
Macro.Break from loop()
end
Variable.Decrement (Math)("lvl")
if Variable.Is less than (Math)("lvl", "0")
begin
Window.Display message box("Failed determining the leveling path for your level", "no")
Macro.Abort()
end
end
Variable.Extract partial text (Regex)("paths", "{pattern}", "1", "desiredX")
Variable.Extract partial text (Regex)("paths", "{pattern}", "2", "desiredY")
Variable.Extract partial text (Regex)("paths", "{pattern}", "3", "desiredHeight")
Variable.Extract partial text (Regex)("paths", "{pattern}", "4", "desiredRange")
end
function
function("Get player location")
begin
// Get our current location, with all decimals
Memory.Get value("{processName}", "{currentLocationXMemoryAddress}", "float", "x")
Variable.Evaluate (Math)("401+({x}/10)", "x")
Memory.Get value("{processName}", "{currentLocationYMemoryAddress}", "float", "y")
Variable.Evaluate (Math)("551+({y}/10)", "y")
Memory.Get value("{processName}", "{currentLocationHeightMemoryAddress}", "float", "z")
Variable.Divide (Math)("z", "10")
end
function
currently the code looks like this ... but with a new error.