Help with Scripts

Go down

Re: Help with Scripts

Post  motiv on Mon Sep 22, 2008 6:52 am

come on grem, what help you want. We aint all psycic Very Happy
avatar
motiv

Posts : 45
Join date : 2008-09-03

View user profile

Back to top Go down

Re: Help with Scripts

Post  Grem` on Mon Sep 22, 2008 6:57 am

motiv wrote:come on grem, what help you want. We aint all psycic Very Happy

Lol motiv, my post disappeared! Basically, need a script that does rocket jump for soldier only, and doesnt activate for other classes bounce
avatar
Grem`

Posts : 272
Join date : 2008-09-03

View user profile

Back to top Go down

Re: Help with Scripts

Post  motiv on Mon Sep 22, 2008 7:09 am

------------------------------------------------------------
this is a bunch of scripts for different classes
-------------------------------------------------------------


Setting up cfg’s to execute with your selected class.

Remember how in TFC you could use the setinfo "ec" "1" command to auto execute class scripts? Well you can’t here. So forget about it. Instead, add this to the autoexec.cfg. (Credit: Patty)

//CLASS ALIASES
Alias scoutcfg "exec scout.cfg"
Alias snipercfg "exec sniper.cfg"
Alias soldiercfg "exec soldier.cfg"
Alias demomancfg "exec demoman.cfg"
Alias mediccfg "exec medic.cfg"
Alias hwguycfg "exec hwguy.cfg"
Alias pyrocfg "exec pyro.cfg"
Alias spycfg "exec spy.cfg"
Alias engineercfg "exec engineer.cfg"

//CLASS BINDINGS
BIND "KP_END" "scoutcfg"
BIND "KP_DOWNARROW" "snipercfg"
BIND "KP_PGDN" "soldiercfg"
BIND "KP_LEFTARROW" "demomancfg"
BIND "KP_5" "mediccfg"
BIND "KP_RIGHTARROW" "hwguycfg"
BIND "KP_HOME" "pyrocfg"
BIND "KP_UPARROW" "spycfg"
BIND "KP_PGUP" "engineercfg"

This will make it so that every time you press the corresponding button, it will load that config for the class, which will set up your keys and activate your scripts. That does mean you’ll have to make the configs stated above, but that shouldn’t be an issue now.

General Scripts

In this script, pressing “p” toggles this script on and off. What happens here is that after you shoot, it waits, and then will reload after a set amount of time. (Credit: kerneld)

//Auto Reload
bind mouse1 "+shootNreload"
bind p "reloadON"
alias reloadON "bind mouse1 +shootNreload; developer 1; echo ** Idle Auto-Reload ON **; wait 10; developer 0; bind p reloadOFF"
alias reloadOFF "bind mouse1 +attack; developer 1; echo ** Idle Auto-Reload OFF **; wait 10; developer 0; bind p reloadON"
alias +shootNreload "+attack"
alias -shootNreload "-attack; wait 10; +reload; wait 50; -reload"

---------------------------------------------------

This is a weapon switching script. Only switches between your main and secondary weapons. This is a cleaner version of what was posted here. This script allows users to bind any number of keys/buttons to the same function. (This does not include the melee function.) (Credit: Greeze)>>

//Alias-only Weapons Switching
alias weaponSet "primary"
alias primary "slot1; wait; alias weaponSet secondary"
alias secondary "slot2; wait; alias weaponSet primary"

//Now bind whatever you like to weaponSet. For example,
bind "MWHEELUP" "weaponSet"
bind "MWHEELDOWN" "weaponSet">>

---------------------------------------------------

This is a duck toggle script. Press "c" once to crouch, press again to stand up. (Credit: Greeze)

//Duck Toggle
alias duckToggle "duck1"
alias duck1 "+duck; alias duckToggle duck2"
alias duck2 "-duck; alias duckToggle duck1"

//Duck Toggle Key Binding:
bind "c" "duckToggle">>

Class Specific scripts (add these to your class cfg’s)

Soldier Scripts

Here’s a good ol’ fashioned rocket jump script for you guys who just can’t get it right. (Credit: RayneJarre)

//Rocket Jump
alias +rocketjump "+jump;+duck;wait;+attack"
alias -rocketjump "-jump;-attack;wait;wait;wait;-duck"
bind mouse2 "+rocketjump"

Just look down and press mouse2.

Engineer Scripts

This is Patty’s engineer script. I’ve posted it verbatim so you can fully understand it.

Next is my engineer script. I left it open ended on the sentry placement to allow for rotation. The other three should place with one button. Also, holding down one button will upgrade and letting go will switch back to shotgun. Can also be used to melee peeps down.

developer 1
echo "***PATCHER'S ENGINEER SCRIPT LOADED***"
wait 100
developer 0

//BUILD SENTRY-DISPENSER-ENTRANCE-EXIT ALLOWS USE OF M TO ROTATE BEFORE SENTRY PLACEMENT
alias sentry1 "build 3"
alias dispenser1 "build 0; wait 50; +attack; wait; -attack; slot1"
alias entrance1 "build 1; wait 50; +attack; wait; -attack; slot1"
alias exit1 "build 2; wait 50; +attack; wait; -attack; slot1"

//BUILD KEY BINDINGS
bind "f1" "sentry1"
bind "f2" "dispenser1"
bind "f3" "entrance1"
bind "f4" "exit1"


////DESTROY SENTRY-DISPENSER-ENTRANCE-EXIT
alias sentry2 "destroy 3"
alias dispenser2 "destroy 0"
alias entrance2 "destroy 1"
alias exit2 "destroy 2"

//DESTROY KEY BINDINGS
bind "f6" "sentry2"
bind "f7" "dispenser2"
bind "f8" "entrance2"
bind "f9" "exit2"


//HOLD DOWN MOUSE3 TO SWING WRENCH FOR UPGRADE THEN LETTING GO SWITCHES BACK TO SHOTGUN
alias +upgrade1 "slot3; +attack"
alias -upgrade1 "-attack; wait; slot1"
bind "mouse3" "+upgrade1"
bind "mouse1" "+attack"

Spy Scripts

This is another of Patty’s scripts, once again posted verbatim.

Finally [this is] my spy script. This is a little more complicated than my engineer script. I'll just let you guys look it over.

developer 1
echo "***PATCHER'S SPY SCRIPT LOADED***"
wait 100
developer 0

//DISABLE SENTRY GUN - HOLD DOWN THE BUTTON AND IT WILL AUTOMATICALLY PLACE THE DEVICE - LET GO TAKES YOU BACK TO KNIFE
alias +destsent "slot2; +attack"
alias -destsent "-attack; wait; slot3"
bind "l" "+destsent"

//CHANGE CLASSES - CUSTOM SPY SCRIPT

//BLUE TEAM ALIASES
alias redscout "disguise 1 2"
alias redsniper "disguise 2 2"
alias redsoldier "disguise 3 2"
alias reddemoman "disguise 4 2"
alias redmedic "disguise 5 2"
alias redhwguy "disguise 6 2"
alias redpyro "disguise 7 2"
alias redspy "disguise 8 2"
alias redengineer "disguise 9 2"

//RED TEAM ALIASES
alias bluescout "disguise 1 1"
alias bluesniper "disguise 2 1"
alias bluesoldier "disguise 3 1"
alias bluedemoman "disguise 4 1"
alias bluemedic "disguise 5 1"
alias bluehwguy "disguise 6 1"
alias bluepyro "disguise 7 1"
alias bluespy "disguise 8 1"
alias blueengineer "disguise 9 1"


//SETS F1-F9 TO DISGUISE INTO EACH CLASS 1=SCOUT 2=SNIPER 3=SOLDIER 4=DEMOMAN 5=MEDIC 6=HWGUY 7=PYRO 8=SPY 9=ENGINEER
alias BLUETEAM "bind f1 redscout; bind f2 redsniper; bind f3 redsoldier; bind f4 reddemoman; bind f5 redmedic; bind f6 redhwguy; bind f7 redpyro; bind f8 redspy; bind f9 redengineer"
alias REDTEAM "bind f1 bluescout; bind f2 bluesniper; bind f3 bluesoldier; bind f4 bluedemoman; bind f5 bluemedic; bind f6 bluehwguy; bind f7 bluepyro; bind f8 bluespy; bind f9 blueengineer"

//SWITCHES UP F10 TO TOGGLE BETWEEN COLORS DEPENDING ON WHICH TEAM YOU ARE ON
alias toggletored "alias changecolor setred"
alias toggletoblue "alias changecolor setblue"

//CHANGES THE BINDINGS AND LETS YOU CHOOSE BINDS APPROPRIATE TO YOUR TEAMS COLOR
alias setred "REDTEAM; redannounce; toggletoblue"
alias setblue "BLUETEAM; blueannounce; toggletored"

//TEAM ANNOUNCE ALIAS
alias redannounce "developer 1; echo ***I AM ON RED TEAM***; wait 100; developer 0"
alias blueannounce "developer 1; echo ***I AM ON BLUE TEAM***; wait 100; developer 0"

//DEFAULT TEAM IS RED
alias changecolor "setred"
Bind "F10" "CHANGECOLOR"

//MAKES IT SO THAT AS SOON AS YOU STOP ATTACKING YOU AUTOMATICALLY REDISGUISE
alias +backstab1 "+attack"
alias -backstab1 "-attack; lastdisguise"
bind "mouse1" "+backstab1"
bind "mouse3" "slot3"

---------------------------------------------------

This script auto-disguises “randomly” after a back stab. Posted verbatim. (Credit: kerneld)

Note: credit, where credit is due (besides Stryfex's great, and hard, work, of course) .. I'm gonna use part of Patty's Spy code here

alias +backstab1 "+attack"
alias -backstab1 "-attack; nextdisguise"
bind "mouse1" "+backstab1"
bind p "tooglecolorRed"

alias tooglecolorRed "alias nextdisguise RedDemo; developer 1; echo ** Using RED Disguises **; wait 10; developer 0; bind p tooglecolorBlue"
alias tooglecolorBlue "alias nextdisguise BlueDemo; developer 1; echo ** Using BLUE Disguises **; wait 10; developer 0; bind p tooglecolorRed"
alias nextdisguise "BlueDemo"

//RED TEAM ALIASES
alias BlueDemo "disguise 4 1; wait; alias nextdisguise BlueEngy"
alias BlueEngy "disguise 9 1; wait; alias nextdisguise BlueSniper"
alias BlueSniper "disguise 2 1; wait; alias nextdisguise BluePyro"
alias BluePyro "disguise 7 1; wait; alias nextdisguise BlueDemo"

//BLUE TEAM ALIASES
alias RedDemo "disguise 4 2; wait; alias nextdisguise RedEngy"
alias RedEngy "disguise 9 2; wait; alias nextdisguise RedSniper"
alias RedSniper "disguise 2 2; wait; alias nextdisguise RedPyro"
alias RedPyro "disguise 7 2; wait; alias nextdisguise RedDemo"

-- Starts always with Blue Team, and everytime you press the 'toogle color' button, and right at the beginning, starts the cycle with the DemoMan.

Medic Scripts

This is an upgraded version of the auto-medigun script. Fixes some bugs the previous script had. Just press "pgup" and you'll
automatically start healing your target with no more input from yourself. (Credit: Essobie)

//Auto-Medigun
alias +automedigun "-attack; use tf_weapon_medigun; wait 3; +attack"
alias -automedigun "">>
alias syringegun "-attack; use tf_weapon_syringegun_medic; -reload">>
alias bonesaw "-attack; use tf_weapon_bonesaw; -reload">>

bind "PGUP" "+automedigun" // Tap to select new heal target.
bind "MWHEELUP" "syringegun" // Use to select Syringe Gun (and disable AutoMedigun)
bind "MWHEELDOWN" "bonesaw" // Use to select Bonesaw (and disable AutoMedigun)>>

Sniper Scripts

Here’s another script from Patty that gives sniping the good old TFC feel. Posted verbatim.

Ok the below script was written by Stryfex, I just tweaked the wait times a bit. Anyone not on broadband might have to increase the wait commands further.

Basically the way it works is holding down the mouse 1 button zooms in and charges the shot. Letting go of mouse one fires and zooms out. It operates a lot like TFC sniper riffle which I'm used too.

Please note that this will essentially screw up your mouse 1 for other weapons.

//OLD SKOOL TFC SNIPER STYLE
alias +tfcsniper "+attack2; wait 25; -attack2"
alias -tfcsniper "+attack; wait 100; -attack; +attack2; wait 25; -attack2"
bind mouse1 +tfcsniper

Demoman Scripts

In this script, just fire off a sticky bomb, run over it, and push x. (Credit: Not sure, educate me if you can)

//Classic Pipebomb Jump
alias +pj "+lj; +attack2"
alias -pj "-lj"
alias +lj "+duck;wait;wait;+jump"
alias -lj "-duck;-jump; -attack2"
bind "x" +pj

Utilizing a default.cfg

Here’s something from me that may prove useful to you in your scripting and binding adventures.

Make a config file called default; in there you can add Patty’s class selection script, slot toggle scripts, voice bindings, basically any script or bind that will get over written by a class config. Now in all your class configs add:

BIND “x” “exec default.cfg”

Doing this sets your controls back up to the way they were before you used a class config. This will free up more keys for your binding and scripting pleasure.

A look at practical binding

Scripts may be the zenith of custom configuration, but let's not forget that some simple binds can make your life that much easier. For example, this binding combo shows that the primary weapon is bound to mouse1, the secondary to mouse2, and the melee weapon to mouse 3.

bind "mouse1" "slot1"
bind "mouse2" "slot2"
bind "mouse3" "slot3"

Being bound this way makes it so that in the heat of battle, with all your frantic clicking and button smashing, you'll get the weapon you want, and not over shoot it and accidently pull out your melee weapon when you wanted your secondary. This can be set up in any config you want, including your config.cfg. You can also set this up simply by using the keyboard settings option that TF2 supplies.
avatar
motiv

Posts : 45
Join date : 2008-09-03

View user profile

Back to top Go down

Re: Help with Scripts

Post  Grem` on Mon Sep 22, 2008 10:37 am

Thats the one I tried motiv. I put the following in my autoexec

//CLASS ALIASES
Alias scoutcfg "exec scout.cfg"
Alias snipercfg "exec sniper.cfg"
Alias soldiercfg "exec soldier.cfg"
Alias demomancfg "exec demoman.cfg"
Alias mediccfg "exec medic.cfg"
Alias hwguycfg "exec hwguy.cfg"
Alias pyrocfg "exec pyro.cfg"
Alias spycfg "exec spy.cfg"
Alias engineercfg "exec engineer.cfg"

//CLASS BINDINGS
BIND "KP_END" "scoutcfg"
BIND "KP_DOWNARROW" "snipercfg"
BIND "KP_PGDN" "soldiercfg"
BIND "KP_LEFTARROW" "demomancfg"
BIND "KP_5" "mediccfg"
BIND "KP_RIGHTARROW" "hwguycfg"
BIND "KP_HOME" "pyrocfg"
BIND "KP_UPARROW" "spycfg"
BIND "KP_PGUP" "engineercfg"

And I put the following in my soldier.cfg

//Rocket Jump
alias +rocketjump "+jump;+duck;wait;+attack"
alias -rocketjump "-jump;-attack;wait;wait;wait;-duck"
bind mouse2 "+rocketjump"

This makes me do a rj for all classes. Kinda annoying when your trying to play spy and instead of cloaking your jumping and shooting Sad
avatar
Grem`

Posts : 272
Join date : 2008-09-03

View user profile

Back to top Go down

Re: Help with Scripts

Post  Sponsored content


Sponsored content


Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum