wc3edit.net

United Warcraft 3 map hacking!
It is currently March 28th, 2024, 9:55 pm

All times are UTC




Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: A few questions
PostPosted: December 13th, 2011, 3:52 am 
Offline
Old Wrinkly Member
User avatar

Joined: April 19th, 2009, 12:46 pm
Posts: 234
Sorry guys, I'm probably being a massive pain in your side, but I always try google before this and search for stuff.
Anyway, I have SendMessage defined and everything, but I can't find a decent example of how to use it in a function.

Someone said to try this, but I'm not sure what to do with it, I'm hoping to use this to send messages into the console of the game im using to execute commands.

EDIT:I want to use this to be able to say commands in the game such as !place and have the utility send a message into the game such as place misc_model_breakable 0 model,map_objects/factory/f_con1,spawnflags,1

so basically, the person says !place and it sends the above command into the game.

Spoiler:
public static extern IntPtr SendMessage(IntPtr hWnd, uint Msg, IntPtr wParam, IntPtr lParam);

_________________
ImageImageImage


Last edited by Durge on December 13th, 2011, 9:37 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: A few questions
PostPosted: December 13th, 2011, 6:45 pm 
Offline
Super Moderator
User avatar

Joined: February 24th, 2009, 1:31 pm
Posts: 3815
Location: JEW LAND
ammm what? As before, more explenation would be awesome.
For what I understand, you want either one of two things.

1) You want to have a message displayed to a user in some way, I do think a messagebox is the best way for you (if your making a win32 application)
2) You want to have a command given to the game as it loads, same way it does for a short-cut executer. Like WarCraft for an example. Make a shortcut to the .exe and add -windowed at the end will make the game play in window mod.

P.S: As before I assume you use C#. But seriosly, more info. I am no psychic (don't know about any one else, I'm pretty sure they are not psychic also.)

_________________
Image
Spoiler:
(02:24:09)
Code:
ChatBot: FatherSpace logs into the Chat.
(02:24:28) Lanaya: Gtfo ken.
(02:24:33) ChatBot: FatherSpace logs out of the Chat.
(02:24:40) Lanaya: Thought so. bitch.
(02:24:44) ChatBot: FatherSpace logs into the Chat.
(02:24:48) FatherSpace: Can I come back yet?
(02:24:51) Lanaya: What'd i say earlier.
(02:24:51) Lanaya: No.
(02:24:58) FatherSpace: Let's try this...
(02:25:01) ChatBot: Lanaya has been logged out (Kicked).
Code:

(14:33:51) 2Pac: Do you know what'S so funny?
(14:34:01) Lanaya: No, please show me.
(14:34:07) 2Pac: This.
(14:34:09) ChatBot: Lanaya has been logged out (Kicked).
(14:34:10) 2Pac:


Code:
(14:35:59) haxorico: No one will belive me if I say "I got this song from 2pac on MSN" lolz ^^
(14:36:02) Lanaya: lolz.
(14:36:16) 2Pac: I AIN'T DEAD FFS.
(14:36:26) 2Pac: I'm a living legend, y'now.
(14:37:17) haxorico: why is 2Pac a legend?
(14:37:28) Lanaya: He's the worse rapper evar.

Code:
(15:42:51) Lanaya: can i suck , . . .

Code:
(13:55:21) ChatBot: 2Pac rolls 1d100 and gets 1.
(13:55:21) ChatBot: haxorico rolls 1d2 and gets 2.
(13:55:27) haxorico: owned?

Code:
GeorgeMots: xplain what happens in SP. Why cant you save?
dast.-:i need play with 2 players

Code:
(21:53:08) (673237): plzplzplz, im sorry about before.
(21:53:26) FatherSpace: I'm sorry you were born.
(21:53:31) ChatBot: (673237) has been logged out (Kicked).


Code:
(10:08:02) Bartimaeus: you do know run I youtube channel for my favorite music, right?


Top
 Profile  
 
 Post subject: Re: A few questions
PostPosted: December 13th, 2011, 9:49 pm 
Offline
Super Moderator

Joined: February 3rd, 2009, 11:28 pm
Posts: 2394
First, you're not being a pain. We all signed up for this, we're not being forced to help.
You want to send commands into an external application?
Best way to do this is the SendKeys.Send method.
Here's an example.
Code:
SendKeys.Send("Hello Durge");

This will send the keys "Hello Durge" to the application you have open and focused. It will be just like you typing the keys on the keyboard.
However if you want to send commands to WC3 you need to send new lines too (the return key)
You do this like:
Code:
SendKeys.Send("{ENTER}");

You can also do that for others like arrow keys, tab, etc.


Top
 Profile  
 
 Post subject: Re: A few questions
PostPosted: December 13th, 2011, 10:00 pm 
Offline
Old Wrinkly Member
User avatar

Joined: April 19th, 2009, 12:46 pm
Posts: 234
Ok, that helps, but how would I make an if statement like if player typed <insert text> then send the message

_________________
ImageImageImage


Top
 Profile  
 
 Post subject: Re: A few questions
PostPosted: December 13th, 2011, 11:35 pm 
Offline
Super Moderator

Joined: February 3rd, 2009, 11:28 pm
Posts: 2394
Um.. I think you would have to read the memory of WC3. I'm not exactly sure how to do it myself, but I can give you the function for reading memory.
Spoiler:
[DllImport("kernel32.dll", SetLastError = true)]
static extern bool ReadProcessMemory(
IntPtr hProcess,
IntPtr lpBaseAddress,
[Out] byte[] lpBuffer,
int dwSize,
out int lpNumberOfBytesRead
);

[DllImport("kernel32.dll", SetLastError = true)]
static extern bool ReadProcessMemory(
IntPtr hProcess,
IntPtr lpBaseAddress,
[Out, MarshalAs(UnmanagedType.AsAny)] object lpBuffer,
int dwSize,
out int lpNumberOfBytesRead
);

[DllImport("kernel32.dll", SetLastError = true)]
static extern bool ReadProcessMemory(
IntPtr hProcess,
IntPtr lpBaseAddress,
IntPtr lpBuffer,
int dwSize,
out int lpNumberOfBytesRead
);

Try to google a tutorial for reading text from WC3. Maybe someone made one.


Top
 Profile  
 
 Post subject: Re: A few questions
PostPosted: December 14th, 2011, 12:26 am 
Offline
Old Wrinkly Member
User avatar

Joined: April 19th, 2009, 12:46 pm
Posts: 234
Well its not for WC3, which is why I posted it in tech section, not in a wc3 section :p

_________________
ImageImageImage


Top
 Profile  
 
 Post subject: Re: A few questions
PostPosted: December 14th, 2011, 4:14 pm 
Offline
Super Moderator
User avatar

Joined: February 24th, 2009, 1:31 pm
Posts: 3815
Location: JEW LAND
Doesn't matter if it wc3 or not. You still require the data rad from the game.

_________________
Image
Spoiler:
(02:24:09)
Code:
ChatBot: FatherSpace logs into the Chat.
(02:24:28) Lanaya: Gtfo ken.
(02:24:33) ChatBot: FatherSpace logs out of the Chat.
(02:24:40) Lanaya: Thought so. bitch.
(02:24:44) ChatBot: FatherSpace logs into the Chat.
(02:24:48) FatherSpace: Can I come back yet?
(02:24:51) Lanaya: What'd i say earlier.
(02:24:51) Lanaya: No.
(02:24:58) FatherSpace: Let's try this...
(02:25:01) ChatBot: Lanaya has been logged out (Kicked).
Code:

(14:33:51) 2Pac: Do you know what'S so funny?
(14:34:01) Lanaya: No, please show me.
(14:34:07) 2Pac: This.
(14:34:09) ChatBot: Lanaya has been logged out (Kicked).
(14:34:10) 2Pac:


Code:
(14:35:59) haxorico: No one will belive me if I say "I got this song from 2pac on MSN" lolz ^^
(14:36:02) Lanaya: lolz.
(14:36:16) 2Pac: I AIN'T DEAD FFS.
(14:36:26) 2Pac: I'm a living legend, y'now.
(14:37:17) haxorico: why is 2Pac a legend?
(14:37:28) Lanaya: He's the worse rapper evar.

Code:
(15:42:51) Lanaya: can i suck , . . .

Code:
(13:55:21) ChatBot: 2Pac rolls 1d100 and gets 1.
(13:55:21) ChatBot: haxorico rolls 1d2 and gets 2.
(13:55:27) haxorico: owned?

Code:
GeorgeMots: xplain what happens in SP. Why cant you save?
dast.-:i need play with 2 players

Code:
(21:53:08) (673237): plzplzplz, im sorry about before.
(21:53:26) FatherSpace: I'm sorry you were born.
(21:53:31) ChatBot: (673237) has been logged out (Kicked).


Code:
(10:08:02) Bartimaeus: you do know run I youtube channel for my favorite music, right?


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 6 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group

phpBB SEO


Privacy Policy Statement
Impressum (German)