Ammunition Setting Spam
Posted: Tue Jun 16, 2015 8:58 pm
From bot.lua at around line 755
Situation goes like this. Create a new Rogue and set RELOAD_AMMUNITION to "thrown" or a new Scout and set it to "arrow" and start playing. So far so good. Get to level 10, pick a second class that isn't Rogue or Scout and the spam begins. "RELOAD_AMMUNITION can only be false, arrow or thrown!" in the MM window every waypoint. Would this be better coded as follows to avoid the spam?
Yeah, I know I can just edit the profile when I change classes to avoid it, but sometimes I just use the default profile and set whichever applies to my classes. My actual playing characters each have their own profiles so that's no problem. It's just when I'm making a new character to work on zone waypoint files.
Code: Select all
-- reloading ammunition
if ( settings.profile.options.RELOAD_AMMUNITION ) then
local ammo = string.lower(settings.profile.options.RELOAD_AMMUNITION);
if ammo == "thrown" and (player.Class1 == CLASS_ROGUE or (player.Class2 == CLASS_ROGUE and player.Level > 11 and player.Level2 > 11)) then
if inventory:getAmmunitionCount() == 0 then
inventory:reloadAmmunition(ammo);
end
elseif ammo == "arrow" and (player.Class2 == CLASS_SCOUT or player.Class1 == CLASS_SCOUT) then
if inventory:getAmmunitionCount() == 0 then
inventory:reloadAmmunition(ammo);
end
else
print("RELOAD_AMMUNITION can only be false, arrow or thrown!");
end
end
Code: Select all
-- reloading ammunition
if ( settings.profile.options.RELOAD_AMMUNITION ) then
local ammo = string.lower(settings.profile.options.RELOAD_AMMUNITION);
if ammo ~= "thrown" and ammo ~= "arrow" and ammo ~= "false" then
print("RELOAD_AMMUNITION can only be false, arrow or thrown!");
end
if ammo == "thrown" and (player.Class1 == CLASS_ROGUE or (player.Class2 == CLASS_ROGUE and player.Level > 11 and player.Level2 > 11)) then
if inventory:getAmmunitionCount() == 0 then
inventory:reloadAmmunition(ammo);
end
elseif ammo == "arrow" and (player.Class2 == CLASS_SCOUT or player.Class1 == CLASS_SCOUT) then
if inventory:getAmmunitionCount() == 0 then
inventory:reloadAmmunition(ammo);
end
end
end