WorthlessCynomys Posted September 2, 2017 Share Posted September 2, 2017 Hello, there, I have a serious problem. My MTA has patched when I started it. After that I ran the server, joined and started my script, that worked today at 1 AM. Now I get errors. debugscript says that this: --[[ Something here so it's commented. --]] is deprecated, as well as it says that i have and unexpected character near "[" in this line: outputChatBox(tostring(i).."|"..items[slot[3]][2]) Again. The exact same script has worked at 1AM today. What did the patch change? Link to comment
Administrators Lpsd Posted September 2, 2017 Administrators Share Posted September 2, 2017 Does doing this change anything? local key = slot[3] outputChatBox(tostring(i).."|"..items[key][2]) If not, I expect something is going wrong elsewhere in the code. How big is this script file? Could you show more, via pastebin or such? Link to comment
WorthlessCynomys Posted September 2, 2017 Author Share Posted September 2, 2017 No. I'm sure that the problem this time is not with my code. I haven't changed a thing and the script worked before the patch. Now it says that the nesting of --[[...]] is deprecated, which is a basic lua block comment, so WTF and your idea hasn't worked either, when I tried it now. So something went wrong with the patch, which is annoying, since it makes me unable to move forward with my work. Link to comment
Tails Posted September 2, 2017 Share Posted September 2, 2017 Check if you have multiple comment blocks like this: --[[ some code --[[ some other code --]] --]] you can't do this. Link to comment
WorthlessCynomys Posted September 2, 2017 Author Share Posted September 2, 2017 1 minute ago, Tails said: Check if you have multiple comment blocks like this: --[[ some code --[[ some other code --]] --]] you can't do this. Nope. Only one 1 Link to comment
Tails Posted September 2, 2017 Share Posted September 2, 2017 Show us the whole thing Link to comment
WorthlessCynomys Posted September 2, 2017 Author Share Posted September 2, 2017 (edited) The problem is not with the script. As I said the exact same script worked at 1AM today. However here's an error msg that I've never seen before. IMGUR IMAGE and that line: --[[ <--- This is line 274 elseif (dragNDrop == true) and (cX < 0.675) or (cX > 0.975) or (cY < 0.325) or (cY > 0.675) then dragNDrop = false draggedItem = nil -- Some item drops on the ground thingy here. --]] Also the whole script is 402 lines sooo... Edited September 2, 2017 by StormFighter Added more Link to comment
WorthlessCynomys Posted September 2, 2017 Author Share Posted September 2, 2017 SOLVED! There was a block comment opening like a 100 lines above. Sorry guys and thank you for your help. 51 minutes ago, Tails said: Check if you have multiple comment blocks like this: --[[ some code --[[ some other code --]] --]] you can't do this. As I found out, that is allowed. On the other hand: --[[ --[[ --]] --]] -- THIS is not. -- For others if they find this, to learn.... My problem was this :S --[[ -- The problem was this, like a 100 lines above, since I haven't closed It so the second block comment was in it. --[[ The error said that the problem is in this line. --]] Link to comment
Moderators IIYAMA Posted September 3, 2017 Moderators Share Posted September 3, 2017 Indeed you can't nest comment tags. I love to comment things and leave them like that until I need them, so I often run in to the nesting problem while adding more comments for multiple lines. Yet after a while the problem becomes almost a habit, so keep commenting more! more! more! Or just use: ctrl + Q(Notepad++) which will add only line comments for the selected lines. (instead of --[[ ]] it will only add --) 1 Link to comment
koragg Posted September 3, 2017 Share Posted September 3, 2017 @IIYAMA thanks for telling that nice comment shortcut But is there a way to uncomment the selected lines with some key combo? 1 Link to comment
Moderators IIYAMA Posted September 4, 2017 Moderators Share Posted September 4, 2017 (edited) Should be the same shortcut.(if line comments) It is like a toggle, but on/off depending per the line status. Edited September 4, 2017 by IIYAMA 1 Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now