Thanks, I didn't see that hooksecurefunc function. I just hooked PitchUpStart() instead of VehicleAimUpStart().
- Registered User
Member for 14 years, 5 months, and 28 days
Last active Thu, Dec, 1 2016 22:05:31
- 0 Followers
- 12 Total Posts
- 0 Thanks
Dec 28, 2008Here's an interesting one. I want to say a message into the chat whenever I press the Insert key (Pitch Up). The OnKeyDown event only works if the frame has focus, I can't find a lua event for it, and I can't make it a binding because then the Insert key won't do the Pitch Up as well.Posted in: Need Help?
Is there a way I can do Pitch Up and say a chat message at the same time?
Thanks in advance.
Nov 28, 2008Sorry, I was writing that in a hurry. I meant close the frame, hide it, as if you had clicked the X button normally in the upper right. Remember I'm talking about the frames that popup from an itemlink in the chat.Posted in: Need Help?
I figured out how to open them automatically when you move the mouse over them by putting the SetItemRef command in the OnHyperlinkEnter event. I just need to know what to put on the OnHyperlinkLeave to close them again.
Sorry about that, and thanks for any help in advance.
Nov 28, 2008I'm still a bit new to this, so I have another question. My AddOn automatically opens some ItemLinks, like from the chat. The problem is, I don't know how to close them automatically. Is there a command or function I could use to close them?Posted in: Need Help?
Thanks in Advance
Nov 4, 2008Posted in: Need Help?Quote from XinhuanThat's because if you were doing say 10000 loops, that might take 5 seconds. But when you use an OnUpdate, and your code is doing 1 loop per OnUpdate, then since Onupdates run once every frame, you'll be taking 10000 frames to run the entirety of your loops. If you play wow at say 100 FPS, then that's 100 seconds, or 1 minute 40 seconds.
The solution? Run say 10 loops per OnUpdate/frame, not 1, and that 100 seconds becomes 10 seconds, and you can animate a nice progress bar while you're at it over the 1000 frames in that 10 seconds.
Well, after messing with a C Stack Overflow error for an hour or so, I got it to work doing 25 at a time (which is a single page in my addon) and it takes like 10 seconds instead of 5, which is acceptable considering it's visual and it's not hung-up time.
Thanks a tun! I don't know if it's too much better then it was but I did learn a lot in the process. Looks like it works great now.
Nov 4, 2008That's what I did, I did the contents of my for loop in a function that runs on the OnUpdate event, and used a global variable in place of a counter. Isn't that what you meant?Posted in: Need Help?
That made it take well over a minute, when it took a few seconds with the for loop.
EDIT: It seems go faster if I use the OnValueChanged event of the status bar rather then the OnUpdate, and it now takes a little under a minute, but still not a few seconds. Hmm...
Nov 4, 2008So like a loop with events? Interesting, I haven't thought of that. I do have another question though, if I do it that way, will it take longer to complete? I don't want to have a status bar at the expense of making my users wait too much longer.Posted in: Need Help?
Nov 4, 2008Ok, I'm writing an AddOn that stores data, then shows it back as a list in a ScrollingMessageFrame. It works fine, except when the amount of data gets too large, it takes a few seconds for the for loop to add everything to the frame.Posted in: Need Help?
I wanted to add a StatusBar in order to show the progress, so the user knows how long to wait. The only problem is, the for loop locks up the game while executing, so for the few seconds it takes, the status bar doesn't appear to move. When it's done, the status bar appears filled, telling me it's done.
I was wondering if there was some function to re-draw the frame, so that it'll refresh the StatusBar each time it updates, while stuck in the loop? Or, is there a sleep or wait function I can add something like 1 millisecond each time to allow the game to continue and update it? Or perhaps another solution?
Note: I'm new to lua, but I have done a lot of programming in other languages, so I just had to pick up the Lua Syntax and API.
Thanks in Advance.
- To post a comment, please login or register a new account.