Page 1 of 1

my game crashes when i collect Mysterious Bags after a while

Posted: Tue Mar 26, 2013 9:16 pm
by abron1

Code: Select all

if player:findNearestNameOrId("Mysterious Bag") then
        player:target_Object("Mysterious Bag")
        yrest(2000) -- If not enough time to pick up bag, increase it.
	end
this is where the code is being used

Code: Select all

<onLeaveCombat><![CDATA[
		-- Additional Lua code to execute after killing an enemy
   	if player:findNearestNameOrId("Mysterious Bag") then
        player:target_Object("Mysterious Bag")
        yrest(2000) -- If not enough time to pick up bag, increase it.
	end
	useGoodie("speed");
   	useGoodie("luck");
   	useGoodie("patt3");
	useGoodie("defense");
	useGoodie("agro"); 
	useGoodie("casting");
	catchCavy()
   	
    	]]></onLeaveCombat>
not sure why it crashes after a few hours or running but if i bot without the code it runs all night

Re: my game crashes when i collect Mysterious Bags after a w

Posted: Tue Mar 26, 2013 10:33 pm
by rock5
Maybe after the bot 'sees' the bag and starts walking towards it, someone comes along and takes the bag before you so that when you get to the bag it's already gone. Is that possible? If so, you could go to the bag and then check if it exists again before taking it.

Code: Select all

local bag = player:findNearestNameOrId("Mysterious Bag")
if bag then
   player:moveTo(bag,true)
   bag:update() -- If bag no longer exists, Id will become 0.
   if bag.Id ~= 0 then 
      player:target_Object("Mysterious Bag")
      yrest(2000) -- If not enough time to pick up bag, increase it.
   end
end

Re: my game crashes when i collect Mysterious Bags after a w

Posted: Tue Mar 26, 2013 10:38 pm
by lisa
If you are in a party any char can "loot" the bag but only one can actually get loot from the bag, after a short time the loot becomes available to anyone but it dissappears very shortly after that.

Re: my game crashes when i collect Mysterious Bags after a w

Posted: Wed Mar 27, 2013 12:36 am
by abron1
nah no one takes the bag before me but maybe i need to have to much in the on leave or not enough yeast times inbetween commands

Code: Select all

We found Mysterious Bag and will harvest it.
We didn't move to the loot!? Root buff? Missing 'click to move' option?
10:52pm - ...rs/User/Desktop/micromacro/scripts/rom/functions.lua:321: bad argum
ent #1 to 'memoryWriteBytePtr' ((null))
i guess i should have posted the error lol

Re: my game crashes when i collect Mysterious Bags after a w

Posted: Wed Mar 27, 2013 1:44 pm
by NyTr0g3n3
Hi everybody,

You're not the only one. I have exactly the same problem when my char try to take the Bag and I have no idea of what it could be.

Re: my game crashes when i collect Mysterious Bags after a w

Posted: Wed Mar 27, 2013 4:07 pm
by abron1
its only the bags in Merdhin Tundra for me not sure if the bags are different or what.

Re: my game crashes when i collect Mysterious Bags after a w

Posted: Wed Jun 19, 2013 11:59 am
by Buster99
My game is constantly crashing while trying to loot Mysterious bags. Never had problem before last patch. I also recently updated to MM 1.03 and latest RoM revision. It happens after about 30-60 minutes of farming in new zone. Error is always same:

We found Mysterious Bag and will harvest it.
We didn't move to the loot!? Root buff? Missing 'click to move' option?
...micromacro/script/rom/functions.lua:756: bad argument #1 to 'memoryReadByte' <<null>>

Any ideas?

Re: my game crashes when i collect Mysterious Bags after a w

Posted: Wed Jun 19, 2013 6:24 pm
by grande
I had a lot of code in my onLeaveCombat part of the profile. I eliminated much of the extra code and experienced less crashing but so far it still seems to happen and still seems to be related to something in the onLeaveCombat. I made some recent additional slimdown to my onLeaveCombat section but haven't had time to see if it helped any.

To me, it seems like it's related to the memory issues RoM has. My observation is that extra code in onLeaveCombat eventually contributes to RoM's poor memory processing and a crash. just my S.W.A.Guess though.

Re: my game crashes when i collect Mysterious Bags after a w

Posted: Wed Jun 19, 2013 6:45 pm
by lisa
Buster99 wrote:micromacro/script/rom/functions.lua:756: bad argument #1 to 'memoryReadByte' <<null>>
Same error you posted in the GM detect and saying it happens when someone is detected as following you?


I think maybe there is an underlying issue that you might need to narrow down the actual error.

Like grande said though it could simply be an issue with RoM's very well known issue with memory.

As I did say in response to your other post though that error is because MM can't find the game process anymore (basically the game crashed). MM isn't causing the game to crash but it is telling you that the game did crash.
So you need to work out why the game itself is crashing.

Re: my game crashes when i collect Mysterious Bags after a w

Posted: Wed Jun 19, 2013 9:11 pm
by grande
It finally dawned on me that the only time I was really crashing consistently was indeed when running waypoints that pick up the "Mysterious Bag". I'm impatient so I'll just post what I changed below. It's been running for nearly an hour with no crash so if that keeps up I won't post again and assume this change worked. I changed the onleavecombat a little. instead of two target objects it now targets the object and then does player:loot() like so:

Code: Select all

if player:findNearestNameOrId("Mysterious Bag") and inventory:itemTotalCount(0) ~= 0 then
player:target_Object("Mysterious Bag")
yrest(800)	 
player:loot()
yrest(900)
end
You may need to change the yrest values to be optimal for your lag situation. Also, here's what my code actually looks like... I added a bit because I was having troubles getting it to go sell at various points which this seems to have resolved:

Code: Select all

if player:findNearestNameOrId("Mysterious Bag") and inventory:itemTotalCount(0) ~= 0 then
player:target_Object("Mysterious Bag")
yrest(800)	 
player:loot()
yrest(900)
elseif inventory:itemTotalCount(0) == 0 then
	__WPL:setWaypointIndex(__WPL:findWaypointTag("sell"));
end
I was just getting frustrated with it constantly trying to loot the friggin bag when the bags were full instead of going off to sell like it should.

Re: my game crashes when i collect Mysterious Bags after a w

Posted: Thu Jun 20, 2013 6:14 am
by grande
Works a lot better now, no crashes since changing in the "player:loot" part