Mintman's, I Want A Script That... Thread
Mintman
Join Date: 2003-05-30 Member: 16866Members
<div class="IPBDescription">Tell me what you want and I'll write it</div> 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.
Comments
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.
The +jump command only jumps once if there is no -jump command after it. eg;
<!--c1--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>CODE</b> </td></tr><tr><td id='CODE'><!--ec1-->
alias +bhop "+jump"
alias -bhop "-jump"
<!--c2--></td></tr></table><div class='postcolor'><!--ec2-->
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;
<!--c1--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>CODE</b> </td></tr><tr><td id='CODE'><!--ec1-->
alias bhop "+jump;w;-jump;w;+jump;w;-jump; bhop"
<!--c2--></td></tr></table><div class='postcolor'><!--ec2-->
Also I'm not sure if there would be any way to stop the jump commands, unless ....
<!--c1--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>CODE</b> </td></tr><tr><td id='CODE'><!--ec1-->
alias bhop "+jump;w;-jump;w;+jump;w;-jump; bhop"
alias +bhop "bhop"
alias -bhop "-jump;w;-jump;w;-jump"
<!--c2--></td></tr></table><div class='postcolor'><!--ec2-->
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.
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.
<!--c1--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>CODE</b> </td></tr><tr><td id='CODE'><!--ec1-->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"<!--c2--></td></tr></table><div class='postcolor'><!--ec2-->
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.
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.
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...
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?
<!--c1--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>CODE</b> </td></tr><tr><td id='CODE'><!--ec1-->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"<!--c2--></td></tr></table><div class='postcolor'><!--ec2-->
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. <!--QuoteEnd--> </td></tr></table><div class='postcolor'> <!--QuoteEEnd-->
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.
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.
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... <!--QuoteEnd--> </td></tr></table><div class='postcolor'> <!--QuoteEEnd-->
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.
The +jump command only jumps once if there is no -jump command after it. eg;
<!--c1--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>CODE</b> </td></tr><tr><td id='CODE'><!--ec1-->
alias +bhop "+jump"
alias -bhop "-jump"
<!--c2--></td></tr></table><div class='postcolor'><!--ec2-->
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;
<!--c1--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>CODE</b> </td></tr><tr><td id='CODE'><!--ec1-->
alias bhop "+jump;w;-jump;w;+jump;w;-jump; bhop"
<!--c2--></td></tr></table><div class='postcolor'><!--ec2-->
Also I'm not sure if there would be any way to stop the jump commands, unless ....
<!--c1--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>CODE</b> </td></tr><tr><td id='CODE'><!--ec1-->
alias bhop "+jump;w;-jump;w;+jump;w;-jump; bhop"
alias +bhop "bhop"
alias -bhop "-jump;w;-jump;w;-jump"
<!--c2--></td></tr></table><div class='postcolor'><!--ec2-->
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. <!--QuoteEnd--> </td></tr></table><div class='postcolor'> <!--QuoteEEnd-->
Don't ever, <b>ever</b> try to use a recursive script. I tried that once for a strobe flashlight without _special, and am still haunted by the memories.
<!--c1--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>CODE</b> </td></tr><tr><td id='CODE'><!--ec1-->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"<!--c2--></td></tr></table><div class='postcolor'><!--ec2-->
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. <!--QuoteEnd--> </td></tr></table><div class='postcolor'> <!--QuoteEEnd-->
Will this script delay the time from which I can switch to my pistol and then fire significantly?
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.
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...
I'm just repeating what they said.
and sorry about my bad english.
thanks
alias +flps "+attack; wait; impulse 100"
alias -flps "-attack; wait; impulse 100"
bind key +flps
<!--c2--></td></tr></table><div class='postcolor'><!--ec2-->
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!
Then put this in your userconfig.cfg file in the ns folder (create if it doesn't exist).
<!--c1--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>CODE</b> </td></tr><tr><td id='CODE'><!--ec1-->alias join1 "exec marines.cfg;jointeamone"
alias join2 "exec aliens.cfg;jointeamtwo"<!--c2--></td></tr></table><div class='postcolor'><!--ec2-->
Then bind the wanted keys (in config.cfg or typing it in console). For example :
<!--c1--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>CODE</b> </td></tr><tr><td id='CODE'><!--ec1-->bind F1 join1
bind F2 join2<!--c2--></td></tr></table><div class='postcolor'><!--ec2-->
What about with mp_bs 1?
What about with mp_bs 1? <!--QuoteEnd--> </td></tr></table><div class='postcolor'> <!--QuoteEEnd-->
I would also like script that allows me to have bite as a main attack but button that shoots spore and changes back.
<span style='font-size:8pt;line-height:100%'>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"</span>
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.
<span style='font-size:8pt;line-height:100%'>alias flashforever "-attack2; wait; impulse 100;wait;wait;impulse100;wait; +attack2;"
alias "+sflash" "alias _special flashforever; +attack2;"
alias "-sflash" "alias _special; -attack2;"</span>
getting your flashlight to land in the off position is a real pain.