Mintman
Jan 24 2005, 12:30 PM
The title says it all, this is a thread where you can ask me for a script that does something and I'll write it for you. I'll then make all the answers into some kind of combined tutorial/reference thing to give people real examples for them to mash about.
Faskalia
Jan 24 2005, 03:55 PM
Well, I always wondered if it possible to make a real bhop script, witheout special :
The script should do the following:
-I keep jumping, as long as i hold my jump key. (resulting in perfect jumps)
-When i release my jump key it stops jumping.
So try to make a script that permanently spams the jump command, witheout using special.
I am really interested in the results.
SpaceJesus
Jan 24 2005, 04:52 PM
Without _special, afaik that isn't possible.
The +jump command only jumps once if there is no -jump command after it. eg;
| CODE |
alias +bhop "+jump" alias -bhop "-jump"
|
The only possible way I can think of doing this would be to have a script including recursion, however I'm not sure if that's possible in HL scripting (an alias that calls itself from inside itself) eg;
| CODE |
alias bhop "+jump;w;-jump;w;+jump;w;-jump; bhop"
|
Also I'm not sure if there would be any way to stop the jump commands, unless ....
| CODE |
alias bhop "+jump;w;-jump;w;+jump;w;-jump; bhop" alias +bhop "bhop" alias -bhop "-jump;w;-jump;w;-jump"
|
Not too sure if that would work but it might do.
There probably isn't any realistic way of doing this without raping your controls response time. Without _special.
Mintman
Jan 24 2005, 05:51 PM
Scripts prevent you from executing any other command whilst they are running unless you are using a _special script. So you could have a script that jumped for you constantly, but you wouldn't be able to use your strafe keys, firing keys or anything else so you would have no other control. So in answer to your question, that isn't possible without you not being able to do anything else.
Also, scripts can only be of a predefined length so once it starts there is no way of making it stop. Putting it on a +/- script does not change this.
Quaunaut
Jan 24 2005, 06:09 PM
I would like a script that will turn on a pistol script when I go to my pistol. I only use my number keys to switch weapon(mwheel is for flashlight[up], and bhop[down]). <3 Thankee!
Mintman
Jan 24 2005, 06:23 PM
First of all you'll need a seperate marine and alien config, unless you want the same effect for parasite, healspray etc. If you need to know how to do this then look in a scripting tutorial or if you can't find out then ask me again in a seperate question.
| CODE |
alias +pistol "+attack; wait; -attack" alias -pistol "+attack; wait; -attack"
alias normalfire "bind mouse1 +attack" alias pistolfire "bind mouse1 +pistol"
bind "1" "slot1; normalfire" bind "2" "slot2; pistolfire" bind "3" "slot3; normalfire" bind "4" "slot4; normalfire" |
This could be done slightly differently which would possibly work a bit quicker, but would take much more code and would be much harder to follow.
SaltzBad
Jan 24 2005, 07:51 PM
A script that makes me a sandwhich.
BobTheJanitor
Jan 24 2005, 08:00 PM
| QUOTE (SaltzBad @ Jan 24 2005, 01:51 PM) |
| A script that makes me a sandwhich. |
alias +sandwich "say Hey Saltzbad, if I can own your lerk with my knife, you have to make me a sandwich; +attack"
alias -sandwich "-attack; say LOL"
Bind mouse1 +sandwich
Oh wait, that's a script that makes ME a sandwich.
Pho3niX
Jan 24 2005, 08:18 PM
RoffleCaekz
God_Killer
Jan 24 2005, 08:39 PM
Okay, I got 2 that I never managed to make work...
1- An all out attack for lerk, meaning, spores, umbra, primal, then switches to bite in one key
2- A backwards long jump without affecting aiming view (where you see)
I know there kinda evil scripts but, I'm sure I saw ppl with 2nd one, first one I don't know...
God_Killer
Jan 24 2005, 09:06 PM
I was making a switch script for the auto pistol script here goes
in autoexec
alias pistswitch PWNon
alias PWNon "exec dpist.cfg; speak two"
alias PWNoff "exec npist.cfg; speak one"
dpist.cfg
alias +pistol "+attack; wait; -attack"
alias -pistol "+attack; wait; -attack"
alias normalfire "bind mouse1 +attack"
alias pistolfire "bind mouse1 +pistol"
bind "1" "slot1; normalfire"
bind "2" "slot2; pistolfire"
bind "3" "slot3; normalfire"
bind "4" "slot4; normalfire"
npist.cfg
bind "1" "slot1"
bind "2" "slot2"
bind "3" "slot3"
bind "4" "slot4"
But it doesnt work, really don't know why...altough, I fire faster no script!
Even the _special one is slower then my finger, real weird.
Oh, is there a command to spam a script every "x" seconds, with of course, a switch on and off?
Quaunaut
Jan 24 2005, 09:46 PM
| QUOTE (Mintman @ Jan 24 2005, 11:23 AM) |
First of all you'll need a seperate marine and alien config, unless you want the same effect for parasite, healspray etc. If you need to know how to do this then look in a scripting tutorial or if you can't find out then ask me again in a seperate question.
| CODE | alias +pistol "+attack; wait; -attack" alias -pistol "+attack; wait; -attack"
alias normalfire "bind mouse1 +attack" alias pistolfire "bind mouse1 +pistol"
bind "1" "slot1; normalfire" bind "2" "slot2; pistolfire" bind "3" "slot3; normalfire" bind "4" "slot4; normalfire" |
This could be done slightly differently which would possibly work a bit quicker, but would take much more code and would be much harder to follow.
|
By quicker, do you mean I could just do a quick-click? Thats what I'm looking for. While this is good, I also have to slow down my rate of fire *significantly*, thus making it worthless.
Mintman
Jan 25 2005, 03:01 AM
Well most people can reach the max RoF of the pistol anyway, the pistol script just in theory gives you more control as you don't have to click as fast. So if you don't feel the script helps you at all just don't use it!
And God Killer, you never initialise either script or make a way of switching between the two. By your script you will always end up with the default binds. Also there is no way to create a script the triggers at a period X without losing the ability to use any other controls.
Mintman
Jan 25 2005, 03:05 AM
| QUOTE (God Killer @ Jan 24 2005, 08:39 PM) |
Okay, I got 2 that I never managed to make work...
1- An all out attack for lerk, meaning, spores, umbra, primal, then switches to bite in one key
2- A backwards long jump without affecting aiming view (where you see)
I know there kinda evil scripts but, I'm sure I saw ppl with 2nd one, first one I don't know... |
The first one would be hard to make work consistently AND quickly due to lag and fps issues, though it would be a case of "slot, waits, attack, waits, slot, waits, attack, etc"
The second would be much better executed through practise as any script would only work for specific angles rather than any situation as practice would allow for. Plus scripting a backwards bunnyhop would be damn difficult and kinda haxing, which I wouldn't condone or put in the effort to create.
Uzguz
Jan 25 2005, 04:07 PM
| QUOTE (SpaceJesus @ Jan 25 2005, 02:52 AM) |
Without _special, afaik that isn't possible. The +jump command only jumps once if there is no -jump command after it. eg;
| CODE | alias +bhop "+jump" alias -bhop "-jump"
|
The only possible way I can think of doing this would be to have a script including recursion, however I'm not sure if that's possible in HL scripting (an alias that calls itself from inside itself) eg;
| CODE | alias bhop "+jump;w;-jump;w;+jump;w;-jump; bhop"
|
Also I'm not sure if there would be any way to stop the jump commands, unless ....
| CODE | alias bhop "+jump;w;-jump;w;+jump;w;-jump; bhop" alias +bhop "bhop" alias -bhop "-jump;w;-jump;w;-jump"
|
Not too sure if that would work but it might do. There probably isn't any realistic way of doing this without raping your controls response time. Without _special.
|
Don't ever, ever try to use a recursive script. I tried that once for a strobe flashlight without _special, and am still haunted by the memories.
MiMiC
Jan 25 2005, 05:33 PM
infinite loops are never a good thing
Alkiller
Jan 26 2005, 02:26 AM
| QUOTE (Mintman @ Jan 24 2005, 01:23 PM) |
First of all you'll need a seperate marine and alien config, unless you want the same effect for parasite, healspray etc. If you need to know how to do this then look in a scripting tutorial or if you can't find out then ask me again in a seperate question.
| CODE | alias +pistol "+attack; wait; -attack" alias -pistol "+attack; wait; -attack"
alias normalfire "bind mouse1 +attack" alias pistolfire "bind mouse1 +pistol"
bind "1" "slot1; normalfire" bind "2" "slot2; pistolfire" bind "3" "slot3; normalfire" bind "4" "slot4; normalfire" |
This could be done slightly differently which would possibly work a bit quicker, but would take much more code and would be much harder to follow.
|
Will this script delay the time from which I can switch to my pistol and then fire significantly?
ReK
Jan 26 2005, 04:44 AM
Not for the switching. For the firing, however, you will have to actually click the button slower than normal, to give the game time to register the shots, but it will fire faster.
Mintman
Jan 26 2005, 03:04 PM
What he said. The built in delay, with draw animations etc, covers the time needed for the script to run so you should notice no difference in the time switching weapons to firing.
And I assume ReK is talking about firing slower with the pistol script. I've never used one so I can't comment on that.
ReK
Jan 27 2005, 03:22 AM
To elaborate, with hud_fastswitch 1, you will not notice any difference in the switch speed. That goes for 0 as well. When actually firing, however, you will need to click at a slower rate in order to give the game time to clear the sprites. You could just spaz out on the button, but that will just tire your finger for no reason. It is essentially like trying to fire a bolt-action rifle while you're drawing back the bolt, you can click the button, but nothing will happen.
Also, I'm not sure on this, but spaz-clicking enough when the sprites aren't clearing could cause glitches. I haven't seen it myself, but a few friends have said that they get something similar to if you don't put enough waits in a switching script...
Bait_Boy
Jan 27 2005, 03:41 AM
Recursive?
ReK
Jan 27 2005, 04:04 AM
Not sure, I've never left out the waits

I'm just repeating what they said.
PeCh
Jan 27 2005, 07:24 PM
if someone will make me script that eveyshot with my pistol it will to trun on my flashlight it'll be nice..
and sorry about my bad english.
thanks
lordofokra
Jan 27 2005, 11:38 PM
| CODE |
alias +flps "+attack; wait; impulse 100" alias -flps "-attack; wait; impulse 100" bind key +flps
|
Audax
Feb 1 2005, 05:24 AM
Can someone give me an example of a harmless _special script? I've heard a lot about them, but never seen one.
Mr_Sneaky
Feb 1 2005, 12:17 PM
Hello Minty
I know this wont be much of a challenge but i have gone a bit code blind and would appreciate this being done for me.
I would like key "f" to be used for when i fade to blink when it is held down and switch to swipe when i release.
I would like to bind "r" to be used for when im a skulk to leap when held and switch to bite when released.
can you also confirm how i place these in my autoexec.cfg to load every time i play.
Thanks for helping a code tard!
Shadow
Feb 1 2005, 01:35 PM
how to make a separed config for aliens and marines (prob a stupid question)
obuh
Feb 1 2005, 02:22 PM
Go in your ns folder and create the configuration files (make sure they have a .cfg extension).
Then put this in your userconfig.cfg file in the ns folder (create if it doesn't exist).
| CODE |
alias join1 "exec marines.cfg;jointeamone" alias join2 "exec aliens.cfg;jointeamtwo" |
Then bind the wanted keys (in config.cfg or typing it in console). For example :
| CODE |
bind F1 join1 bind F2 join2 |
2_of_Eight
Feb 2 2005, 03:01 AM
Let's say I'm lerk. I'm on bite, and I use it the most. However, I want to have one button that lets me fire a spore and instantly switch back to bite. Another button would let me fire an umbra and instantly switch back to bite. Is that possible, and how?
What about with mp_bs 1?
SLizer
Feb 2 2005, 12:32 PM
| QUOTE (2 of Eight @ Feb 1 2005, 10:01 PM) |
Let's say I'm lerk. I'm on bite, and I use it the most. However, I want to have one button that lets me fire a spore and instantly switch back to bite. Another button would let me fire an umbra and instantly switch back to bite. Is that possible, and how?
What about with mp_bs 1? |
I would also like script that allows me to have bite as a main attack but button that shoots spore and changes back.
Swift_Idiot
Feb 2 2005, 04:54 PM
I don't know if this has been answered before but I've been posting this set of scripts ever since I found out every time there's been an opportunity. Now I can spam them and tbh be totally within the limits of da law.
alias +s1 "slot1;wait;+attack;"
alias -s1 "-attack;"
alias +s2 "slot2;wait;+attack;
alias -s2 "-attack;wait;slot1"
alias +s3 "slot3;wait;+attack;
alias -s3 "-attack;wait;slot1"
alias +s4 "slot4;wait;+attack;
alias -s4 "-attack;wait;slot1"
Allows binding different buttons to switch to and use various weapon slots separate from mouse1.
The way it goes is, when you press the button, it switches as fast as the game allows to the weapon currently in whichever slot the script concerns, and uses it very much like holding mouse1 would go. +s2 would be pretty boring with the pistol. And I don't think it works with welders with mines or hand grenades. When you let up, it switches to slot1 as fast as the game allows. Due to the way switching weapon animations can be instant or delayed for the aliens, these scripts might seem pretty unimpressive most of the time. +s2 with the lerk will do exactly what you're asking, but it's not like you'll whip around a corner, and spore and bite in the same fifth of a second, because there's a weapon animation that plays between spore and bite, which kind of sucks a little I guess. This might mean that you could switch the script up and make it always switch back to slot2, turning +s1 into one built like the other three and reverse for +s2. I'm way too lazy and busy to mess with my cfg when I don't have time to play much of the actual game itself. Try it and let me know how it goes.
Anyway +s2/-s2 is your spore-bite combo button, blink-slash button, but it's horrible for trying to devour. It's not even close to instant. +s3/-s3 is your meta-slash button, leap-bite button, umbra-bite button, and stomp-gore button. +s4/-s4 is uhhh, I guess for xeno-biting assuming you have a full energy bar, maybe you can be a leetscript combat gorge with every upgrade web-spitting marines to death. I suppose you could write it to switch between acidrocket and metabolize, since at that point you're basically an alien siege cannon anyway and need to switch back and forth between those.
These scripts aren't really useful on bs 1 servers. What they will do is show you the cheery message that screams disconnect now, switch to the slot when the button is held down, but not actually use it. So you have to press the button and press mouse1 at close to the same time then let go of the button to get sort-of results. I don't know how to get great results on bs 1 servers. I assume at that point you just use lastinv and bind some buttons to various slots within easy reach with fastswitch on.
Also someone wanted an innocuous example of a special script. Here's one.
alias flashforever "-attack2; wait; impulse 100;wait;wait;impulse100;wait; +attack2;"
alias "+sflash" "alias _special flashforever; +attack2;"
alias "-sflash" "alias _special; -attack2;"
getting your flashlight to land in the off position is a real pain.
xtcmen
Feb 3 2005, 05:19 AM
Can you make me the fasted speed script eva!
paco
Feb 4 2005, 06:04 AM
i dont like to script... but there is one that i've always wanted. ok, let's say you are reloading your gun and then a

comes rushing at you! is there a script where u can hit your mouse1 and it will cancel the reload and +attack ?
in a jist... when reload, hit mouse1, cancel reload, +attack
surprise
Feb 4 2005, 12:24 PM
hm, you can just change weapons with fastswitch and use the pistol when you where reloading if you used lmg or use lmg if you were reloading the pistol
Firstly, that would only work for the shotty and gl (if the bug is ever fixed), assuming you had put at least 1 shell/nade in already. And secondly, it's much better to just whip out your pistol.
Krazy_Glue
Feb 4 2005, 12:47 PM
alias cancel "slot3; wait; lastinv"
bind <key> cancel
thats a normal cancel reload script
unless you want something that will pull out your knife everythime before you fire you cant do what your asking for
alias +cancel "slot3; wait; lastinv; +attack"
alias -cancel "-attack"
bind mouse1 +cancel
that would be what your asking for however this would happen everytime you fire
Swift_Idiot
Feb 4 2005, 06:34 PM
Rek, I'm not sure about the shotgun, but I know for a fact that even if the grenade launcher animation plays putting a shell in the gun, unless you let the animation finish until you see the number of ammo hit 4, quickswitching back and forth to the grenade launcher will reset the reload completely.
The GL sucks. Oh yeah and I didn't notice that you said there was that bug with the gl already, nvm.
Unless you use another button to fire your gun, I don't think you'd be able to do this with mouse1. What I guess you could do is write a script that switches to ... okay I think I have an idea for this. Assuming you write this script and you're making a different cfg for marines and for aliens, as a marine, you'd use your reload button and mouse1 button as usual, but have a script that will switch to slot3 and then lastinv back to whatever gun you were reloading. With the LMG, I think you'd be able to interupt your reload pretty well doing this, and presumably just as well with the HMG. Not sure about the shotgun. Go try it out.
alias interupt "slot3;wait;lastinv"
I don't read very well some mornings. Yeah try the above scripts, they look solid. you'll have to bind them to a button you can press easily obviously. Depending on how many binds you have already that might be tricky.
The shotgun reloads one shell at a time, just like the gl is supposed to. If your shotty is reloading, just hit attack again and it will stop and fire with whatever number of shells were inside when you stopped. I've done it plenty a time to a skulk's face.
xtcmen
Feb 6 2005, 07:05 AM
I need a script that says "ready to move" And says Need rt/PG When i press the z button.
And i need the fastes wagglewalk you can make.
| CODE |
alias buildme "impulse 14; say_team "Comm, I need a pg/rt here." bind "z" "buildme" |
| CODE |
alias "speedup" "+moveleft;wait;-moveleft;+moveright;wait;-moveright;+moveleft;wait;-moveleft;+moveright;wait;-moveright;+moveleft;wait;-moveleft;+moveright;wait;-moveright;+moveleft;wait;-moveleft;+moveright;wait;-moveright;+moveleft;wait;-moveleft;+moveright;wait;-moveright;+moveleft;wait;-moveleft" alias "speed" "speedup;speedup;speedup;speedup" bind "h" "speed" |
Wiggle walk will always give you the same speed boost. The only real difference is if it's _special or not. This isn't, which means you can't do anything while using it, but it will not be blocked for beta 6.
xtcmen
Feb 7 2005, 05:27 AM
Oh and i remember seeing a script that prevents the no pistol, no knife, in a start of the match. Can you dig me one of those?
a_civilian
Feb 7 2005, 05:50 AM
| CODE |
| alias fix "record temp_bugfix;wait;stop" |
And type "fix" in console when it happens, or bind a key to "fix".
Steel_Monkey
Feb 7 2005, 05:51 AM
This isnt really a script, more of a bind. I want to make it so when i right click as a fade, it metabolizes, and when i release it activates lastinv. Thanks.
I wouldn't mind it if it was just mouse2 switching to metab and activating it. Whatever you guys can do.
ThreeLeggedSkulk
Feb 7 2005, 06:59 AM
| CODE |
alias +quickmeta "slot3; wait; +attack" alias -quickmeta "-attack; wait; slot1; wait; wait; slot2" bind mouse2 "+quickmeta" |
[EDIT]: Tweaked code
Golden
Feb 7 2005, 06:09 PM
| QUOTE (God Killer @ Jan 24 2005, 03:39 PM) |
| 1- An all out attack for lerk, meaning, spores, umbra, primal, then switches to bite in one key |
Both of these *should* work.
alias w "wait;wait;wait;wait"
alias +allout1 "slot2;w;+attack;w;-attack;w"
alias -allout1 "slot3;w;+attack;w;-attack;w"
alias +allout2 "slot4;w;+attack;w;-attack;w"
alias -allout2 "slot1;w"
bind i "+allout1;w;bind i +allout2"
bind o "bind i +allout1"
Basically what happens is:
When you press the key, it fires spores. When you let go, it fires umbra.
When you press it again, it fires umbra. When you let go the second time it switches back to bite.
The second bind resets it to fire spores/umbra. Had to do this because I'm too tired to figure out to automate it.
Or you can bind it like this.
alias +alloutfire "+allout1;w;-allout1;w;+allout2;w"
alias -alloutfire "-allout2;w"
bind i "+alloutfire"
I think you'd just have to hold the key down until you hear the primal go off, then let go to switch back to bite.
Once again these *should* work, I haven't tested them.
God_Killer
Feb 7 2005, 11:11 PM
Too bad the script doesn't work, nt. Maybe just more waits for primal screem would make it work, but from what I can see, primal screem takes too long to start working even with lastinv so spores/umbra are almost gone when bite comes up. I'll just use this one, making a script without testing
alias +gas "slot3; wait; slot2; wait; +attack; wait; lastinv;wait;"
alias - gas "-attack; wait; slot1"
bind q "+gas"
I'll test.
God_Killer
Feb 7 2005, 11:27 PM
Damn, even this doesn't work
alias +gas "slot3; w; slot2; w; w; w; +attack; w; w; w; lastinv; w;"
alias -gas "-attack; w; slot1"
w is wait
If I do the same manually, it works, but in script it doesn't yet. Does FPS play a role in how many waits?
Swift_Idiot
Feb 7 2005, 11:32 PM
It might just be simpler to pick a few buttons for the different attacks and use the usual fastweapon scripts on page 3. You press and release each button for each attack, and you probably get way more control in the process. I don't think anyone can write a script that combines two or three weapons on one button. It would probably be laggy and clunky.
SpaceMoogle5
Feb 8 2005, 11:50 AM
Santa I would like:
An easy to use, great speed increasing, wiggle walk script.
A top level bhop script.
and a uber fast pistola scripto.
and a script that will make my friends not want me dead

when they find out I'm using scripts.
Thanks
SM5
ok i come here with a couple problems that may be easily fixed.
i made a couple tiny scripts to help my skulk and lerk game.
first i made a leap script just because since i use q to lastinv, i couldnt leap then strafe hard left in the air because at somepoint i would have to let go of a and hit q to switch to bite, so if igured why not make a script that leaps then switches to bite for me, and i came up with this
alias +leap1 "slot3;wait;+attack"
alias -leap1 "-attack;wait;slot1"
bind "mouse2" "+leap1"
so, i put this in a config called alien.cfg which is what iuse for all my separate alien tweaks. problem is when i join a game and load up the config it doesnt work, i press mouse2 and nothing happens. i usually have to go into the consol and type bind mouse2 +leap1 then it will work.
my question is why.
thsi goes as well with my two lerk scripts. which are in a separate config as well.
alias +umbra "slot3;wait;+attack"
alias -umbra "-attack;wait;lastinv"
bind "mouse2" +umbra
alias +scream "slot4;wait;+attack"
alias -scream "-attack;wait;lastinv"
bind shift +scream
also, what i did when i made these configs (rine.cfg, alien.cfg and lerk and fade.cfg) is copied and pasted all the info from the last one, assuming that the config before it was executed would be completely cut off so you would need to have all the movment configs in there. could i just have a lerk.cfg with two scripts in them and still have everthing else bound. and lets say i did this and my previous config had mouse2 bound and the new config that was executed had a mouse2, would it auto overwrite when i executed it or would i ahve to put an unbind mouse2 before the bind mouse2 line in the new config?