Thread Tools Display Modes
01-18-10, 10:16 AM   #1
zomgwtfkek
A Defias Bandit
 
zomgwtfkek's Avatar
Join Date: Jan 2010
Posts: 2
find lines in .lua files

Hai, i'm a newb @ lua editing but when u open a lua file with notepad, when do the lines start? is it at the first scentence of the document? or does it start with 0 1 2 3 4 ,... or 1 2 3 4 5... I wanna adjust faceroller: fury warrior so that the AP shout isnt in my way :P


thx
  Reply With Quote
01-18-10, 10:28 AM   #2
Zyonin
Coffee powered Kaldorei
 
Zyonin's Avatar
AddOn Author - Click to view addons
Join Date: May 2006
Posts: 1,443
Originally Posted by zomgwtfkek View Post
Hai, i'm a newb @ lua editing but when u open a lua file with notepad, when do the lines start? is it at the first scentence of the document? or does it start with 0 1 2 3 4 ,... or 1 2 3 4 5... I wanna adjust faceroller: fury warrior so that the AP shout isnt in my way :P


thx
First line of the document is line 1. If you are going to be doing any amount of dabbling with lua, you want to get a good text editor that can highlight code bits with color and display line numbers. For the Windows platform, I loved Notepad++ (Google it), though I started using SciTE later. I still use SciTE on Linux for coding.

Notepad++: http://notepad-plus.sourceforge.net
SciTE: http://www.scintilla.org/SciTE.html
__________________
Twitter
  Reply With Quote
01-18-10, 11:07 AM   #3
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,710
If you want to add Lua 5.1 + WoW API highlighting into Notepad++ you can use the gist I created:
http://gist.github.com/280186

This is updated for 3.3.0
  Reply With Quote
01-18-10, 11:29 AM   #4
zomgwtfkek
A Defias Bandit
 
zomgwtfkek's Avatar
Join Date: Jan 2010
Posts: 2
Originally Posted by Zyonin View Post
First line of the document is line 1. If you are going to be doing any amount of dabbling with lua, you want to get a good text editor that can highlight code bits with color and display line numbers. For the Windows platform, I loved Notepad++ (Google it), though I started using SciTE later. I still use SciTE on Linux for coding.

Notepad++: http://notepad-plus.sourceforge.net
SciTE: http://www.scintilla.org/SciTE.html
ok :P I cant get my head around it xD w2b easier explenation! hihi
  Reply With Quote
01-18-10, 11:34 AM   #5
Toran
A Nerdscale Dorkin
 
Toran's Avatar
Premium Member
Join Date: May 2006
Posts: 143
I assume the "Notepad++ langs.xml" file goes into the plugins\APIs folder of Notepad++?
  Reply With Quote
01-18-10, 11:36 AM   #6
Zyonin
Coffee powered Kaldorei
 
Zyonin's Avatar
AddOn Author - Click to view addons
Join Date: May 2006
Posts: 1,443
Originally Posted by zomgwtfkek View Post
ok :P I cant get my head around it xD w2b easier explenation! hihi
Goto to one of those sites I linked too. Download the program offered. Install it. Use it to open up a lua file. If you look at the left side of the window, you will see numbers. Those numbers are the line numbers

The coloring thing is highlight bits of code. Such as code wrapped between tags (like in HTML), or are modifiers, etc.
__________________
Twitter
  Reply With Quote
01-18-10, 11:36 AM   #7
Ailae
A Rage Talon Dragon Guard
 
Ailae's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2007
Posts: 318
If you're dead set on using Notepad (although Notepad++ is terribly nifty), you can use it's "Go to" function under the Edit-menu (CTRL+G is the shortcut). A box will pop up and you can enter the linenumber you'd like to move the marker to.

If the option is greyed out make sure that "Word Wrap" isn't checked in the Format-menu.
__________________
Oh, the simulated horror!
  Reply With Quote
01-18-10, 11:44 AM   #8
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,710
Originally Posted by Toran View Post
I assume the "Notepad++ langs.xml" file goes into the plugins\APIs folder of Notepad++?
You replace the lua part inside langs.xml, which is found in the program dir.
  Reply With Quote
01-19-10, 12:25 PM   #9
Beoko
Guest
Posts: n/a
Originally Posted by p3lim View Post
You replace the lua part inside langs.xml, which is found in the program dir.
I love you, but Notepad++ is overwriting my langs.xml file every time it loads. I didn't see an option to disable it, either. Are you using an old version?

Last edited by Beoko : 01-19-10 at 12:31 PM.
  Reply With Quote
01-19-10, 01:55 PM   #10
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860
You don't need the file p3lim linked. I don't use it.
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

  Reply With Quote
01-19-10, 02:22 PM   #11
Beoko
Guest
Posts: n/a
Originally Posted by Seerah View Post
You don't need the file p3lim linked. I don't use it.
I don't -need- it, but having wow specific function highlighting would be very nice. ^^
  Reply With Quote
01-23-10, 07:33 AM   #12
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,710
Originally Posted by Beoko View Post
I don't -need- it, but having wow specific function highlighting would be very nice. ^^
Don't use Notepad++ to change the langs.xml file, use notepad or something.

Seerah says you don't have to change the langs.xml file, which is true, but its how i've done it since I started using Notepad++ ages ago.
  Reply With Quote
01-24-10, 09:38 AM   #13
Beoko
Guest
Posts: n/a
Originally Posted by p3lim View Post
Don't use Notepad++ to change the langs.xml file, use notepad or something.

Seerah says you don't have to change the langs.xml file, which is true, but its how i've done it since I started using Notepad++ ages ago.
Figured it would be something simple, thanks for the info. I much prefer doing it this way rather than manually adding the keywords through the options.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » find lines in .lua files


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off