Mintman's, I Want A Script That... Thread

MintmanMintman 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.
«13456712

Comments

  • FaskaliaFaskalia Wechsellichtzeichenanlage Join Date: 2004-09-12 Member: 31651Members, Constellation
    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.
  • SpaceJesusSpaceJesus Join Date: 2004-07-02 Member: 29683Banned
    Without _special, afaik that isn't possible.
    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.
  • MintmanMintman Join Date: 2003-05-30 Member: 16866Members
    edited January 2005
    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.
  • QuaunautQuaunaut The longest seven days in history... Join Date: 2003-03-21 Member: 14759Members, Constellation, Reinforced - Shadow
    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!
  • MintmanMintman Join Date: 2003-05-30 Member: 16866Members
    edited January 2005
    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.
    <!--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.
  • SaltzBadSaltzBad Join Date: 2004-02-23 Member: 26833Members
    A script that makes me a sandwhich.
  • BobTheJanitorBobTheJanitor Join Date: 2003-12-10 Member: 24228Members, NS1 Playtester
    <!--QuoteBegin-SaltzBad+Jan 24 2005, 01:51 PM--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> (SaltzBad @ Jan 24 2005, 01:51 PM)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin-->A script that makes me a sandwhich.<!--QuoteEnd--></td></tr></table><div class='postcolor'><!--QuoteEEnd-->
    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.
  • Pho3niXPho3niX Join Date: 2003-09-22 Member: 21118Members
    RoffleCaekz <!--emo&???--><img src='http://www.unknownworlds.com/forums/html/emoticons/confused-fix.gif' border='0' style='vertical-align:middle' alt='confused-fix.gif' /><!--endemo-->
  • God_KillerGod_Killer Join Date: 2004-02-16 Member: 26592Members
    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_KillerGod_Killer Join Date: 2004-02-16 Member: 26592Members
    edited January 2005
    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?
  • QuaunautQuaunaut The longest seven days in history... Join Date: 2003-03-21 Member: 14759Members, Constellation, Reinforced - Shadow
    <!--QuoteBegin-Mintman+Jan 24 2005, 11:23 AM--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> (Mintman @ Jan 24 2005, 11:23 AM)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin--> 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.
    <!--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.
  • MintmanMintman Join Date: 2003-05-30 Member: 16866Members
    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.
  • MintmanMintman Join Date: 2003-05-30 Member: 16866Members
    <!--QuoteBegin-God Killer+Jan 24 2005, 08:39 PM--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> (God Killer @ Jan 24 2005, 08:39 PM)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin--> 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... <!--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.
  • UzguzUzguz Join Date: 2003-06-05 Member: 17016Members, Constellation
    <!--QuoteBegin-SpaceJesus+Jan 25 2005, 02:52 AM--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> (SpaceJesus @ Jan 25 2005, 02:52 AM)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin--> Without _special, afaik that isn't possible.
    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.
  • MiMiCMiMiC Join Date: 2004-10-03 Member: 32061Members
    infinite loops are never a good thing <!--emo&;)--><img src='http://www.unknownworlds.com/forums/html/emoticons/wink-fix.gif' border='0' style='vertical-align:middle' alt='wink-fix.gif' /><!--endemo-->
  • AlkillerAlkiller Join Date: 2004-05-23 Member: 28847Members
    <!--QuoteBegin-Mintman+Jan 24 2005, 01:23 PM--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> (Mintman @ Jan 24 2005, 01:23 PM)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin--> 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.
    <!--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?
  • ReKReK Join Date: 2004-08-30 Member: 31058Members, Constellation, Reinforced - Shadow, WC 2013 - Silver
    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.
  • MintmanMintman Join Date: 2003-05-30 Member: 16866Members
    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.
  • ReKReK Join Date: 2004-08-30 Member: 31058Members, Constellation, Reinforced - Shadow, WC 2013 - Silver
    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_BoyBait_Boy Join Date: 2004-05-14 Member: 28672Members
  • ReKReK Join Date: 2004-08-30 Member: 31058Members, Constellation, Reinforced - Shadow, WC 2013 - Silver
    Not sure, I've never left out the waits <!--emo&:p--><img src='http://www.unknownworlds.com/forums/html/emoticons/tounge.gif' border='0' style='vertical-align:middle' alt='tounge.gif' /><!--endemo-->

    I'm just repeating what they said.
  • PeChPeCh Join Date: 2005-01-12 Member: 35023Members
    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
  • lordofokralordofokra Join Date: 2002-11-09 Member: 7898Members, Constellation
    edited January 2005
    <!--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 +flps "+attack; wait; impulse 100"
    alias -flps "-attack; wait; impulse 100"
    bind key +flps
    <!--c2--></td></tr></table><div class='postcolor'><!--ec2-->
  • AudaxAudax Join Date: 2003-09-20 Member: 21025Members
    Can someone give me an example of a harmless _special script? I've heard a lot about them, but never seen one.
  • Mr_SneakyMr_Sneaky Join Date: 2002-12-11 Member: 10601Members
    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!
  • ShadowShadow Join Date: 2004-09-01 Member: 31145Members, Constellation
    how to make a separed config for aliens and marines (prob a stupid question)
  • obuhobuh Not Quite Smart at NS Join Date: 2003-03-31 Member: 15072Members, Constellation
    edited February 2005
    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).

    <!--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-->
  • 2_of_Eight2_of_Eight Join Date: 2003-08-20 Member: 20016Members
    Let's say I'm lerk. I'm on bite, and I use it the most. However, I want to have <b>one button</b> 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?
  • SLizerSLizer Join Date: 2003-11-07 Member: 22363Members, Constellation
    <!--QuoteBegin-2 of Eight+Feb 1 2005, 10:01 PM--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> (2 of Eight @ Feb 1 2005, 10:01 PM)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin--> Let's say I'm lerk. I'm on bite, and I use it the most. However, I want to have <b>one button</b> 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? <!--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.
  • Swift_IdiotSwift_Idiot Join Date: 2003-01-05 Member: 11883Members
    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.

    <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.
Sign In or Register to comment.