• 0

    posted a message on Sending chat messages on a keypress
    Thanks, I didn't see that hooksecurefunc function. I just hooked PitchUpStart() instead of VehicleAimUpStart().

    Thanks again!
    Posted in: Need Help?
  • 0

    posted a message on Sending chat messages on a keypress
    Here'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.

    Is there a way I can do Pitch Up and say a chat message at the same time?

    Thanks in advance.
    Posted in: Need Help?
  • 0

    posted a message on Closing a hyperlink window
    Once again, thanks a tun! You've been a big help with my problems, and I commend you for that :)
    Posted in: Need Help?
  • 0

    posted a message on Closing a hyperlink window
    Sweet, thanks a tun!

    One last question though. Is there a website I can go to to look up this kinda stuff? Like the frame names?

    Thanks again!
    Posted in: Need Help?
  • 0

    posted a message on Closing a hyperlink window
    Sorry, 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.

    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.
    Derrekk
    Posted in: Need Help?
  • 0

    posted a message on Closing a hyperlink window
    I'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?

    Thanks in Advance
    Derrekk
    Posted in: Need Help?
  • 0

    posted a message on Status bar in a while loop
    Quote from Xinhuan
    That'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.
    Posted in: Need Help?
  • 0

    posted a message on Status bar in a while loop
    That'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?

    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...
    Posted in: Need Help?
  • 0

    posted a message on Status bar in a while loop
    Ok, that didn't work. I mean, it worked, but whereas it used to take a few hung-up seconds, now it takes well over a minute. That's not worth it.
    Thanks for the help anyway though. Any other ideas?
    Posted in: Need Help?
  • 0

    posted a message on Status bar in a while loop
    Yeah that's another good point. I'd have to try it to see how much longer it takes. Thanks a tun!
    Posted in: Need Help?
  • 0

    posted a message on Status bar in a while loop
    So 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?
  • 0

    posted a message on Status bar in a while loop
    Ok, 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.

    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.
    Posted in: Need Help?
  • To post a comment, please or register a new account.