Error: bad argument #1 to '?' (string expected, got nil)

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Post Reply
Message
Author
CrazyGuy
Posts: 63
Joined: Mon Mar 23, 2009 10:41 am

Error: bad argument #1 to '?' (string expected, got nil)

#1 Post by CrazyGuy »

Hello, haven't used the bot in a while so i got the newest version of the bot from the svn, the most recent version of micromacro. Copied the files over, and tried to run the bot and got the following error:

Code: Select all

...MainUser/Desktop/micromacro/scripts/rom/settings.lua:568: bad argument #1 to '?' (string expected, got nil)
Any ideas what is causing it or what a possible solution would be?
User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: Error: bad argument #1 to '?' (string expected, got nil)

#2 Post by lisa »

Yup, which language do you use?

that is calling for language 186 which is in english.lua but doesn't seem to be a translation for any other languages.

So maybe we need to rethink how the language works or just make sure that each [#] has something in every language.lua even if it is just the english version?

So for you, just open the rom/language/**.lua that is for your language and add in

Code: Select all

[186] = "Loading profile %s.xml\n",
Remember no matter you do in life to always have a little fun while you are at it ;)

wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: Error: bad argument #1 to '?' (string expected, got nil)

#3 Post by lisa »

Edit:

Meh I need to spend more time looking into it, at work atm and kinda seeing things but not whole picture.

Profile is being checked in bot.lua but obviously before language is being set in settings.lua
Remember no matter you do in life to always have a little fun while you are at it ;)

wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Error: bad argument #1 to '?' (string expected, got nil)

#4 Post by rock5 »

lisa wrote:that is calling for language 186 which is in english.lua but doesn't seem to be a translation for any other languages.
I'm pretty sure the English file is loaded first before loading other languages, so if a number is missing from the other language it will come up in English.
lisa wrote:Profile is being checked in bot.lua but obviously before language is being set in settings.lua
That's probably the case. I'll have a look too.
  • 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
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Error: bad argument #1 to '?' (string expected, got nil)

#5 Post by rock5 »

I had a look.

Language 186 is used in only one place settings.loadProfile()

settings.loadProfile() is used in only one place (not including createpath.lua) during bot start.

So there should be no reason for that error, given that it works for me.

Are you using settings.loadProfile() anywhere in your profile or waypoint file?

If not maybe your bot version is corrupt. Try doing a "TortoiseSVN/Revert" on the rom folder.
  • 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
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: Error: bad argument #1 to '?' (string expected, got nil)

#6 Post by lisa »

bot.lua line 194

Code: Select all

settings.loadProfile(load_profile_name);
settings.lua line 567

Code: Select all

function settings.loadProfile(_name)
	printf(language[186], _name)
Remember no matter you do in life to always have a little fun while you are at it ;)

wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
CrazyGuy
Posts: 63
Joined: Mon Mar 23, 2009 10:41 am

Re: Error: bad argument #1 to '?' (string expected, got nil)

#7 Post by CrazyGuy »

rock5 wrote: Are you using settings.loadProfile() anywhere in your profile or waypoint file?

If not maybe your bot version is corrupt. Try doing a "TortoiseSVN/Revert" on the rom folder.
No, i am not using settings.loadProfile() anywhere in the profile or waypoint file. Ill try doing a revert and see if that changes anything.
Post Reply