Page 1 of 2

bitAnd(null) crashing (not autologin issue)

Posted: Thu Sep 23, 2010 1:16 am
by MiesterMan
Hello,

I've noticed this since I updated my bot (I did this back when 3.0.4 sent everything to hell) and it's really starting to impede me so I figured I'd ask if there was some fix to get around this. Maybe I'll just add a repeat to makesure the value shows but here's what's happening:

Code: Select all

We try to find NPC QuestLady: Use MACRO: Executing RoMScript "OnClick_QuestListButton(1,1);".
Use MACRO: Executing RoMScript "AcceptQuest();".
Use MACRO: Executing RoMScript "OnClick_QuestListButton(3,1);".
Use MACRO: Executing RoMScript "CompleteQuest();".
Use MACRO: Executing RoMScript "CloseWindows();".
Clearing target.
Moving to waypoint #2, (31784, 4605)
Moving to waypoint #3, (31795, 4711)
Moving to waypoint #4, (31853, 4973)
Moving to waypoint #5, (31430, 5705)
Moving to waypoint #6, (31420, 5722)
Moving to waypoint #7, (31420, 5722)
We found Scooby Snack and will harvest it.
Clearing target.
Moving to waypoint #8, (31917, 4808)
scripts/rom/classes/pawn.lua:184: bad argument #1 to 'bitAnd' ((null))
The odd thing is that it happens in the same waypoint but it's completely random. This character was on her fourth round when it happened. The other consoles I had running the same route didn't have any problems and completed without issue but just about every time I come back and check at least one has errored out like this randomly.

Edit: I don't really know what loop to put in it though as I have no idea what bitAnd does, something about an offset?

Re: bitAnd(null) crashing (not autologin issue)

Posted: Thu Sep 23, 2010 9:48 am
by MiesterMan
Trying to figure out what additional information I should post. There's no code in the waypoint that this happened at, I use the default profile, and I can run 10 eggscripts continuously without this happening once (I only go for 48 hour instances but that should be long enough). Any debug or log information I can look up to post? I've really never done any of it so I'm kinda at a loss :oops: .

Re: bitAnd(null) crashing (not autologin issue)

Posted: Thu Sep 23, 2010 10:24 am
by rock5
MiesterMan wrote: and I can run 10 eggscripts continuously without this happening once
If you can run them without it happening once, then what's the problem?

Re: bitAnd(null) crashing (not autologin issue)

Posted: Thu Sep 23, 2010 11:15 am
by Administrator
Again, you need to tell us exactly where this is happening. It looks like it could be due to a bugged pawn somewhere in that region of the map, but there's nothing anybody can do about it without information.

Re: bitAnd(null) crashing (not autologin issue)

Posted: Thu Sep 23, 2010 3:19 pm
by MiesterMan
Oh, the script I'm running is my daily quest runner. One sec, I'll send it to you.

Re: bitAnd(null) crashing (not autologin issue)

Posted: Fri Sep 24, 2010 2:18 am
by ezgitaran
Hello,
I got this errör many times too, randomly, in random characters. I encountered with it in Obsidian Stronghold, Janos Forests, SL, Weeping Coast but never in Miller's Ranch. So it seems this happens only in certain situations in combat, which I don't know what is it exactly. My bot running in Obsidian got this error 3 times in same spot, but I don't really know what happened. My waypoint is simple like this:

Code: Select all

<?xml version="1.0" encoding="utf-8"?><waypoints>
	<!-- #  1 --><waypoint x="-12332" z="12845">	</waypoint>
	<!-- #  2 --><waypoint x="-12320" z="12886">	</waypoint>
       ...
	<!-- # 13 --><waypoint x="-12135" z="12757">	</waypoint>
	<!-- # 14 --><waypoint x="-12260" z="12699">	</waypoint>
</waypoints>
However there's lots of modifications in my profile.xml file

Code: Select all

		<option name="HP_LOW_POTION"	value="60" />
		<option name="USE_HP_POTION"	value="best" />

		<option name="HP_REST" value="70" />
		<option name="MP_REST" value="5" />
            <option name="resttype" value="full" />   
            <option name="SIT_WHILE_RESTING" value="true" />  

		<option name="HEALING_POTION" value="0" />
		<option name="MANA_POTION" value="0" />
		<option name="ARROW_QUIVER" value="0" />
		<option name="THROWN_BAG" value="0" />
		<option name="POISON" value="0" />
		<option name="MAX_TARGET_DIST"    value="125" />
		<!-- either false or arrow or thrown -->
		<option name="RELOAD_AMMUNITION" value="false" />	

		<!-- Combat options -->
		<option name="COMBAT_TYPE"        value="" />	
		<option name="COMBAT_RANGED_PULL" value="true" /> 
		<option name="COMBAT_DISTANCE"    value="200" />
		<option name="MAX_FIGHT_TIME"     value="15" />	
		<option name="DOT_PERCENT"        value="90" />
		<option name="ANTI_KS"            value="true" />

		<option name="TARGET_LEVELDIF_ABOVE" value="3" />
		<option name="TARGET_LEVELDIF_BELOW" value="20" />

		<!-- Waypoint and movement settings -->
		<option name="WAYPOINTS"		value="" />  
		<option name="RETURNPATH"		value="" />
		<option name="PATH_TYPE"		value="waypoints" />
		<option name="WANDER_RADIUS"		value="200" />
		<option name="WAYPOINT_DEVIATION"	value="0" />
		<option name="QUICK_TURN" 		value="true" />

		<!-- Loot settings -->
		<option name="LOOT"               value="true" />
		<option name="LOOT_IN_COMBAT"     value="true" />
		<option name="LOOT_DISTANCE"      value="100" />
		<option name="LOOT_PAUSE_AFTER"   value="0" />		

		<!-- Log out and resurrect settings -->
		<option name="LOGOUT_TIME" 			value="0" />	
		<option name="LOGOUT_SHUTDOWN"		value="false" />
		<option name="LOGOUT_WHEN_STUCK"	value="true" />
		<option name="RES_AUTOMATIC_AFTER_DEATH" value="false" />

	<skills>
	    <skill name="KNIGHT_DISARMAMENT" hotkey="VK_6" priority="90" />
	    <skill name="KNIGHT_ENHANCED_ARMOR"    modifier="" hotkey="VK_8" priority="105" />
	</skills>

	<skills_rogue>
		<skill name="ROGUE_LOW_BLOW"    modifier="" hotkey="VK_2" priority="110" />
		<skill name="ROGUE_LIONS_PROTECTION"    modifier="" hotkey="VK_7" priority="95" />
		<skill name="ROGUE_INFORMER"    modifier="" hotkey="VK_5" priority="95" />
		<skill name="ROGUE_SEARING_LIGHT"    modifier="" hotkey="VK_4" priority="104" />
	</skills_rogue>

	<onLeaveCombat><![CDATA[
local dura = inventory:getMainHandDurability();
printf("Durability:%s\n", dura);
if( dura < 20 ) then player:logout(); 
end 
	]]></onLeaveCombat>
Also I modified skills.xml and skills_local.xml to add some missing elite skills but I don't think its related with this problem
Is there anything else I can provide?

Re: bitAnd(null) crashing (not autologin issue)

Posted: Fri Sep 24, 2010 11:09 am
by Administrator
Describe any patterns you might notice. Are there any players around when it happens? Lots of monsters? Is it while moving into a 'new' party of the map (so loading up players, monsters, environmental objects, etc.)?

Re: bitAnd(null) crashing (not autologin issue)

Posted: Fri Sep 24, 2010 11:26 am
by MiesterMan
I think I noticed something. I got the error a few times during the chicken script too now. It seems to happen near or after the waypoint where the quest condition has been met. When I logged back into the chicken harvesters that had crashed they either had 10 or 0 eggs.

Edit: It's also happening on the collection of the tenth.

Edit 2: Is anyone else having this problem or is it just me?

Re: bitAnd(null) crashing (not autologin issue)

Posted: Fri Sep 24, 2010 1:54 pm
by DrG
never get this error on chickens farm.

when it apears is when i'm killing mobs. i try it in differents places and always hapened this error.

the only situation i don't get this error is when i put in wander mode and radius zero. if put radius different than zero sonner or later the error it's there. :)

can't give more info because when this happened i almost never in front of the pc. :))))))

Re: bitAnd(null) crashing (not autologin issue)

Posted: Fri Sep 24, 2010 9:55 pm
by Paton
This error happened to me at Miller´s ranch, so it can happen anywhere. At Miller's ranch there are no players, so it is something else.

I wasnt there, when it happened. All i can Report from the MM Window is:

Miller's ranch
Char was at waypoint #1(waypoint where the char looks for hens to feed with sacks) in Rock5 Hen script and then

Code: Select all

.../scripts/rom/classes/pawn.lua:184: bad argument #1 to 'bitAnd' <<null>>

Re: bitAnd(null) crashing (not autologin issue)

Posted: Sat Sep 25, 2010 1:11 pm
by Administrator
Someone try this. On line 184 of pawn.lua, you'll see this:

Code: Select all

	self.Lootable = bitAnd(self.Lootable, 0x4);
Directly above this line, insert this:

Code: Select all

if( self.Lootable == nil ) then
  printf("Erroneous pawn, name: %s\n", tostring(self.Name));
end 
Save. Post results.

Re: bitAnd(null) crashing (not autologin issue)

Posted: Sat Sep 25, 2010 5:13 pm
by sfrattini
Hi,
having experienced the same annoying problem in the last weeks without finding a working solution, finally this thread brings some light.
As said from previous posts, this error happens randomly. In my case specifically when entering end exiting instances and loading areas of the game (basically when the player address changes) if I run a standard bot with no area load, relog or party generation the error does not happen. :o
Attached screenshot and log.txt after adding the new string in pawn.lua, I am not an expert but this:
scripts\rom/bot.lua:636: in function 'foo'
sounds a bit strange...
Hope it helps.

Re: bitAnd(null) crashing (not autologin issue)

Posted: Sun Sep 26, 2010 12:07 am
by rock5
sfrattini, erasing the pawn name defeats the purpose of adding that line in the first place. Obviously Administrator feels he needs the name of the pawn that is causing problems.

If the pawn name is somehow personal then at lease say what it is, eg. "It's my characters name", "It's my pet name" etc.

Re: bitAnd(null) crashing (not autologin issue)

Posted: Sun Sep 26, 2010 12:14 am
by sfrattini
yes, it is my Char name.
I can also add a consideration, the error seems happening more frequent when the ROM client is running since more time. If I restart ROM and start the bot it might go well for an hour or two then starting to crash.

Re: bitAnd(null) crashing (not autologin issue)

Posted: Sun Sep 26, 2010 3:42 am
by MiesterMan
Actually sfrattini, I think what you've described in directly related to the login issue though at the same time we may be coming up with a way to fix that with this issue. At least that's what I'm seeing.

Administrator: I'm sorry, I've been very busy, just read the bottom part of this thread. I'll give it a try and let you know.

Re: bitAnd(null) crashing (not autologin issue)

Posted: Sun Sep 26, 2010 1:21 pm
by MiesterMan
So far all I've been getting is the autologin fail where is says the <NONE> in the name. I'll keep testing.

Re: bitAnd(null) crashing (not autologin issue)

Posted: Sun Sep 26, 2010 3:57 pm
by sfrattini
What I do is having 2 clients running, entering an instance, fight, exit and regroup. But happens also with profiles that travel from area to area and of course with login.

Re: bitAnd(null) crashing (not autologin issue)

Posted: Mon Sep 27, 2010 1:27 am
by rock5
sfrattini wrote:What I do is having 2 clients running, entering an instance, fight, exit and regroup. But happens also with profiles that travel from area to area and of course with login.
There used to be a memory leak issue where every time you teleported, entered your house,etc. the game would use more and more memory until it crashed. Although it has been mostly fixed I believe it is still an issue. So if you have a script that does one of those things, it will eventually crash. Try checking how much memory the game is taking after running 1 of those scripts for an hour or 2.

Re: bitAnd(null) crashing (not autologin issue)

Posted: Tue Sep 28, 2010 1:09 am
by sfrattini
So it is a game related issue. Is there anything we can do?

Re: bitAnd(null) crashing (not autologin issue)

Posted: Tue Sep 28, 2010 1:49 am
by rock5
sfrattini wrote:So it is a game related issue. Is there anything we can do?
Anything that reduces memory use might help. Remove any addons you don't need and reduce the graphic details to minimum. And try not to run any other memory hog programs at the same time. That might help.