循环式脚本:
循环式脚本实际上就是开关式脚本的多种选择项时的情况,其格式为:
alias "循环开关" "循环第一步"
alias "循环第一步" "alias 循环开关 循环第二步;循环第一步需执行的命令"
alias "循环第二步" "alias 循环开关 循环第三步;循环第二步需执行的命令"
alias "循环第三步" "alias 循环开关 循环第一步;循环第三步需执行的命令"
然后bind "键位" "循环开关"即可。
比如:
alias graph "graph1"
alias graph1 "net_graph 1; alias graph graph2"
alias graph2 "net_graph 2; alias graph graph3"
alias graph3 "net_graph 3; alias graph graph4"
alias graph4 "net_graph 0; alias graph graph1"
然后bind "v" "graph"即可。以后按v键即可实现网络状况图形的切换显示:按一下执行第二句即net_graph 1还有alias graph graph2;再按一下执行第三句即net_graph 2还有alias graph graph3,如此类推,当执行到最后一句时我们需要使循环开关回复到初始的状态所以最后一句net_graph 0执行完命令后,定义alias graph graph1这和第一句是一样的即回复到初始的状态。
按下&松开式脚本:
按下&松开式脚本的格式为:
alias "+按下松开命令" "第一条当按下时执行的命令;第二条当按下时执行的命令"
alias "-按下松开命令" "第一条当松开时执行的命令;第二条当松开时执行的命令"
然后bind "键位" "+按下松开命令"即可。
比如:
alias +qslash "weapon_knife; wait; +attack"
alias -qslash "-attack; lastinv"
然后bind "alt" "+qslash"即可。以后当按下alt键时执行第一句:拿出刀子开始削,当松开alt键时执行第二句:停止削,并拿出上一次拿的武器。
按下&松开的开关式脚本:
按下&松开的开关式脚本实际上就是按下&松开式脚本和开关式脚本的合成,其格式为:
alias "+按下松开命令" "第一条当按下时执行的命令;第二条当按下时执行的命令"
alias "-按下松开命令" "第一条当松开时执行的命令;第二条当松开时执行的命令"
alias "按下松开命令开关" "按下松开命令关闭"
alias "按下松开命令关闭" "alias 按下松开命令开关 按下松开命令打开;bind 键位 原来的命令"
alias "按下松开命令打开" "alias 按下松开命令开关 按下松开命令关闭;bind 键位 +按下松开命令"
然后bind "键位" "按下松开开关"即可。
比如:
alias +qslash "weapon_knife; wait; +attack"
alias -qslash "-attack; lastinv"
alias qslash "qslash_on"
alias qslash_on "alias qslash qslash_off;bind alt +qslash"
alias qslash_off "alias qslash qslash_on;bind alt +strafe"
然后bind "v" "qslash"即可。
以后当按过一次v键后执行第四句:
当按下alt键时执行第一句:拿出刀子开始削,当松开alt键时执行第二句:停止削,并拿出上一次拿的武器。
当再按过一次v键后执行第五句:
alt键恢复为平移键当按下alt键时再按左右转向键则变成左右平移。
在此v键即为"按下松开命令开关"而alt键即为"+按下松开命令"
变位分配式脚本:
变位分配式脚本实际上就是按下&松开式脚本的变例形式,其格式为:
alias "命令a" "命令1;命令2"
alias "命令b" "命令1';命令2'"
bind "初始键位" "命令a"
alias +变位分配 "bind 初始键位 命令b"
alias -变位分配 "bind 初始键位 命令a"
然后bind "键位" "+变位分配"即可。
如:
alias go "radio2; wait;menuselect 1;clmenu"
alias fal "radio2; wait;menuselect 2;clmenu"
alias +metaradio "bind ins fal"
alias -metaradio "bind ins go"
最后:
bind "ins" "go"
bind "alt" "+metaradio"
则当平时按下ins键(即方向键上方的Insert键)因为ins键分配给go命令,所以执行第一句:使用语音信息:Go! Go! Go!
当按下alt键后(按住)执行第三句:ins键分配给了fal命令,此时再按下ins键则使用语音信息:Team,Fall Back!
当松开alt键后执行第四句:ins键又重新分配给了go命令,所以此时再按下ins键则使用语音信息:Go! Go! Go!
大家还可以参考我在打包购买脚本里的变位购买脚本那一部分来熟悉变位分配式脚本
综合运用的例子:
综合运用以上的6种模式的脚本,能使你的CS功能更强大。以下是一些例子:
//----------------------------------------
//| 快速拔刀,松开收刀 |按下&松开式脚本
//----------------------------------------
alias +quickstab "weapon_knife;wait;+attack2"
alias -quickstab "-attack2;lastinv"
//------------------------
//| 蹲跳,超级跳开关 |按下&松开的开关式脚本
//------------------------
alias +cjump "+jump; +duck"
alias -cjump "-jump; -duck"
alias cjump "cjump_on"
alias cjump_on "bind space +cjump; alias cjump cjump_off"
alias cjump_off "bind space +jump; alias cjump cjump_on"
//----------------------------------------
//| 自动完成安装C4炸药 |按下&松开式脚本
//----------------------------------------
alias +plant_c4 "weapon_c4;wait;wait;+attack;+duck;radio1;menuselect 1;say_team I am Planting C4 , cover!;slot10"
alias -plant_c4 "-attack;-duck;lastinv;slot10"
//---------------------------------------------
//| 开火模式 单发/3发/连发 |循环式脚本
//---------------------------------------------
alias burstswitch mode1
alias single "unbind mouse1; +attack; wait; -attack; bind mouse1 single"
alias burst "unbind mouse1; single; single; single; single; single; single; single; bind mouse1 burst"
alias mode1 "bind mouse1 burst; dvon; echo Burst Fire; dvoff; alias burstswitch mode2"
alias mode2 "bind mouse1 +attack; dvon; echo Standard Fire; dvoff; alias burstswitch mode3"
alias mode3 "bind mouse1 single; dvon; echo Single Fire; dvoff; alias burstswitch mode1"
//--------------------------------
//| 改变夜视仪对比度 |基本式脚本
//--------------------------------
alias nvg_u "+nvgadjust; wait; +nvgadjust; wait; +nvgadjust"
alias nvg_d "-nvgadjust; wait; -nvgadjust; wait; -nvgadjust"
//-----------------------------
//| 开/关雷达显示 |开关式脚本
//-----------------------------
alias radar_t radar_off
alias radar_off "alias radar_t radar_on; hideradar"
alias radar_on "alias radar_t radar_off; drawradar"
//-----------------------------
//| 换左/右手持木仓 |开关式脚本
//-----------------------------
alias changehand hand_left
alias hand_left "setinfo lefthand 1;cl_righthand 0;alias changehand hand_right;wait;wait;wait;weapon_knife;lastinv;dvon;echo LEFT HANDED;dvoff"
alias hand_right "setinfo lefthand 0;cl_righthand 1;alias changehand hand_left;wait;wait;wait;weapon_knife;lastinv;dvon;echo RIGHT HANDED;dvoff"
//----------------------------------------------------------
//| 开/关武器模型的显示,消除杂点 |开关式脚本
//----------------------------------------------------------
alias tg_alpha alpha_on
alias alpha_on "gl_alphamin 0.999;r_drawviewmodel 0;alias tg_alpha alpha_off;dvon;echo Clear View;dvoff"
alias alpha_off "gl_alphamin 0.25;r_drawviewmodel 1;alias tg_alpha alpha_on;dvon;echo Normal View;dvoff"
//--------------------------------------------------------
//| 切换显示FPS,PING等其它信息 |循环式脚本
//--------------------------------------------------------
alias tsn shownet1
alias shownet1 "net_graph 1;cl_showfps 0;net_graphsolid 1;alias tsn shownet2"
alias shownet2 "net_graphsolid 0;alias tsn shownet3"
alias shownet3 "net_graph 2;alias tsn shownet4"
alias shownet4 "net_graph 3;alias tsn shownet5"
alias shownet5 "net_graph 0;cl_showfps 1;alias tsn shownetoff"
alias shownetoff "net_graph 0;cl_showfps 0;alias tsn shownet1"
//--------------------------------
//| 模拟上网的PING |循环式脚本
//--------------------------------
alias sim_lag FL100
alias FL100 "fakelag 50;dvon;echo Your PING is 100 now..;dvoff;alias sim_lag FL200"
alias FL200 "fakelag 100;dvon;echo Your PING is 200 now..;dvoff;alias sim_lag FL300"
alias FL300 "fakelag 150;dvon;echo Your PING is 300 now..;dvoff;alias sim_lag FL400"
alias FL400 "fakelag 200;dvon;echo Your PING is 400 now..;dvoff;alias sim_lag FL0"
alias FL0 "fakelag 0;dvon;echo Your PING is 0 now;dvoff;alias sim_lag FL100"
//--------------------
//| 显示时间 |基本式脚本
//--------------------
alias timer "dvon; echo This Script Edited by Nick; dvoff;timeleft"
//----------------------------
//| 改变准星颜色 |基本式脚本
//----------------------------
alias ccc "dvon; echo Crosshair Color Changed ; dvoff;adjust_crosshair"
//-----------------------------
//| 普通功能通知队友版|按下&松开式脚本
//-----------------------------
alias "+rls" "+reload;say_team [Reload]"//换弹夹并通知队友
alias "-rls" "-reload"
alias "+dr" "+use;say_team [Defusing Bomb/Rescuing Hostage]"//拆炸弹或救人质并通知队友
alias "-dr" "-use"
//-----------------------------
//| 打包购买|购买式脚本和变位分配式脚本
//-----------------------------
alias "SMG1" "buyequip;menuselect 1;buy;menuselect 3;menuselect 1;wammo;buyequip;menuselect 4; clmenu;say_team I am Buy [MP5 Value Pack]"//买防弹衣MP5、满的主弹夹、和手雷
alias "SMG1F" "buyequip;menuselect 2;buy;menuselect 3;menuselect 1;wammo;buyequip;menuselect 4;buy;menuselect 1;menuselect 3; sammo;buyequip;menuselect 3;buyequip;menuselect 6;buyequip;menuselect 3;buyequip;menuselect 5; clmenu;say_team I am Buy [MP5 Navy Full Pack]"//买防弹衣和头盔、MP5、Desert Eagle .50AE沙漠之鹰、满的所有弹夹和三种手雷、拆弹器
alias "AR1" "buyequip;menuselect 2;buy;menuselect 4;menuselect 3;buy;menuselect 4;menuselect 1;wammo;buyequip;menuselect 4;buyequip;menuselect 3;buyequip;menuselect 6;buyequip;menuselect 3;clmenu;say_team I am Buy [M4A1/AK47 Normal Pack]"//买防弹衣和头盔、M4A1或AK47、满的主弹夹、手雷和2个闪光弹、拆弹器
alias "AR1F" "buyequip;menuselect 2;buy;menuselect 4;menuselect 3;buy;menuselect 4;menuselect 1;wammo;buyequip;menuselect 4;buyequip;menuselect 3;buyequip;menuselect 6;buy;menuselect 1;menuselect 3;buyequip;menuselect 3;sammo;clmenu;say_team I am Buy [M4A1/AK47 Full Pack]"//买防弹衣和头盔、M4A1或AK47、沙漠之鹰、满的所有弹夹、手雷和2个闪光弹、拆弹器
alias "ARA1" "buyequip;menuselect 1;buy;menuselect 4;menuselect 4;buy;menuselect 4;menuselect 2;wammo;buyequip;menuselect 4;buyequip;menuselect 3;buyequip;menuselect 6; clmenu;say_team I am Buy [SG552/Aug Normal Pack]"//买防弹衣、SG552或Aug、满的主弹夹、手雷和1个闪光弹、拆弹器
alias "ARA1F" "buyequip;menuselect 2;buy;menuselect 4;menuselect 4;buy;menuselect 4;menuselect 2;wammo;buyequip;menuselect 4;buy;menuselect 1;menuselect 3;bs2;buyequip;menuselect 3;buyequip;menuselect 6;buyequip;menuselect 3;clmenu;say_team I am Buy [SG552/Aug Full Pack]"//买防弹衣和头盔、SG552或Aug、满的主弹夹、沙漠之鹰、2个手木仓弹夹、手雷和2个闪光弹、拆弹器
alias "SNFS" "buyequip;menuselect 1;buy;menuselect 4;menuselect 6;wammo;buyequip;menuselect 4; clmenu;say_team I am Buy [AWM/P Value Pack]"//买防弹衣、AWM/P、满的主弹夹、手雷
alias "SNFF" "buyequip;menuselect 2;buy;menuselect 4;menuselect 6;wammo;buy;menuselect 1;menuselect 3;sammo;buyequip;menuselect 4;buyequip;menuselect 3;buyequip;menuselect 6;buyequip;menuselect 3;buyequip;menuselect 5; clmenu;say_team I am Buy [AWM/P Full Pack]"//买防弹衣和头盔、AWM/P、沙漠之鹰、满的所有弹夹、和三种手雷、拆弹器
alias +metabuy "bind DEL SMG1F;bind END AR1F;bind PGDN SNFF;bind HOME ARA1F"//变位购买增强包
alias -metabuy "bind DEL SMG1;bind END AR1;bind PGDN SNFS;bind HOME ARA1"//还原变位购买普通包
//----------------------------
//| 快速切换手雷 |变位分配式脚本+循环式脚本
//----------------------------
alias +metasw "bind MOUSE2 qgsw"
alias -metasw "bind MOUSE2 +attack2;alias qgsw qgswhg"
alias qrgsw "weapon_hegrenade;weapon_flashbang;weapon_smokegrenade"
alias qgsw qgswhg
alias qgswhg "qrgsw;weapon_hegrenade;dvon; echo Quick Select HE Grenade; dvoff;alias qgsw qgswfb"
alias qgswfb "qrgsw;weapon_flashbang;dvon; echo Quick Select FlashBang; dvoff;alias qgsw qgswsg"
alias qgswsg "qrgsw;weapon_smokegrenade;dvon; echo Quick Select Smoke Grenade; dvoff;alias qgsw qgswhg"
//----------------------------
//| 录制Demo录像 |开关式脚本
//----------------------------
alias rec_t rec_off
alias rec_off "alias rec_t rec_on;dvon; echo Now Recording Demo to nicktemp.dem; dvoff;record nicktemp"
alias rec_on "alias rec_t rec_off;dvon; echo Now Record Stopped; dvoff;stop"
//----------------------------
//| 队长战术功能 |基本式脚本
//----------------------------
// 冲A点/到A点协助防守。
alias cs_a "dvon;echo Go to A ; dvoff;say_team Attack/Defence A"
// 冲B点/到B点协助防守。
alias cs_b "dvon;echo Go to B ; dvoff;say_team Attack/Defence B"
最后这是我在CS1.3时闲来无事时编写的一个综合型的脚本,您能看的懂么?(看懂了,应该就已经全学会了,呵呵。)
//Quick AWP Attack
//first You Must Bind a Key to "qawpsw"
//second you must have a AWP (buy/pick)
//than this key will switch your AWP fire Mode in Normal Attack / Quick AWP Click Attack / Quick AWP Release Attack
//Note: Not to use this script in the team match,it's important!
//Create by Nick Cable,12/16/2001
alias qawpsw qawpm1
alias lw "wait;wait;wait;wait;wait;wait;wait;wait;wait;wait"
alias qawpt "bind MOUSE2 +attack2;bind MOUSE1 +attack"
alias +qawpa1 "+attack2;wait;-attack2"
alias -qawpa1 "+attack;wait;-attack;qawpmn;lastinv"
alias +qawpa2 "weapon_awp;wait"
alias -qawpa2 "+attack2;wait;-attack2;+attack;wait;-attack;qawpmn;lastinv"
alias +qawpa3 "weapon_awp;lw;lw;lw;lw"
alias -qawpa3 "+attack2;wait;-attack2;+attack;wait;-attack;qawpmn;lastinv"
alias +qawpa4 "weapon_awp;lw;lw;lw;wait;wait;wait;+attack2;wait;-attack2;+attack;wait;-attack"
alias -qawpa4 "qawpmn;lastinv"
alias qawpm1 "qawpt;weapon_awp;bind MOUSE1 +qawpa1; dvon; echo Quick AWP Release Attack1; dvoff; alias qawpsw qawpm2"
alias qawpm2 "qawpt;bind MOUSE2 +qawpa2; dvon; echo Quick AWP Release Attack2; dvoff; alias qawpsw qawpm3"
alias qawpm3 "qawpt;bind MOUSE1 +qawpa3; dvon; echo Quick AWP Click Attack1; dvoff; alias qawpsw qawpm4"
alias qawpm4 "qawpt;bind MOUSE2 +qawpa4; dvon; echo Quick AWP Click Attack2; dvoff; alias qawpsw qawpmn"
alias qawpmn "qawpt; dvon; echo Normal Attack; dvoff; alias qawpsw qawpm1;bind kp_del qawpsw"