Email services will be down for 24 hours. Thanks for your understanding.

Results 1 to 8 of 8
  1. #1
    defaulto's Avatar
    Join Date
    Aug 2017
    Gender
    male
    Posts
    27
    Reputation
    25
    Thanks
    9
    My Mood
    Asleep

    Question C# (Bot programming) - How would you solve this?

    Intralism-Bot.EXE
    Someone else who helped me a lot with ideas & I worked on some sort of Bot the past 2 days. It was pretty head breaking. :D

    Since we are the very first ones working on a bot for it made in C# there is no base technique we could use.
    There was once a Russian who made one. I contacted him and found out that it was made with pixel color detections.
     


    I thought about using the same techniques as for Osu a very long time till we started.
    In Short:
    1) Getting the current song through memory reading.
    2) Opening the right file based on the current song. (Where all the pieces of information from the map are written down)
    3) Converting it trough Readline functions into a for us useful list.
    4) Checking by a time offset when to click.
    5) Hooking the keyboard.

    What we had to fight with:
    It isn't possible to get the current map/song trough memory reading since the game "Intralism" doesn't have a method like that.
    The Game got made in Unity so I was able to find that out after I tried finding it with Cheat Engine. Sadly they have used a strong Obfuscation a few weeks afterward. And there is now way to compile it now. Else I would make my own one. Sure. You can use de4dot or other deobfuscators. But the game is unplayable afterwards.

    Fine. I decided to use a combo box for it instead. So the user can select the current map himself.
    The next one was easy due to the combo box I included.
    Converting the config was pretty decent. I nearly raged at this point.
     


    Using the Readline function & the split function wouldn't be enough. It didn't work.
    So the one who worked with me had suddenly an awesome Idea using Regular Expressions.
    It got that option to look for a pattern.

    I know that this looks terrible. But it is the first version and I hadn't thought about cleaning the code before since the Bot isn't finished yet.
    Code:
    [...]
    
    using System.Text.RegularExpressions;
    
    [...]
    
            List<string> config = new List<string>();
            List<string> timepoints = new List<string>();
            string path = @"C:\Program Files (x86)\Steam\steamapps\workshop\content\513510\1282  767793\config.txt";
            bool fertig = false;
            string s = "";
    
    [...]
    
    private void ConfigOpener()
            {
                using (StreamReader sr = File.OpenText(path))
                {
                    while ((s = sr.ReadLine()) != null)
                    {
                        config.Add(s);
                    }
                }
                fertig = true;
                AddTimepoints();
            }
    
    [...]
    
    private void AddTimepoints()
            {
                if (fertig == true)
                {
                    string pattern = @"{""time"":([0-9]*\.[0-9]*),""data"":\[""SpawnObj"",""\[([a-z-]*)]""]}";
                    string input = "";
    
                    foreach (string item3 in config)
                    {
                        input = input + item3;
                    }
    
    
                    RegexOptions options = RegexOptions.Multiline | RegexOptions.IgnoreCase;
    
                    foreach (Match m in Regex.Matches(input, pattern, options))
                    {
                        timepoints.Add(m.Groups[1].ToString());
                        timepoints.Add(m.Groups[2].ToString());
                    }
                }
                ActualBot();
            }
    
    [...]
    The next step was easy again. Since we added only the time & what to press to the list "timepoints" we could use the information from now on.
    It would look like this imaginary:
    the_list = [time_1, what_to_press_1, time_2, what_to_press_2, time_3, what_to_press_3, ...] and so on.
    We could output it somehow else and make it look like this technically:

    time_1
    what_to_press_1
    time_2
    what_to_press_2
    time_3
    what_to_press_3
    ...
    But I think it wouldn't make any differs.

    Here comes the next small problem. There is no time offset. The game got no sort of timer for the songs like Osu does. So I tried doing it with some timer at first. But the tick rate isn't fast enough and isn't constantly enough for me. So I used "sleep" instead. Didn't worked out well.

    So why did I created this thread?
    This community is creative. And there are very skilled coders here. I can't reach that skill at this point and got less knowledge than them.

    My Question is: "How would you solve this?"

    I clearly got no ideas anymore at this point.
    Thanks in advance! I would also credit the one whose method I will use.

    Making Signatures! +~+
    Click me~



  2. #2
    MikeRohsoft's Avatar
    Join Date
    May 2013
    Gender
    male
    Location
    Los Santos
    Posts
    688
    Reputation
    320
    Thanks
    22,569
    it's json.. i would say.. you just parse it as json?
    Code:
        var json = System.IO.File.ReadAllText(@"d:\test.json");
        var objects = JArray.Parse(json); // parse as array

  3. #3
    Efilon's Avatar
    Join Date
    Jan 2019
    Gender
    male
    Posts
    1
    Reputation
    10
    Thanks
    0
    Quote Originally Posted by MikeRohsoft View Post
    it's json.. i would say.. you just parse it as json?
    Hello, I'm the guy who suggested making use of RegEx.

    OP has already successfully parsed the times and input directions but is unsure how he should implement them to make a bot functional.
    He basically has it listed as strings like this atm:
    Code:
    time //called by timepoints[0]
    input //called by timepoints[1]
    time //timepoints[2]
    input //...
    ...
    (Idk his exact code but...)
    He's struggling with setting up a proper accurate timer to use and with effectively using the time and input together to get a bot to run properly.
    So far I know he tried using InputSimulator but hasn't gotten it to work the way he meant it to.
    Last edited by Efilon; 5 Days Ago at 04:47 PM.

  4. #4
    MikeRohsoft's Avatar
    Join Date
    May 2013
    Gender
    male
    Location
    Los Santos
    Posts
    688
    Reputation
    320
    Thanks
    22,569
    Quote Originally Posted by Efilon View Post
    Hello, I'm the guy who suggested making use of RegEx.

    OP has already successfully parsed the times and input directions but is unsure how he should implement them to make a bot functional.
    He basically has it listed as strings like this atm:
    Code:
    time //called by timepoints[0]
    input //called by timepoints[1]
    time //timepoints[2]
    input //...
    ...
    (Idk his exact code but...)
    He's struggling with setting up a proper accurate timer to use and with effectively using the time and input together to get a bot to run properly.
    So far I know he tried using InputSimulator but hasn't gotten it to work the way he meant it to.
    the time is for sure findable with cheat engine then your Thread can just read constantly the Game Timer and if the actual time needs a keypress, then you send it.
    All what you need to find out is, what keysending the game is accepting.
    Some Application just need the Window Messages, then you can just send a PostMessage to the Window.
    If not, you need to simulate a keypress with SendInput. The Trick that the Window accept it propper is not to send the key and key up immidiatly, it needs some ms timeout. How much depends on the Target Process

  5. #5
    defaulto's Avatar
    Join Date
    Aug 2017
    Gender
    male
    Posts
    27
    Reputation
    25
    Thanks
    9
    My Mood
    Asleep
    Quote Originally Posted by MikeRohsoft View Post

    the time is for sure findable with cheat engine then your Thread can just read constantly the Game Timer and if the actual time needs a keypress, then you send it.
    All what you need to find out is, what keysending the game is accepting.
    Some Application just need the Window Messages, then you can just send a PostMessage to the Window.
    If not, you need to simulate a keypress with SendInput. The Trick that the Window accept it propper is not to send the key and key up immidiatly, it needs some ms timeout. How much depends on the Target Process
    I will try to find it again then.

    Is there a proper way on how to check if the time value from the adress is the one on the list? Which, after the time has passed jumps to the next timestamp? Or is there a better way to handle this and maybe preprocess this?


    I looked into resources like Blackmagic where all the parsers for the .osk files are, calculating stuff, etc.

    I haven't found a method which checks this yet. Some Pseudocode would be great.
    Last edited by defaulto; 4 Days Ago at 07:56 AM. Reason: Addition.

  6. #6

  7. #7
    defaulto's Avatar
    Join Date
    Aug 2017
    Gender
    male
    Posts
    27
    Reputation
    25
    Thanks
    9
    My Mood
    Asleep
    Quote Originally Posted by MikeRohsoft View Post
    From which Game exactly we are even talking about here, if not OSU? Is it for free? then i may help
    I am talking about Intralism.
    Since it's a rhythm game I associated it with Osu. Since there are some parallels between those two.

    Sadly no, it isn't free. But I can purchase it for you if necessary.

    Making Signatures! +~+
    Click me~



  8. #8
    Azuki's Avatar
    Join Date
    Mar 2015
    Gender
    female
    Location
    京都市
    Posts
    968
    Reputation
    170
    Thanks
    15,898
    My Mood
    Angelic
    hm i see a lot of issues here.
    hit me up on disc Snowyy#0001
    werd dir helfen

    BTC: 1LLm4gaPYCZsczmi8n1ia1GsEMsDRs2ayy
    ETH: 0x7d8045F6e452045439c831D09BAB19Bf9D5263EE

Similar Threads

  1. How would you rate this post?
    By Draganoid in forum Spammers Corner
    Replies: 10
    Last Post: 06-26-2018, 03:20 PM
  2. [WTS] Want to know for how much would you buy this account
    By Jetpack in forum Alliance of Valiant Arms (AVA) Selling / Trading / Buying
    Replies: 1
    Last Post: 03-28-2013, 06:13 AM
  3. [Help] How would you make sense of this to change it?
    By ballin299 in forum Android / iOS Programming
    Replies: 4
    Last Post: 08-14-2012, 07:55 PM
  4. How much would you buy this for
    By komakazee in forum Trade Accounts/Keys/Items
    Replies: 82
    Last Post: 12-02-2009, 08:23 PM
  5. HOW MUCH WOULD YOU BUY THIS ACCOUNT 4?
    By VIC116052 in forum Trade Accounts/Keys/Items
    Replies: 9
    Last Post: 12-01-2009, 04:54 PM

Tags for this Thread