Page 1 of 1

Trouble with Mob Count

Posted: Tue Jan 08, 2013 12:53 pm
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

Re: Trouble with Mob Count

Posted: Tue Jan 08, 2013 1:35 pm
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)

Re: Trouble with Mob Count

Posted: Tue Jan 08, 2013 3:13 pm
by Ego95
Oh lol. The quotes explained everything :O
Thanks