I want to make bot which will choose his equip from quests depending on his class.
The first pieces of equipment are obtained in from a armorbag and a weaponbag. So I let my bot open those bags. Now it shall check which class the bot's primary class is because the equipment u get from those bags are class-dependant, e.g. a mage gets a wand, a rouge gets a dagger.
Code: Select all
inventory:update();
inventory:useItem(201704); -- Waffen-Paket
inventory:useItem(201705); -- Ruestungspaket
if (player.Class1 == CLASS_SCOUT or player.Class1 == CLASS_ROGUE) then
inventory:useItem(210512);
inventory:useItem(221582);
else if (player.Class1 == CLASS_MAGE or player.Class1 == CLASS_PRIEST) then
inventory:useItem(210514);
inventory:useItem(221584);
else
inventory:useItem(210511);
inventory:useItem(221582);
end;
inventory:useItem(209577); -- Geheimnisvolle Runenschriftrolle
Whenever I try to run this mm keeps telling my I got a compilationerror and I should check the LUA code there. As I couldn't find any mistake just from looking at it, I did some tests.
Code: Select all
if (player.Class1 == CLASS_SCOUT or player.Class1 == CLASS_ROGUE) then
inventory:useItem(210512);
inventory:useItem(221582);
It's the same with this piece of code:
Code: Select all
if (player.Class1 == CLASS_MAGE or player.Class1 == CLASS_PRIEST) then
inventory:useItem(210514);
inventory:useItem(221584);
Code: Select all
if (player.Class1 == CLASS_MAGE or player.Class1 == CLASS_PRIEST) then
inventory:useItem(210514);
inventory:useItem(221584);
else
inventory:useItem(210511);
inventory:useItem(221582);
end;
I've tested this stuff in nearly every possible combination but whenever it comes to "else" my script goes bananas. The weird thing is that I am using "else" in many other WPs and they work fine. So what's the problem with this particular piece of code? What am I missing?
btw.
1. I know those Items arent completely right.. But as long as I can't get it to work, I don't care.
2. I am using the newest version of mm.
Thanks in advance :*