- Registered User
Member for 11 years and 10 months
Last active Fri, Oct, 4 2013 14:30:32
- 0 Followers
- 31 Total Posts
- 0 Thanks
Apr 29, 2012Hi,Posted in: Lua Code Discussion
I hope this turns out to be another simple question to answer. :)
I've been trying to work out how to escape strings so I can use string.match. I found this function:
function escape(s) return (s:gsub('[%-%.%+%[%]%(%)%$%^%%%?%*]','%%%1'):gsub('%z','%%z')) end
I swiped it from here. I have to admit I don't understand the rest of the code. Although I think I understand most of the function above - except the last gsub.
Why? What have "z"s done to deserve special treatment?
Apr 26, 2012Hi,Posted in: Lua Code Discussion
I hope this is a quick question. I'm not keen on putting code in the OnUpdate of a frame, mainly because my code doesn't need to run all the time. At the moment I am using 1 var and an if statement to disable my code. But that still means the if statement is still being tested even though it fails.
I can't help thinking that I could register the OnUpdate only when I need it, then unregister it after. When I've looked at other addons, I've not noticed this kind of activity. Registering events, yes, but not scripts.
So, in short, why? Does registering and unregistering a script lots of times* cause other issues?
* I realise that the register/unregister functions would probably take more processing power than an if statement, so it would depend on just how many. What I want to do is:
- 1-x seconds OnUpdate activity
- idle for x seconds to x minutes
Jan 16, 2012Thanks for the information. I've learned something new about my text editor and UTF8. :) I was saving files as ansi.Posted in: Lua Code Discussion
I've not had much time to look in detail, but I seem to remember a bit about string.char not being OS independent. As WoW runs on Windows and Mac, I'd want to test how Blizzard's code handles this.
Also, Blizzard's code seems to be inconsistent in the way string.xxx functions handle UTF8. Sometimes an accented letter magically become 2 chars when using certain functions. Hence the TitleCase function, I nicked from elsewhere.
Ofc, this all could be down to gaps in my knowledge, so when I have time - I shall keep looking.
Jan 9, 2012Posted in: Lua Code Discussion
Nope, Players point and click to sign up to an event. The event administrator, then selects the players and the toon they will play and their role. This is the list that gets typed. The event administrator is not always the person leading the raid.
I like the idea of a point and click solution for the website, but I don't have the knowledge or the access to implement such a change.
I'm not convinced of the benefits for your in game solution. Unless the user could remember all attendees, they would still need to alt-tab between game and browser. So it would have to be a particularly fancy window for the user to think it's better than using the existing guild roster window to send invites manually.
I'm a "new" member in a well established guild. I don't want to bore peeps with details of our administration procedures, which I can't change. So I need to make my addon look simple, flexible and be able to fit into established routines.
If you fancy being horrified, the latest version of my addon can be found here. I have coded for "Imanidiot" type duplicates, but there aren't any in my guild, so I've not properly tested or implemented that feature.
Jan 8, 2012Posted in: Lua Code Discussion"Ímånìdîõt"
hehe. While I would agree with your sentiment if we were talking about native English speakers - the problem is, we're not. This is Europe, native English speakers are very much the minority.
For most of my guild members, accented letters are a part of every day life. So I must respect and accommodate these linguistic differences. And it doesn't help that different European languages use different accented letters. So not all players can type every variation.
My addon provides an edit box for the text entry. If I find duplicate names, I can update that text and ask the user to edit. Everyone can delete. :)
Thank you for your replies.
Jan 7, 2012In a word, yes. My guild uses a website calendar to arrange raids. Attending Toon names are listed on the site. Using my addon, the raid leader can copy+paste the list of names into my addon, which will then send out group invites to those toons.Posted in: Lua Code Discussion
What I want to do create a function so I can reuse it anywhere:
if RemoveAccents (Var1) == RemoveAccents (Var2) then ... end
Jan 6, 2012Hi,Posted in: Lua Code Discussion
All of the very few peeps to use my addon are based in Europe. And being "Johnny Foreigners" they will insist on using "funny" letters (ÐãØë?). The problem is, not everyone can easily type all of them. So most of the time they use the non-accented version (DaOeC). This, ofc, makes string matching impossible.
The only solution I can think of, is some sort of look up table. But I can't help thinking there's a more cleaver way of solving it. Would anyone have any alternative suggestions or ideas?
Edit: Sorry, I forgot to make it clear that my tongue is firmly in cheek for the first part. :)
Jun 21, 2011Hi,Posted in: Lua Code Discussion
I've been reading up about the quest functionality and it seems to me that there's an event for everything except when the user clicks on the "complete" button on a quest.
Before I start trying to build some complicate solution, is there something I've missed?
Dec 21, 2010Hi,Posted in: Lua Code Discussion
I have a very basic window where the user can drag and drop an item from their inventory and the item's icon is nicely displayed. What I would like to add is the display of the same tooltip I get when I hover over the same item in my bag, but to appear when I hover over the icon in my window.
I know that I can create my own tooltip, but that won't display the same information. If it's at all possible, I'd like to be able to "trick" other addons into thinking it's the "real thing" so they display their information as well.
I've been struggling to "decode" other addons to see how I can find a solution to what I want to do. I am hoping there's some simple function, but part of me is thinking that's too easy. Is there a solution? (and will I understand, but that can wait. ;))
Nov 3, 2010Hi,Posted in: Lua Code Discussion
When I want to change the colour of text sent to the chat window I use hexadecimal, like "|cffffff00". What I would like to do, is be able to do is select from a range from RGB (255,0,0) to RGB (0,255,0) (for example).
But as far as I can tell, you need to use the hexadecimal value, not RGB. Being lazy I was hoping there might be someone willing to let me borrow their code ;D or would you have any other suggestions?
- To post a comment, please login or register a new account.