gsub error

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Post Reply
Message
Author
ZZZZZ
Posts: 513
Joined: Sun Oct 21, 2012 1:42 am

gsub error

#1 Post by ZZZZZ »

I keep getting this error sometimes when loading rombot:

Code: Select all

Welcome to rom bot! press END to quit
RoM Bot Version 3.29, Revision 770
Press the (End) key to stop/pause the script.
You can resume with the (Delete) key.
The game client did not crash.
12:28am - E:/micromacro/scripts/rom/functions.lua:923: bad argument #1 to 'gsub'
 (string expected, got nil)


Please enter the script name to run.
Type in 'exit' (without quotes) to exit.
Script>
I had 3 clients running at the time, 2 on Nexon, 1 on Official, if that has anything to do with it.
User avatar
Bill D Cat
Posts: 555
Joined: Sat Aug 10, 2013 8:13 pm
Location: Deep in the Heart of Texas

Re: gsub error

#2 Post by Bill D Cat »

I get that quite often too. It's because the official server and Nexon server are not at the same revision. You can't run the same bot files for both servers at the same time when the versions are different. Doing a rom/update will fix the addresses.lua file for whichever server you are connected to. If you want to run on different servers at different server versions, it would be best to make two copies of the bot folder with separate addresses.lua files.
ZZZZZ
Posts: 513
Joined: Sun Oct 21, 2012 1:42 am

Re: gsub error

#3 Post by ZZZZZ »

Then why does it only happen sometimes? Currently i have 3 clients doing mini's on Nexon and 2 on Offical going at the same time with the same micromacro. This is what i dont understand lol. Only happens sometimes.
User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: gsub error

#4 Post by rock5 »

The reason it only sometimes happens is because normally when the addresses are wrong it doesn't find the name address so it prints the (RoM window n) line instead of the character name. But what must happen "sometimes" is, even though the addresses are wrong, it finds something that looks like a correct name address and then tries to read the name at this "bad" address. It gets nil and tries to send it to the string convert function which crashes.

This is a bug that needs fixing. I'll add a fix in my next commit.
  • 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
ZZZZZ
Posts: 513
Joined: Sun Oct 21, 2012 1:42 am

Re: gsub error

#5 Post by ZZZZZ »

Getting this gsub error more and more. I tried using 2 different MM's, 1 for each server version, but that didn't work. And right now I have 1 client logged in, i deleted addresses and svn updated again and it's still saying

Code: Select all

The game client did not crash.
1:19am - E:/micromacro/scripts/rom/functions.lua:923: bad argument #1 to 'gsub'
(string expected, got nil)
Is there anything I could edit myself to help it? Because it's making using mm/rombot quiet difficult.
User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: gsub error

#6 Post by rock5 »

This happens if the string sent to the utf8ToAscii_umlauts is a nil value. This function is mainly used when the bot starts and on object and pawn names. It's also used in the getPartyLeaderName function.

It would help to know what it was doing at the time it got the error. Also it would be useful to know if you are using any party options.
  • 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
ZZZZZ
Posts: 513
Joined: Sun Oct 21, 2012 1:42 am

Re: gsub error

#7 Post by ZZZZZ »

I had 8 clients running (3 on Nexon, 5 on Official) that were doing their usual daily/mini run and all were running fine. All of them had finished and I went to do an instance, only had myself as dps so tried to log in another alt that buffs me. Had 2 Nexon clients and 3 on official just sitting there after they had done their loop.
Went to run a buff function I made but as soon as I started MM I got the gsub error (didnt type in a command or anything).I get it a lot and usually I can temp fix it by either logging out all the clients on 1 server or the other, or deleting addresses.lua and running svn update again. Except for some reason this time it didn't work at all. I even tried closing all clients and MM windows and after logging back in on official it still had an error.
User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: gsub error

#8 Post by lisa »

do you use 2 different folders of MM?
1 for each server you use.
If not, you should.
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
ZZZZZ
Posts: 513
Joined: Sun Oct 21, 2012 1:42 am

Re: gsub error

#9 Post by ZZZZZ »

Getting this gsub error more and more. I tried using 2 different MM's, 1 for each server version
I had 2, actually still have 2, but I was still getting the exact same error, so I stopped using both because it just made editing files annoying.
User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: gsub error

#10 Post by rock5 »

ZZZZZ wrote:Went to run a buff function I made but as soon as I started MM I got the gsub error (didnt type in a command or anything)
Do you mean you started the commandline file? That should do an update.lua when necessary.

I think you might get some weird behavior if you have clients that have been logged in and now are sitting at the character selection and you are using 2 different client versions at the same time. Try shutting down any clients that are not currently in use. See if that helps.
  • 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
ZZZZZ
Posts: 513
Joined: Sun Oct 21, 2012 1:42 am

Re: gsub error

#11 Post by ZZZZZ »

No, just typing in rom/bot and went strait to gsub error. Got the issue again today, it seems that after a certain point it stuffs up on 1 or 2 names in particular, and just keeps saying gsub error even if that's the only client left running (closed the rest to try and get it to stop getting the error). Names seem to be random so far....so im not sure what is going on. (None of the names I use have Alt-codes in them so that wouldn't be causing anything)
User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: gsub error

#12 Post by rock5 »

Maybe if the addresses have been set for one client and then you try to start the bot on the other client it might successfully read some gibberish text that causes the error. When you get the error, if you run bot/update beforehand does that fix it?

In the end, though, if utf8ToAscii_umlauts is fed a nil value it should return nil. I guess I could add that. I don't know if that will fix this error as the name it will try to print will still be nil.
  • 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
ZZZZZ
Posts: 513
Joined: Sun Oct 21, 2012 1:42 am

Re: gsub error

#13 Post by ZZZZZ »

Tried rom/update and got this error:

Code: Select all

Script> rom/update
Opening update.lua...
Starting script execution - Press CTRL+C to exit.
Press CTRL+L to cancel execution and load a new script.
-------------------------------------------------------------------------------
Choose your character that you want to play on:

(RoM window 1) - 6.0.5.268311:58pm - E:/micromacro/scripts/rom/functions.lua:161
: attempt to concatenate field '?' (a nil value)


Please enter the script name to run.
Type in 'exit' (without quotes) to exit.
Script>
User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: gsub error

#14 Post by rock5 »

Wow, that's strange.

Try this.
functions.lua
(84.41 KiB) Downloaded 114 times
Make sure to let us know if it works or not.
  • 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: gsub error

#15 Post by rock5 »

I got reported a similar error on another post. It was in relation to a bug in userfunction_fusion.lua. I've updated it. It might be related. If you use Fusion and updated the userfunction recently, try version 0.43.
http://www.solarstrike.net/phpBB3/viewt ... 786#p11786
  • 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
Post Reply