Download
(181Kb)
Download
Compatible with Retail, Classic & TBC
Updated: 03-24-24 08:14 AM
Pictures
File Info
Compatibility:
Plunderstorm (10.2.6)
Classic (1.15.1)
WOTLK Patch (3.4.3)
Updated:03-24-24 08:14 AM
Created:unknown
Downloads:67,404
Favorites:350
MD5:
10.2.6

WowLua  Popular! (More than 5000 hits)

Version: v1.1.1-release
by: Cladhaire [More]

WowLua should be classic compatible!

WowLua is an in-game Lua scripting environment that includes an interactive Lua interpreter as well as a multi-page script editor. Other features include:

  • Syntax coloring, courtesy of krka's spectacular For All Indents and Purposes library
  • Sleek buttons, courtesy of Mikk
  • When WowLua is running code, it defines a global function print() which directs output to the WowLua window, for convenience. This global is removed when not running from WowLua
  • Can run WowLua pages from the commandline using /wowluarun or /luarun. Each slash command takes the name of a page, and prints any issues or activity to the chat frame. These can thus be used from macros.
  • Can open WowLua using /wowlua or /lua. Both of these slash commands will take a lua expression and run it, if provided:

/lua print(14) will open WowLua and print the number 14 to the output window.

Please feel free to post any comments or questions here, you'll find I'm relatively responsible. This addon has been written primarily as a companion tool for World of Warcraft Programming: A Guide and Reference for Creating WoW Addons.

WowLua
v1.1.1-release (2024-03-24)
Full Changelog Previous Releases
  • Fix luacheckrc
Beta Files (1)
File Name
Version
Hits
Size
Author
Date
r8
2,363
161kB
Cogwheel
04-29-08 09:25 PM


Archived Files (5)
File Name
Version
Size
Author
Date
v1.0.5-release
180kB
Cladhaire
04-01-23 04:58 AM
v1.0.4-release
180kB
Cladhaire
12-14-22 10:19 AM
v1.0.3-release
180kB
Cladhaire
10-25-22 08:53 AM
v1.0.2-release
180kB
Cladhaire
10-04-22 09:11 AM
v1.0.1-alpha
180kB
Cladhaire
10-01-22 12:59 AM


Post A Reply Comment Options
Unread 11-09-08, 08:16 AM  
xbeeps
A Kobold Labourer

Forum posts: 0
File comments: 3
Uploads: 0
Excellent addon, and a very good replacement for myDebug which is now broken. I have two suggestions:

1) Add the following code to the toc:

## LoadManagers: AddonLoader
## X-LoadOn-Slash: /wowlua, /lua

This allows it to load automatically when the slash command is executed, if AddonLoader is installed. Otherwise it is just ignored. This saves the load time for those 99/100 sessions where you're not using it.

2) Use something else than print, as that symbol is now already in the global namespace for use by addons (it was introduced in 3.0.2 i believe).
Report comment to moderator  
Reply With Quote
Unread 11-01-08, 05:15 AM  
Tifi
A Murloc Raider
AddOn Author - Click to view AddOns

Forum posts: 6
File comments: 94
Uploads: 4
Code:
local function dropDownFunc(page)
	WowLua:GoToPage(page)
end
needs to be changed to
Code:
local function dropDownFunc(btn, page)
	WowLua:GoToPage(page)
end
Oh and could you please either remove the Undo button or implement a Redo? ATM this "Undo" just loads the previously saved version of the script. All this button ever did for me was destroy work, because I accidentally clicked it when I wanted to click Save.
An Undo without Redo is no real Undo IMHO. What I would love to see is an undo queue. Every time the script is executed, the current version is saved to the queue (unless it wasn't changed of course). Undo loads the previous script from the queue, Redo the next. The queue is flushed when another page is loaded. It's not hard to implement, you just have to maintain the current position in the queue, and remove stuff after this position when a new item enters the queue.

Code:
local queue, queuePos = {}, 0
local function queueFlush(all)
	if all then
		table.wipe(queue)
		queuePos = 0
	end
end
local function queueAction(text)
	if text ~= queue[queuePos] then
		queuePos = queuePos+1
		queue[queuePos] = text
		for i=queuePos+1,#queue do
			queue[i]=nil
		end
	end
end
local function queueUndo()
	local item = queue[queuePos-1]
	if item then 
		queuePos = queuePos-1
		return item
	end
	return queue[queuePos]
end
local function queueRedo()
	local item = queue[queuePos+1]
	if item then
		queuePos = queuePos+1
		return item
	end
	return queue[queuePos]
end

function WowLua:Button_Undo()
	local page, entry = self:GetCurrentPage()
	WowLuaFrameEditBox:SetText(queueUndo() or entry.content)
end
function WowLua:Button_Redo()
	local page, entry = self:GetCurrentPage()
	WowLuaFrameEditBox:SetText(queueRedo())
end
function WowLua:Button_Run()
	local text = WowLuaFrameEditBox:GetText()
	
	-- Run the script, if there is an error then highlight it
	if text then
		local succ,err = WowLua:RunScript(text)
		if not succ then
			local chunkName,lineNum = err:match("(%b[]):(%d+):")
			lineNum = tonumber(lineNum)
			WowLua:UpdateLineNums(lineNum)

			-- Highlight the text in the editor by finding the char of the line number we're on
			text = WowLua.indent.coloredGetText(WowLuaFrameEditBox)

			local curLine,start = 1,1
			while curLine < lineNum do
				local s,e = text:find("\n", start)
				start = e + 1
				curLine = curLine + 1
			end

			local nextLine = select(2, text:find("\n", start))
			
			WowLuaFrameEditBox:SetFocus()
			WowLuaFrameEditBox:SetCursorPosition(start - 1)
		else
			queueAction(text)
		end
	end
end
Last edited by Tifi : 11-01-08 at 06:07 AM.
Report comment to moderator  
Reply With Quote
Unread 10-30-08, 03:19 AM  
Drauer
A Fallenroot Satyr
 
Drauer's Avatar
AddOn Author - Click to view AddOns

Forum posts: 22
File comments: 88
Uploads: 22
Many thanks for you, Cladhaire, for this wonderfull addon.

It saved HUGE ammount of re-writing lua and /reloading.

__________________
Quando omni flunkus moritati
Report comment to moderator  
Reply With Quote
Unread 10-28-08, 09:34 PM  
Recompense
A Deviate Faerie Dragon
AddOn Author - Click to view AddOns

Forum posts: 15
File comments: 160
Uploads: 11
TOC number at 20400?

Hi Cladhaire, I first just wanted to say that this mod was and still is a great help to me when I got the WoW Programming book. Many many kudos and internet fuzzies for you all.

That being said, I was glad to see this was updated for 3.0.2, but the TOC Interface number is still set to 20400. I changed it to 30000 and all works well, or seems to, but I didn't know if that was perhaps a hidden sign that this wasn't really the most updated version.
Report comment to moderator  
Reply With Quote
Unread 10-23-08, 02:13 AM  
Cladhaire
Salad!
 
Cladhaire's Avatar
Premium Member
AddOn Author - Click to view AddOns

Forum posts: 1935
File comments: 4939
Uploads: 19
Originally posted by myrroddin
Cladhaire, I bought the book too, and recommended to Dudeinthedark, who is developing a new version of Discord. ~Plug and sold x 2!!

Anyway, I'm still learning, haven't written any code except for the .toc files, so I wonder: can you load and save .lua files in wowlua? It would be great to write code directly in the game, save it as myaddon.lua, reloadui, and test.

If not, may I ask what you use to write addons, that auto-indent, and hopefully is an interpreter as well? I tried jEdit, but it won't indent lua properly. And I don't think Addon Studio is up to date on the new APIs.

Suggestions?
No you can't save any files from within wow due to the sandbox limitations. A nice simple editor is SciTE.. since its core is partially written in Lua so it has really good syntax/indent support, and also can execute the files directly from the editor. I happen to use vi. I'm also working with the Addon Studio guys to provide them with up to date API documentation for their next version.
__________________
"There's only one thing that I know how to do well and I've often been told that you only can do what you know how to do well, and that's be you-- be what you're like-- be like yourself. And so I'm having a wonderful time, but I'd rather be whistling in the dark..."
Report comment to moderator  
Reply With Quote
Unread 10-22-08, 10:19 PM  
myrroddin
A Pyroguard Emberseer
 
myrroddin's Avatar
AddOn Author - Click to view AddOns

Forum posts: 1240
File comments: 226
Uploads: 21
Cladhaire, I bought the book too, and recommended to Dudeinthedark, who is developing a new version of Discord. ~Plug and sold x 2!!

Anyway, I'm still learning, haven't written any code except for the .toc files, so I wonder: can you load and save .lua files in wowlua? It would be great to write code directly in the game, save it as myaddon.lua, reloadui, and test.

If not, may I ask what you use to write addons, that auto-indent, and hopefully is an interpreter as well? I tried jEdit, but it won't indent lua properly. And I don't think Addon Studio is up to date on the new APIs.

Suggestions?
Report comment to moderator  
Reply With Quote
Unread 10-22-08, 06:08 PM  
Aesir
An Aku'mai Servant
 
Aesir's Avatar
AddOn Author - Click to view AddOns

Forum posts: 30
File comments: 143
Uploads: 1
Originally posted by Cladhaire
Indeed, as I was writing the first part of that book,<snip>
You have to wake up pretty early in the afternoon to fool me, Cladhaire.

First off, there are pics on the net of the authors of that book - and not a single one of them looks anything like your forum picture.

Second, the author names are clearly spelled out in the book. And not a single one of them is named "Cladhaire". I double-checked. Both first *and* last names. You don't even have a last name.

These forums are getting almost as bad as that other wow addon site.

The book is interesting, though. I got to the cliff-hanger part in Chapter 2 where, according to the story's main protaganist (chick by the name of "Lua") 0.2 evaluates to less than 0.2. I can't wait to see how this turns out!
__________________
-- ęsir
Report comment to moderator  
Reply With Quote
Unread 10-22-08, 03:47 PM  
Cladhaire
Salad!
 
Cladhaire's Avatar
Premium Member
AddOn Author - Click to view AddOns

Forum posts: 1935
File comments: 4939
Uploads: 19
Originally posted by Aesir
Ok, so I just got back from the bookstore where I'd bought this book about programming wow. It mentioned something about this addon used throughout the book examples, so I'm happy it works in 3.x. Thanks!
Indeed, as I was writing the first part of that book, I decided it would be useful to have an in-game interpreter to play with lua code, like on the commandline. I hope you enjoy the book!
__________________
"There's only one thing that I know how to do well and I've often been told that you only can do what you know how to do well, and that's be you-- be what you're like-- be like yourself. And so I'm having a wonderful time, but I'd rather be whistling in the dark..."
Report comment to moderator  
Reply With Quote
Unread 10-22-08, 03:38 PM  
Aesir
An Aku'mai Servant
 
Aesir's Avatar
AddOn Author - Click to view AddOns

Forum posts: 30
File comments: 143
Uploads: 1
Originally posted by Cladhaire
EDIT: Actually, I have already fixed this error you need to be running the latest version.
Ok, so I just got back from the bookstore where I'd bought this book about programming wow. It mentioned something about this addon used throughout the book examples, so I'm happy it works in 3.x. Thanks!
__________________
-- ęsir
Report comment to moderator  
Reply With Quote
Unread 10-18-08, 03:21 AM  
Recompense
A Deviate Faerie Dragon
AddOn Author - Click to view AddOns

Forum posts: 15
File comments: 160
Uploads: 11
Thank you!

Cladhaire, thank you for making this 3.0.2 friendly! I <3 WowLua for letting me try little things out in-game!
Report comment to moderator  
Reply With Quote
Unread 10-17-08, 01:57 AM  
Cladhaire
Salad!
 
Cladhaire's Avatar
Premium Member
AddOn Author - Click to view AddOns

Forum posts: 1935
File comments: 4939
Uploads: 19
Originally posted by moolgar
getting this error from wowlua after patch yesterday.

Interface\FrameXML\UIPanelTemplate.lua:315: attempt to index a local 'self' (a number value)

only addon running is wowlua atm
Yes, I need to get the addon updated for 3.X. I'll push out a version in a few minutes.

EDIT: Actually, I have already fixed this error you need to be running the latest version.
__________________
"There's only one thing that I know how to do well and I've often been told that you only can do what you know how to do well, and that's be you-- be what you're like-- be like yourself. And so I'm having a wonderful time, but I'd rather be whistling in the dark..."
Last edited by Cladhaire : 10-17-08 at 02:06 AM.
Report comment to moderator  
Reply With Quote
Unread 10-16-08, 11:13 PM  
moolgar
A Defias Bandit

Forum posts: 3
File comments: 1
Uploads: 0
getting this error from wowlua after patch yesterday.

Interface\FrameXML\UIPanelTemplate.lua:315: attempt to index a local 'self' (a number value)

only addon running is wowlua atm
Report comment to moderator  
Reply With Quote
Unread 09-08-08, 01:18 AM  
Cladhaire
Salad!
 
Cladhaire's Avatar
Premium Member
AddOn Author - Click to view AddOns

Forum posts: 1935
File comments: 4939
Uploads: 19
Originally posted by Qaazim
I just installed wowlua using the instructions in the book "WoW Programming". However, when I bring up the in-game interpreter, the graphics are seemingly all wrong.

I cannot see the buttons along the top. I can see the tooltips and names telling me what the blank spaces do - ie "Create...." etc. and they seem to work as well. Also, the upper left corner is dominated by a huge green square that spills out over the borders.

I tinkered with the video settings, but beyond that I do not know what is causing the problem.

Suggestions?
It sounds very likely that when you extracted the addon, the subdirectories were not properly extractd and as a result the graphics aren't in the right place. Underneath the main WowLua directory, there is an images directory (as well as a fonts directory). You need to ensure they are both there.
__________________
"There's only one thing that I know how to do well and I've often been told that you only can do what you know how to do well, and that's be you-- be what you're like-- be like yourself. And so I'm having a wonderful time, but I'd rather be whistling in the dark..."
Report comment to moderator  
Reply With Quote
Unread 09-07-08, 09:52 PM  
Qaazim
A Kobold Labourer

Forum posts: 0
File comments: 1
Uploads: 0
I just installed wowlua using the instructions in the book "WoW Programming". However, when I bring up the in-game interpreter, the graphics are seemingly all wrong.

I cannot see the buttons along the top. I can see the tooltips and names telling me what the blank spaces do - ie "Create...." etc. and they seem to work as well. Also, the upper left corner is dominated by a huge green square that spills out over the borders.

I tinkered with the video settings, but beyond that I do not know what is causing the problem.

Suggestions?
Report comment to moderator  
Reply With Quote
Unread 05-09-08, 04:01 PM  
Cogwheel
Sans Poisson
 
Cogwheel's Avatar
AddOn Author - Click to view AddOns

Forum posts: 237
File comments: 137
Uploads: 12
Thanks for the update. I'm looking into this.

Edit: Found the problem. Should have a fix soon.

Done! Enjoy
Last edited by Cogwheel : 05-09-08 at 04:23 PM.
Report comment to moderator  
Reply With Quote
Post A Reply



Category Jump: