CountMobs
CountMobs is obsolete. It's functionality has been added to the bot. You can use player:countMobs(inrange, onlyaggro, idorname).
Syntax:
- CountMobs(onlyaggro, inrange)
- onlyaggro - Set true if you want to count only mobs that are attacking you. Optional.
inrange - The range in which you want to count the mobs. Optional. If omitted, it will count all mobs it can detect.
- Cast Purgatory Fire if 3 or more mobs are in range.
Code: Select all
if CountMobs(nil,50) > 3 then
player:cast("MAGE_PUGATORY_FIRE")
end
Syntax:
- CountPlayers(inrange, printnames, ignorefriends)
- inrange - The range in which you want to count the players. Optional. If omitted, it will count all players it can detect.
printnames - If true, prints the names of the players. I find this useful if creating a wait loop so I can see how the names change over time while I wait.
ignorefriends - If true, does not include friends in the count. 'Friends' includes names in your profile friends list, party members if in a party and warden pet if you have one.
- Code I use to wait until there is at most only one other player in the area I'm doing my dailies. The daily can only really support 2 players at a time.
Code: Select all
if CountPlayers() > 1 then
print("Waiting till it's less crowded")
repeat
yrest(15000)
until 2 > CountPlayers(nil,true)
end