Help Reading from console
#1
Is it possible to read the console output from a script?
Reply

#2
Probably but why would you need that?
[Image: azuw.jpg]
Reply

#3
My external rcon plugin
Reply

#4
It's possible, Mine was able to do it.
You need to get the window offset and need to use some windows api functions though
Reply

#5
i am able to read the last used command in black ops console so its possible (commands like, +melee -melee or even dvars)
it was just some address
0x03536C5C for black ops, i will try to update this post if i find it for mw3

EDIT: cant find. Sad
Reply

#6
I don't understand this offset thing can you tell me how to do this?
Reply

#7
Code:
unsafe string MW3Console { get { IntPtr form = *(IntPtr*)0x5933A50; IntPtr txtbox = FindWindowEx(form, IntPtr.Zero, "Edit", null); IntPtr console = FindWindowEx(form, txtbox, "Edit", null); StringBuilder sb = new StringBuilder(9999999); int result = SendMessageTimeout( console, 0x0D /*WM_GETTEXT*/, 9999999, sb, 10 /*SMTO_ABORTIFHUNG | SMTO_NOTIMEOUTIFNOTHUNG*/, 500, IntPtr.Zero); return sb.ToString(); } } [DllImport("user32.dll", EntryPoint = "FindWindow", CharSet = CharSet.Ansi)] public static extern IntPtr FindWindow(string className, string windowName); [DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Auto)] public static extern IntPtr FindWindowEx(IntPtr parentHandle, IntPtr childAfter, string lclassName, string windowTitle); [DllImport("User32.dll", SetLastError = true)] public static extern int SendMessageTimeout( IntPtr hWnd, uint uMsg, uint wParam, StringBuilder lParam, uint fuFlags, uint uTimeout, IntPtr lpdwResult);

The offset (line 5) is outdated and I got it from nukem.
I think (but not entirely sure) that barata's tool can tell you what it is.
Reply

#8
This worked for me
Code:
unsafe string MW3Console { get { IntPtr form = FindWindow("IW5 WinConsole", "Call of Duty: Modern Warfare 3 Dedicated Server"); IntPtr txtbox = FindWindowEx(form,IntPtr.Zero,"Edit",null); IntPtr console = FindWindowEx(form, txtbox, "Edit", null); StringBuilder sb = new StringBuilder(9999999); int result = SendMessageTimeout( console, 0x0D /*WM_GETTEXT*/, 9999999, sb, 10 /*SMTO_ABORTIFHUNG | SMTO_NOTIMEOUTIFNOTHUNG*/, 500, IntPtr.Zero); return sb.ToString(); } } [DllImport("user32.dll", EntryPoint = "FindWindow", CharSet = CharSet.Ansi)] public static extern IntPtr FindWindow(string className, string windowName); [DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Auto)] public static extern IntPtr FindWindowEx(IntPtr parentHandle, IntPtr childAfter, string lclassName, string windowTitle); [DllImport("User32.dll", SetLastError = true)] public static extern int SendMessageTimeout( IntPtr hWnd, uint uMsg, uint wParam, StringBuilder lParam, uint fuFlags, uint uTimeout, IntPtr lpdwResult);
Reply



Possibly Related Threads…
Thread Author Replies Views Last Post
  Help mod not reading .iwd files? hmann 4 6,039 10-13-2013, 20:14
Last Post: hmann
  Help MW3 (External) Console - TeknoMW3? Strazeeh 7 10,815 10-01-2013, 21:54
Last Post: DeHEnergY
  Help MW3 (External) Console - TeknoMW3? Strazeeh 2 5,877 09-30-2013, 19:19
Last Post: surtek
  [Request] MW2 EXTERNAL CONSOLE!!! thomiromi 4 7,717 09-26-2013, 18:02
Last Post: Rendflex
  console or server browser MW2 kerm007 1 4,991 08-30-2013, 21:52
Last Post: Nekochan
  [News] T6 Console [PC] zer0w 42 41,208 08-08-2013, 17:27
Last Post: Bandarigoda123
  Help GSC Reading Files?! Howl3r 11 11,191 07-30-2013, 04:00
Last Post: DidUknowiPwn
Wink Help MW3 Server Console Bandarigoda123 0 4,104 07-26-2013, 04:01
Last Post: Bandarigoda123
  Help Help in address console Bandarigoda123 2 4,582 07-20-2013, 15:46
Last Post: Bandarigoda123
  [Release] Black Ops 1 "External" Console barata 16 26,333 07-19-2013, 21:15
Last Post: Jakeyellis

Forum Jump:


Users browsing this thread:
1 Guest(s)

Forum Powered By MyBB, Theme by © 2002-2026 Melroy van den Berg.