Page 1 of 1

need help with a script

Posted: Sat Jan 27, 2007 5:35 pm
by mexykanu
i'm having problems with two scripts (counter-strike config): i want them to be executed at once at a press of a button.
they're both "+COMMAND" type of scripts... one "freezes" the game, and the other one starts a demo. when the button is released, the game "unfreezes" and the demo stops.

Posted: Sun Jan 28, 2007 1:32 am
by DesasterUK
alias +freezedemo "pause;record nameofdemofile"
alias -freezedemo "pause;stop"
bind key freezedemo

not sure if it is also pause to unfreeze
maybe u have to try with unpause

Posted: Sun Jan 28, 2007 3:19 am
by mexykanu
i have the scripts... i need them to be executed at once when u hold a button

example.rar - demos

example1.rar - freeze

Posted: Sun Jan 28, 2007 4:54 am
by DesasterUK
so u got 2 commands to use on one button?
what are the commands?

ok the first is record
but the other one?

u simply have to write an +/- alias and bind it to your key

alias +example "command1;command2"
alias -example "undo_command1;undo_command2"
bind key example

for the demo u have to use record for the + alias and stop for the -alias

the alias +example is triggered when u press a button
and the alias -example is triggered when u release it

just an example
alias +makedemo "record demo.dem"
alias -makedemo "stop"
bind MOUSE3 makedemo

when u press (and hold) MOUSE3 it will start to record a demo and stops it when u release MOUSE3


or just name the commands u want to use or post the scripts u are using atm

Posted: Sun Jan 28, 2007 5:21 am
by mexykanu
i know how to script/do aliases/whatever.

i have 2 commands:

1. +freeze (stop everything)
2. +rec1 (record demo)

currently bound to

1. bind e +rec1
2. bind f +freeze

how do u bind these to one button ?

bind f "+rec1;wait;wait; +freeze" doesn't work

Posted: Sun Jan 28, 2007 5:37 am
by DesasterUK
alias +freezerec "+freeze;+rec1"
alias - freezerec "-freeze;-rec1"
bind f freezerec

this should work
if it's not try to bind +freezerec

it doesn't work when u try to directly bind both commands, cause they are +/- commands
it will only execute the first one

Posted: Sun Jan 28, 2007 7:01 am
by mexykanu
it doesn't work when u try to directly bind both commands, cause they are +/- commands
i know... i'll try now what you said. and bind f freezerec will not work because the freezerec command is not registered, the bind + might work

it worked ! 10x :D

Posted: Sun Jan 28, 2007 7:57 am
by DesasterUK
:lol:

Posted: Sun Jan 28, 2007 8:39 am
by mexykanu
now i've got another problem... the demo starts after the game is "Freezed" and ends before the game "Unfreezes"... so it's useless. "wait;wait etc" won't work, or i don't know how to use it..

Posted: Sun Jan 28, 2007 8:43 am
by DesasterUK
and how should it work?
i don't know what the script is for

press button = freeze game + record demo
release button = unfreeze + stop demo

or should it work in another way?

Posted: Sun Jan 28, 2007 9:25 am
by mexykanu
yea that's the way it should work, but it should be like this :

press button - start demo... wait 3 seconds... freeze
release button - unfreeze... wait 3 seconds... stop demo

and it is like this:

press button - freeze, wait 1 sec, start demo
release: stop demo, wait 1 sec, unfreeze

which is not what i have in mind

Posted: Sun Jan 28, 2007 11:25 am
by DesasterUK
:?

should be impossible

if u are running with 100 fps (frames per second) u have to insert 100 waits to get a pause of 1 second

so u need 300 waits for ur command
ok u can build an alias for it

alias wait5 "wait;wait;wait;wait;wait"
alias wait10 "wait5;wait5"
alias wait20 "wait10;wait10"
alias wait100 "wait20;wait20;wait20;wait20;wait20"
alias wait300 "wait100;wait100;wait100"

alias +freezerec "+rec1;wait300;+freeze"
alias -freezerec "-freeze;wait300;-rec1"
bind key +freezerec

this one should work
but u cant move the time while the waits are running

every wait will be 1 frame
if ur playing on 50 frames u need 150 wait to build 3 secs

Posted: Sun Jan 28, 2007 11:37 am
by mexykanu
i know i can't move while the wait is active, but i need to...

i saw somewhere a name spam script; it included several waits but you wouldn't lag because of it