AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

(Random) Change Google talk status message

 
Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions
View previous topic :: View next topic  
Author Message
1991



Joined: 20 Jan 2006
Posts: 29
Location: Colorado, USA

PostPosted: Sat Sep 09, 2006 5:42 am    Post subject: (Random) Change Google talk status message Reply with quote

I decided to pst this small code snippet because this was very time consuming and difficult.
Possible uses:
-timestamp messages visible to recipent only.
-random sayings that can be differentiated from normal typing
-making a timed message schedule ex. 'asleep' at night, 'eating' during lunch etc.

Code:

WinGetActiveTitle, titleold
blockinput,on
ControlClick,Status View 21, Google Talk, , L, 2,x30 y20
ControlSetText, RichEdit20W2, %var%, Google Talk
winactivate, %titleold%
blockinput,off


random, yes. I know.

Any bugs updates etc? post!
Back to top
View user's profile Send private message
BoBo
Guest





PostPosted: Sat Sep 09, 2006 7:18 am    Post subject: Reply with quote

As its not a third party app/script but a native AHK code, it should be moved to the Scripts & Functions section. Thx for sharing it. Cool
Back to top
Veovis



Joined: 13 Feb 2006
Posts: 389
Location: Utah

PostPosted: Sat Sep 09, 2006 8:38 pm    Post subject: Reply with quote

LOL! i was so going to make this but never got around to it. last time i tried i seem to remember gtalk being unfriendly since it doesnt use normal controls.
_________________

"Power can be given overnight, but responsibility must be taught. Long years go into its making."
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Veovis



Joined: 13 Feb 2006
Posts: 389
Location: Utah

PostPosted: Sat Sep 09, 2006 11:06 pm    Post subject: Reply with quote

Added some functions.
Time is how often to change the pm
Order 1=random 0=in order

Quotes = List of quotes seperated by linefeeds with no linefeed before the list

enjoy!

Code:
time := 5 * 60 * 1000   ;5 minutes * 60 seconds * 1000 milliseconds
order = 1    ;0 = do in order, 1 = random

quotes =
(
Strength is being able to admit your weakness to others in order to get help.
Misfortune shows those who are not really friends. ~Aristotle
Without friends no one would choose to live, though he had all other goods. ~Aristotle
A good friend can tell you what is the matter with you in a minute. He may not seem such a good friend after telling. ~Arthur Brisbane
The meeting of two personalities is like the contact of two chemical substances: if there is any reaction, both are transformed. ~Carl Jung
Friendship makes prosperity more shining and lessens adversity by dividing and sharing it. ~Cicero
Do not protect yourself by a fence, but rather by your friends. ~Czech Proverb
You can make more friends in two months by becoming interested in other people than you can in two years by trying to get other people interested in you. ~Dale Carnegie
There are no strangers, only friends you haven't met yet.
Nobody sees a flower - really - it is so small it takes time - we haven't time - and to see takes time, like to have a friend takes time. ~Georgia O'Keeffe
Fall seven times, stand up eight. ~Japanese Proverb
The reverse side also has a reverse side. ~Japanese Proverb
In prosperity our friends know us; in adversity we know our friends. ~John Churton Collins
Treat your friend as if he might become an enemy. ~Publilius Syrus
The ornament of a house is the friends who frequent it. ~Ralph Waldo Emerson
Sometimes the measure of friendship isn't your ability to not harm but your capacity to forgive the things done to you and ask forgiveness for your own mistakes. ~Randy K. Milholland
When someone allows you to bear his burdens, you have found deep friendship.
Get not your friends by bare compliments, but by giving them sensible tokens of your love. ~Socrates
Don't walk behind me, I may not lead. Don't walk in front of me, I may not follow. Just walk beside me and be my friend. ~Unknown
I no doubt deserved my enemies, but I don't believe I deserved my friends. ~Walt Whitman
Genius might be described as a supreme capacity for getting its possessors into trouble of all kinds. ~Samuel Butler
We make a living by what we get, we make a life by what we give. ~Sir Winston Churchill
We find no real satisfaction or happiness in life without obstacles to conquer and goals to achieve. ~Maxwell Maltz
Do not turn back when you are just at the goal. ~Publilius Syrus
Call on God, but row away from the rocks. ~Indian Proverb
I know God will not give me anything I can't handle. I just wish that He didn't trust me so much. ~Mother Teresa
)

;=========Code Starts Here===========
;auto-execute:
Loop,parse,Quotes,`n
   quotecount := A_index     ;this will retreive the number of quotes
if order
   SetTimer, RandQuote, %time%
else
{
   curquotecount = 1
   SetTimer, OrderQuote, %time%
}
return
#persistent

RandQuote:
   random,random,1,quotecount
   send, %random%%A_space%
   curquote := GetLine(Quotes,random)
   ;SetGTalkMessage(curquote)
return

OrderQuote:
   curquote := GetLine(Quotes,curquotecount)
   curquotecount += 1
   SetGTalkMessage(curquote)
return

GetLine(input,linenum)
{
   stringgetpos,count,input,`n,L%linenum%   ;this is kinda backward, this gets the `n after the line you want
   linenum -= 1
   stringgetpos,start,input,`n,L%linenum%   ;and this gets the `n before the line you want
   count := count - start
   start += 2
   stringmid,output,input,start,count
   return output
}

SetGTalkMessage(message)
{
   WinGetActiveTitle, titleold
   blockinput,on
   ControlClick,Status View 21, Google Talk, , L, 2,x30 y20
   ControlSetText, RichEdit20W2, %message%, Google Talk
   ControlSend,RichEdit20W2,{enter}, Google Talk
   winactivate, %titleold%
   blockinput,off
}

_________________

"Power can be given overnight, but responsibility must be taught. Long years go into its making."
Back to top
View user's profile Send private message Send e-mail Visit poster's website
ProfessorY91



Joined: 03 Mar 2008
Posts: 12
Location: Inside your mind.

PostPosted: Mon Aug 10, 2009 2:48 am    Post subject: Reply with quote

Just wanted to take the time to thank you for your snippet. You're right, Google Talk is an application that tends to resist scripting, unless you want to get into COM, etc...

Thanks for your work.

Y
_________________

Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group