Tyler Durden Posted April 16, 2006 Share Posted April 16, 2006 (edited) Hi, I'm writing Diablo Hot (DClone) IP informer, which parse Hot IP info from server and shows it in the little window as well as current game IP. But, i need some help pls 1. How to make informer window disapear when active window (the window in which user pressed informer's hot-key) loose focus (I tried to save current window title and then check for activity in the main loop, but something is wrong with it 2. How to change informer's window background color ? Is the only way is to make my own GUI window for it ?3. How to change info appeared when mouse is over the tray icon of autoit ?Thx for the answers, here's the code (link is here):expandcollapse popup;HOT ip script by Tyler Durden #Include <process.au3> $strFirstServerStart="<trclass=""ligne0""><tdclass=""ip"">" $strFirstServerEnd="</tr>" $strEndTd="</td>" $strDelTd1="<tdclass=""noleftborder"">" $strDelTd2="<tdclass=""norightborder"">" $strDelTd3="<td>" $server="http://dclone.eskysse.com/" $strConnection=":4000 ESTABLISHED" $fileServers="servers.html" $fileCons="cons.txt" $winName="D2 Hot IP Informer by Tyler Durden" $d2WinName="D2Loader" ;Opt("WinTitleMatchMode",2) Opt("PixelCoordMode",2) HotKeySet("{NUMPADSUB}", "HotIPInfo") dim $showing=0,$currentWin="" while 1 if WinActive($currentWin)=0 then $showing=0 SplashOff() endif ;sleep(100) wend func HotIPInfo () if $showing=0 then $currentWin=WinGetTitle(""); $showing=1 InetGet($server,$fileServers) $file=FileOpen($fileServers, 0) $serversHtml=FileRead($file, FileGetSize($fileServers)) $serversHtml=StringReplace($serversHtml," ","") $posFSStart=StringInStr($serversHtml,$strFirstServerStart) $serversFirst=StringMid($serversHtml,$posFSStart+StringLen($strFirstServerStart)) $posFSEnd=StringInStr($serversFirst,$strFirstServerEnd) $serversFirst=StringLeft($serversFirst,$posFSEnd-StringLen($strFirstServerEnd)-1) $serversFirst=StringReplace($serversFirst,$strDelTd1,"") $serversFirst=StringReplace($serversFirst,$strDelTd2,"") $serversFirst=StringReplace($serversFirst,$strDelTd3,"") $serversFirst=StringSplit($serversFirst,$strEndTd,1) FileClose($file) FileDelete($fileServers) _RunDOS("netstat.exe -n>"&$fileCons) $file=FileOpen($fileCons, 0) $connections=FileRead($file, FileGetSize($fileCons)) $connections=StringReplace($connections," "," ") $connections=StringReplace($connections," "," ") $posGameIP=StringInStr($connections,$strConnection); $gameIP="None" if $posGameIP>0 then $posGameIPStart=$posGameIP-4+StringInStr(StringMid($connections,$posGameIP-4,4),".") if $posGameIPStart>0 then $gameIP=StringMid($connections,$posGameIPStart,$posGameIP-$posGameIPStart) endif endif FileClose($file) FileDelete($fileCons) $pos=WinGetPos("") $resultStr=" Current game IP: "&$gameIP&@LF&" Hotest IP: "&$serversFirst[1]&@LF&" State: "&$serversFirst[7]&@LF&" SOJ sold: "&$serversFirst[6]&@LF&" SOJ left: "&$serversFirst[8] SplashTextOn($winName,$resultStr,120+(StringLen($GameIP)-2)*7,72,$pos[0]+10,$pos[1]+30,1+4,"tahoma",9) WinSetTrans ($winName,"",200) WinSetOnTop ($winName,"",1) sleep(10000) $showing=0 SplashOff() else $showing=0 SplashOff() endif endfunc Edited April 16, 2006 by Tyler Durden Link to comment Share on other sites More sharing options...
Tyler Durden Posted April 16, 2006 Author Share Posted April 16, 2006 Updated, but informer's window don't close immediatly if app window minimized expandcollapse popup;HOT ip script by Tyler Durden v 0.6 #include <process.au3> #include <GUIConstants.au3> dim $strFirstServerStart="<trclass=""ligne0""><tdclass=""ip"">" dim $strFirstServerEnd="</tr>" dim $strEndTd="</td>" dim $strDelTd1="<tdclass=""noleftborder"">" dim $strDelTd2="<tdclass=""norightborder"">" dim $strDelTd3="<td>" dim $server="http://dclone.eskysse.com/" dim $strConnection=":4000 ESTABLISHED" dim $fileServers="servers.html" dim $fileCons="cons.txt" dim $winName="D2 Hot IP Informer by Tyler Durden" dim $showing=0 dim $serversFirst=" </td> </td> </td> </td> </td> </td> </td>" dim $gameIP="" dim $wndHnd=0 dim $lblHnd=0 dim $oldTitle="" dim $winHeight=68 dim $winWidth=108 Opt("WinTitleMatchMode",2) Opt("PixelCoordMode",2) Opt("GUICoordMode",2) HotKeySet("{NUMPADSUB}", "hotIPInfo") HotKeySet("{NUMPADADD}", "hotIPUpdate") hotIPUpdate() while 1 if WinActive($oldTitle)=0 then $showing=0 GUIDelete($wndHnd) endif sleep(100) wend GUIDelete($wndHnd) func getHotIpData() $serversFirst="" $r=InetGet($server,$fileServers,1,1) if $r=1 then while @InetGetActive=1 wend $file=FileOpen($fileServers, 0) $serversHtml=FileRead($file, FileGetSize($fileServers)) $serversHtml=StringReplace($serversHtml," ","") $posFSStart=StringInStr($serversHtml,$strFirstServerStart) $serversFirst=StringMid($serversHtml,$posFSStart+StringLen($strFirstServerStart)) $posFSEnd=StringInStr($serversFirst,$strFirstServerEnd) $serversFirst=StringLeft($serversFirst,$posFSEnd-StringLen($strFirstServerEnd)-1) $serversFirst=StringReplace($serversFirst,$strDelTd1,"") $serversFirst=StringReplace($serversFirst,$strDelTd2,"") $serversFirst=StringReplace($serversFirst,$strDelTd3,"") FileClose($file) FileDelete($fileServers) endif endfunc func getGameIP() $gameIP="" _RunDOS("netstat.exe -n>"&$fileCons) $file=FileOpen($fileCons, 0) $connections=FileRead($file, FileGetSize($fileCons)) $connections=StringReplace($connections," "," ") $connections=StringReplace($connections," "," ") $posGameIP=StringInStr($connections,$strConnection); if $posGameIP>0 then $posGameIPStart=$posGameIP-4+StringInStr(StringMid($connections,$posGameIP-4,4),".") if $posGameIPStart>0 then $gameIP=StringMid($connections,$posGameIPStart,$posGameIP-$posGameIPStart) endif endif FileClose($file) FileDelete($fileCons) endfunc func hotIPUpdate() if $showing=1 then getHotIpData() getGameIP() $sfInfo=StringSplit($serversFirst,$strEndTd,1) if $sfInfo[0]=8 then if $gameIP=$sfInfo[1] then GUISetBkColor(0xff0000,$wndHnd) endif $resultStr="Current game IP: "&$gameIP&@LF&"Hotest IP: "&$sfInfo[1]&@LF&"State: "&$sfInfo[7]&@LF&"SOJ sold: "&$sfInfo[6]&@LF&"SOJ left: "&$sfInfo[8] GUICtrlSetData($lblHnd,$resultStr) endif GUISetState(@SW_SHOW,$wndHnd) endif endfunc func hotIPInfo() if $showing=0 then $showing=1 $pos=WinGetPos("") $oldTitle=WinGetTitle("") $wndHnd=GUICreate ($winName,$winWidth,$winHeight,$pos[0]+10,$pos[1]+30,$WS_POPUP,$WS_EX_TOPMOST,WinGetHandle($oldTitle)) $lblHnd=GUICtrlCreateLabel ("",5,3,$winWidth-5,$winHeight-3) WinSetTrans ($winName,"",190) GUISetBkColor(0xffffff,$wndHnd) $sfInfo=StringSplit($serversFirst,$strEndTd,1) if $sfInfo[0]=8 then if $gameIP<>"" then if $gameIP=$sfInfo[1] then GUISetBkColor(0xff0000,$wndHnd) endif endif $resultStr="Current game IP: "&$gameIP&@LF&"Hotest IP: "&$sfInfo[1]&@LF&"State: "&$sfInfo[7]&@LF&"SOJ sold: "&$sfInfo[6]&@LF&"SOJ left: "&$sfInfo[8] GUICtrlSetData($lblHnd,$resultStr) endif GUISetState(@SW_SHOW,$wndHnd) WinActivate($oldTitle) hotIPUpdate() else GUIDelete($wndHnd) $showing=0 endif endfunc Link to comment Share on other sites More sharing options...
Tyler Durden Posted April 17, 2006 Author Share Posted April 17, 2006 Updated. Many fixes and features All in ini file, diablo window transparency changing, languages support, "skins" support.download hereP.S. But still can't get how to change tooltip text when i put mouse over autoit tray icon Link to comment Share on other sites More sharing options...
GrungeRocker Posted April 17, 2006 Share Posted April 17, 2006 then ask in v3-support this is not a support forum..... and well: there aren't many people interested in DII, but i was it a long time...... so well, does hot ips matter after the new patch.... like i heard, noone is searching for some! [font="Verdana"]In work:[list=1][*]InstallIt[*]New version of SpaceWar[/list] [/font] Link to comment Share on other sites More sharing options...
Tyler Durden Posted June 13, 2006 Author Share Posted June 13, 2006 Yes they have matter BTW I've updated the tool, it's now have many features, but I'm still working on it (planning to make fastTPtoTown, HostChicken, GUI configurator and so on). You can download it here Link to comment Share on other sites More sharing options...
Daniel W. Posted June 13, 2006 Share Posted June 13, 2006 What do you want with tptotown and chicken in this hotip informer? --------------------------------------------------------------------------------------------------------------------------------Scripts : _Encrypt UDF_UniquePCCode UDF MS like calculatorInstall programm *UPDATED* --------------------------------------------------------------------------------------------------------------------------------[quote name='Helge' post='213117' date='Jul 26 2006, 10:22 AM']Have you ever tried surfing the internet with a milk-carton ?This is similar to what you're trying to do.[/quote] Link to comment Share on other sites More sharing options...
Tyler Durden Posted June 13, 2006 Author Share Posted June 13, 2006 Yeah, I'm thinkin' 'bout renaming project Link to comment Share on other sites More sharing options...
Daniel W. Posted June 13, 2006 Share Posted June 13, 2006 Ok if you need help i can help you and i know diablo very well --------------------------------------------------------------------------------------------------------------------------------Scripts : _Encrypt UDF_UniquePCCode UDF MS like calculatorInstall programm *UPDATED* --------------------------------------------------------------------------------------------------------------------------------[quote name='Helge' post='213117' date='Jul 26 2006, 10:22 AM']Have you ever tried surfing the internet with a milk-carton ?This is similar to what you're trying to do.[/quote] Link to comment Share on other sites More sharing options...
Tyler Durden Posted June 14, 2006 Author Share Posted June 14, 2006 Yes I need it Can you tell me an idea how to make a hostile chicken ? I'm thinking on scaning 2 pixels (with automap on and off) for Hostile icon, but the icon itself is transparent so i can't get what "control" colors I must use (also stupid hand-cursor of Diablo is messing autoit info proggy to recognize the true colors under it ). Is there any way to avoid the icon's itransparency ? May be I must change the picture of it in the mpq or something ? Link to comment Share on other sites More sharing options...
Daniel W. Posted June 14, 2006 Share Posted June 14, 2006 You can check for the message that appears when someone hostiles you --------------------------------------------------------------------------------------------------------------------------------Scripts : _Encrypt UDF_UniquePCCode UDF MS like calculatorInstall programm *UPDATED* --------------------------------------------------------------------------------------------------------------------------------[quote name='Helge' post='213117' date='Jul 26 2006, 10:22 AM']Have you ever tried surfing the internet with a milk-carton ?This is similar to what you're trying to do.[/quote] Link to comment Share on other sites More sharing options...
Tyler Durden Posted June 14, 2006 Author Share Posted June 14, 2006 Yep, but messages appearince in not fixed... If someone leaves or join party (which is always happens when that someone use tppk) the hostile message appear not at the bottom of the screen... I can't control many pixels on the screen 'couse it's too laggy P.S. Do someone knows how auto.it reads pixels from other's app. screen ? 'Couse if it use hooks, it can be detectable (the dll must be mapped for hooking)... 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