Keep laying traps.... wtf

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Post Reply
Message
Author
whome
Posts: 58
Joined: Fri Jun 17, 2011 2:51 am

Keep laying traps.... wtf

#1 Post by whome »

Even without a cavy appearing, i keep laying traps. I have logged out and restarted MM several times, but have wasted aboout 6 traps... grrrr. What can I do to stop this???
User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: Keep laying traps.... wtf

#2 Post by lisa »

Well going to need more info of course.

I'd try loading character with default profile, if it doesn't lay any traps then check whats in your profile that is causing it to lay traps.
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
whome
Posts: 58
Joined: Fri Jun 17, 2011 2:51 am

Re: Keep laying traps.... wtf

#3 Post by whome »

I copied a profile that works fine, just changed the name. It seems to think I have a cavy to catch and lays a trap for some reason. I have changed to catch golden only but it just lays traps regardless even without a cavy?
User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Keep laying traps.... wtf

#4 Post by rock5 »

Also what version of the catchcavy script are you using? And copy the commands you tried here.
  • 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
whome
Posts: 58
Joined: Fri Jun 17, 2011 2:51 am

Re: Keep laying traps.... wtf

#5 Post by whome »

Heres the cavy thingy....

Code: Select all

--==<<            Rock5'scatchCavy function               >>==--
--==<<           By Rock5        Version 1.02             >>==--
--==<<                                                    >>==--
--==<<  www.solarstrike.net/phpBB3/viewtopic.php?p=12979  >>==--

function catchCavy(_cavy)

	local hpper = 50 -- Players hp percent threshhold to give-up catching the cavy
	_cavy = _cavy or 103567 -- Default value "Golden Magic Cavy"
	if string.lower(_cavy) == "cavy" then -- Look for all cavies
		_cavy = {103566,103567}
	end

	local cavy = player:findNearestNameOrId(_cavy, player.IgnoreCavy)

	if not cavy then return end -- No cavy, return

	yrest(200); -- Make sure you've come to a complete stop.
	player:update()

	-- Don't catch cavy if still battling.
	if player.Battling  and
		player:findEnemy(true, nil, evalTargetDefault) then
		return
	end

	local function CalcNewPos(_trap, _cavy)
		local HerdDist = 50 -- distance to herd cavy
		local TrapCavyDist = distance(_trap.X, _trap.Z, _cavy.X, _cavy.Z)
		local Ratio = (TrapCavyDist + HerdDist) / TrapCavyDist
		local x = (_cavy.X - _trap.X) * Ratio + _trap.X
		local z = (_cavy.Z - _trap.Z) * Ratio + _trap.Z
		local NewPos = CWaypoint(x, z)
		NewPos.Type = 4 -- Travel
		return NewPos
	end

	if cavy and inventory:useItem(206776) then -- Huntsman's Trap
		cprintf(cli.yellow,"\a\aAttempting to catch cavy...\n")
		yrest(3000)
		player:update()
		trap = {X = player.X, Z = player.Z}

		while true do
			cavy:update()
			if cavy.Id == 0 then break end -- cavy is gone
			if distance(cavy.X, cavy.Z, trap.X, trap.Z ) < 5 then -- cavy is in trap
				printf("Cavy is in trap\n")
				memoryWriteInt(getProc(), player.Address + addresses.pawnTargetPtr_offset, cavy.Address);
				RoMScript("UseSkill(1,1)"); yrest(50); RoMScript("UseSkill(1,1)"); -- 'click' again to be sure
				yrest(2000);
				break
			end
			if player.Battling and (100*player.HP/player.MaxHP) < hpper then -- taking too much damage. fight
				player.IgnoreCavy = cavy.Address
				break
			end

			NewPos = CalcNewPos(trap, cavy)
			player:moveTo(NewPos, true)
			yrest(200)
			player:update()
		end
	end
end
and a bit of my profile...

Code: Select all

<onLeaveCombat><![CDATA[
		-- Additional Lua code to execute after killing an enemy
		catchCavy()
		player:update()
		if 65 > (player.Pet.HP/player.Pet.MaxHP * 100) then
		player:target( player.Pet )
		player:cast("WARDEN_ELVEN_PRAYER")
		yrest(3000)
		end
	]]></onLeaveCombat>
Does each character have an event log or something, its like the stupid thing thinks it has to catch a cavy from ages ago......
User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: Keep laying traps.... wtf

#6 Post by lisa »

Is it possible it is now detecting cavy that is far away?
If so might need to add in a distance check before laying traps.
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
whome
Posts: 58
Joined: Fri Jun 17, 2011 2:51 am

Re: Keep laying traps.... wtf

#7 Post by whome »

BizARRo, I played another char for a little while, then came back to this one and, VIOLA, it is fine. I have no idea what happened....
User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Keep laying traps.... wtf

#8 Post by rock5 »

lisa wrote:Is it possible it is now detecting cavy that is far away?
If so might need to add in a distance check before laying traps.
I was thinking that but wouldn't it try to catch it anyway? Then you'd see that it is trying to catch a cavy far away. Still, it probably does need a distance check now. I'll see about updating it. Maybe compare it to MAX_TARGET_DIST.
  • 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
whome
Posts: 58
Joined: Fri Jun 17, 2011 2:51 am

Re: Keep laying traps.... wtf

#9 Post by whome »

There was noone near me, I was literally miles from anyone, and there was defiitely no cavys about. It was very strange. I just had to kill something, and it would say setting a trap... like about six times. In fact to describe the incident more, I would kill a mushroom and have my character lay a trap. Thinking 'bloody hell' I would find something close hoping it would drop a cavy before the trap disappears, to only have the dopey character drop another trap within inches of the first :shock: . Restarting MM changed nothing. I had to play another character for this bizarre behaviour to stop....... Still, trying to catch other peeps cavys is annoying to say the least. Maybe a distance thingy would be a great idea.......
whome
Posts: 58
Joined: Fri Jun 17, 2011 2:51 am

Re: Keep laying traps.... wtf

#10 Post by whome »

Hate to ask, but now that things have quietened down a little (I think) can someone point me in the direction as to how I can add a range/distance option to the catchcavy script as suggested by Rock? Then I won't run off and try to catch someone elses cavy, which more often than not, run and hide just as the trap is laid, wasting the bloody trap....... :(
User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Keep laying traps.... wtf

#11 Post by rock5 »

whome wrote:Hate to ask, but now that things have quietened down a little (I think) can someone point me in the direction as to how I can add a range/distance option to the catchcavy script as suggested by Rock? Then I won't run off and try to catch someone elses cavy, which more often than not, run and hide just as the trap is laid, wasting the bloody trap....... :(
Try changing line 16

Code: Select all

	if not cavy then return end -- No cavy, return
to

Code: Select all

	if not cavy or
		distance(cavy.X, cavy.Z, player.X,player.Z) > settings.profile.options.MAX_TARGET_DIST then
		return -- No cavy, return
	end
Let me know if that works.
  • 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