Error when using RoMScript() to cast Lion's Protection

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Post Reply
Message
Author
Velsharon
Posts: 12
Joined: Wed May 26, 2010 8:59 pm

Error when using RoMScript() to cast Lion's Protection

#1 Post by Velsharon » Thu Nov 18, 2010 7:50 pm

I think I have a good one for all the lua code experts. I'm getting the following error when Micromacro tries to cast the Rogue/Knight elite spell "Lion's Protection" using the built in RoMScript function and the spell never casts.

[string "r=" a={CastSpellByName('Lion's Protection');} for i=1,#a do r=..."]:1: ')' expected near 's'

I think it's tripping up on the apostrophe in the word Lion's hence it's looking for a closing parentheses near the "s" in Lion's. The code that looks like it might be be causing the issue is found in skills.lua, line 411 which is using the built in RoMScript function found in functions.lua, line 525.

I wish I new enough about lua coding to figure out how to change the RoMScript function to be able to handle spells with apostrophes in them. Any ideas?

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

Re: Error when using RoMScript() to cast Lion's Protection

#2 Post by Administrator » Thu Nov 18, 2010 8:53 pm

It is from your use of single quotes. Either escape the single quote in Lion's Protection, or change the outer single quotes to double quotes.

Velsharon
Posts: 12
Joined: Wed May 26, 2010 8:59 pm

Re: Error when using RoMScript() to cast Lion's Protection

#3 Post by Velsharon » Thu Nov 18, 2010 10:23 pm

Well I tried both suggestions and they both worked. I guess I feel more comfortable escape sequencing the single quote in Lion's Protection. Thanks Admin :)

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest