News: 1up Discord VOIP
Invite Code: https://discord.gg/VPv9JhP

Author Topic: UrT Script Help (Speed n Doors)  (Read 2702 times)

0 Members and 1 Guest are viewing this topic.

Offline RonaldLee[1up]

  • *[1up] Clan Founder
  • [1up] UrT Admin
  • [1up] KF Admin
  • [1upZ] NMRiH Admin
  • [1upZ] Zombie
  • Posts: 5,570
  • Karma: 2634
  • 1up Founder
  • Since: 02/03/2009
    YearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYears
    • 1up Clan
    • Youtube's channel
UrT Script Help (Speed n Doors)
« on: August 27, 2012, 04:57:49 PM »
Can somebody tell me how to write this script for my autoexec.cfg?

I use "E" to run fast (sprint).
I use "CTFL" to open and close doors.

I was to make it so when I hit "E" I can run fast, but if I am at a door it will open or close it.

I tried to write this script for my autoexec.cfg, but it does not work.

bind e "+button8; +button7"[1]

I tried to base it off of my other script: bind i "ut_itemdrop flag;ut_weaptoggle bomb"

_______________________________

This example is killing me:

Here's an example for a 3x - 6x zoom toggle:

set zoomtoggle1 "cg_zoomfov 15; sensitivity 25; set nextzoomtoggle vstr zoomtoggle2; echo 6x magnification"
set zoomtoggle2 "cg_zoomfov 30; sensitivity 17; set nextzoomtoggle vstr zoomtoggle1; echo 3x magnification"

Assign dynamic variable to first 'step' in sequence: After you have finished writing the basic set of commands, use set [nextscriptline] vstr [scriptline(n+1)]
This tells the computer that [nextscriptline] should start by executing [scriptline(n+1)]. Notice however, that every time you execute your script, the value attached to [nextscriptline] changes. Here's an example for a 3x - 6x zoom toggle: set nextzoomtoggle "vstr zoomtoggle1"

Bind key to execute dynamic variable: The last step is to bind a key to execute your new script. We learned the syntax in the first step, Simple Binds. The final line in the zoom toggle looks like: Here's an example for a 3x - 6x zoom toggle:
bind b "vstr nextzoomtoggle"
 1. I thought it was as simple as: bind [key] "[command 1]; [command 2]" //Comments go here

Offline Zod

  • Posts: 483
  • Karma: -116
  • Since: 24/05/2011
    YearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYears
Re: UrT Script Help (Speed n Doors)
« Reply #1 on: August 27, 2012, 05:23:03 PM »
use a wait

/bind e "button8; wait 2; +button7"

Offline G|Man[1up]

  • I want to sleep.
  • *[1up] Member
  • [1upZ] NMRiH Admin
  • [1upZ] Zombie
  • Posts: 1,754
  • Karma: -28
  • Since: 19/05/2013
    YearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYears
    • 1up Clan Forums
    • Youtube's channel
Re: UrT Script Help (Speed n Doors)
« Reply #2 on: August 27, 2012, 06:28:27 PM »
^Solution^

Offline TurbanError

  • Posts: 613
  • Karma: 60
  • Since: 12/11/2010
    YearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYears
Re: UrT Script Help (Speed n Doors)
« Reply #3 on: August 28, 2012, 08:10:24 PM »
Did the wait time fix it?  Wait time might defeat the purpose for sprinting.  The order also might be an issue (urt needs to resolve the command left to right and you generally hold sprint) so maybe:


bind x "+button7; +button8;"

or if that doesn't work:

bind x "+button7; -button7; +button8;"

Sprinkle wait time in there as you see fit.  I haven't tested this but I believe it would allow you to tap to open doors and hold to sprint.  Its actually a very good idea to have your sprint and activate buttons together.  The only downside is defusing a bomb will not work with the -button7 (as you need to hold it). 
« Last Edit: August 28, 2012, 08:14:30 PM by TurbanError[1up] »

Offline Zod

  • Posts: 483
  • Karma: -116
  • Since: 24/05/2011
    YearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYears
Re: UrT Script Help (Speed n Doors)
« Reply #4 on: August 28, 2012, 08:23:05 PM »
most server have "sv_floodprotect" set to 1, which means you can't spam. sending 2 commands without a wait is like trying to say "hello" twice in 1 second, its not possible with floodprotect on. this is why it wouldnt let you use 2 commands without a wait.