Trouble with Mob Count

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Post Reply
Message
Author
User avatar
Ego95
Posts: 564
Joined: Tue Feb 28, 2012 12:38 pm
Contact:

Trouble with Mob Count

#1 Post by Ego95 »

Hey,
I try to get one part, the most important part of my script working. The only thing he should do is to stay between two mobs and kill them with purgatory fire and loot them and do this over and over again alway wehen they spawn.

First I tried this simple thing:

Code: Select all

		if player:countMobs(75) > 1 then
			player:cast("MAGE_PURGATORY_FIRE)
		end
So if there is at least one mob is in a range of 75 he should cast purgatory fire. So far it works fine. But after they have been looted the bot errors with an error while using the lua function at waypoint #1. Sometimes the script works for 5 minutes or longer but when he tries to use the code above and there isn't a mob it errors. I thought normally it should then go to waypoint #1 again and try it again until there are mobs. So I thought maybe this helps:

Code: Select all

	repeat
		if player:countMobs(75) > 1 then
			player:cast("MAGE_PURGATORY_FIRE)
		end
	until not player:countMobs(75) > 1
But I get the same error. I don't know why such a simple thing can make such trouble. Anyone has an idea why this won't work? I am using the RC3 version.

AlterEgo95
User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Trouble with Mob Count

#2 Post by rock5 »

You are missing quotes
player:cast("MAGE_PURGATORY_FIRE")
Be careful when using 'not'. It's always done first so what you wrote is interpreted as

Code: Select all

until ( not player:countMobs(75) ) > 1
To have it work the way you intended you would have to write it as

Code: Select all

until not (player:countMobs(75) > 1)
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan
User avatar
Ego95
Posts: 564
Joined: Tue Feb 28, 2012 12:38 pm
Contact:

Re: Trouble with Mob Count

#3 Post by Ego95 »

Oh lol. The quotes explained everything :O
Thanks
Post Reply