Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Read Text, Do Action...
#1
I want to make a macro that when somebody says something in an instant message I want it to do an action, like "Sign out" the macro would read the text of the instant message window and it would sign out of the instant messanger service... Here's what I came up with and I got it so it would type what the text is but I can't make it do the action :?


Code:
Copy      Help
str a.getwintext(child("" "Ate32Class" win("Username1 : Username2- Instant Message" "AIM_IMessage") 0x5))   ****Gets the message from IM Window*****
,,if(IsWindowVisible(child("Usernamehere: sign out" "Ate32Class" win("Username1 : Username2 - Instant Message" "AIM_IMessage") 0x5)))        *****If Username1 says "Sign out" then I want it to move the mou...  (for an example)
,,mou 45 45
#2
Why IsWindowVisible? Use operator = or ~, or functions find or match, or sel. Example with sel:

Code:
Copy      Help
str a.getwintext(child("" "Ate32Class" win("Username1 : Username2- Instant Message" "AIM_IMessage") 0x5))   ;;****Gets the message from IM Window*****
sel a 3
,case "*Usernamehere: sign out*" ;;if contains this text (* are wildcard character, ie match 0 or more characters)
,mou 45 45
,;here also could be
,;case "*other text*"
,;other actions
,;and so on
,
#3
Alright thanks Gintaras It worked but the only problem is, how do I make it run until the person says "Sign out" , do I make it a function or can I add a loop type thing (Visual Basic learner) only thing I found was If and out :?

I want it to run a macro until the personn says Sign out, then I want it to stop the macro and run another one... so far I have this..

mac+ "Macro1"

str a.getwintext(child("" "Ate32Class" win("Username1 : Username2- Instant Message" "AIM_IMessage") 0x5)) ;;****Gets the message from IM Window*****
sel a 3
,case "*Usernamehere: sign out*" ;;if contains this text (* are wildcard character, ie match 0 or more characters)
,mou 45 45

then like a, If Case = "Sign Out" then

mac- "Macro1"

any ideas? :?:

WAS ASLO THINKING - MAKE FUNCTION RUN 24/7 or until the Signout comes, then have another function stop the 24/7 running one, and start another macro

the only way it works if is I keep running the macro over and over Sad
#4
Code:
Copy      Help
int h=child("" "Ate32Class" win("Username1 : Username2- Instant Message" "AIM_IMessage") 0x5)
rep
,if(!IsWindow(h)) ret ;;window closed
,str a.getwintext(h)
,sel a 3
,,case "*Usernamehere: sign out*"
,,mou 45 45
,,case "Sign Out"
,,mac "another macro"
,,break
,wait 0.1


Forum Jump:


Users browsing this thread: 1 Guest(s)