Code:
|** Author: cjt
|
| This macro uses openvanilla and mq2nav
| it is meant to run low level characters
| in Mines of Gloomindale.
| it scans for mobs that are around your
| level (-4 to +1) and makes a list then
| The macro is set to allow you to go
| select an area and when you duck
| it will set camp and start the fun.
|
| Update 2023 10 24
|
| As recomended by Sic I am updating sources and
| started with the explanation that I started by
| downloading the most recent openvanilla source
| here https://gitlab.com/redguides/openvanilla,
| and downloaded Visual Studio 202 Community and
| Git for windows using the links in the same page
| then used VS 2022 to compile the source follwing
| the recomendations provided in the same page.
| I also made some changes in the code and now it
| is working as I intended it to work by going back
| to camp when it cant find any more mobs
|
| Notes: You can adjust the level ranges by adjusting lines:
|
| /varset low ${Math.Calc[${Me.Level}-5]}
| /varset high ${Math.Calc[${Me.Level}+1]}
|
| Where changing the -5 substracts 5 levels from your level and + ads 1 level to your level
| this way it targets blue to yellow mobs.
|
| You can change the Camp Radius (cr) to whatever you need, I left it at 150.
| The line is
|
| /varset cr 150
|
| just change it to whatever fits your need.
|
|
**|
Sub main
/echo Macro Started
/declare y int outer
/declare x int outer
/declare z int outer
/declare camphere bool outer FALSE
/declare mobs int outer
/declare index int outer
/declare ns int outer
/declare cr int outer
/declare tm int outer
/declare low int outer
/declare high int outer
/declare counter int outer 0
/varset cr 150
/target clear
/mapfilter CampRadius ${cr}
/mapfilter CampRadius TargetLine ${cr}
/squelch /mapfilter target show
/call CampHere
/varset low ${Math.Calc[${Me.Level}-5]}
/varset high ${Math.Calc[${Me.Level}+1]}
:repeat
/echo SpawnCount npc los ${SpawnCount[npc los radius ${cr} range ${low} ${high}]}
/target clear
/varset mobs ${SpawnCount[npc los radius ${cr} range ${low} ${high}]}
/echo -----------
/echo mobs ${mobs}
/if (${mobs}==0) {
/Call MoveBack2Camp
/delay 60
/goto :repeat
}
/declare DucksInRow[${mobs}] int outer
/echo ==[Getting ducks in a row]==
/for index 1 to ${mobs}
/echo ${index} ${NearestSpawn[${index},npc los radius ${cr} range ${low} ${high}].CleanName} Level ${NearestSpawn[${index},npc los radius ${cr} range ${low} ${high}].Level} @ ${NearestSpawn[${index},npc los radius ${cr} range ${low} ${high}].Distance}
/echo ${index} ${NearestSpawn[${index},npc los radius ${cr} range ${low} ${high}].ID}
/varset DucksInRow[${index}] ${NearestSpawn[${index},npc los radius ${cr} range ${low} ${high}].ID}
/next index
|===============================================
/call KillDucks
|===============================================
/deletevar DucksInRow
/delay 1
/goto :repeat
/return
Sub KillDucks
/echo ==[listing ducks in a row]==
|/for index 1 to ${mobs}
/for index 1 to 1
/echo Next : ${DucksInRow[${index}]} - ${Spawn[${DucksInRow[${index}]}].CleanName} Lvl ${Spawn[${DucksInRow[${index}]}].Level}
/squelch /nav ${Spawn[${DucksInRow[${index}]}]}[/BGCOLOR]
/echo moving
:dontstop
/delay 1
/if (${Navigation.Active}) /goto :dontstop
/target ${Spawn[${DucksInRow[${index}]}]}
/attack on
|--------------------------------------------
:killmob
/delay 1
/if (${Target.Distance}<7) {
/squelch /face fast ${Target.CleanName}
} else {
/squelch /nav Target
}
/if (${Target.PctHPs}>0) /goto :killmob
|--------------------------------------------
| Kill Adds
/if (${SpawnCount[npc xtarhater radius 150]}) {
/target ${NearestSpawn[npc xtarhater]}
/squelch /face fast Nolook
/attack on
/goto :killmob
}
/varset counter ${Math.Calc[${counter}+1]}
/echo ${counter} mobs dead
/echo Current Exp--> ${Me.Exp}
|--------------------------------------------
/delay 1
/next index
/hidecorpses looted
/return
Sub CampHere
|get loc to camp
:LoopUntilLoc
/IF (${Me.Ducking}) {
/varset x ${Me.X}
/varset y ${Me.Y}
/varset z ${Me.Z}
/varset camphere TRUE
/echo ${camphere}
}
/delay 1
/if (!${camphere}) /goto :LoopUntilLoc
/if (${Me.Ducking}) /stand
/target clear
/return
Sub MoveBack2Camp
/echo Moving back to camp
/squelch /nav loc ${y} ${x} ${z}
:dontstop
/delay 1
/if (${Navigation.Active}) /goto :dontstop
/echo waiting 1 minute
/sit
/delay 600
/stand
/return
My 2c
Last edited: