statistics
People Online: 17
Today's Visitors: 439
Total Visitors: 3,727,949
February 07, 2012, 05:44:24 PM
Shoutbox
   
 
[Guest] [joshmiller83]: Can we get an Astrolabe fix please? Or has WIM stopped being developed?
[DevTeam] [Astaldo]: You can disable wim2wim for now or visit the forum thread where you originally posted the issue
[DevTeam] [Zeke]: Yay for spam!
[DevTeam] [Zeke]: ....
[DevTeam] [Zeke]: I love that I get emailed when someone reports spam on the boards, but I can't do anything about it.
[DevTeam] [Nachonut]: lol i got you
[DevTeam] [Astaldo]: How about "hide email address from public checked" and it's still visible in all my posts...
[DevTeam] [Astaldo]: I'd delete my account on this site, but by the time I realized the problem half the spambots on the planet had it already
[Developer] [Pazza]: Astaldo if you log out and view your profile with a refresh you'll see that your email is hidden.
[Developer] [Pazza]: Your user level on the forums permit you to see emails even though they are marked hidden.
[DevTeam] [Astaldo]: Ah.. thanks for the clarification and apologies for "crying wolf" in that case :
[DevTeam] [Kaidenn]: PAZZA! i miss you.
[DevTeam] [Nachonut]: Lol, it's funny how it takes spam message reports to get me to come back
[DevTeam] [sylvanaar]: Check out the beta tester forum. Need alpha testers and feedback so I can come up with a maintenance plan.
[Developer] [Pazza]: loaded some new spam prevention modules... lets see if this stops the bastards.
[DevTeam] [Maziel]: Thought I'd check in and say Howdy Doody from Australia
[DevTeam] [Maziel]: Yeah the spam from shoes salesmen was becoming insane
[Guest] [Delakando]: What ever happened to the ability to track friend's location by wim? Other then just showing their general zone location.
Zeke pokes his head around the corner.
[DevTeam] [Zeke]: Anybody home?
[Guest] [Theillur]: I would like to know if it is just me.
[Guest] [Theillur]: http://www.wimaddon.com/forums/index.php/topic,1796.0.html
[Guest] [Nev]: I'm here
[Guest] [Nev]: I don't think anyone else is though
[Guest] [tomasio]: great site [url=http://freeonlinemusicvideos.net].[/url] [url=http://freepeopleclothing.org].[/url]
[Guest] [Theillur]: Nev it is not working for Zeke as well.
[DevTeam] [lothaer]: im here
[DevTeam] [lothaer]: ...
lothaer yawns sleepily.
[DevTeam] [lothaer]: sooooooooooooooooo
[Guest] [j3ff]: Hello. It is very quiet. I would love a response to my thread directly below your "Been very quiet" thread!
[DevTeam] [lothaer]: Check out my new post in the Skins forum
[DevTeam] [lothaer]: Posted a new download in the skins forum check it out
[DevTeam] [lothaer]: Zeke, Maziel, Pazza, Nachonut, sylvanaar, Kaidenn, Astaldo where are you?
[DevTeam] [lothaer]: It would be a real shame if WIM was left to die.
[DevTeam] [lothaer]: i think these forums are dead, Sylvanaar dosnt post on them as he only bug fixes when possible. WIMs future isnt very bright
[Guest] [justgiz]: Yea, its rather sad.
[Guest] [silvercola]: I wish it had skype
[DevTeam] [lothaer]: noy possible for a addon to do.
[DevTeam] [lothaer]: ...........
[Guest] [elzershark]: where is the download file?
lothaer beckons everyone over to you.
[DevTeam] [lothaer]: has anyone been able to take WIM to the beta yet?
[DevTeam] [lothaer]: PTR*
[DevTeam] [Maziel]: *sticks head up and looks around*
lothaer cries.
[DevTeam] [lothaer]: who the hell flagged my post as spam?
[Guest] [primalforce]: Hey guys
[DevTeam] [lothaer]: hello Primalforce.
[DevTeam] [lothaer]: PAZZA COME BACK!!!
 
   
   
News: World of Warcraft v4.0.1
 
Pages: [1]
Print
Author Topic: Triggering WIM to send message  (Read 3287 times)
Hawksy
Newbie
*

Karma: +0/-0
Offline Offline

Posts: 4


View Profile
« on: January 17, 2008, 10:37:59 AM »

Hi,

In response to a user request I have been altering Recap so that it can post to WIM.

When I post using WIM_EditBoxInFocus:Insert it works fine except that the user then needs to hit 'enter' to actually send the message.

Is there any function available in WIM that I can call to trigger WIM to actually post the message?  I looked through the code and couldn't spot anything.  Calling WIM_MessageWindow_MsgBox_OnEnterPressed gives an error at WIM.lua:2938.

Having to press 'enter' wouldn't be a horrible burden on the user, except that Recap also has a multi-line posting capability, which fails with WIM because as far as I can see I can only put the text of one line into the WIM chat edit box (unless I can trigger WIM to send).

The Blizzard function SendChatMessage works as follows:

If the user has for example the raid chat edit box open, then Recap can repeatedly call SendChatMessage, complete messages are sent, and the raid chat edit box remains open and empty after Recap has finished.

I'd be looking either for that functionality, or for a separate call that triggers WIM to post its current chat edit box.  In either case the focus would have to remain in the WIM chat edit box after WIM did its post.

Hawksy

Logged
Pazza
Administrator
Hero Member
*****

Karma: +89/-15
Offline Offline

Posts: 1375


Effin A


View Profile WWW
« Reply #1 on: January 17, 2008, 12:49:21 PM »

Thanks for the post Hawksy.

Let me try to explain the best I can.. There shouldn't be a need to actually send data through the WIM window since WIM itself just takes that data and issues a SendChatMessage().

I don't really understand what is giving you a problem using this method. In actuality, it shouldn't have anything to do with the chat edit box. It is a pure API call that sends the message directly to the server.

If you are trying to NOT have the user enter in who to send the message to and simply look from WIM, then your best bet is to still use the SendChatMessage API call but in this case, and if WIM_EditBoxInFocus != nil, then you can get the user by using this code:
Code:

usertosend = WIM_EditBoxInFocus:GetParent().theUser;


Now I am doing this strictly from memory since I don't have a WoW comp here at work :-(.

here is some pseudo code I would call:
Code:

if(WIM_EditBoxInFocus) then
    usertosend = WIM_EditBoxInFocus:GetParent().theUser;
else
    usertosend = [some action to get usertosend from the actual user]
end

[Code to send the actual message through]



Maybe I am not understanding right. That might be the case since I am at work and doing 100 things at once. If you want, you could PM me and I'll give you my vent info. we can discuss more. I would like WIM to work with as many addons as possible.
Logged

My hobbies consume way too much time :-).
Hawksy
Newbie
*

Karma: +0/-0
Offline Offline

Posts: 4


View Profile
« Reply #2 on: January 17, 2008, 08:19:57 PM »

Hi Pazza,

Thanks for the prompt reply.

It didn't directly answer my question, but you gave me exactly the information that I needed to get Recap and WIM working together.

Rather than writing to the WIM edit box (and hoping/expecting that WIM would send the message), as you suggested I now grab the name of the user (the target of the whisper) from WIM and then use SendChatMessage to whisper in the usual way from within the Recap code.

Not being familiar with WIM, I hadn't understood that WIM is purely about whispers, nor had I understood that I could easily get the user name for the WIM edit box that had the focus.

Thanks again,
Hawksy

Logged
Hawksy
Newbie
*

Karma: +0/-0
Offline Offline

Posts: 4


View Profile
« Reply #3 on: July 24, 2009, 09:40:27 PM »

Hi,

I don't use WIM actively, so I haven't been keeping Recap working with WIM as WIM has evolved.  I have recently been told that Recap no longer posts correctly using WIM.

The code that I was using within Recap was very similar to what WIM has.  Grab the target associated with the chat edit box and send the message directly:

if WIM_EditBoxInFocus then
   SendChatMessage(text, "WHISPER", nil, WIM_ParseNameTag(WIM_EditBoxInFocus:GetParent().theUser))
end

This seems no longer to work.  Specifically, even when the cursor is in one of WIM's edit boxes, WIM_EditBoxInFocus now seems to be nil.

Am I missing something?  Do I need to do things differently now?  I need to detect when the cursor is in a WIM chat edit box, and then determine the type of chat and (if a whisper) the target of that whisper.

Thank you.
Hawksy
Logged
Hawksy
Newbie
*

Karma: +0/-0
Offline Offline

Posts: 4


View Profile
« Reply #4 on: July 28, 2009, 01:29:17 PM »

Okay, did a bunch of active research, figured out a way to do it by searching WIM's active chat and whisper windows to see if one of them has the focus, and if it does then send a chat message to the appropriate target.

Here's the first bit of code to scan the chat windows to determine if one (window index i) has the focus.  There is similar code for the whisper windows.  I don't know what to do with the w2w windows, so at the moment I'm ignoring them.

Code:
if WIM.windows.active.chat then
for i in pairs(WIM.windows.active.chat) do
if getglobal(WIM.windows.active.chat[i]:GetName().."MsgBox"):HasFocus() then
-- determine chat type and / or whisper target
end
end
end

Is there a slicker way?

Hawksy
Logged
Pages: [1]
Print
Jump to:  

You must be logged in to send a message to the shout box.
     
  test stamp