Error with getpos ?

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Post Reply
Message
Author
Jiggaboo
Posts: 9
Joined: Mon Jan 18, 2010 9:05 pm

Error with getpos ?

#1 Post by Jiggaboo » Mon Jan 18, 2010 9:25 pm

Hey bros,

I'm trying to get my in-game coordinates so I can setup some waypoints, but every time I enter the command rom\getpos to run the get position script I get this error:

Image

I ran the update script and updated the SVN just in case; that didn't solve it either. I guess for some reason 'database' hasn't been initialized by this line (695):
local tmp = database.utf8_ascii[_key];

I searched the forums and the wiki and wasn't able to find any solutions or similar problems.
I also tried setting the ROMDATA_PATH to my RoM installation path (C:\Program Files\Runes of Magic) and it didn't help.
I wish people actually used IRC for this haha, I logged on only to be greeted by ChanServ T_T.


Any and all help would be appreciated!
Thanks

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

Re: Error with getpos ?

#2 Post by Administrator » Mon Jan 18, 2010 11:11 pm

Open up getpos.lua in notepad. You'll see this line near the top:

Code: Select all

include("functions.lua");
Directly above that, add this:

Code: Select all

include("database.lua");
Save it. Let me know if this works.

Jiggaboo
Posts: 9
Joined: Mon Jan 18, 2010 9:05 pm

Re: Error with getpos ?

#3 Post by Jiggaboo » Tue Jan 19, 2010 12:55 am

Ah sorry I forgot to mention I tried that.
This is the error I get when I add the include (which I also added to the functions.lua file):
Image

This is the function that is crashing, the specific line (698) is in bold:
function utf8ToAscii_umlauts(_str)

-- convert one UTF8 character to his ASCII code
-- key is the combined UTF8 code
local function replaceUtf8( _str, _key )
local tmp = database.utf8_ascii[_key];
_str = string.gsub(_str, string.char(tmp.utf8_1, tmp.utf8_2), string.char(tmp.ascii) );
return _str
end

_str = replaceUtf8(_str, 195164); -- ä
_str = replaceUtf8(_str, 195132); -- Ä
_str = replaceUtf8(_str, 195182); -- ö
_str = replaceUtf8(_str, 195150); -- Ö
_str = replaceUtf8(_str, 195188); -- ü
_str = replaceUtf8(_str, 195156); -- Ü
_str = replaceUtf8(_str, 195159); -- ß
return _str;
end
Pretty weird, because that would mean database is no longer null, but the utf8_ascii array is? Heh, sorry my LUA is pretty rusty
Thanks for the reply by the way. Is there any way I can contact you over an instant messenger (whatever works for you) by chance? Would love to get this figured out asap.

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

Re: Error with getpos ?

#4 Post by Administrator » Tue Jan 19, 2010 2:26 am

Try adding this to the function:

Code: Select all

if( not tmp ) then
    error("Invalid database information passed to replaceUtf8()", 2);
end
Does the bot work normally for you? You could just use the position given in the titlebar.

Jiggaboo
Posts: 9
Joined: Mon Jan 18, 2010 9:05 pm

Re: Error with getpos ?

#5 Post by Jiggaboo » Wed Jan 20, 2010 1:25 am

I can just use the CreatePath script to get coordinates without any issues - I don't know why I was using getpos in the first place.

If you still want me to test that code for the sake of fixing it just let me know, otherwise I'm going to move on.
Thanks for the replies by the way, pretty cool to see you providing support for your (fantastic/very well done/impressive etc) project to anyone who stumbles in :)

I still really believe that an IRC channel is the way to go. So much more ideal for getting help and talking to fellow users.

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

Re: Error with getpos ?

#6 Post by Administrator » Wed Jan 20, 2010 7:00 am

No worries. I'll debug it when I get around to it. As long as you got something that works, that's good enough.

InadequateCoder
Posts: 33
Joined: Fri Jan 22, 2010 1:23 am

Re: Error with getpos ?

#7 Post by InadequateCoder » Fri Jan 22, 2010 1:28 am

I get the same error and I was wondering if this option existed. Could we make an injections script within the createpath.lua script that added a waypoint after a designated waypoint (this would also autocorrect the comment numbering).

option 7 (or next up I forget what it is), edit existing file
enter filename
mark waypoint
which waypoint would you like to place this waypoint after?
use code to insert
correct comments
have beer and pretzels
watch bot work
etc...

Jiggaboo
Posts: 9
Joined: Mon Jan 18, 2010 9:05 pm

Re: Error with getpos ?

#8 Post by Jiggaboo » Fri Jan 22, 2010 11:22 pm

InadequateCoder wrote:I get the same error and I was wondering if this option existed. Could we make an injections script within the createpath.lua script that added a waypoint after a designated waypoint (this would also autocorrect the comment numbering).

option 7 (or next up I forget what it is), edit existing file
enter filename
mark waypoint
which waypoint would you like to place this waypoint after?
use code to insert
correct comments
have beer and pretzels
watch bot work
etc...
This might actually be useful. If I find the time I'll look into implementing this, shouldn't be too difficult.

Post Reply

Who is online

Users browsing this forum: No registered users and 15 guests