wc3campaigns
WC3C Homepage - www.wc3c.netUser Control Panel (Requires Log-In)Engage in discussions with other users and join contests in the WC3C forums!Read one of our many tutorials, ranging in difficulty from beginner to advanced!Show off your artistic talents in the WC3C Gallery!Download quality models, textures, spells (vJASS/JASS), systems, and scripts!Download maps that have passed through our rigorous approval process!

Go Back   Wc3C.net > Warcraft III Modding > Developer's Corner > Warcraft Editing Tools
User Name
Password
Register Rules Get Hosted! Chat Pastebin FAQ and Rules Members List Calendar



Reply
 
Thread Tools Search this Thread
Old 01-09-2014, 02:23 PM   #1
MasterofSickness
User
 
MasterofSickness's Avatar
 
Join Date: Feb 2006
Posts: 200

MasterofSickness is on a distinguished road (23)

Information WC3 map loader for advanced customized WE settings

type of loader: vbscript
required OS: windows
hint: copy code only from this post as vbscripts are very powerful & quickly can harm your system if this is the intention of the author!

about:
1 vbscript (*.vbs file) runs 1 map with desired editor settings automatically. You can setup every editor setting which you can reach through shortcuts. This script sends the keys: "g" 3 times, "l" & "p" 1 time. "g" sets small grid size, "l" disables light & "p" enables path.

the road so far...:
I could no longer stand the missing feature of saved customized editor settings like desired grid size, light, path or grid size or grid size! So I searched through all the MPQs in every UI file. I wasnt able to find any key responsible for grid size, even after like 8 hours of exploration! After that time consuming task I gave up & dropped into another unbelievable task of time consumption. As Im on windows I tried to use a batch file to load my map & send the key strokes automatically. After some hours I realised that BAT files cannot send keys without 3rd party tools. So I tried on VBS files. A few couples of hours later - the war between wscript & cscript was decided - I finally made some useful progress.

important instructions:
Before running the VBS file, at least you have to adjust the absolute path to your desired map file! The appropriate line which has to be rewritten is marked in red in the code at the bottom. Another not minor important thing which has to be taken into account is the delay after which the keys are sent. I customized it for my own loading time for warcraft 3 map editor. If your editor gets loaded faster than mine theres no problem (although I think it will take longer as I have a SSD ). So if your editor takes longer to load, you have to increase the delay a bit. The simplest way of doing so, is increasing the orange colorized number in the code at the bottom. Note that the number's format is in milliseconds. To increase the delay by 1 second, you have to increase the number by 1000. And one last note: While the script is active, especially when the keys are sent, you have to keep your mouse pointer within the WE GUI (=Graphical User Interface)!

Version [2014_01_09]:
Hidden information:
'WARCRAFT 3 MAP LOADER FOR ADVANCED CUSTOMIZED EDITOR SETTINGS

'BATCH CANT SEND KEYS WITHOUT A 3RD PARTY TOOL
'THEREFOR USE A VBSCRIPT-FILE

'CMD COMMANDS:
'http://www.script-example.com/themen/cmd_Batch_Befehle.php
'VBSCRIPT SENDKEYS CODES:
'http://social.technet.microsoft.com/wiki/contents/articles/5169.vbscript-sendkeys-method.aspx



Dim oShell
Set oShell = WScript.CreateObject ("WScript.Shell")

'########## CONSOLE WINDOW 1 ##########
oShell.run "%comspec% /K "
WScript.Sleep 100
oShell.SendKeys "PROMPT $_{ENTER}" '=INSTEAD OF SHOWING PATH IN EVERY LINE, REPLACE IT WITH A SPACE
oShell.SendKeys "COLOR 40{ENTER}" '=CHANGE COLOR (4=DARKRED BACKGROUND, 0=BLACK FOREGROUND)
oShell.SendKeys "ECHO OFF{ENTER}"
oShell.SendKeys "CLS{ENTER}" '=CLEARS CONSOLE WINDOW
oShell.SendKeys "{ENTER} OPENING WC3 MAP NOW!"
WScript.Sleep 1500
oShell.SendKeys "{ENTER}CLS{ENTER}EXIT{ENTER}"



'#################### SETUP PATH TO WC3 MAP IN NEXT LINE ####################
oShell.run("""C:\Spiele\Warcraft III\Maps\_SourceSeeker\_TESTMAP_SEIKEN.w3x""")
'#################### SETUP PATH TO WC3 MAP IN LINE ABOVE ####################
WScript.Sleep 5000


'########## CONSOLE WINDOW 2 ##########
oShell.run "%comspec% /K "
WScript.Sleep 100
oShell.SendKeys "PROMPT $_{ENTER}" '=INSTEAD OF SHOWING PATH IN EVERY LINE, REPLACE IT WITH A SPACE
oShell.SendKeys "COLOR 50{ENTER}" '=CHANGE COLOR (5=PURPLE BACKGROUND, 0=BLACK FOREGROUND)
oShell.SendKeys "ECHO OFF{ENTER}"
oShell.SendKeys "CLS{ENTER}" '=CLEARS CONSOLE WINDOW
oShell.SendKeys "{ENTER} SENDING KEYS [g] [g] [g] [l] [p] IN "
WScript.Sleep 2000
oShell.SendKeys "5"
WScript.Sleep 1000
oShell.SendKeys ", 4"
WScript.Sleep 1000
oShell.SendKeys ", 3"
WScript.Sleep 1000
oShell.SendKeys ", 2"
WScript.Sleep 1000
oShell.SendKeys ", 1"
WScript.Sleep 1000
'oShell.SendKeys "COLOR /?{ENTER}" '=SHOW COLOR HELP
'oShell.SendKeys "CMD /? {ENTER}" '=SHOW CMD HELP, BUT BETTER COMPARE LINK FROM TOP!
'oShell.SendKeys "PROMPT /?{ENTER}" '=SHOW PROMPT HELP
'WScript.echo "test" '=POPUP
'MsgBox("Hello world") '=POPUP
oShell.SendKeys "{ENTER}CLS{ENTER}EXIT{ENTER}"
WScript.Sleep 500

'#################### SENDING KEYS ####################
oShell.SendKeys "ggg" '=CHANGE GRID SIZE
oShell.SendKeys "l" '=TURN OFF LIGHT
oShell.SendKeys "p" '=TURN ON PATHING
WScript.Sleep 500

'########## CONSOLE WINDOW 3 ##########
oShell.run "%comspec% /K "
WScript.Sleep 100
oShell.SendKeys "PROMPT $_{ENTER}" '=INSTEAD OF SHOWING PATH IN EVERY LINE, REPLACE IT WITH A SPACE
oShell.SendKeys "COLOR 20{ENTER}" '=CHANGE COLOR (2=DARKGREEN BACKGROUND, 0=BLACK FOREGROUND)
oShell.SendKeys "ECHO OFF{ENTER}"
oShell.SendKeys "CLS{ENTER}" '=CLEARS CONSOLE WINDOW
oShell.SendKeys "{ENTER} KEYS WERE SENT!"
WScript.Sleep 1000
oShell.SendKeys "{ENTER}CLS{ENTER}EXIT{ENTER}"

Set oShell = Nothing


instructions for copying & using the above code:
As the final vbscript is still a text file you can just copy & paste the code into an empty TXT file & rename the extension from TXT to VBS & save. After that, perform the changes I talked about under 'Important instructions'. You can name the file however you want as long as it has the VBS extension. Simply run the file by double clicking it.

Have fun!
__________________
my nicknames:
20002006200720102012
Master of SicknessDesignatusKakarotEdwardElricSourceSeeker

Last edited by MasterofSickness : 01-10-2014 at 04:30 AM.
MasterofSickness is online now   Reply With Quote
Sponsored Links - Login to hide this ad!
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off


All times are GMT. The time now is 06:25 PM.


Donate

Affiliates
The Hubb http://bylur.com - Warcraft, StarCraft, Diablo and DotA Blog & Forums The JASS Vault Clan WEnW Campaign Creations Clan CBS GamesModding Flixreel Videos

Powered by vBulletin (Copyright ©2000 - 2014, Jelsoft Enterprises Ltd).
Hosted by www.OICcam.com
IT Support and Services provided by Executive IT Services