Page 3 of 3
Re: Extracting 'scores'
Posted: Wed Mar 05, 2014 6:08 am
by ZZZZZ
Now I can't get it to loot more than 1 mob :/
Code: Select all
Moving to waypoint #4, (6715, 2935)
Checking for Loot
Looting Dreamland Float
Looting Dreamland Float
[DEBUG] don't loot reason: target not lootable.
Looting Dreamland Float
[DEBUG] don't loot reason: target not lootable.
Looting Dreamland Float
[DEBUG] don't loot reason: target not lootable.
Looting
[DEBUG] don't loot reason: self.TargetPtr == 0
Not sure why it will not update to the next mob.
This is where its getting stuck now :S
Code: Select all
if player:findNearestNameOrId("", nil, evalTargetLootable) then
local canLoot = player:findNearestNameOrId("", nil, evalTargetLootable)
repeat
lootIgnoreList[1] = nil
player:target(canLoot)
print("Looting "..canLoot.Name.."");
player:loot(canLoot)
yrest(500);
canLoot:update();
local canLoot = player:findNearestNameOrId("", nil, evalTargetLootable)
until not player:findNearestNameOrId("", nil, evalTargetLootable)
end
This is taking way too long to get working lol..
Re: Extracting 'scores'
Posted: Wed Mar 05, 2014 6:44 am
by rock5
Did you try
like I said? There is a reason why I used 0 instead of nil. Because lootIgnoreListPos will probably still = 1 so the code expects a value at 1. So I used 0 so there is a value.
ZZZZZ wrote:This is taking way too long to get working lol..
I agree. The fact is the looting is pretty reliable especially if you don't disable the second try code. So if it's regularly failing for you then it's probably something buggy with your set up.
Re: Extracting 'scores'
Posted: Wed Mar 05, 2014 8:47 am
by ZZZZZ
Ok 1 last look before I give up on this >.<
The function to make sure mobs are killed and then looted before waiting for next round: (mobs MUST be looted completely before it'll continue to next round)
Code: Select all
function KillMobs()
keyboardPress(settings.hotkeys.JUMP.key);
yrest(10)
player:update()
if player:findEnemy(nil,nil,evalTargetDefault) then
enemy = player:findEnemy(nil,nil,evalTargetDefault)
if (enemy.Name == "Hlethfir Deliriumscribe"
or enemy.Name == "Kaleks Nightmareclaw"
or enemy.Name == "Herugrim Dreamlava"
or enemy.Name == "Mayvel Nightmaremuse"
or enemy.Name == "Nightmare Beast Atollop"
or enemy.Name == "Infected Dreamland Guardian") then
useGoodie("critp");
if player.Class1 == 3 and player.Class2 == 4 then
RogueBoss(true);
end
print("Boss settings updated")
end
player:updateBattling()
if (not player.Battling) then
print("Checking for Loot");
if player:findNearestNameOrId("", nil, evalTargetLootable) then
local canLoot = player:findNearestNameOrId("", nil, evalTargetLootable)
repeat
lootIgnoreList[1] = 0
player:target(canLoot)
print("Looting "..canLoot.Name.."");
player:loot(canLoot)
yrest(500);
canLoot:update();
canLoot = player:findNearestNameOrId("", nil, evalTargetLootable)
until not player:findNearestNameOrId("", nil, evalTargetLootable)
end
end
clearSlots()
prevcoords = {X=player.X, Z=player.Z, Y=player.Y}
print("Waiting for next area to appear")
repeat
yrest(2000);
player:update();
until distance(player,prevcoords) >= 100
yrest(1000);
cprintf(cli.yellow,"\nArea changed\n")
player:update()
if isInGame() then
DLApplyDpsPots()
yrest(1000);
__WPL:setWaypointIndex(__WPL:getNearestWaypoint(player.X,player.Z,player.Y))
end
end
Loot settings:
Code: Select all
changeProfileOption("LOOT_ALL", true)
changeProfileOption("LOOT", true)
changeProfileOption("LOOT_JUMPING", false)
changeProfileOption("LOOT_AGAIN", 2000)
changeProfileOption("LOOT_TIME", 1000)
changeProfileOption("LOOT_DISTANCE", 500)
changeProfileOption("LOOT_IGNORE_LIST_SIZE", 0 )
* accidentally deleted stuff from the main function >.<
Re: Extracting 'scores'
Posted: Wed Mar 05, 2014 9:14 am
by rock5
I can think of 1 more thing. There might be a possibility when you first start the bot that lootIgnoreList is empty. In that case adding a value might cause problems. If you still have problems try
Code: Select all
if lootIgnoreList[1] then
lootIgnoreList[1] = 0
end
Re: Extracting 'scores'
Posted: Wed Mar 05, 2014 7:11 pm
by lisa
honestly I would stop using the default evaluation stuff and just do something specific for the job at hand.
I have a function I am currently using in KS to help eggpet get all the loot, it looks like this
Code: Select all
function checkloot(_count,_dist)
_dist = _dist or 200
_count = _count or 5
local loottable = {}
local count = 0
local objectList = CObjectList();
objectList:update();
local objSize = objectList:size()
for i = 0,objSize do
obj = objectList:getObject(i)
obj:update()
if obj.Type == 2 then
local pawn = CPawn(obj.Address)
if pawn.Lootable and _dist >= distance(player,pawn) then
table.insert(loottable,pawn)
count = count + 1
end
end
end
--print("Count: "..count) -- for testing, works fine
if count >= _count and inventory:itemTotalCount(0) ~= 0 then
local loot = 3
if _count ~= 5 then loot = _count end
for i = 1,loot do
loottable[i]:updateLootable()
if loottable[i].Lootable then
teleport(loottable[i].X,loottable[i].Z)
player:target(loottable[i])
yrest(500)
Attack()
yrest(2000)
end
end
local tmp = CWaypoint(__WPL.Waypoints[__WPL.CurrentWaypoint])
teleport(tmp.X,tmp.Z)
return false
else
return true
end
end
then use this at the waypoint
Code: Select all
repeat
yrest(1000)
until checkloot(3,100)
first arg is number of mobs possible to loot and second is distance. so in your case you would set first arg to 1 and then what ever distance you need. So it will keep doing the code until it passes the criteria set by you, number of mobs left to loot within distance.
Once the function is finished looting it teleports to current waypoint coords and continues on, this may not be what you are after but you can change that without to much hassle. (just delete teleport(tmp.X,tmp.Z))
Re: Extracting 'scores'
Posted: Thu Mar 06, 2014 4:22 am
by ZZZZZ
Thank you! That works spot on. I'll make all the settings more user friendly then might upload the waypoint/userfunction so others can use. Though at the moment it only works with 1 follower..and to solo dps/tank you need a fair bit of Hp. I sit on around 200k hp and get hits for up to 110k xD