Page 1 of 1
Error: bad argument #1 to '?' (string expected, got nil)
Posted: Fri Jul 08, 2011 12:09 am
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?
Re: Error: bad argument #1 to '?' (string expected, got nil)
Posted: Fri Jul 08, 2011 12:27 am
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",
Re: Error: bad argument #1 to '?' (string expected, got nil)
Posted: Fri Jul 08, 2011 12:55 am
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
Re: Error: bad argument #1 to '?' (string expected, got nil)
Posted: Fri Jul 08, 2011 1:48 am
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.
Re: Error: bad argument #1 to '?' (string expected, got nil)
Posted: Fri Jul 08, 2011 2:02 am
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.
Re: Error: bad argument #1 to '?' (string expected, got nil)
Posted: Fri Jul 08, 2011 2:08 am
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)
Re: Error: bad argument #1 to '?' (string expected, got nil)
Posted: Fri Jul 08, 2011 8:39 am
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.