@cksboy If you want a delay, you need to create a frame (it can be invisible) and use the OnUpdate event to measure out some amount of elapsed time, and then unregister the event and print the message.
There might be something buried in FrameXML for displaying message boxes, but I don't know of anything, and I don't feel like searching through it.
You'd want something like this (YouTube wasn't designed for pasting code, so YMMV):
local frame=CreateFrame("FRAME")
local elapsed=0
frame:SetScript("OnUpdate", function (self, delta) elapsed = elapsed+delta if elapsed > NUMBER_OF_SECONDS_TO_WAIT then self:SetScript("OnUpdate", nil) print("Hello World") end
@nfsmwanted You can use any text editor you want, although you'll more than likely want one with syntax highlighting. Wowpedia has a page called Lua_editors, which has a nice list of programs you can use.
Windows Notepad, while technically usable, will break horribly on the code from most AddOns. 26 years of development and it still can't handle linefeed characters. Avoid it like the plague.
I want to make an addon for my rogue that makes a group of a bunch of skills onto just 1 skill so I just press one buttom then the group of skills are executed in order btw I just want to have to work with 4 buttoms as dota ^^
@Flowgeta I was the original author of QuestHelper, which I believe one or two people found useful. Of course, I haven't contributed anything to it in well over a year, and it has just recently changed hands for the third time, but still.
@smariot Can you help me?? If you can pm me on yt. Im not trying to write my own addon, im just trying to update one of my favorites. The addon is called Unreal sound and what it does is track your kills and depending on your kill streak it will use the voices of the announcers of unreal tournament.
XML in WoW is for metaprogramming, which is where you write code that generates code. It's mostly for creating frames and widgets and all that stuff, since it will let you create templates and have it generate the code to setup those frames for you.
You don't need XML, you can do pretty much anything with Lua, it's just a convenience. Personally, I don't like it.
It would be kind of hard to tell you what you did wrong without seeing what you did, but here's a checklist:
- Make sure the TOC file has the same name as the folder it's in.
- If in Windows, the file extension of the TOC file might be hidden. (It might appear as foo.toc, when in reality it's foo.toc.txt)
- The encoding of the files (toc, lua, xml) should either be ASCII, or UTF-8 without a byte order mark. I think WoW actually will accept a BOM, but a stand-alone lua interpreter will barf.
- Completely restart Warcraft when you add a new file. It internally identifies files via a hash table which it generates at startup from the MPQ files and everything it finds in its own directory.
- Completely restart Warcraft when you edit anything other than a LUA or XML file. They tend to get cached. LUA/XML files can be reloaded with: /console reloadui
- Try searching WoWWiki for a tutorial. I'll add a link to one in the video description.
I was having the same issue, file name was HelloWorld.toc.txt and hello.lua.txt.
I fixed this by going in to another addon, copy+paste the toc and lua file to my hello world folder, rename and edit as necessary. Not the clean and neat version, but it works.
love it i all ways wanted to know how the addons worked and were made, do you think you could show us how to make a more difficult one. plz plz plz =P
can you make more tut for create addons please? :D
kodama91 2 weeks ago
@OfficialRox The legal implications of this request are questionable.
smariot 1 month ago
Also: ## Desc: My addon does: blah
RMRNetwork 4 months ago
So if Print puts the message in the chatbox, how to do I get it to be a window? I imagine I would have to make a window.
or is there an easier method that puts the print message after all the addon spam?
cksboy 5 months ago
@cksboy If you want a delay, you need to create a frame (it can be invisible) and use the OnUpdate event to measure out some amount of elapsed time, and then unregister the event and print the message.
There might be something buried in FrameXML for displaying message boxes, but I don't know of anything, and I don't feel like searching through it.
smariot 5 months ago
@smariot How would I go about doing that? Just making a addon for a UI compilation.
cksboy 5 months ago
You'd want something like this (YouTube wasn't designed for pasting code, so YMMV):
local frame=CreateFrame("FRAME")
local elapsed=0
frame:SetScript("OnUpdate", function (self, delta) elapsed = elapsed+delta if elapsed > NUMBER_OF_SECONDS_TO_WAIT then self:SetScript("OnUpdate", nil) print("Hello World") end
end
smariot 5 months ago
@cksboy I should have wrote CreateFrame("Frame") there, I expect case matters.
smariot 5 months ago
@smariot I get
Message: Interface\AddOns\BobUI\BobUI.lua:5: unexpected symbol near '?'
Time: 08/31/11 19:35:18
Count: 1
Stack:
Locals:
cksboy 5 months ago
What softwear Can I use to Open/use .lua and .toc files?
nfsmwanted 7 months ago
@nfsmwanted You can use any text editor you want, although you'll more than likely want one with syntax highlighting. Wowpedia has a page called Lua_editors, which has a nice list of programs you can use.
Windows Notepad, while technically usable, will break horribly on the code from most AddOns. 26 years of development and it still can't handle linefeed characters. Avoid it like the plague.
smariot 7 months ago
this is eazy (has experience) way easier than java to me
UltimateTutorial5000 7 months ago
Thank you for this tutorial, and thank you for the hours you put into what was and is still a great addon in QuestHelper.
NinetyNineRule 8 months ago
I want to make an addon for my rogue that makes a group of a bunch of skills onto just 1 skill so I just press one buttom then the group of skills are executed in order btw I just want to have to work with 4 buttoms as dota ^^
Gh0StSecurity 8 months ago
@Gh0StSecurity Addons aren't allowed to control your player, to prevent people from making bots. What you probably want is a /castsequence macro.
smariot 8 months ago
I fell asleep.
mtramm 8 months ago
Is there anyway to make this wait?? Please help me
Achilliez101 1 year ago
i gave up on making a addon cuz its to much to learn lua :'( might try again maybe when i have alot of time on my hands lol :D
xSILV3RxM0NST3Rx 1 year ago
it's usally where ever the .... you installed it! LOL
jeremynanhu 1 year ago
The porgram to make addons is "Add on studio for world of warcraft"
Blackops1990 1 year ago
@Flowgeta I was the original author of QuestHelper, which I believe one or two people found useful. Of course, I haven't contributed anything to it in well over a year, and it has just recently changed hands for the third time, but still.
smariot 1 year ago 4
@smariot Can you help me?? If you can pm me on yt. Im not trying to write my own addon, im just trying to update one of my favorites. The addon is called Unreal sound and what it does is track your kills and depending on your kill streak it will use the voices of the announcers of unreal tournament.
baggens55 11 months ago
omg, u have the most annoying voice ever.... lol
sariouso 1 year ago
Omg lol. i renamed the title of my healbot to MyMoooooooom and it worked XD
IQuickPredatorI 1 year ago
ijust farted D:
Linkiboy112 1 year ago
@Linkiboy112 I'm not sure why you believed it prudent I be made aware of this, but congratulations all the same.
smariot 1 year ago
how do you tell the interface version?
ConquestsProductions 1 year ago
@ConquestsProductions I believe you can type: /script print(GetBuildInfo())
It should displace the game version, the build number, the build date, and lastly, the interface version.
smariot 1 year ago
great tut, the only thing is that the addon isn't working...
PlAsKusJ3GaRn 1 year ago
what is XML ? what dose it do can you tell me plz
nohearth1 1 year ago
XML in WoW is for metaprogramming, which is where you write code that generates code. It's mostly for creating frames and widgets and all that stuff, since it will let you create templates and have it generate the code to setup those frames for you.
You don't need XML, you can do pretty much anything with Lua, it's just a convenience. Personally, I don't like it.
smariot 1 year ago
ok thank you =)
nohearth1 1 year ago
looking for wow lua scripter a expiernced 1 plz apply quik
armando1653 1 year ago
Why would I put effort into helping you, when you don't seem to have put any effort into asking?
smariot 1 year ago
it just updated . its not 30200 but i dont know how to put it
1Mihailo 2 years ago
Okay, I'll assume it's 30300 now.
smariot 2 years ago
not working ... i used :
print("Hello Master!");
but it aint workin :(
can you help me ?
1Mihailo 2 years ago
It would be kind of hard to tell you what you did wrong without seeing what you did, but here's a checklist:
- Make sure the TOC file has the same name as the folder it's in.
- If in Windows, the file extension of the TOC file might be hidden. (It might appear as foo.toc, when in reality it's foo.toc.txt)
- The encoding of the files (toc, lua, xml) should either be ASCII, or UTF-8 without a byte order mark. I think WoW actually will accept a BOM, but a stand-alone lua interpreter will barf.
smariot 2 years ago
- Completely restart Warcraft when you add a new file. It internally identifies files via a hash table which it generates at startup from the MPQ files and everything it finds in its own directory.
- Completely restart Warcraft when you edit anything other than a LUA or XML file. They tend to get cached. LUA/XML files can be reloaded with: /console reloadui
- Try searching WoWWiki for a tutorial. I'll add a link to one in the video description.
smariot 2 years ago
My file is helloworld.toc.txt, but how can i change it to just .toc then?
im REALLY glad if u can answer, and ty for a great vid! ;)
opismahname 2 years ago
And for what it's worth,
print("Hello Master!");
is valid lua, so that's not the problem.
smariot 2 years ago
I was having the same issue, file name was HelloWorld.toc.txt and hello.lua.txt.
I fixed this by going in to another addon, copy+paste the toc and lua file to my hello world folder, rename and edit as necessary. Not the clean and neat version, but it works.
SoonerBourne34 2 years ago
actualy it maybe works but when i click "Addons" it wont show up ... ( addons button is there becouse i have other addons i downloaded )
1Mihailo 2 years ago
Just a heads up, Blizz have removed the "message()" function, only "print ()" will work now, will show RIGHT at the top of your chat box.
Good luck! :D
LilPika11 2 years ago
Very nice. Are you able to call other methods from any lua file?
Such as getting stats and other data?
pcZero713 2 years ago
love it i all ways wanted to know how the addons worked and were made, do you think you could show us how to make a more difficult one. plz plz plz =P
sineus123 2 years ago