Run multiple SytheLibs without using your Mouse!

Discussion in 'Sythe Lib Archive' started by Sythe, Oct 27, 2018.

Run multiple SytheLibs without using your Mouse!
  1. Unread #1 - Oct 27, 2018 at 10:02 PM
  2. Sythe
    Joined:
    Apr 21, 2005
    Posts:
    8,063
    Referrals:
    446
    Sythe Gold:
    5,171
    Discord Unique ID:
    742989175824842802
    Discord Username:
    Sythe
    Dolan Duck Dolan Trump Supporting Business ???
    Poképedia
    Clefairy Jigglypuff
    Who did this to my freakin' car!
    Hell yeah boooi
    Tier 3 Prizebox Toast Wallet User
    I'm LAAAAAAAME Rust Player Mewtwo Mew Live Free or Die Poké Prizebox (42) Dat Boi

    Sythe Join our discord

    test

    Administrator Village Drunk

    Run multiple SytheLibs without using your Mouse!

    As of Alpha10 you can run multiple clients on your computer without tying up your mouse and keyboard.

    Here's how to do it:

    Windows 10 has a feature called virtual desktop. You can access your virtual desktops by holding windows key + tab and clicking + Desktop at the top then switching between them.

    To run multiple SytheLib instances neatly it's best to use these multiple desktops, although you don't need to. While holding windows key + tab you can drag and drop windows from your current desktop onto another desktop at the top.

    To allow SytheLib to Scrape() your game window while it is off screen (on a virtual desktop for example) you will need to enable GDI mode in your script. You can enable this by first setting your game window then calling SetGDICaptureOn().

    Here's some example code

    Code:
    if (SetWindow("Old School") == ""){Die("Could not find runescape");}while(SelectInnerWindow("SunAwtCanvas")){}
    StartTCPImageListen("127.0.0.1", 2000, "p");
    SetGDICaptureOn(); // turns GDI mode on
    SetVirtualMouseJavaModeOn();
    while(true) {
        Scrape();
        Sleep(1);
    }
    
    To demonstrate this example open your game client. Move it to the second virtual desktop as per winkey+tab instructions above. Now open a sythelib instance on that virtual dekstop and run the above script. Provided you do not minimise the game client on the second desktop you should now be able to switch back to your first(primary) desktop and open a browser to http://127.0.0.1:2000/p each time you refresh this page it will pull a copy of the current backbuffer from the script. You should see the game client running, rendering correctly off screen. (Incidentally you can use these sockets to keep an eye on multiple game clients running in virtual desktops).

    The final piece of this puzzle is virtual inputs. To ensure virtual inputs work correctly with java games such as OSRS you will need to use AntiGCP.exe which ships with the latest SytheLib (Alpha10 at time of writing).

    This executable scans for JagexLauncher.exe processes and patches them to fix a specific bug( or feature?) in the java's win32 code which prevents virtual inputs working correctly. Specifically it kills the client's ability to call the win32 GetCursorPos API -- which it doesn't need to call. Once this patch has been made the client can receive all virtual inputs from SytheLib without issue. You will need to run this executable each time you fire up a new client so that it too becomes patched. This patch is undetectable from within java and consists of 5 bytes being written to the process' copy of user32.dll forcing a `return false` from GetCursorPos function call. Note: this does not work on x64 game clients. Ensure you run a x32 game client. If your game client is called something other than JagexLauncher.exe or you are targetting a different game, that is fine but you will need to called AntiGCP from the commandline and pass it an executable name to search for as the first parameter.

    Once you have done the above you should be good to go for as many Sythelib clients and game clients as your computer will run without your mouse and keyboard being tied up.
     
    ^ weby, Blupig, Fast Coins and 8 others like this.
  3. Unread #2 - Feb 28, 2019 at 1:30 PM
  4. Blupig
    Joined:
    Nov 23, 2006
    Posts:
    7,145
    Referrals:
    16
    Sythe Gold:
    1,609
    Discord Unique ID:
    178533992981594112
    Valentine's Singing Competition Winner Member of the Month Winner MushyMuncher Gohan has AIDS Extreme Homosex World War 3 I'm LAAAAAAAME
    Off Topic Participant

    Blupig BEEF TOILET
    $5 USD Donor

    Run multiple SytheLibs without using your Mouse!

    I should figure out how to make this user friendly in Slade like with a "monitor centre" or something where you can view all your instances and maybe run that executable for you.

    Hmmmmmmmmmmmmmmmmmmmmmmmmmmmm big slade update on the horizon I think
     
    ^ Dev Zach, Sythe, Program and 2 others like this.
    Last edited: Feb 28, 2019
< Function reference | >

Users viewing this thread
1 guest


 
 
Adblock breaks this site