Page 1 of 1

windowChoice? error

Posted: Tue Apr 08, 2014 4:45 pm
by ZZZZZ
After looting chests in Garden sometimes MM errors with the below message.

Code: Select all

Player Teleported to X: -182    Z: -43  Y: 8
The game client did not crash.
7:37am - E:\micromacro\scripts\rom/login.lua:51: [string "..."]:146: attempt to
index field '?' (a nil value)
This is the part of the function where it happens (after the chests disappear and before moving to the NPC)

Code: Select all

   for i = 1, #path do
      if (os.time() - starttime) > 60 then break end
      teleport(path[i].X,path[i].Z,path[i].Y)
      openchest(true)
   end
	cprintf(cli.purple,"\nTotal # chests looted: "..chestLootedCounter.."\n")
	exitNPC = player:findNearestNameOrId(123562)
	--teleport(-140,-302,5)
	player:moveTo(exitNPC);
	player:target_NPC(123562) -- Kekonee
	ChoiceOption(1)
	waitForLoadingScreen()
end

Re: windowChoice? error

Posted: Tue Apr 08, 2014 5:32 pm
by lisa
I don't know Z that doesn't seem to add up.

The error message you posted says it teleported to a location in the table and then errored before doing anything else, so it didn't do print of number of chests and it didn't move to NPC.

The error itself seems weird, erroring in login.lua at line 51 is the include("bot.lua") and line 146 of bot.lua is about the args that you do when starting bot, like path: and profile:

So yeah I don't understand, is something else going on in the script, a timer maybe?

Re: windowChoice? error

Posted: Tue Apr 08, 2014 6:05 pm
by ZZZZZ
It's only running the same function that you made for Secret Garden, so I don't believe there is anything else. It doesn't happen every time either, it seems completely random. But out of 150+ characters that I run through the Garden, probably 20-30 get it.

Re: windowChoice? error

Posted: Tue Apr 08, 2014 6:08 pm
by ZZZZZ
Same spot, different error this time:

Code: Select all

Player Teleported to X: -182    Z: -43  Y: 8
The game client did not crash.
9:05am - [string "..."]:146: attempt to index field '?' (a nil value)
144 - 147 in my waypoint is

Code: Select all

      local function distancesortfunc(a,b)
         return b.distance > a.distance
      end
      table.sort(tablechest, distancesortfunc)

Re: windowChoice? error

Posted: Tue Apr 08, 2014 6:34 pm
by Administrator
Check the log. The stack traceback might help.

Re: windowChoice? error

Posted: Tue Apr 08, 2014 9:13 pm
by rock5
It's strange because login.lua is only used to start clients. It should not be being used in the middle of a running script. There isn't even any relogging happening, it's just teleporting.

Re: windowChoice? error

Posted: Wed Apr 09, 2014 2:30 am
by ZZZZZ
I was running 4 clients at the time, could they have somehow been conflicting? Though I hadn't had this issue until recently and I havn't changed anything.

~~ actually I had downloaded latest version of login and fastlogin userfunctions. That was all i believe.

Re: windowChoice? error

Posted: Thu Apr 10, 2014 3:55 am
by ZZZZZ
Odd...I added teleport_SetStepSize(70) to Garden script a while back because I was getting some rubberbanding after the chests, in the hope it would reduce it. Since taking out that line the bot only returned that error 4-5 times in all my characters. I'll run them again tomorrow (assuming garden is still there) and see if its the same deal, might even put it back in to check if that was actually the cause.

Re: windowChoice? error

Posted: Thu Apr 10, 2014 5:10 am
by lisa
each teleport is only around 50-55 anyway, isn't it?
So reducing max teleport distance each step to 70 won't affect it.

this is first 2 spots, distance is 50.

Code: Select all

Command> local x1,z1,x2,z2 = -139,-291,-106,-253 print(math.sqrt( (z2-z1)*(z2-z1) + (x2-x1)*(x2-x1) ))
50.328918128646

Re: windowChoice? error

Posted: Thu Apr 10, 2014 7:59 am
by ZZZZZ
Sorry, i meant after the timer was up I had it teleport to the npc and that's where it was getting rubber band.

Re: windowChoice? error

Posted: Thu Apr 10, 2014 8:08 am
by lisa
ZZZZZ wrote:Sorry, i meant after the timer was up I had it teleport to the npc and that's where it was getting rubber band.
After that many small teleports I would just walk it, takes just a few seconds and you have less issues.

Re: windowChoice? error

Posted: Fri Apr 11, 2014 12:43 am
by ZZZZZ
lisa wrote:After that many small teleports I would just walk it, takes just a few seconds and you have less issues
Yeh thats what I ended up doing, then forgot to remove that line. Hence the -- in front of teleport

Code: Select all

exitNPC = player:findNearestNameOrId(123562)
   --teleport(-140,-302,5)
   player:moveTo(exitNPC);
Ran all my alts through again today, didn't get the error this time. So it must have been the step size somehow causing it. Doesn't make sense but w/e.

Re: windowChoice? error

Posted: Fri Apr 11, 2014 3:00 am
by rock5
Was the teleport step pause changed as well? If it was reduced then that might explain it. If it's set too small it might be trying to teleport too quickly, ie. not waiting long enough between teleports.

Re: windowChoice? error

Posted: Fri Apr 11, 2014 3:28 am
by lisa
yeah pause was changed to low at the start because after each teleport you have a few seconds while it opens 2 chests, so wasn't an issue. Could just change the pause back to default after opening chests I guess.