3.0.4 problem again :)

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Message
Author
User avatar
MiesterMan
Posts: 543
Joined: Tue Jul 06, 2010 9:15 pm
Location: Between the Second and Third Circles of Hell

Re: 3.0.4 problem again :)

#61 Post by MiesterMan » Thu Sep 23, 2010 1:12 am

I'm gonna make a new thread for this but the issue he mentioned above is unfortunately not with autorelog. This is the 15th time it randomly happened in the same place in my script. I have another script runnning the exact same thing that goes fine but at this waypoint on one of my consoles it does this...

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))

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

Re: 3.0.4 problem again :)

#62 Post by Administrator » Thu Sep 23, 2010 2:41 am

So you actually going to give a detailed explanation of what happened, or are you want us to read your mind?
You need to provide information such as how often it happens, when it happens, where it happens, whether it only happens with certain sets of waypoints or not, whether it only happens on certain characters or not, and any other potentially useful information.

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

Re: 3.0.4 problem again :)

#63 Post by rock5 » Thu Sep 23, 2010 2:42 am

MiesterMan wrote:scripts/rom/classes/pawn.lua:184: bad argument #1 to 'bitAnd' ((null))[/code]
Hm... I don't normally respond to threads about these bitAnd errors because I've never encountered them myself but I've made some observations about this one.

The code in question is this;

Code: Select all

	self.Lootable = debugAssert(memoryReadInt(proc, self.Address + addresses.pawnLootable_offset), memerrmsg);
	if( self.Type == 2 ) then
		--printf("%s Lootable flag: 0x%X (%d)\n", self.Name, self.Lootable, self.Lootable);
	end
	self.Lootable = bitAnd(self.Lootable, 0x4);
So what the error means is sometimes the first line returns nil. I'm not sure what could cause a memory read to return nil. Maybe running too many clients at once causes this but that is just speculation?

A thought comes to mind, though, why use a bit wise operation at all? Why not just use memoryReadByte?
  • 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
Administrator
Site Admin
Posts: 5307
Joined: Sat Jan 05, 2008 4:21 pm

Re: 3.0.4 problem again :)

#64 Post by Administrator » Thu Sep 23, 2010 2:48 am

A thought comes to mind, though, why use a bit wise operation at all? Why not just use memoryReadByte?
Because of the way flags work. If we need to check for a flag (0x2) being set, the number could be 0x2 or 0x3, or... any number of combinations and still be set. It's much easier to use bitwise operations to check for this rather than a huge number of conditions.

Anyways, it doesn't mater. The problem here is that the memory reading is failing for some reason, not the bitAnd() function.

net_ralf
Posts: 28
Joined: Thu Feb 04, 2010 9:40 am

Re: 3.0.4 problem again :)

#65 Post by net_ralf » Thu Sep 23, 2010 4:14 am

My solution for my problem :) leave you pc off for one night and then it works :) lol

swietlowka
Posts: 316
Joined: Wed Jun 16, 2010 8:16 am

Re: 3.0.4 problem again :)

#66 Post by swietlowka » Thu Sep 23, 2010 5:01 am

best way to solve it would be to add that when this bitand is null the bot waits for for example 5s, cause from my observation its something with the memory reading and if you just start it right after error it works again with no problem

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

Re: 3.0.4 problem again :)

#67 Post by rock5 » Thu Sep 23, 2010 8:56 am

Administrator wrote:
A thought comes to mind, though, why use a bit wise operation at all? Why not just use memoryReadByte?
Because of the way flags work. If we need to check for a flag (0x2) being set, the number could be 0x2 or 0x3, or... any number of combinations and still be set. It's much easier to use bitwise operations to check for this rather than a huge number of conditions.

Anyways, it doesn't mater. The problem here is that the memory reading is failing for some reason, not the bitAnd() function.
Ah yes, I'm showing my ignorance again. A byte is not a bit. You still need to get the bit. There is no memoryReadBit. LoL

Anyway, couldn't we just say after the memory read "if Lootable == nil then Lootable = false"?

Also, I don't understand how Lootable is being used.
Doesn't

Code: Select all

   self.Lootable = bitAnd(self.Lootable, 0x4);
mean that self.Lootable will equal 0 or 4?

And doesn't that mean

Code: Select all

if target.Lootable then
will always return true?

Maybe it's supposed to be

Code: Select all

   self.Lootable = bitAnd(self.Lootable, 0x4) == 0x4;
That way you get a true or false value.

And yet it seems to work anyway.
Last edited by rock5 on Thu Sep 23, 2010 9:01 am, edited 1 time in total.
  • 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
Administrator
Site Admin
Posts: 5307
Joined: Sat Jan 05, 2008 4:21 pm

Re: 3.0.4 problem again :)

#68 Post by Administrator » Thu Sep 23, 2010 9:00 am

rock5 wrote: Also, I don't understand how Lootable is being used.
Doesn't

Code: Select all

   self.Lootable = bitAnd(self.Lootable, 0x4);
mean that self.Lootable will equal 0 or 4?
Nope. It returns if the flag stored at 0x4 is on or off.


We could assume false if there is a problem reading memory, but it's best to figure out why it's failing to begin with. There's about a million different things that I can think of that could cause that, but, as of yet, nobody has provided enough information to even begin to understand what the problem is.

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

Re: 3.0.4 problem again :)

#69 Post by rock5 » Thu Sep 23, 2010 9:05 am

Administrator wrote:Nope. It returns if the flag stored at 0x4 is on or off.
But what value does it return? What value does Lootable have if the target is lootable or not lootable?
  • 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
MiesterMan
Posts: 543
Joined: Tue Jul 06, 2010 9:15 pm
Location: Between the Second and Third Circles of Hell

Re: 3.0.4 problem again :)

#70 Post by MiesterMan » Thu Sep 23, 2010 9:44 am

Sorry, started a new thread for it here.

Cookie
Posts: 2
Joined: Fri Nov 26, 2010 6:46 am

Re: 3.0.4 problem again :)

#71 Post by Cookie » Fri Nov 26, 2010 6:52 am

Hello, i have the same Prob like net_ralf.

...macro/micromacro/scripts/rom/classes/memorytable.lua:37: attempt to compare number with nil

I reinstalled, updated and checked all, any Idea?

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

Re: 3.0.4 problem again :)

#72 Post by rock5 » Fri Nov 26, 2010 7:31 am

Cookie wrote:Hello, i have the same Prob like net_ralf.

...macro/micromacro/scripts/rom/classes/memorytable.lua:37: attempt to compare number with nil

I reinstalled, updated and checked all, any Idea?
That just happened to me. Don't know what caused it but restarting the game fixed 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
botje
Posts: 656
Joined: Wed Oct 27, 2010 7:17 am

Re: 3.0.4 problem again :)

#73 Post by botje » Fri Nov 26, 2010 7:33 am

works fine for me O.o

no errors seen after patch.

Botje

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

Re: 3.0.4 problem again :)

#74 Post by rock5 » Fri Nov 26, 2010 9:51 am

Damn! Happened again, and this time it was right after starting the game. Again, restarting the game fixed it.

Weird, I hope this doesn't become a common occurrence.
  • 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

Cookie
Posts: 2
Joined: Fri Nov 26, 2010 6:46 am

Re: 3.0.4 problem again :)

#75 Post by Cookie » Fri Nov 26, 2010 1:27 pm

Hi!

Restarting the Game didnt fix my problem :/ any other Ideas?

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest