Jump to content

Diablo Hot Ip Informer


Tyler Durden
 Share

Recommended Posts

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 :think:

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):

;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 by Tyler Durden
Link to comment
Share on other sites

Updated, but informer's window don't close immediatly if app window minimized :think:

;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

then ask in v3-support :think:

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

  • 1 month later...

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

Ok if you need help i can help you and i know diablo very well :D

--------------------------------------------------------------------------------------------------------------------------------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

Yes :D I need it :D 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 :P). 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

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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...