|
beyoungse
中级用户
积分 253
发帖 112
注册 2005-12-20
状态 离线
|
『楼 主』:
[已结]如何接受用户输入更改文本内容
rev.ini文本如下:
# Game Config dods.cn
[Emulator]
# CachePath - set to the folder where your GCF files are located
#
CacheEnabled=False
CachePath=d:\Steam\SteamApps
# Language - rev emu will automagically load the correct language files.
# This can be English, French, Italian, German, Spanish, sChinese,
# Korean, Koreana, tChinese, Japanese, Russian, Thai, or Portugeuse
#
Language=sChinese
# Change Logging to True to enable/disable log file output for steam.dll
#
Logging=False
# Change SteamDll to point to your official Steam client DLL.
# This setting is required for Steam UserID Validation functions
# to support legit Steam IDs. Otherwise, all clients would get
# IDs generated from their IP addresses.
# Also make sure you uncomment the line below (remove "#")
# if you want to use this setting!
#
SteamDll=bin\steam_old.dll
# Change SteamClient to True if you want to use steamclient emulator
#
SteamClient=True
# 如果要使用steam上的用户名,请修改SteamUser后面的内容
# Defaults to revCrew if not specified
SteamUser=revCrew
[Log]
# If Logging is set to True, choose which functions would you like to log.
#
FileSystem=False
Account=False
UserID=False
[steamclient]
################################### NOTE ####################################
# These settings may apply even if you don't choose to use steamclient.dll! #
#############################################################################
#
# 玩家名称在下面修改,将DODS.CN修改为你的名字 (仅用于起源2007引擎的游戏)
#
PlayerName="[color=Red][b]test[/b][/color]"
# Change the setting below to enable/disable log file output for steamclient.dll
#
Logging=False
# Change the setting below to enable a different master server for the server
# browser
#MasterServer=213.239.209.221 上面的rev.ini配置文件中红色字体如何用批处理接受用户输入做出相应更改
[ Last edited by HAT on 2008-12-26 at 23:19 ]
|
|
2008-12-25 01:19 |
|
|
tireless
银牌会员
积分 2025
发帖 1122
注册 2007-9-5
状态 离线
|
『第
2 楼』:
这样:
@echo off
set /p input=请输入 PlayerName:
set file=d:\test\rev.ini
for /f "delims=" %%a in ('findstr /n .* "%file%"') do (
set "str=%%a"
if not defined Overwrite (
>"%file%" call echo.%%str:~2%%
set Overwrite=.
) else (
setlocal enabledelayedexpansion
set str=!str:*:=!
if /i "!str:~,10!"=="PlayerName" (
>>"%file%" echo PlayerName="%input%"
) else (>>"%file%" echo.!str!)
endlocal
)
) [ Last edited by tireless on 2008-12-25 at 16:55 ]
此帖被 +2 点积分 点击查看详情 评分人:【 HAT 】 | 分数: +2 | 时间:2008-12-26 23:20 |
|
|
|
2008-12-25 15:27 |
|
|
tireless
银牌会员
积分 2025
发帖 1122
注册 2007-9-5
状态 离线
|
『第
3 楼』:
或者这样:
@echo off
set /p input=请输入 PlayerName:
set "file=d:\test\rev.ini"
more +15 %0>"%file%"
>>"%file%" echo PlayerName="%input%"
>>"%file%" echo.
>>"%file%" echo # Change the setting below to enable/disable log file output for steamclient.dll
>>"%file%" echo #
>>"%file%" echo Logging=False
>>"%file%" echo.
>>"%file%" echo # Change the setting below to enable a different master server for the server
>>"%file%" echo # browser
>>"%file%" echo #MasterServer=213.239.209.221
exit /b
# Game Config dods.cn
[Emulator]
# CachePath - set to the folder where your GCF files are located
#
CacheEnabled=False
CachePath=d:\Steam\SteamApps
# Language - rev emu will automagically load the correct language files.
# This can be English, French, Italian, German, Spanish, sChinese,
# Korean, Koreana, tChinese, Japanese, Russian, Thai, or Portugeuse
#
Language=sChinese
# Change Logging to True to enable/disable log file output for steam.dll
#
Logging=False
# Change SteamDll to point to your official Steam client DLL.
# This setting is required for Steam UserID Validation functions
# to support legit Steam IDs. Otherwise, all clients would get
# IDs generated from their IP addresses.
# Also make sure you uncomment the line below (remove "#")
# if you want to use this setting!
#
SteamDll=bin\steam_old.dll
# Change SteamClient to True if you want to use steamclient emulator
#
SteamClient=True
# 如果要使用steam上的用户名,请修改SteamUser后面的内容
# Defaults to revCrew if not specified
SteamUser=revCrew
[Log]
# If Logging is set to True, choose which functions would you like to log.
#
FileSystem=False
Account=False
UserID=False
[steamclient]
################################### NOTE ####################################
# These settings may apply even if you don't choose to use steamclient.dll! #
#############################################################################
#
# 玩家名称在下面修改,将DODS.CN修改为你的名字 (仅用于起源2007引擎的游戏)
#
|
|
2008-12-25 15:28 |
|
|
HAT
版主
积分 9023
发帖 5017
注册 2007-5-31
状态 离线
|
『第
4 楼』:
Re 3楼
PlayerName="test"下面的几行直接more一下原始ini文件更简介些吧^_^
|
|
|
2008-12-25 16:11 |
|
|
yishanju
银牌会员
[b]看你妹啊[/b]
积分 1488
发帖 1357
注册 2006-5-20
状态 离线
|
『第
5 楼』:
#开头的注释内容全不要了吧
然后按配置文件的格式ECHO 生成一个配置文件。这样或许更好写
[ Last edited by yishanju on 2008-12-25 at 16:20 ]
|
有问题请发论坛或者自行搜索,再短消息问我的统统是SB |
|
2008-12-25 16:15 |
|
|
yishanju
银牌会员
[b]看你妹啊[/b]
积分 1488
发帖 1357
注册 2006-5-20
状态 离线
|
『第
6 楼』:
去年注释后的配置文件就像被拔光毛的狮子。
[Emulator]
CacheEnabled=False
CachePath=d:\Steam\SteamApps
Language=sChinese
Logging=False
SteamDll=bin\steam_old.dll
SteamClient=True
SteamUser=revCrew
[Log]
FileSystem=False
Account=False
UserID=False
[steamclient]
PlayerName="test"
Logging=False
[ Last edited by yishanju on 2008-12-25 at 16:21 ]
|
有问题请发论坛或者自行搜索,再短消息问我的统统是SB |
|
2008-12-25 16:16 |
|
|
tireless
银牌会员
积分 2025
发帖 1122
注册 2007-9-5
状态 离线
|
『第
7 楼』:
Quote: | Originally posted by HAT at 2008-12-25 04:11 PM:
PlayerName="test"下面的几行直接more一下原始ini文件更简介些吧^_^ |
|
我刚想说是,发现这样不对,因为我前面已经把原文件覆盖了...而且不可以 more 到同一个文件,如 more 1.txt>1.txt
[ Last edited by tireless on 2008-12-25 at 16:46 ]
|
|
2008-12-25 16:42 |
|
|
HAT
版主
积分 9023
发帖 5017
注册 2007-5-31
状态 离线
|
『第
8 楼』:
Re 7楼
是的,如果要采用4楼的方法,就要使用临时文件了。
|
|
|
2008-12-25 16:46 |
|
|
beyoungse
中级用户
积分 253
发帖 112
注册 2005-12-20
状态 离线
|
|
2008-12-26 14:33 |
|
|
kurt101
初级用户
积分 23
发帖 17
注册 2008-8-22
状态 离线
|
『第
10 楼』:
来学习了。。看到那么多代码头有点大
|
|
2008-12-26 19:28 |
|