Get lucky room IP address in Diablo 3 using Sikuli

Oct/7/2012 update:

I just wrote this for fun and did not want to be in any trouble so I did not upload the script. But it seems that many guys really typed it character by character, I think I should upload it 🙂

Here is the download link. Have fun. By the way, my battle tag is SeanWang#1150, usually play on US Server, also Asia Server sometimes.

After I noticed that guys  posted that certain servers of Diablo 3 have good drops (orginal post and battlenet quote) than others, I observed this ip address stuff when repeatedly running Warrior’s Rest using a monk with all MF items

My conclusion is that it is some sort of correct! especially the part about ” last number of the ip address that is over 80 is not good”.

certain servers have good drops and some have bad drops, each time you log in you are connected to a random server this is how you can find servers with better drops than others.
1) go to your cmd promt while logged into a game (not at the log in screen or at char screen but in a game)
2) type in “netstat -n” into your cmd promt to find what server you are connected to the last 4 digits of the ip are what matter. anything with 3 digits sucks and typically games with 2 digit ending in even numbers are good loot games. The best ones are “74:1119” and “76:1119” but 72-78 even work also, games like 46 also work.

So based on this theory, I wrote a Sikuli script to get the ip address less than 80. In my script, I did not judge for even number, because I think that it may be too long to get a even number AND less than 80. Too many times creating and quiting games may trigger the Blizzard anti-bot mechanism…

Here comes the script:)

NOTICE: Above script should only work in windowed game mode.

Have fun:)

Advertisements

50 thoughts on “Get lucky room IP address in Diablo 3 using Sikuli

  1. I did it but a lot of numbers and IP addresses come up, which one should I be looking at? There are a couple that have 1119 at the end.

  2. i made the script exactly as posted using sikuli, however, the game starts and just sits there even if the ip is above 80. game will not search for the ip or leave game. no errors when running.. how can i fix that?? here is the sikuli script as i made it.

    import time
    import subprocess
    import re

    IP_PATTERN=re.compile(‘(\d+):1119’)
    def create_room():
    wait(“quRESUFHEGAF.png”,15)
    click(“quRESUFHEGAF-1.png”)
    waitVanish(“WHquRESUFHEG.png”)

    def exit_room():
    wait(“Jfrl.png”,30)
    type(‘t’)
    time.sleep(7)
    type(Key.ESC)
    click(“KGIF1LEAVEGA.png”)

    def get_room_ip():
    output,error=subprocess.Popen(“netstat -n”,stdout=subprocess.PIPE, stdin=subprocess.PIPE).communicate()
    for text in output.split():
    result= re.search(IP_PATTERN,text)
    if result and result.group(1) != ‘193’:
    ip=int(result.group(1))
    print ‘room ip is %s’%ip
    return ip
    print ‘room ip not fetched!’
    return None

    def is_good(ip):
    if (not ip) or ip >=80:
    return False
    elif ip%2 ==0:
    return True

    def main():
    create_room()
    while True:
    ip=get_room_ip()
    if ip== None:
    continue
    if is_good(ip):
    break
    else:
    exit_room()
    create_room()

    main()

      • I start diablo 3 in window mode, then Start sikuly and hit run. Diablo 3 starts the game so i know the script is working somewhat. then it stats the game but it just sits there no matter what ip gets.. I don not see the ip the game is on nor the script verifying for it or any msgs. Also, when I look at my processes that are running i do see NETSTAT running hidden…

  3. Hello. a wrote this:
    import time
    import subprocess
    import re

    IP_PATTERN=re.compile(‘(\d+):1119’)
    def create_room():
    wait(“continue.png”,15)
    click(“continue-1.png”)
    waitVanish(“continue-2.png”)

    def exit_room():
    wait(“ball.png”,30)
    type(‘t’)
    time.sleep(7)
    type(Key.ESC)
    click(“LEAVE.png”)

    def get_room_ip():
    output,error=subprocess.Popen(“netstat -n”,stdout=subprocess.PIRE, stdin=subprocess.PIRE).communicate()
    for text in output.split():
    result = re.search(IP_PATTERN,text)
    if result and result.group(1) !=’193′:
    ip=int(result.group(1))
    print ‘room ip is %s’%ip
    return ip
    print ‘room ip not fetched’
    return None

    def is_good(ip):
    if(not ip) or ip >=80:
    return False
    # elif ip%2 == 0:
    return True

    def main():
    create_room()
    while True:
    ip=get_room_ip()
    if ip == None:
    continue
    if is_good(ip):
    break
    else:
    exit_room()
    create_room()

    main()

    and get error:

    [error] Остановлено

    [error] Ошибка происходит на строке 1
    [error] Сообщение об ошибке: Traceback (most recent call last):
    File “”, line 1, in
    File “C:\Program Files (x86)\Sikuli X\sikuli-script.jar\Lib\sikuli\__init__.py”, line 3, in
    File “C:\Program Files (x86)\Sikuli X\sikuli-script.jar\Lib\sikuli\Sikuli.py”, line 22, in
    java.lang.UnsatisfiedLinkError: C:\Program Files (x86)\Sikuli X\libs\VisionProxy.dll: Can’t load IA 32-bit .dll on a AMD 64-bit platform
    at java.lang.ClassLoader$NativeLibrary.load(Native Method)
    at java.lang.ClassLoader.loadLibrary1(Unknown Source)
    at java.lang.ClassLoader.loadLibrary0(Unknown Source)
    at java.lang.ClassLoader.loadLibrary(Unknown Source)
    at java.lang.Runtime.load0(Unknown Source)
    at java.lang.System.load(Unknown Source)
    at com.wapmx.nativeutils.jniloader.NativeLoader.loadLibrary(NativeLoader.java:44)
    at org.sikuli.script.Finder.(Finder.java:33)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forNa

    me(Unknown Source)
    at org.python.core.Py.loadAndInitClass(Py.java:895)
    at org.python.core.Py.findClassInternal(Py.java:830)
    at org.python.core.Py.findClassEx(Py.java:881)
    at org.python.core.packagecache.SysPackageManager.findClass(SysPackageManager.java:133)
    at org.python.core.packagecache.PackageManager.findClass(PackageManager.java:28)
    at org.python.core.packagecache.SysPackageManager.findClass(SysPackageManager.java:122)
    at org.python.core.PyJavaPackage.__findattr_ex__(PyJavaPackage.java:137)
    at org.python.core.PyObject.__findattr__(PyObject.java:863)
    at org.python.core.imp.import_name(imp.java:849)
    at org.python.core.imp.importName(imp.java:884)
    at org.python.core.ImportFunction.__call__(__builtin__.java:1220)
    at org.python.core.PyObject.__call__(PyObject.java:357)
    at org.python.core.__builtin__.__import__(__builtin__.java:1173)
    at org.python.core.imp.importFromAs(imp.java:978)
    at org.python.core.imp.importFrom(imp.java:954)
    at sikuli.Sikuli$py.f$0(C:\Progra

    m Files (x86)\Sikuli X\sikuli-script.jar\Lib\sikuli\Sikuli.py:211)
    at sikuli.Sikuli$py.call_function(C:\Program Files (x86)\Sikuli X\sikuli-script.jar\Lib\sikuli\Sikuli.py)
    at org.python.core.PyTableCode.call(PyTableCode.java:165)
    at org.python.core.PyCode.call(PyCode.java:18)
    at org.python.core.imp.createFromCode(imp.java:386)
    at org.python.core.util.importer.importer_load_module(importer.java:109)
    at org.python.modules.zipimport.zipimporter.zipimporter_load_module(zipimporter.java:161)
    at org.python.modules.zipimport.zipimporter$zipimporter_load_module_exposer.__call__(Unknown Source)
    at org.python.core.PyBuiltinMethodNarrow.__call__(PyBuiltinMethodNarrow.java:47)
    at org.python.core.imp.loadFromLoader(imp.java:513)
    at org.python.core.imp.find_module(imp.java:467)
    at org.python.core.PyModule.impAttr(PyModule.java:100)
    at org.python.core.imp.import_next(imp.java:715)
    at org.python.core.imp.import_name(imp.java:824)
    at org.python.core.imp.importName(imp.java:884)
    at

    org.python.core.ImportFunction.__call__(__builtin__.java:1220)
    at org.python.core.PyObject.__call__(PyObject.java:357)
    at org.python.core.__builtin__.__import__(__builtin__.java:1173)
    at org.python.core.imp.importAll(imp.java:998)
    at sikuli$py.f$0(C:\Program Files (x86)\Sikuli X\sikuli-script.jar\Lib\sikuli\__init__.py:3)
    at sikuli$py.call_function(C:\Program Files (x86)\Sikuli X\sikuli-script.jar\Lib\sikuli\__init__.py)
    at org.python.core.PyTableCode.call(PyTableCode.java:165)
    at org.python.core.PyCode.call(PyCode.java:18)
    at org.python.core.imp.createFromCode(imp.java:386)
    at org.python.core.util.importer.importer_load_module(importer.java:109)
    at org.python.modules.zipimport.zipimporter.zipimporter_load_module(zipimporter.java:161)
    at org.python.modules.zipimport.zipimporter$zipimporter_load_module_exposer.__call__(Unknown Source)
    at org.python.core.PyBuiltinMethodNarrow.__call__(PyBuiltinMethodNarrow.java:47)
    at org.python.core.imp.loadFromLoader(imp.java:513)
    at

    org.python.core.imp.find_module(imp.java:467)
    at org.python.core.imp.import_next(imp.java:713)
    at org.python.core.imp.import_name(imp.java:824)
    at org.python.core.imp.importName(imp.java:884)
    at org.python.core.ImportFunction.__call__(__builtin__.java:1220)
    at org.python.core.PyObject.__call__(PyObject.java:357)
    at org.python.core.__builtin__.__import__(__builtin__.java:1173)
    at org.python.core.imp.importAll(imp.java:998)
    at org.python.pycode._pyx2.f$0(:1)
    at org.python.pycode._pyx2.call_function()
    at org.python.core.PyTableCode.call(PyTableCode.java:165)
    at org.python.core.PyCode.call(PyCode.java:18)
    at org.python.core.Py.runCode(Py.java:1261)
    at org.python.core.Py.exec(Py.java:1305)
    at org.python.util.PythonInterpreter.exec(PythonInterpreter.java:206)
    at org.sikuli.script.ScriptRunner.runPython(ScriptRunner.java:61)
    at org.sikuli.ide.SikuliIDE$ButtonRun.runPython(SikuliIDE.java:1572)
    at org.sikuli.ide.SikuliIDE$ButtonRun$1.run(SikuliIDE.jav

    a:1677)

    java.lang.UnsatisfiedLinkError: java.lang.UnsatisfiedLinkError: C:\Program Files (x86)\Sikuli X\libs\VisionProxy.dll: Can’t load IA 32-bit .dll on a AMD 64-bit platform

  4. not working..

    [error] Stopped
    [error] An error occurs at line 5
    [error] Error message: SyntaxError: (“no viable alternative at character ‘\u2018′”

    ive never used this sikuli before so i have no clue whats messing it up. u2018 is the character : and the error is with this for some reason. i understand netstat -n and i know it needs to find the second string containing :1119. in my case i would like it to run script until result xx.xxx.xxx.72:1119, xx.xxx.xxx.74:1119, xx.xxx.xxx.76:1119 or xx.xxx.xxx.78:1119 and then exit. the script is running into an error with this line: IP_PATTERN=re.compile(‘(\d+):1119′) and to me this just appears to be identifying the number that comes before :1119. further down in the script it has reference to the 193:1119 returned result which is primarily the auction house server. assuming this is just telling the check to ignore this ip or server? would like to point out that your game can also be created on server 193 and this might mess the script up at some point. i was going to write a similar script in autoit but when i seen how extremely easy this looks i thought i would try this first since im not the greatest with au3 either lol. i have been using a simple batch file i wrote that pings the server for me every x seconds and returns only the server which im on. i leave the window pinned on top and resume/leave in window mode til i find the server manually. would be so much easier to use this style of scripting though. could even set it to a hotkey, add the function to change from full screen to windowed, perform the tedious task of finding the server then when its done set the game back to full screen before the script exits.

    anyways, any help is much appreciated i spent about as long typing this reply as i did working with sikuli so following this message i will begin to research and try and learn more about this. great share and thank you 🙂

    -Matt

    • Hi Matt,
      Thanks for your detailed description. I think that error may be caused by the netstat command output due to your locale. It seems that the RegEx module ‘re’ met some problem to deal with your locale. You could try to look into it.
      Actually Sikuli script is written in Python. I would help if you have further questions:)

      About your advice about the ip, actually I have dealt with the 193 address. You could see that in method ‘get_room_ip()’. And another thing, I did not just filter out the ip you said, but all that less than 80, because it is way tooooo hard to get those 4 room ips… You could change it in method ‘is_good(ip)’

      I will upload the sikuli script to save all you guys’ time. Actually I did not mean to get into trouble and I did not upload the script.

      • yes…its upto to the locale…therefore u have to define everything whats different directly after “import re”. Maybe someone would be so kind to share a script apart from en_us.

      • No one posted the output of the netstat -n in en_US locale. so I could not help. Matt used a far more complicated workaround, I asked him to post the output, but no response.

  5. script you uploaded is the same as the one im using with the exception of screens. i was originally going to make something similar in autoit but when i seen this i knew i had to give it a go.

    still getting the same error as before. locale is en_US. still having a problem with the (colon) : in :1119. ive never perfected any computer language 100% just a bunch jammed together in my head over the last decade. ive learned they are all very similar and that this can be good sometimes but bad in others.

    i already have a batch file running netstat -n and is set to findstr .xx:1119. this is constantly updating and i keep onscreen when im hunting for servers. i was looking at the observe and onChange for region command and was curious if this could serve as a work around for my issue. what im not certain of is if i set the region to the blank section of my cmd window (black box basically) that fills only when one of my desired servers is found, if the text showing in the black section will trigger an onChange due to either a color difference or texture. im sure with time i can test it and figure it out but it is as you said, a long time to get those desired servers lol. if the region method wont work i could have it check the d3ip.txt my .bat is creating for the server but am a bit lost on how that function should look or handle the result. i would imagine the ip_get and good_ip would still work the close to the same just have to point it in a different direction. c:\d3ip.txt for example 🙂

    any help you can offer is much appreciated with the observation and handler if it works how im hoping anyways. pretty much no change to region will continue loop and onchange will trigger the operation “def full_screen():” which will launch my “buff macro” and end with break. pretty much just cutting off the last 4 or 5 clicks of making the game full screen again. or even with the new method of searching the text file instead.

    also, sent you an add in-game. i can tank with barb but choose to ww since its faster. my monk can tank though but i rarely play him. after patch 1.05 i might turn my barb back into a tank or start playing my dh more again, she surprisingly tanks ok mp5-7 solo. even if i cant tank for you the occasional chat might be worth it.

    thanks,
    -Matt

  6. scratch all that. i got it working how i want it now. i wrote it a bit different but does exactly what i was aiming for.

    -Matt

    • Glad to hear that.
      I was too busy to look into your problem. Actually ‘u2018’ is the single quote character. I still think that it’s the character parsing problem. you could post your netstat -n result in plain text in pastebin or other sites. I could help you figure it out.

      Also it would be good to know your solution to handle or bypass the issue:)

  7. having some issues getting this going… I pretty much copy and pasted your script and inserted the proper .png files that I created from your draft, and I keep getting error on line 1… here is what I have….

    import time
    import subprocess
    import re

    IP_PATTERN=re.compile(‘(\d+):1119’)
    def create_room():
    wait(“d3.png”,15)
    click(“d3-1.png”)
    waitVanish(“d3-2.png”)

    def exit_room():
    wait(“d1-1.png”,30)
    type(‘t’)
    time.sleep(7)
    type(Key.ESC)
    click(“d2-3.png”)

    def get_room_ip():
    output,error=subprocess.Popen(“netstat -n”,stdout=subprocess.PIPE, stdin=subprocess.PIPE).communicate()
    for text in output.split():
    result= re.search(IP_PATTERN,text)
    if result and result.group(1) != ‘193’:
    ip=int(result.group(1))
    print ‘room ip is %s’%ip
    return ip
    print ‘room ip not fetched!’
    return None

    def is_good(ip):
    if (not ip) or ip <=80:
    return False
    # elif ip%2 ==0:
    return True

    def main():
    create_room()
    while True:
    ip=get_room_ip()
    if ip== None:
    continue
    if is_good(ip):
    break
    else:
    exit_room()
    create_room()

    main()

    and the error message

    [error] Stopped
    [error] An error occurs at line 1
    [error] Error message: Traceback (most recent call last):
    File "", line 1, in
    File "C:\Program Files\Sikuli X\sikuli-script.jar\Lib\sikuli\__init__.py", line 3, in
    File "C:\Program Files\Sikuli X\sikuli-script.jar\Lib\sikuli\Sikuli.py", line 26, in
    java.lang.NoClassDefFoundError: Could not initialize class org.sikuli.script.App
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Unknown Source)
    at org.python.core.Py.loadAndInitClass(Py.java:895)
    at org.python.core.Py.findClassInternal(Py.java:830)
    at org.python.core.Py.findClassEx(Py.java:881)
    at org.python.core.packagecache.SysPackageManager.findClass(SysPackageManager.java:133)
    at org.python.core.packagecache.PackageManager.findClass(PackageManager.java:28)
    at org.python.core.packagecache.SysPackageManager.findClass(SysPackageManager.java:122)
    at org.python.core.PyJavaPackage.__findattr_ex__(PyJavaPackage.java:137)

    at org.python.core.PyObject.__findattr__(PyObject.java:863)
    at org.python.core.imp.import_name(imp.java:849)
    at org.python.core.imp.importName(imp.java:884)
    at org.python.core.ImportFunction.__call__(__builtin__.java:1220)
    at org.python.core.PyObject.__call__(PyObject.java:357)
    at org.python.core.__builtin__.__import__(__builtin__.java:1173)
    at org.python.core.imp.importFromAs(imp.java:978)
    at org.python.core.imp.importFrom(imp.java:954)
    at sikuli.Sikuli$py.f$0(C:\Program Files\Sikuli X\sikuli-script.jar\Lib\sikuli\Sikuli.py:211)
    at sikuli.Sikuli$py.call_function(C:\Program Files\Sikuli X\sikuli-script.jar\Lib\sikuli\Sikuli.py)
    at org.python.core.PyTableCode.call(PyTableCode.java:165)
    at org.python.core.PyCode.call(PyCode.java:18)
    at org.python.core.imp.createFromCode(imp.java:386)
    at org.python.core.util.importer.importer_load_module(importer.java:109)
    at org.python.modules.zipimport.zipimporter.zipimporter_load_module(zipimporter.java:161)
    at org.python.modules.

    zipimport.zipimporter$zipimporter_load_module_exposer.__call__(Unknown Source)
    at org.python.core.PyBuiltinMethodNarrow.__call__(PyBuiltinMethodNarrow.java:47)
    at org.python.core.imp.loadFromLoader(imp.java:513)
    at org.python.core.imp.find_module(imp.java:467)
    at org.python.core.PyModule.impAttr(PyModule.java:100)
    at org.python.core.imp.import_next(imp.java:715)
    at org.python.core.imp.import_name(imp.java:824)
    at org.python.core.imp.importName(imp.java:884)
    at org.python.core.ImportFunction.__call__(__builtin__.java:1220)
    at org.python.core.PyObject.__call__(PyObject.java:357)
    at org.python.core.__builtin__.__import__(__builtin__.java:1173)
    at org.python.core.imp.importAll(imp.java:998)
    at sikuli$py.f$0(C:\Program Files\Sikuli X\sikuli-script.jar\Lib\sikuli\__init__.py:3)
    at sikuli$py.call_function(C:\Program Files\Sikuli X\sikuli-script.jar\Lib\sikuli\__init__.py)
    at org.python.core.PyTableCode.call(PyTableCode.java:165)
    at org.python.core.PyCode.call(PyCode.java:

    18)
    at org.python.core.imp.createFromCode(imp.java:386)
    at org.python.core.util.importer.importer_load_module(importer.java:109)
    at org.python.modules.zipimport.zipimporter.zipimporter_load_module(zipimporter.java:161)
    at org.python.modules.zipimport.zipimporter$zipimporter_load_module_exposer.__call__(Unknown Source)
    at org.python.core.PyBuiltinMethodNarrow.__call__(PyBuiltinMethodNarrow.java:47)
    at org.python.core.imp.loadFromLoader(imp.java:513)
    at org.python.core.imp.find_module(imp.java:467)
    at org.python.core.imp.import_next(imp.java:713)
    at org.python.core.imp.import_name(imp.java:824)
    at org.python.core.imp.importName(imp.java:884)
    at org.python.core.ImportFunction.__call__(__builtin__.java:1220)
    at org.python.core.PyObject.__call__(PyObject.java:357)
    at org.python.core.__builtin__.__import__(__builtin__.java:1173)
    at org.python.core.imp.importAll(imp.java:998)
    at org.python.pycode._pyx11.f$0(:1)
    at org.python.pycode._pyx11.call_function(

    )
    at org.python.core.PyTableCode.call(PyTableCode.java:165)
    at org.python.core.PyCode.call(PyCode.java:18)
    at org.python.core.Py.runCode(Py.java:1261)
    at org.python.core.Py.exec(Py.java:1305)
    at org.python.util.PythonInterpreter.exec(PythonInterpreter.java:206)
    at org.sikuli.script.ScriptRunner.runPython(ScriptRunner.java:61)
    at org.sikuli.ide.SikuliIDE$ButtonRun.runPython(SikuliIDE.java:1572)
    at org.sikuli.ide.SikuliIDE$ButtonRun$1.run(SikuliIDE.java:1677)

    java.lang.NoClassDefFoundError: java.lang.NoClassDefFoundError: Could not initialize class org.sikuli.script.App

    not too sure what is up but could use some help and input…. it doesn't do anything in game just spits out that error message, so I'm not sure if I'm not doing something right or what….

  8. hey, segan,

    any idea what could cause this error, he seems to throw out an error already at line 1

    [error] Abgebrochen
    [error] Ein Fehler in Zeile 1
    [error] Fehlermeldung: Traceback (most recent call last):
    File “”, line 1, in
    File “C:\Program Files\Sikuli X\sikuli-script.jar\Lib\sikuli\__init__.py”, line 3, in
    File “C:\Program Files\Sikuli X\sikuli-script.jar\Lib\sikuli\Sikuli.py”, line 22, in
    java.lang.NoClassDefFoundError: Could not initialize class org.sikuli.script.Finder
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Unknown Source)
    at org.python.core.Py.loadAndInitClass(Py.java:895)
    at org.python.core.Py.findClassInternal(Py.java:830)
    at org.python.core.Py.findClassEx(Py.java:881)
    at org.python.core.packagecache.SysPackageManager.findClass(SysPackageManager.java:133)
    at org.python.core.packagecache.PackageManager.findClass(PackageManager.java:28)
    at org.python.core.packagecache.SysPackageManager.findClass(SysPackageManager.java:122)
    at org.python.core.PyJavaPackage.__findattr_ex__(PyJavaPackage.java:137)

    at org.python.core.PyObject.__findattr__(PyObject.java:863)
    at org.python.core.imp.import_name(imp.java:849)
    at org.python.core.imp.importName(imp.java:884)
    at org.python.core.ImportFunction.__call__(__builtin__.java:1220)
    at org.python.core.PyObject.__call__(PyObject.java:357)
    at org.python.core.__builtin__.__import__(__builtin__.java:1173)
    at org.python.core.imp.importFromAs(imp.java:978)
    at org.python.core.imp.importFrom(imp.java:954)
    at sikuli.Sikuli$py.f$0(C:\Program Files\Sikuli X\sikuli-script.jar\Lib\sikuli\Sikuli.py:211)
    at sikuli.Sikuli$py.call_function(C:\Program Files\Sikuli X\sikuli-script.jar\Lib\sikuli\Sikuli.py)
    at org.python.core.PyTableCode.call(PyTableCode.java:165)
    at org.python.core.PyCode.call(PyCode.java:18)
    at org.python.core.imp.createFromCode(imp.java:386)
    at org.python.core.util.importer.importer_load_module(importer.java:109)
    at org.python.modules.zipimport.zipimporter.zipimporter_load_module(zipimporter.java:161)
    at org.python.modul

    es.zipimport.zipimporter$zipimporter_load_module_exposer.__call__(Unknown Source)
    at org.python.core.PyBuiltinMethodNarrow.__call__(PyBuiltinMethodNarrow.java:47)
    at org.python.core.imp.loadFromLoader(imp.java:513)
    at org.python.core.imp.find_module(imp.java:467)
    at org.python.core.PyModule.impAttr(PyModule.java:100)
    at org.python.core.imp.import_next(imp.java:715)
    at org.python.core.imp.import_name(imp.java:824)
    at org.python.core.imp.importName(imp.java:884)
    at org.python.core.ImportFunction.__call__(__builtin__.java:1220)
    at org.python.core.PyObject.__call__(PyObject.java:357)
    at org.python.core.__builtin__.__import__(__builtin__.java:1173)
    at org.python.core.imp.importAll(imp.java:998)
    at sikuli$py.f$0(C:\Program Files\Sikuli X\sikuli-script.jar\Lib\sikuli\__init__.py:3)
    at sikuli$py.call_function(C:\Program Files\Sikuli X\sikuli-script.jar\Lib\sikuli\__init__.py)
    at org.python.core.PyTableCode.call(PyTableCode.java:165)
    at org.python.core.PyCode.call(PyCode.ja

    va:18)
    at org.python.core.imp.createFromCode(imp.java:386)
    at org.python.core.util.importer.importer_load_module(importer.java:109)
    at org.python.modules.zipimport.zipimporter.zipimporter_load_module(zipimporter.java:161)
    at org.python.modules.zipimport.zipimporter$zipimporter_load_module_exposer.__call__(Unknown Source)
    at org.python.core.PyBuiltinMethodNarrow.__call__(PyBuiltinMethodNarrow.java:47)
    at org.python.core.imp.loadFromLoader(imp.java:513)
    at org.python.core.imp.find_module(imp.java:467)
    at org.python.core.imp.import_next(imp.java:713)
    at org.python.core.imp.import_name(imp.java:824)
    at org.python.core.imp.importName(imp.java:884)
    at org.python.core.ImportFunction.__call__(__builtin__.java:1220)
    at org.python.core.PyObject.__call__(PyObject.java:357)
    at org.python.core.__builtin__.__import__(__builtin__.java:1173)
    at org.python.core.imp.importAll(imp.java:998)
    at org.python.pycode._pyx5.f$0(:1)
    at org.python.pycode._pyx5.call_function(

    >)
    at org.python.core.PyTableCode.call(PyTableCode.java:165)
    at org.python.core.PyCode.call(PyCode.java:18)
    at org.python.core.Py.runCode(Py.java:1261)
    at org.python.core.Py.exec(Py.java:1305)
    at org.python.util.PythonInterpreter.exec(PythonInterpreter.java:206)
    at org.sikuli.script.ScriptRunner.runPython(ScriptRunner.java:61)
    at org.sikuli.ide.SikuliIDE$ButtonRun.runPython(SikuliIDE.java:1572)
    at org.sikuli.ide.SikuliIDE$ButtonRun$1.run(SikuliIDE.java:1677)

    java.lang.NoClassDefFoundError: java.lang.NoClassDefFoundError: Could not initialize class org.sikuli.script.Finder

  9. sorry bout the delayed reply, i too have been swamped over here.

    my solution, though the sikuli code was short and sweet, involved a batch file i created based off a design wrote by |34N4N4@BH. i launch a batch file which is:

    @echo off
    title Diablo Server Checker
    color 0a
    mode 68,7
    :Start
    echo.
    echo ******************************************************
    echo ** Server Will Display Upon Match Of Desired Server **
    echo ******************************************************
    echo.
    @netstat -n > c:\d3ip.txt
    @Findstr “:1119” c:\d3ip.txt
    ::Update Timer (x = seconds)
    ::PING -n x 127.0.0.1>nul
    PING -n 3 127.0.0.1>nul
    @CLS

    ive filtered my strings for a more refined search and you can add as many str as you like for example:

    @Findstr “245.72:1119” c:\d3ip.txt
    @Findstr “245.78:1119” c:\d3ip.txt
    @Findstr “246.72:1119” c:\d3ip.txt
    @Findstr “246.78:1119” c:\d3ip.txt
    @Findstr “247.72:1119” c:\d3ip.txt
    @Findstr “247.78:1119” c:\d3ip.txt

    this way just eliminates returning servers 172 and 178 which will happen if input like this .72:1119

    i named the batch DiabloIP.bat so you will know this reference within my script and your welcome to modify anything to your liking. color is backround/foreground and mode is width/height a quick google search should assist further if you need color flags

    i have sikuli check my cmd window where i have declared a region.. if a server is displayed it triggers the exit(), if not exist() it runs the loop again. my script is started while already in a game in window mode with enough space to keep cmd window visible. i keep my cmd window fixed to the top of my screen above the diablo window. this is the script im using:

    reg = region .png #click the create region button set to the cmd window bottom blank section
    d3 = App(“Diablo III”)

    while(1):
    App.open(“location-of-DiabloIP.bat”)
    wait(1)
    d3.focus()
    while reg.exists(1119_Established.png):#screenshot of :1119 ESTABLISHED from cmd
    closeApp(“location-of-DiabloIP.bat”)
    exit()
    else:
    type(Key.ESC)
    click(leavegame.png)
    wait(7)#prevents hang – wait(.png) seemed to result in error most of the time
    click(resumegame.png)
    wait(7)#same as above – if it still hangs just increase wait time

    short and sweet like i said but requires the batch file to function. i export the script to executable and run when i need it. hope this helps anyone who had troubles getting seganw method to work. the problem i had with his script was the ip checking part of the code so i more or less just bypassed that and used a method im more familiar with.

    -Matt

    • just tested that to ensure i wrote it right since its not an exact copy of mine.. move the App.open to above the while(1) line.. i have it on line 3 in my script and while(1) is line 5.. sorry if this caused any confusion for anyone.. basically the problem with how its wrote above is it will open the batch file over and over in series with the loop.. we only want to call the App.open once so it should be outside of the loop

      -Matt

    • Oh… I think you just gave up the simplicity of Python and used a Windows batch script to get the ip. Anyway, any method you are comfortable with is the best one for you:)

      • it wasnt so simple for me though lol.. i dont know python.. i know bits of java so that allows me to understand the basics.. pinging the server in the backround and then finding the string through python wasnt such a simple task for me since your script kept giving me errors before it would even execute 1 command 😦

      • this is the output of netstat -n which i have saving in the text file:

        Active Connections

        Proto Local Address Foreign Address State
        TCP 127.0.0.1:19301 127.0.0.1:19302 ESTABLISHED
        TCP 127.0.0.1:19302 127.0.0.1:19301 ESTABLISHED
        TCP 192.168.2.3:19303 12.130.244.193:1119 ESTABLISHED
        TCP 192.168.2.3:19379 12.130.245.78:1119 ESTABLISHED

        i agree, my workaround is ugly but it works 😦

  10. ran into one more goof.. on line 9 – you need the window name not the location so change it to this:

    closeApp(“Diablo Server Checker”)

    this should now properly close the window and end the PING process.. you can title the batch to anything but i used “Diablo Server Checker” in the example

    -Matt

  11. hello can some1 help plz whats wrong…

    [info] Sikuli vision engine loaded.
    [info] Windows utilities loaded.

    [info] VDictProxy loaded.

    [error] Stopped
    [error] An error occurs at line 55
    [error] Error message: Traceback (most recent call last):
    File “C:\Users\*****\AppData\Local\Temp\sikuli-tmp1333220088912084859.py”, line 55, in
    main()
    File “C:\Users\*****\AppData\Local\Temp\sikuli-tmp1333220088912084859.py”, line 44, in main
    create_room()
    File “C:\Users\\******\AppData\Local\Temp\sikuli-tmp1333220088912084859.py”, line 12, in create_room
    wait(“5KRESUUIEGAU.png”,15)
    File “C:\Program Files (x86)\Sikuli X\sikuli-script.jar\Lib\sikuli\Region.py”, line 101, in wait
    Line 14, in file C:\Users\******l\AppData\Local\Temp\sikuli-tmp1333220088912084859.py

    at org.sikuli.script.Region.handleFindFailed(Region.java:420)
    at org.sikuli.script.Region.wait(Region.java:511)
    at org.python.proxies.sikuli.Region$Region$0.super__wait(Unknown Source)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMe

    thodAccessorImpl.invoke(Unknown Source)

    org.sikuli.script.FindFailed: FindFailed: can not find 5KRESUUIEGAU.png on the screen.
    Line 14, in file C:\Users\*****\AppData\Local\Temp\sikuli-tmp1333220088912084859.py

    • you could set a list and judge if the number in the list. for example:
      ip_list=[’21’,’22’,’23’]
      if ip in ip_list:
      #do something

      If you want more, I suggest you learning Python.

  12. @Daniel

    right click desktop and create new>text document

    copy/paste this inside the document:

    @echo off
    title Diablo Server Checker
    color 0a
    mode 68,7
    :Start
    echo.
    echo ******************************************************
    echo ** Server Will Display Upon Match Of Desired Server **
    echo ******************************************************
    echo.
    @netstat -n > c:\d3ip.txt
    @Findstr “:1119? c:\d3ip.txt
    ::Update Timer (x = seconds)
    ::PING -n x 127.0.0.1>nul
    PING -n 3 127.0.0.1>nul
    @CLS

    save the document and close.. highlight the document and strike F2 key.. name the document DiabloIP.bat and hit enter.. this will popup with a warning about changing the extension of a file.. click ok.. you now have the batch file

    next open sikuli and copy/paste the following:

    reg = region .png #click the create region button set to the cmd window bottom blank section
    d3 = App(“Diablo III”)
    App.open(“location-of-DiabloIP.bat”)#put the location of the batch file

    while(1):
    wait(1)
    d3.focus()
    while reg.exists(1119_Established.png):#screenshot of :1119 ESTABLISHED from cmd
    closeApp(“Diablo Server Checker”)
    exit()
    else:
    type(Key.ESC)
    click(leavegame.png)
    wait(7)#prevents hang – wait(.png) seemed to result in error most of the time
    click(resumegame.png)
    wait(7)#same as above – if it still hangs just increase wait time

    the indentation is extremely important with python or it simply will just not work.. you have to manually take your screen shots between the () just simply delete the words leavegame.png and click on “Take a Screenshot” button top left of sikuli program.. then take a screenshot of that location while in game.. remember you must be in windowed mode for this to work.. do the same for resumegame.png and click the 3rd button to take a screenshot of region in the very first line.. should be reg = “your screenshot here without the quotes”.. when you have it all done it should look like this:

    server checker – http://i49.tinypic.com/2004nx4.jpg
    sikuli script – http://i50.tinypic.com/dq2btg.jpg

    click file in sikuli and save.. type a name for which to save it under, it will create a new folder at the desired location.. also from file, you can select export to executable.. this creates a sikuli version of a batch file with the extension .skl and will work without having to open sikuli each time you want to scan for servers

    my screenshots will look a little different than what yours will because i added extra commands to mine that wont be needed in yours.. the INSERT line for example is not needed in your script and the reg.highlight is optional.. this just ensures that the cmd window is positioned correctly and sikuli is able to see the correct region.. hope this helps you

    -Matt

  13. segan, just out of curiousity, do you encounter now after some testing any relevance of the ip rooms influencing your luck? I mean even if you get (lets say the 74) etc at the end there are still various of them like xxx.xxx.209.74, xxx.xxx.210.74, xxx.xxx.211.74?

  14. Hey seganw i get an error on line 50 for main() any idea what could cause that?

    [info] Sikuli vision engine loaded.
    [info] Windows utilities loaded.

    [info] VDictProxy loaded.

    [error] Stopped
    [error] An error occurs at line 50
    [error] Error message: Traceback (most recent call last):
    File “C:\Users\PATRIK~1\AppData\Local\Temp\sikuli-tmp78548079534523072.py”, line 50, in
    main()
    File “C:\Users\PATRIK~1\AppData\Local\Temp\sikuli-tmp78548079534523072.py”, line 39, in main
    create_room()
    File “C:\Users\PATRIK~1\AppData\Local\Temp\sikuli-tmp78548079534523072.py”, line 7, in create_room
    wait(“5KRESUUIEGAU.png”,15)
    File “C:\Program Files (x86)\Sikuli X\sikuli-script.jar\Lib\sikuli\Region.py”, line 101, in wait
    Line 9, in file C:\Users\PATRIK~1\AppData\Local\Temp\sikuli-tmp78548079534523072.py

    at org.sikuli.script.Region.handleFindFailed(Region.java:420)
    at org.sikuli.script.Region.wait(Region.java:511)
    at org.python.proxies.sikuli.Region$Region$0.super__wait(Unknown Source)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAc

    cessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)

    org.sikuli.script.FindFailed: FindFailed: can not find 5KRESUUIEGAU.png on the screen.
    Line 9, in file C:\Users\PATRIK~1\AppData\Local\Temp\sikuli-tmp78548079534523072.py

  15. also, if I wanted to only get an ip of 72, 76 or 76….what would i put on line 32?

    if (not ip) or ip != (72, 76, 78):

    have no idea if that works using sikuli

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s