onLoad error

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Post Reply
Message
Author
User avatar
jduartedj
Posts: 599
Joined: Sat Dec 19, 2009 12:18 am
Location: Lisbon
Contact:

onLoad error

#1 Post by jduartedj »

I get this error:

Code: Select all

...ktop/Jogos/micromacro/scripts/rom/classes/player.lua:1424: attempt to index l
ocal 'pA' (a nil value)
when I use player:moveTo(point, nil) in the onLoad section.
heres the corresponding fragment of the file

Code: Select all

<?xml version="1.0" encoding="utf-8"?><waypoints>
<onLoad>

--WC_R+L_keypoint file
--Weeping Coast, Farming Raptors and Leopards
--JDuarteDJ's Keypoint system 
--ultimate-bot project
--COORDINATES (x="15901" z="24787")

local dqCount, dqPerDay = RoMScript("Daily_count()");
local point = CWaypoint(15901, 24787);
--force to be at keypoint				
player:moveTo(point, nil);
Any help would be appreciated, thanks.
Thanks for reading! :D

Some of you might find this useful: RoM-bot Wiki
User Functions Repository (and other useful files): Addon Repo
Latest SVN updates: SVN updates
User avatar
Administrator
Site Admin
Posts: 5353
Joined: Sat Jan 05, 2008 4:21 pm

Re: onLoad error

#2 Post by Administrator »

Are you sure that your player.lua is up to date? Try deleting and reupdating. It might have got broken.
User avatar
jduartedj
Posts: 599
Joined: Sat Dec 19, 2009 12:18 am
Location: Lisbon
Contact:

Re: onLoad error

#3 Post by jduartedj »

Administrator wrote:Are you sure that your player.lua is up to date? Try deleting and reupdating. It might have got broken.
Oh the line numbers may not match the SVN because I included the target Boss patch in the other thread. anyway using TortoiseMerge (or Diff) I have confirmed that it is (other than that Boss part) the same as revision 529 which is, if I'm not mistaken, the last modification to the file.

I got this error more than once... then in some other occasions I don't get it anymore o.O ! It's weird...
Thanks for reading! :D

Some of you might find this useful: RoM-bot Wiki
User Functions Repository (and other useful files): Addon Repo
Latest SVN updates: SVN updates
User avatar
Administrator
Site Admin
Posts: 5353
Joined: Sat Jan 05, 2008 4:21 pm

Re: onLoad error

#4 Post by Administrator »

Then what is on the line that is generating the error for you?
User avatar
jduartedj
Posts: 599
Joined: Sat Dec 19, 2009 12:18 am
Location: Lisbon
Contact:

Re: onLoad error

#5 Post by jduartedj »

Administrator wrote:Then what is on the line that is generating the error for you?
This is a bit of the context for you to have an idea where it is, and the line is marked 1424:

Code: Select all

	if( player.Returning ) then
		wpl = __RPL;
	else
		wpl = __WPL;
	end

	if (__WPL:getMode() == "waypoints") then
		local pA = wpl.Waypoints[wpl.LastWaypoint]
		local pB = wpl.Waypoints[wpl.CurrentWaypoint]

1424:here->V = getNearestSegmentPoint(player.X, player.Z, pA.X, pA.Z, pB.X, pB.Z);
	else
		V = CWaypoint(player.X, player.Z); -- Distance check from player in wander mode
	end

	-- use a bounding box first to avoid sqrt when not needed (sqrt is expensive)
	if( target.X > (V.X - settings.profile.options.MAX_TARGET_DIST) and
		tar
Thanks for reading! :D

Some of you might find this useful: RoM-bot Wiki
User Functions Repository (and other useful files): Addon Repo
Latest SVN updates: SVN updates
User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: onLoad error

#6 Post by rock5 »

pA being nil would imply a problem with the value wpl.LastWaypoint. That should still be the default value of 1 in the onLoad section. It should find that waypoint. Has waypointlist.lua been kept up to date as well?
  • 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
jduartedj
Posts: 599
Joined: Sat Dec 19, 2009 12:18 am
Location: Lisbon
Contact:

Re: onLoad error

#7 Post by jduartedj »

rock5 wrote:pA being nil would imply a problem with the value wpl.LastWaypoint. That should still be the default value of 1 in the onLoad section. It should find that waypoint. Has waypointlist.lua been kept up to date as well?

Yeah i'm pretty sure it is because I recently updated all the bot...
Thanks for reading! :D

Some of you might find this useful: RoM-bot Wiki
User Functions Repository (and other useful files): Addon Repo
Latest SVN updates: SVN updates
User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: onLoad error

#8 Post by rock5 »

jduartedj wrote:Yeah i'm pretty sure it is because I recently updated all the bot...
Ok I figured it out. It's because you don't have any waypoints. Part of moveto is evaluating targets. Part of evaluating targets is checking their distance to the waypoints. If there are no waypoints it causes that error.

You could create a dummy waypoint but I think that would mean it wouldn't target mobs because they are too far from the waypoint. What you could do is change the mode to 'wander' that way it will check the distance to the player instead of non existing waypoints.

So first use this command.

Code: Select all

__WPL.Mode = "wander"
Then the rest should work.

I'll probably add a fix that if a waypoint file has no waypoints then it sets the mode to wander.
  • 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
jduartedj
Posts: 599
Joined: Sat Dec 19, 2009 12:18 am
Location: Lisbon
Contact:

Re: onLoad error

#9 Post by jduartedj »

THANKS!! it's as if you read my mind! I just have that error again and was gonna post some more info!

EDIT: I'm gonna use a lot of "keypoints" that don't have any waypoints so I'd appreciate that fix.
Thanks for reading! :D

Some of you might find this useful: RoM-bot Wiki
User Functions Repository (and other useful files): Addon Repo
Latest SVN updates: SVN updates
User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: onLoad error

#10 Post by rock5 »

Ok added to rev 539.
  • 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
jduartedj
Posts: 599
Joined: Sat Dec 19, 2009 12:18 am
Location: Lisbon
Contact:

Re: onLoad error

#11 Post by jduartedj »

rock5 wrote:Ok added to rev 539.
thanks!
Thanks for reading! :D

Some of you might find this useful: RoM-bot Wiki
User Functions Repository (and other useful files): Addon Repo
Latest SVN updates: SVN updates
Post Reply