I got a few suggestion's of code changes on 2.11 for the next version, here they are:
bot.lua "old" line 71 - 73: -- Fix crash on MM 1.0 due to death (startKey will crash MM 1.0)
Code: Select all
cprintf(cli.red, "You have died... Sorry.\n");
printf("Script paused until you revive yourself. Press %s when you\'re ready to continue.\n",
getKeyName(startKey))
to:
Code: Select all
cprintf(cli.red, "You have died... Sorry.\n");
if( getVersion() < 100 ) then
printf("Script paused until you revive yourself. Press %s when you\'re ready to continue.\n",
getKeyName(startKey))
else
printf("Script paused until you revive yourself. Press %s when you\'re ready to continue.\n",
getKeyName(getStartKey()))
end
Bot.lua "old" line 100 - 110: -- Try to fix OoC* spell casting to not activate if we got hostile attacking us (solve a looting problem) *OOC = Out of Combat
Code: Select all
player:checkPotions();
player:checkSkills();
if( player.TargetPtr ~= 0 and (not player:haveTarget()) ) then
player:clearTarget();
end
if( success ) then
__WPL:advance();
to:
Code: Select all
-- player:checkPotions(); -- moved to new location
-- player:checkSkills(); -- moved to new location
player:update();
if( player.TargetPtr ~= 0 and (not player:haveTarget()) ) then
player:checkPotions(); -- new location
player:update();
if( player.TargetPtr ~= 0 and (not player:haveTarget()) ) then
player:checkSkills(); -- new location
player:update();
if( player.TargetPtr ~= 0 and (not player:haveTarget()) ) then
player:clearTarget();
end
end
end
if( success ) then
cprintf(cli.turquoise, "Waypoint Reached!\n");
__WPL:advance();
player.lua "old" line 161 - 162: -- Move spell casting to fix loosing self.TargetPtr before looting start (part 1/2)
Code: Select all
self:checkPotions();
self:checkSkills();
to:
Code: Select all
-- self:checkPotions(); -- moved to new location
-- self:checkSkills(); -- moved to new location
player.lua "old" line 252 - 260: -- Move spell casting to fix loosing self.TargetPtr before looting start (part 2/2)
Code: Select all
if( correctingAngle ) then
keyboardRelease( settings.hotkeys.ROTATE_LEFT.key );
keyboardRelease( settings.hotkeys.ROTATE_RIGHT.key );
end
yrest(100);
target:update();
self:update();
to:
Code: Select all
if( correctingAngle ) then
keyboardRelease( settings.hotkeys.ROTATE_LEFT.key );
keyboardRelease( settings.hotkeys.ROTATE_RIGHT.key );
end
self:checkPotions(); -- new location
self:checkSkills(); -- new location
yrest(100);
target:update();
self:update();
player.lua "old" line 273 - 292: -- make ranged COMBAT_TYPE have a lootdistance of settings.profile.options.COMBAT_DISTANCE or 155 if not specified in profile, & add a few msg in console
Code: Select all
if( self.TargetPtr ~= 0 ) then
if( settings.profile.options.LOOT == true ) then
local dist = distance(self.X, self.Z, target.X, target.Z);
if( dist < 100 ) then -- only loot when close by
-- "attack" is also the hotkey to loot, strangely.
yrest(500);
keyboardPress(settings.profile.hotkeys.ATTACK.key);
yrest(settings.profile.options.LOOT_TIME);
-- now take a 'step' backward (closes loot bag if full inventory)
keyboardPress(settings.hotkeys.MOVE_BACKWARD.key);
-- Maybe take a step forward to pick up a buff.
if( math.random(100) > 20 ) then
keyboardHold(settings.hotkeys.MOVE_FORWARD.key);
yrest(100);
keyboardRelease(settings.hotkeys.MOVE_FORWARD.key);
end
end
to:
Code: Select all
if( self.TargetPtr ~= 0 ) then
if( settings.profile.options.LOOT == true ) then
local lootdist = 100;
if( settings.profile.options.COMBAT_TYPE == "ranged" ) then
if( settings.profile.options.COMBAT_DISTANCE ~= nil ) then
lootdist = settings.profile.options.COMBAT_DISTANCE;
else
lootdist = 155;
end
end
local dist = distance(self.X, self.Z, target.X, target.Z);
if( dist < lootdist ) then -- only loot when close by
-- "attack" is also the hotkey to loot, strangely.
yrest(500);
keyboardPress(settings.profile.hotkeys.ATTACK.key);
cprintf(cli.green, "Looting Target\n");
yrest(settings.profile.options.LOOT_TIME);
-- now take a 'step' backward (closes loot bag if full inventory)
keyboardPress(settings.hotkeys.MOVE_BACKWARD.key);
-- Maybe take a step forward to pick up a buff.
if( math.random(100) > 20 ) then
keyboardHold(settings.hotkeys.MOVE_FORWARD.key);
cprintf(cli.green, "Try to pickup buff\n");
yrest(300);
keyboardRelease(settings.hotkeys.MOVE_FORWARD.key);
end
else
cprintf(cli.red, "Not Looting due to distance\n");
end
I don't know if any of these changes will make it into next version, but these changes solve 99% of
my looting problem's.
Zilvermoon