Results 1 to 5 of 5
  1. #1
    HACKINGPIE's Avatar
    Join Date
    Nov 2009
    Gender
    male
    Posts
    109
    Reputation
    10
    Thanks
    76

    Reading and writing to Modern Warfare 2 console?

    Basically, I want to be able to read a line in the console. This is not begging, I am just crap with C#, which is what I would like to use as it would be suitable for a basic task.

    So, I basically want to use a GSC mod to send a line to the console, which, for exmaple starts with: 'program_read'
    I would like it to ONLY read lines that start with that.

    I would also like to be able to send commands to the console, like program_response XXXX as a dvar, which I can read with the script.

    For example, a player uses a /save command in the console. The game sends these lines to the console:
    program_saveguid YOUR GUID HERE
    program_save money 12345
    program_save kills 123
    program_save deaths 23
    program_savestop

    The program picks up those lines, and creates a text file. In this case, the file is called playerstats_YOURGUIDHERE.sav and it looks like this inside the file:

    Code:
    money 12345
    kills 123
    deaths 23
    And when the program sees the line 'program_loadguid YOURGUIDHERE' in the console, it loads that file one line at a time. One line is loaded and it waits for a line 'program_loadnext' to appear before it proceeds. This is to give time for the script to set the saved lines into a script definition. Such as: self.money = 12345; self.kills = 123; self.deaths = 23;

    This is quite hard for me to do as I do not know how to read the console. If someone could assist me in reading and writing to the console in alterIWnet using a C# script, it would make my day. I can figure out the rest.
    -----♥♥♥-----
    ----♥♥♥♥♥ ---Put This
    ---♥♥---♥♥---In Your
    ---♥♥---♥♥---Sig If
    ---♥♥---♥♥---You Know
    ----♥♥-♥♥----Someone
    -----♥♥♥-----Who Died Or Is Suffering
    ----♥♥-♥♥----from
    ---♥♥---♥♥---Cancer

  2. #2
    aIW|Convery's Avatar
    Join Date
    Oct 2010
    Gender
    male
    Posts
    2,876
    Reputation
    124
    Thanks
    595
    My Mood
    Cynical
    I'm not sure why you'd want to do that.. just to load saved profiles?

  3. #3
    HACKINGPIE's Avatar
    Join Date
    Nov 2009
    Gender
    male
    Posts
    109
    Reputation
    10
    Thanks
    76
    Quote Originally Posted by aIW|Convery View Post
    I'm not sure why you'd want to do that.. just to load saved profiles?
    I'm making a mod that has server side, stored stats and I want to be able to restore them when the server loads without going through a ton of hassle when I close it.
    -----♥♥♥-----
    ----♥♥♥♥♥ ---Put This
    ---♥♥---♥♥---In Your
    ---♥♥---♥♥---Sig If
    ---♥♥---♥♥---You Know
    ----♥♥-♥♥----Someone
    -----♥♥♥-----Who Died Or Is Suffering
    ----♥♥-♥♥----from
    ---♥♥---♥♥---Cancer

  4. #4
    aIW|Convery's Avatar
    Join Date
    Oct 2010
    Gender
    male
    Posts
    2,876
    Reputation
    124
    Thanks
    595
    My Mood
    Cynical
    Quote Originally Posted by HACKINGPIE View Post
    I'm making a mod that has server side, stored stats and I want to be able to restore them when the server loads without going through a ton of hassle when I close it.
    Right, that makes more sense :3

    Either way, why would you want to inject crap and use the console rather than just reading the memory?


    Make a program that checks the client info (struct in the memory) of all players and get the XUID, then all the info from your mod. Check the XUID every, say, 10 seconds and if it has changed you just save the stats. Really not that hard to do unless you want the console part, which I honestly can't find anything about justify the extra debugging, code and injections.. not to mention the anticheat biting you if you do it wrong..

  5. The Following User Says Thank You to aIW|Convery For This Useful Post:

    HACKINGPIE (12-24-2011)

  6. #5
    HACKINGPIE's Avatar
    Join Date
    Nov 2009
    Gender
    male
    Posts
    109
    Reputation
    10
    Thanks
    76
    Thanks, I have coded a plugin and i'm about to test it out.
    -----♥♥♥-----
    ----♥♥♥♥♥ ---Put This
    ---♥♥---♥♥---In Your
    ---♥♥---♥♥---Sig If
    ---♥♥---♥♥---You Know
    ----♥♥-♥♥----Someone
    -----♥♥♥-----Who Died Or Is Suffering
    ----♥♥-♥♥----from
    ---♥♥---♥♥---Cancer

Similar Threads

  1. [Help] Reading and Writing Float
    By hack_tr in forum Visual Basic Programming
    Replies: 2
    Last Post: 08-11-2011, 05:01 AM
  2. need help!? read and write (txt)
    By GER-Domi. in forum Visual Basic Programming
    Replies: 5
    Last Post: 09-10-2010, 09:11 PM
  3. [TUT]How to read and write to a text file
    By XORxHACK in forum Java
    Replies: 18
    Last Post: 02-26-2010, 05:41 PM
  4. [Help]Reading and Writing to .txt files on the internet
    By treeham in forum Visual Basic Programming
    Replies: 6
    Last Post: 01-30-2010, 02:07 AM
  5. [Tutorial/Snippet][VB6] Reading and writing INI Files
    By That0n3Guy in forum Visual Basic Programming
    Replies: 6
    Last Post: 10-26-2009, 06:31 PM