Встроенная команда set

Теперь разберёмся с не менее важной вещью - командой
set . Это команда редактирования чего-либо. Так же устанавливает некоторые переменные, но об этом позже.
На начальном этапе команда set может установить любой ваш параметр на более желаемый уровень.
Рассмотрим параметры.

sethealth число - это установка здоровья персонажа (в случае какой мы рассматриваем, т.е. ввод команды при помощи player это корректировка здоровья игрока)

Обязательно после ввода переменной должно идти число. Покажу на примере:
Player->sethealth 25000
Вот. Моё здоровье увеличилось до 25000. Рассмотрим остальные переменные. Но чтобы их установить, повторюсь, должно идти число, т.е. их значение:

setmagicka - установка магии
setfatigue - установка переменной усталости
setstrength - очень важный параметр - сила. Чем выше уровень, тем сильнее вы наносите удары
setintelligence - Интеллект, чем выше, тем сильнее магию вы сможете применить
setwillpower - сила воли. Регулирует усталость и так же от неё зависит сила заклинаний
setagility - ловкость
setspeed - скорость
setendurance - выносливость
setpersonality - привлекательность
setluck - удача (от этого параметра зависят ВСЕ ваши действия)
setblock - защита (чем выше, тем больше вероятности заблокировать удар щитом)
setarmorer - Кузнец.
setmediumarmor - способность носить средние доспехи
setheavyarmor - способность носить тяжёлые доспехи (к примеру даэдрик)
setBluntweapon - дробящее оружие (дубины, посохи)
setLongBlade - длинные клинки
setaxe - топоры
setspear - древковые (копья)
setathletics - атлетика (развитие этого навыка позволяет уменьшать расход сил на бег)
setenchant - зачарование предметов (вообщем будьте супермагом.)
setdestruction - магия разрушения
setalteration - изменения
setillusion - иллюзии
setconjuration - колдовство
SetMysticism - мистицизм
SetRestoration - восстановление (чем выше навык, тем быстрее вы лечитесь)
setalchemy - алхимия (чем выше тем больше эффектов в препаратах вы распознаете)
setunarmored - бездоспешный бой
setsecurity - безопасность (обезвреживание ловушек)
setsneak - красться (для воров просто отпад, можно стырить вещь прямо у людей под носом)
setacrobatics - акробатика (чем выше тем выше вы сможете прыгнуть)
setlightarmor - лёгкие доспехи
setshortblade - кинжалы
setmarksman - меткость (зависит на точность ударов)
setmercantile - торговля
setspeechcraft - красноречие (умение всех убеждать словами)
sethandtohand - рукопашный бой

set не только добавляет вещи и заклинания, она так же регулирует многие переменные, рассмотрим некоторые из них.

Setlevel число - команда представляет собой установку уровня персонажа, но действует она не сразу, а через какое-то время, вздремните пару ночей и все будет ок. НО изменения принимаются игрой сразу, независимо от того какой уровень у вас отображен в профиле. Т.е. монстры появляются сильнее и т.д.

SetPCcrimeLevel 0 - команда устанавливает уровень штрафов героя. 0 – означает нулевое значение преступности.

SetReputation 100 - устанавливает число известности

Страница 23 из 29

Команда SHOW

Команда SHOW позволяет получить значение системных переменных SQL*Plus, а также ряд информации о среде, базе данных, к которой подключена утилита, и об ошибках в последней выполненной команде. Эта команда имеет следующий синтаксис:

<команда SHOW> ::= SHO [W ] <опция> <опция> ::= <имя системной переменной>
/ ALL
/ BTI [TLE ]
/ ERR [ORS ] [[<объект>] [<схема>. ]<имя объекта>]
/ LNO
/ PARAMETERS [<часть параметра>]
/ PNO
/ REL [EASE ]
/ REPF [OOTER ]
/ REPH [EADER ]
/ SGA
/ SPOO [L ]
/ SQLCODE
/ TTI [TLE ]
/ USER <объект> ::= FUNCTION / PROCEDURE
/ PACKAGE
/ PACKAGE BODY
/ TRIGGER
/ VIEW
/ TYPE
/ TYPE BODY
/ DIMENSION
/ JAVA CLASS

Назначение опций представлено в табл. 16.

Таблица 16. Опции команды SHOW.

Опция Назначение
ALL Выдает значения всех опций SHOW , кроме ERRORS и SGA , и всех системных переменных.
BTI [TLE ] Выдает текущее определение BTITLE (нижнего колонтитула).
ERR [ORS ] Выдает ошибки компиляции хранимой программной единицы. При компиляции выдается сообщение, что ошибки есть. Для получения детальной информации об ошибках необходимо выполнить команду SHOW ERRORS . При выполнении этой команды без аргументов, выдается информация об ошибках при компиляции последней созданной или измененной программной единицы. Если же указать тип и имя программной единицы, будут выданы ошибки, полученные при ее компиляции.

Выдается номер строки/столбца (в столбце LINE/COL ), в которых обнаружена ошибка, и текст сообщения об ошибке (в столбце ERROR). Форматом выдачи можно управлять с помощью команды COLUMN .

LNO Показывает номер текущей строки на странице.
PARAMETERS Выдает имя, тип и текущее значение одного или нескольких параметров инициализации. При вызове без дополнительных параметров, эта команда выдает информацию обо всех параметрах инициализации. Если указать части имен параметров, будет выдана информация только о параметрах, в имена которых указанные части присутствуют.

Для использования этой опции необходима объектная привилегия SELECT на представление V_$PARAMETER .

PNO Выдает номер текущей страницы результатов.
REL [EASE ] Выдает номер версии сервера Oracle, к которой подключена утилита SQL*Plus.
REPF [OOTER ] Выдает текущее определение REPFOOTER .
REPH [EADER ] Выдает текущее определение REPHEADER .
SGA Выдает информацию об области SGA экземпляра, к которому подключена утилита SQL*Plus.

Для использования опции SGA необходима объектная привилегия SELECT на представление V_$SGA .

SPOO [L ] Выдает информацию о том, направляются ли результаты в файл или на принтер.
SQLCODE Выдает код завершения последнего оператора SQL.
TTI [TLE ] Выдает текущее определение TTITLE (верхнего колонтитула).
USER Выдает имя текущего пользователя.

Рассмотрим пример использования ряда опций команды SHOW :

17:21:24 SQL> connect system/manager
Соединено.
17:21:47 SQL> show sga

Total System Global Area 152581388 bytes
Fixed Size 70924 bytes
Variable Size 78741504 bytes
Database Buffers 73691136 bytes
Redo Buffers 77824 bytes
17:21:49 SQL> show sqlcode
sqlcode 0
17:33:36 SQL> select * from emp;
select * from emp
*
ошибка в строке 1:
ORA-00942: таблица или представление пользователя не существует

Затрач.время: 00:00:00.40
17:33:43 SQL> show sqlcode
sqlcode 942
17:33:50 SQL> show spool
spool OFF
17:34:52 SQL> show linesize
linesize 128
17:36:07 SQL> show user
USER имеет значение "SYSTEM"
17:36:10 SQL> show parameters buff

NAME TYPE VALUE
buffer_pool_keep string
buffer_pool_recycle string
db_block_buffers integer 17991
log_buffer integer 32768
use_indirect_data_buffers boolean FALSE

If Command Extensions are enabled SET changes as follows:

SET command invoked with a variable name , no equal sign or value displays the value of all variables whose prefix matches the name given to the SET command. For example:

would display all variables that begin with the letter "P."

SET command will set the ERRORLEVEL to 1 if the variable name is not found in the current environment.

SET command will not allow an equal sign to be part of the name of a variable.

Two new switches have been added to the SET command:

SET /A expression
SET /P variable=

The /A switch specifies that the string to the right of the equal sign is a numerical expression that is evaluated. The expression evaluator is pretty simple and supports the following operations, in decreasing order of precedence:

() - grouping
* / % Arithmetic operators.
+ - Arithmetic operators.
<< >> Logical shift.
& Bitwise and.
^ Bitwise exclusive or.
| Bitwise or.
= *= /= %= += -=
&= ^= |= <<= >>=
Assignment.
, Expression separator.

If you use any of the logical or modulus operators, you need to enclose the expression string in quotes. Any non-numeric strings in the expression are treated as environment variable names whose values are converted to numbers before using them. If an environment variable name is specified but is not defined in the current environment, then a value of zero is used. Doing this allows you to do arithmetic with environment variable values without having to type all those % signs to get their values. If SET /A is executed from the command line outside of a command script, then it displays the final value of the expression. The assignment operator requires an environment variable name to the left of the assignment operator. Numeric values are decimal numbers unless prefixed by 0x for hexadecimal numbers, and 0 for octal numbers. So 0x12 is the same as 18 is the same as 022. Note: the octal notation can be confusing: 08 and 09 are not valid numbers because 8 and 9 are not valid octal digits.

The /P switch allows you to set the value of a variable to a line of input entered by the user. Displays the specified promptString before reading the line of input. The promptString can be empty.

Environment variable substitution has been enhanced as follows:

%PATH:str1=str2%

would expand the PATH environment variable, substituting each occurrence of str1 in the expanded result with str2 . str2 can be the empty string to effectively delete all occurrences of str1 from the expanded output. str1 can begin with an asterisk, which matches everything from the beginning of the expanded output to the first occurrence of the remaining portion of str1.

May also specify substrings for an expansion.

%PATH:~10,5%

would expand the PATH environment variable, and then use only the 5 characters that begin at the 11th (offset 10) character of the expanded result. If the length is not specified, then it defaults to the remainder of the variable value. If either number (offset or length) is negative, then the number used is the length of the environment variable value added to the offset or length specified.

%PATH:~-10%

would extract the last 10 characters of the PATH variable.

%PATH:~0,-2%

would extract all but the last 2 characters of the PATH variable.

Finally, support for delayed environment variable expansion has been added. This support is always disabled by default, but may be enabled/disabled via the /V command line switch to CMD.EXE. See CMD /?

Delayed environment variable expansion is useful for getting around the limitations of the current expansion that happens when a line of text is read, not when it is executed. The following example demonstrates the problem with immediate variable expansion:

Set VAR=before if "%VAR%" == "before" (set VAR=after; if "%VAR%" == "after" @echo If you see this, it worked)

would never display the message, because %VAR% is expanded when the lie is read into memory. Changes that occur to the variable after that (such as VAR=after in our compound if statement) will not be expanded.

Similarly, the following example will not work as expected:

Set LIST= for %i in (*) do set LIST=%LIST% %i echo %LIST%

in that it will NOT build up a list of files in the current directory, but instead will set the LIST variable to the last file found. Again, this is because the %LIST% is expanded once when the FOR statement is read, and at that time the LIST variable is empty. So the actual FOR loop we are executing is:

For %i in (*) do set LIST= %i

which keeps setting LIST to the last file found.

Delayed environment variable expansion allows you to use a different character (the exclamation mark) to expand environment variables at execution time. If delayed variable expansion is enabled, the above examples could be written as follows to work as intended:

Set VAR=before if "%VAR%" == "before" (set VAR=after if "!VAR!" == "after" @echo If you see this, it worked) set LIST= for %i in (*) do set LIST=!LIST! %i echo %LIST%

If Command Extensions are enabled, then there are several dynamic environment variables that can be expanded, which don"t show up.

The list of variables displayed by SET. These variable values are computed dynamically each time the value of the variable is expanded. If the user explicitly defines a variable with one of these names, then that definition will override the dynamic one described below:

%CD% - expands to the current directory string.

%DATE% - expands to current date using the same format as DATE command.

%TIME% - expands to current time using the same format as TIME command.

%RANDOM% - expands to a random decimal number between 0 and 32767.

%ERRORLEVEL% - expands to the current ERRORLEVEL value

%CMDEXTVERSION% - expands to the current Command Processor Extensions version number.

%CMDCMDLINE% - expands to the original command line that invoked the command processor.

Windows 2000 and Windows XP recovery console syntax

set =

allowwildcards
allowallpaths
allowremovablemedia
nocopyprompt
Setting the enviroment_variable to true enables the enviroment_variable. By default, these are set to False .

MS-DOS, Windows 95, Windows 98, Windows ME syntax

Displays, sets, or removes Windows environment variables.

SET ]

variable Specifies the environment variable name.
string Specifies a series of characters to assign to the variable.

Type SET without parameters to display the current environment variables.

Set examples

set path=c:\windows\command

Set the path to c:\windows\command.

Notice: Users in Microsoft Windows 2000 and Windows XP may have difficulty defining the set values through the MS-DOS prompt. See the link below for setting variables within Windows.

set

Display all of the set environment variables currently defined.

How to use the set command as a substitute for the choice command in Windows 2000 and Windows XP

In the example below, a user would be prompted to enter an option of 1,2, or 3 to print hello , bye , or test .

@ECHO off
cls
:start
ECHO.
ECHO 1. Print Hello
ECHO 2. Print Bye
ECHO 3. Print Test
set choice=
set /p choice=Type the number to print text.
if not "%choice%"=="" set choice=%choice:~0,1%
if "%choice%"=="1" goto hello
if "%choice%"=="2" goto bye
if "%choice%"=="3" goto test
ECHO "%choice%" is not valid, try again
ECHO.
goto start
:hello
ECHO HELLO
goto end
:bye
ECHO BYE
goto end
:test
ECHO TEST
goto end
:end

Secret commands

If you wanted to hide all your directories from users, you could use:

SET DIRCMD=0

The above command prevents anyone from seeing the directories; however, they can still be accessed. To allow the directories to be visible again, type the command below.