check and inv player

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

check and inv player

#1 Post by ZZZZZ » Fri Apr 04, 2014 6:47 pm

I have made waypoints for farming TT and IDK, but trying to completely automate TT farm to be as fast as possible I added a check for my alts in a list, and inv 1 of them before entering. When I first run the waypoint it works fine, invites, runs through, kills/loots and resets. The issue is when it gets to the same spot, it'll just sit there, rather than inv a new char. This is my waypoint:

Code: Select all

	<!-- # 15 --><waypoint x="11588" z="2266" y="34">
	inParty = false
	repeat
		player:update()
		if RoMScript("UnitExists('party1')") then
			GoThroughPortal()
			inParty = true
			fly()
		else
			if player.Name == "Main1" or player.Name == "Main2" then
				local altList = {"Alt1","Alt2","Alt3","Alt4","Alt5"}
				local obj = nil;
				local objectList = CObjectList();
				repeat
					objectList:update();
					player:updateXYZ()
					for i = 0,objectList:size() do
						obj = objectList:getObject(i);   
						if obj ~= nil and obj.Type == 1 then
							for k,v in pairs(altList) do
								if obj.Name == v and 100 >= distance(player,obj) then
									player:target(obj.Address)
									RoMScript('InviteToParty("target")')
									invited = true
								end
							end
						end
						if invited and invited == true then
							break
						end
					end
				yrest(2000);
				until RoMScript("UnitExists('party1')")
			else
				if player.Aggro then
					player:fight()
				else
					yrest(5000);
				end
			end
		end
	until inParty
	</waypoint>

User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: check and inv player

#2 Post by lisa » Fri Apr 04, 2014 7:18 pm

fill the code with prints and then you will know exactly where the issue is ;)
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: check and inv player

#3 Post by ZZZZZ » Fri Apr 04, 2014 7:35 pm

>.< I keep forgetting to do that..... hopefully next time i'll remember this post and put in prints... the variable 'invited' wasnt being set back to false, so it would simply break the object check on the 1st found :/ Ty lol

ZZZZZ
Posts: 513
Joined: Sun Oct 21, 2012 1:42 am

Re: check and inv player

#4 Post by ZZZZZ » Sat Apr 05, 2014 12:57 am

A similar issue again ... but this time print's are not working for me.
This is supposed to locate and fight Crasset Hairyfoot, 2nd boss in IDK. Have tried both its Id's (IDK35 = 101587, IDK50 = 101883) and neither of them work. I have Max target dist set to 500 to make sure it finds it. Using findNearestNameOrId() will find the boss, but then player:fight() doesn't even do anything. Any help would be great :)

Code: Select all

repeat
					print("Looking")
					if player:findEnemy(nil,101587,evalTargetDefault) then	
						print("Found Crasset Hairyfoot")
						if player.Class1 == 4 and player.Class2 == 7 then -- mage/warden
							MWDBoss(true)
						end					
						hairyFoot = player:findEnemy(nil,101587,evalTargetDefault)
						repeat
							player:target(hairyFoot)
							MWDSpam()
							player:fight()
							hairyFoot = player:findEnemy(nil,101587,evalTargetDefault)
						until not player:findEnemy(nil,101587,evalTargetDefault)
						hairyFootDead = true
					else
						yrest(50);
					end
				until hairyFootDead

User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: check and inv player

#5 Post by lisa » Sat Apr 05, 2014 1:34 am

So you are saying findNearestNameOrId() works but findenemy doesn't ?

if findenemy isn't working it is probably because the mob doesn't meet the requirements of something to kill, so maybe the elite factor ?

You could simply use findNearestNameOrId(), then target it, then player:fight and not use findenemy at all but you should find out why it's not finding the boss as an enemy. Easiest way is to turn on debugging and DEBUG_TARGET to true and it will print on screen why it won't target it.
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: check and inv player

#6 Post by ZZZZZ » Sat Apr 05, 2014 4:37 am

Found out by accident. Apparently there is a distance check with findEnemy and player:fight()? Because when I ran close to the boss it started to attack.. solved by porting down to it.

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: check and inv player

#7 Post by rock5 » Sat Apr 05, 2014 6:25 am

"down to it"? There is also an angle check. If the angle is too steep then it will assume the target is on another level and ignore it.
  • 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: check and inv player

#8 Post by lisa » Sat Apr 05, 2014 6:42 am

That is part of evalTargetDefault though, so if you know that there is a boss there you want to kill then don't use the evaluate target.
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: check and inv player

#9 Post by ZZZZZ » Sat Apr 05, 2014 9:27 am

I use it because it's the easiest way I know to get target and then know if it's dead so I can loot lol. And yeh, that must have been it Rock, I stop alts above the room to avoid aggro.

User avatar
Administrator
Site Admin
Posts: 5331
Joined: Sat Jan 05, 2008 4:21 pm

Re: check and inv player

#10 Post by Administrator » Sat Apr 05, 2014 10:17 am

You can specify your own callback instead of evalTargetDefault. Just create a new function that emulates the way evalTargetDefault works but without the stuff that is prohibiting it from functioning the way you want. If you're just doing it to target a specific boss, you can simple change it to check for name or ID instead of all the fancy stuff.

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: check and inv player

#11 Post by rock5 » Sat Apr 05, 2014 10:26 pm

The id argument of findEnemy already does that. If all you want to do is find the enemy with that id just ise the id argument and leave out the eval function.
  • 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

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest