Features include:
- When a tracked mob spawns - How many of a tracked mob is in the zone
When a tracked mob dies - How many of a tracked spawn is left in the zone
Individual zone lists (Alert.ini)
Be gentle about my coding skills I've been learning the new verbage and such maybe 3 hours exclusively writing this... Oh and let me know if you find it useful! Thanks
Code: Select all
|#Track.mac
|Ideally you want to run this by doing /Mac track run
|But if you don't it'll nag you with who created this and additional parameters.
|#Created by Shin Noir.#
Sub Main
/declare MaxTrack int outer 99
/declare i int local
/declare MobsToTrack int outer
/declare SpawnTracker[${MaxTrack}] int outer 0
/if (${Param0.Equal["add"]}) {
/if (${Ini[Alerts.ini,${Zone.ShortName},index]}==NULL) {
/varset i 0
} else {
/varset i ${Ini[Alerts.ini,${Zone.ShortName},index,${Param1}]}
}
/varcalc i ${i}+1
/ini "Alerts.ini" "${Zone.ShortName}" "${i}" ${Param1}
/ini "Alerts.ini" "${Zone.ShortName}" "index" "${i}"
/echo Added NPC to ${Zone.ShortName}(${i}):${Param1}
/goto :Run
}
/if (${Param0.Equal["run"]}) /goto :Run
/if (${Param0.Equal["list"]}) /call ListMobs
/if (!${Defined[Param0]}) /call Syntax
:Run
/declare Current_Zone outer
/varset Current_Zone ${Zone.ShortName}
/if (${Ini[Alerts.ini,${Zone.ShortName},index]}==NULL) {
/echo Zone is currently ${Zone.ShortName} with no spawns being tracked.
/ini "Alerts.ini" "${Zone.ShortName}" "index" "0"
} else {
/echo Zone is currently ${Zone.ShortName} with ${Ini[Alerts.ini,${Zone.ShortName},index]} spawns being tracked.
}
:Loop
/if (${Zone.ShortName.NotEqual[${Current_Zone}]}) {
/if (${Ini[Alerts.ini,${Zone.ShortName},index]}==NULL) {
/echo Zone is currently ${Zone.ShortName} with no spawns being tracked.
/ini "Alerts.ini" "${Zone.ShortName}" "index" "0"
} else {
/echo Zone is currently ${Zone.ShortName} with ${Ini[Alerts.ini,${Zone.ShortName},index]} spawns being tracked.
}
/for i 1 to 99
/varset SpawnTracker[${i}] 0
/next i
/ini "Alerts.ini" "Current_Zone" "visited" "${Time.Date} at ${Time.Time24}"
/varset Current_Zone ${Zone.ShortName}
}
/call DoTracking
/doevents
/goto :Loop
/return
Sub DoTracking
/if (${Ini[Alerts.ini,${Zone.ShortName},index]}==NULL) {
/varset MobsToTrack 0
} else {
/varset MobsToTrack 1
}
/if (${MobsToTrack}>0) {
/declare i int local
/for i 1 to ${Ini[Alerts.ini,${Zone.ShortName},index]}
/if (${SpawnTracker[${i}]}<${SpawnCount[npc ${Ini[Alerts.ini,${Zone.ShortName},${i}]}]}) {
/echo ${Ini[Alerts.ini,${Zone.ShortName},${i}]} is up (${SpawnCount[npc ${Ini[Alerts.ini,${Zone.ShortName},${i}]}]} total).
/varset SpawnTracker[${i}] ${SpawnCount[npc ${Ini[Alerts.ini,${Zone.ShortName},${i}]}]}
} else /if (${SpawnTracker[${i}]}>${SpawnCount[npc ${Ini[Alerts.ini,${Zone.ShortName},${i}]}]}) {
/if (${SpawnTracker[${i}]}>0) {
/echo ${Ini[Alerts.ini,${Zone.ShortName},${i}]} has died (${SpawnCount[npc ${Ini[Alerts.ini,${Zone.ShortName},${i}]}]} remain).
/varset SpawnTracker[${i}] ${SpawnCount[npc ${Ini[Alerts.ini,${Zone.ShortName},${i}]}]}
}
}
/next i
}
/return
Sub ListMobs
/declare i int local
/echo Track List:
/if (${Ini[Alerts.ini,${Zone.ShortName},index]}==NULL) {
/echo None.
} else {
/for i 1 to ${Ini[Alerts.ini,${Zone.ShortName},index]}
/echo ${Ini[Alerts.ini,${Zone.ShortName},${i}]}
/next i
}
/return
Sub Syntax
/echo Created by Shin Noir.
/echo Note you can use "add <name>" or "list" when calling this macro.
/return

