Extracting 'scores'

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Message
Author
ZZZZZ
Posts: 513
Joined: Sun Oct 21, 2012 1:42 am

Re: Extracting 'scores'

#41 Post 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..
User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Extracting 'scores'

#42 Post by rock5 »

Did you try

Code: Select all

lootIgnoreList[1] = 0
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.
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan
ZZZZZ
Posts: 513
Joined: Sun Oct 21, 2012 1:42 am

Re: Extracting 'scores'

#43 Post 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 >.<
User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Extracting 'scores'

#44 Post 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
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan
User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: Extracting 'scores'

#45 Post 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))
Remember no matter you do in life to always have a little fun while you are at it ;)

wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
ZZZZZ
Posts: 513
Joined: Sun Oct 21, 2012 1:42 am

Re: Extracting 'scores'

#46 Post 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
Post Reply