Andreik Posted July 10, 2008 Share Posted July 10, 2008 (edited) Yahoo! Avatar is a nice script to view avatar from any yahoo ID and verify if is online. expandcollapse popup#include <GDIPlus.au3> If FileExists(@WindowsDir & "\YAG.dll") = 0 Then FileInstall("C:\YAG.dll",@WindowsDir & "\YAG.dll",1) EndIf If FileExists(@WindowsDir & "\LOOKUP.JPG") = 0 Then FileInstall("C:\LOOKUP.JPG",@WindowsDir & "\LOOKUP.JPG",1) EndIf If FileExists(@WindowsDir & "\AVATAR.JPG") = 0 Then FileInstall("C:\AVATAR.JPG",@WindowsDir & "\AVATAR.JPG",1) EndIf Const $LOOKUP_URL = "http://lookup.avatars.yahoo.com/wimages?yid=" Const $LOOKUP_SET = "&size=large&type=png" Const $AVATAR_URL = "http://img.msg.yahoo.com/avatar.php?yids=" Const $ONLINE_URL = "http://mail.opi.yahoo.com/online?u=" Const $ONLINE_SET = "&m=a&t=0" Const $DIR = @TempDir & "\" Const $EXT = ".PNG" $GUI = GUICreate("Yahoo! Avatar by Andreik",276,277,-1,-1,0x16C00000,0x00000181) $Y_ID = GUICtrlCreateInput("",10,245,256,22,BitOR(0x0001,0x0010)) $LOOKUP = GUICtrlCreatePic(@WindowsDir & "\LOOKUP.JPG",10,10,150,225) $AVATAR = GUICtrlCreatePic(@WindowsDir & "\AVATAR.JPG",170,10,96,96) $BUTTON1 = GUICtrlCreateButton("",180,123,32,32,0x0040) $BUTTON2 = GUICtrlCreateButton("",224,123,32,32,0x0040) $BUTTON3 = GUICtrlCreateButton("",180,160,32,32,0x0040) $BUTTON4 = GUICtrlCreateButton("",224,160,32,32,0x0040) $BUTTON5 = GUICtrlCreateButton("",180,197,32,32,0x0040) $BUTTON6 = GUICtrlCreateButton("",224,197,32,32,0x0040) GUICtrlSetImage($BUTTON1,@WindowsDir & "\YAG.dll","2",1) GUICtrlSetImage($BUTTON2,@WindowsDir & "\YAG.dll","1",1) GUICtrlSetImage($BUTTON3,@WindowsDir & "\YAG.dll","3",1) GUICtrlSetImage($BUTTON4,@WindowsDir & "\YAG.dll","4",1) GUICtrlSetImage($BUTTON5,@WindowsDir & "\YAG.dll","5",1) GUICtrlSetImage($BUTTON6,@WindowsDir & "\YAG.dll","6",1) GUISetState(@SW_SHOW,$GUI) _GDIPlus_Startup() _ReduceMemory() While 1 $MSG = GUIGetMsg() Switch $MSG Case $BUTTON1 $ID = GUICtrlRead($Y_ID) FileDelete($DIR & $ID & "_LOOKUP" & $EXT) InetGet($LOOKUP_URL & $ID & $LOOKUP_SET,$DIR & $ID & "_LOOKUP" & $EXT,1,0) $hWND = GUICtrlGetHandle($LOOKUP) $GRAPHIC = _GDIPlus_GraphicsCreateFromHWND($hWND) $IMAGE = _GDIPlus_ImageLoadFromFile($DIR & $ID & "_LOOKUP" & $EXT) _GDIPlus_GraphicsDrawImage($GRAPHIC,$IMAGE,0,0) _GDIPlus_ImageDispose($IMAGE) _GDIPlus_GraphicsDispose($GRAPHIC) _ReduceMemory() Case $BUTTON2 $ID = GUICtrlRead($Y_ID) FileDelete($DIR & $ID & "_AVATAR" & $EXT) InetGet($AVATAR_URL & $ID,$DIR & $ID & "_AVATAR" & $EXT,1,0) $hWND = GUICtrlGetHandle($AVATAR) $GRAPHIC = _GDIPlus_GraphicsCreateFromHWND($hWND) $IMAGE = _GDIPlus_ImageLoadFromFile($DIR & $ID & "_AVATAR" & $EXT) _GDIPlus_GraphicsDrawImage($GRAPHIC,$IMAGE,0,0) _GDIPlus_ImageDispose($IMAGE) _GDIPlus_GraphicsDispose($GRAPHIC) _ReduceMemory() Case $BUTTON3 $ID = GUICtrlRead($Y_ID) InetGet($LOOKUP_URL & $ID & $LOOKUP_SET,@ScriptDir & "\" & $ID & "1" & $EXT,1,0) InetGet($AVATAR_URL & $ID,@ScriptDir & "\" & $ID & "2" & $EXT,1,0) _ReduceMemory() Case $BUTTON4 $ID = GUICtrlRead($Y_ID) InetGet($LOOKUP_URL & $ID & $LOOKUP_SET,@ScriptDir & "\" & $ID & "1" & ".JPG",1,0) InetGet($AVATAR_URL & $ID,@ScriptDir & "\" & $ID & "2" & ".JPG",1,0) _ReduceMemory() Case $BUTTON5 $ID = GUICtrlRead($Y_ID) FileDelete($DIR & "Y_ONLINE.XML") InetGet($ONLINE_URL & $ID & $ONLINE_SET,$DIR & "Y_ONLINE.XML",1,0) FileOpen($DIR & "Y_ONLINE.XML",0) $STAT = FileReadLine($DIR & "Y_ONLINE.XML",1) FileClose($DIR & "Y_ONLINE.XML") If StringRight($STAT,10) = "NOT ONLINE" Then _Speak("USER NOT ONLINE") ElseIf StringRight($STAT,6) = "ONLINE" Then _Speak("USER ONLINE") Else _Speak("ERROR") EndIf _ReduceMemory() Case $BUTTON6 _GDIPlus_Shutdown() Exit EndSwitch Sleep(20) WEnd Func _Speak($TEXT,$VOICE="Sam",$VOLUME=50,$RATE=0,$WAIT=-1,$LANG_ID="Language=409") Local $Speech $Speech = ObjCreate("SAPI.SpVoice") $Speech.Rate = $RATE $Speech.Volume = $VOLUME $Speech.Voice = $Speech.GetVoices("Name=Microsoft " & $VOICE , $LANG_ID).Item(0) $Speech.Speak($TEXT) $Speech.WaitUntilDone($WAIT) $Speech = "" EndFunc Func _ReduceMemory() Local $dll = DllOpen("kernel32.dll") Local $ai_GetCurrentProcessId = DllCall($dll, 'int', 'GetCurrentProcessId') Local $ai_Handle = DllCall($dll, 'int', 'OpenProcess', 'int', 0x1f0fff, 'int', False, 'int', $ai_GetCurrentProcessId[0]) Local $ai_Return = DllCall("psapi.dll", 'int', 'EmptyWorkingSet', 'long', $ai_Handle[0]) DllCall($dll, 'int', 'CloseHandle', 'int', $ai_Handle[0]) DllClose($dll) Return $ai_Return[0] EndFunc Edited July 10, 2008 by Andreik When the words fail... music speaks. Link to comment Share on other sites More sharing options...
mantas Posted July 10, 2008 Share Posted July 10, 2008 Thank you Andreik Link to comment Share on other sites More sharing options...
Andreik Posted July 10, 2008 Author Share Posted July 10, 2008 Thank you AndreikYou're welcome. And if you something not work please tell me to fix. muttley When the words fail... music speaks. Link to comment Share on other sites More sharing options...
d4rk Posted July 10, 2008 Share Posted July 10, 2008 Hello, I recently see this kind of work , but on a web page, it help me figure out what are you doing That's cool [quote]Don't expect for a perfect life ... Expect a least troubles ones[/quote]Contact me : ass@kiss.toWhat I Have Done :Favorites Manager Mangage your favorite's folder, that's coolPC Waker For those who want to save stickersWebScipts Supporter For those who've just started with Web and WebScriptsTemporary Looker Simple but powerful to manage your Temporary folder, you know what you downloaded[UDF] _NumberFormat() Better performance on number display[UDF] _DirGet() What a folder contain [how many (hidden,normal,...) files], with one line of code[UDF] _IsPressEs() Just like _IsPress() but for a group of keys Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now