need help with a script

Anything not related to war3 mods

Moderator: Forum Moderator

Post Reply
mexykanu
Rifleman
Posts: 176
Joined: Sun Oct 22, 2006 8:06 am

need help with a script

Post by mexykanu » Sat Jan 27, 2007 5:35 pm

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.

DesasterUK
WC3Mods Donor
WC3Mods Donor
Posts: 223
Joined: Thu Mar 09, 2006 6:05 pm
Location: Germany
Contact:

Post by DesasterUK » Sun Jan 28, 2007 1:32 am

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
Image

mexykanu
Rifleman
Posts: 176
Joined: Sun Oct 22, 2006 8:06 am

Post by mexykanu » Sun Jan 28, 2007 3:19 am

i have the scripts... i need them to be executed at once when u hold a button

example.rar - demos

example1.rar - freeze
Attachments
example1.rar
(258.55 KiB) Downloaded 774 times
example.rar
(139.21 KiB) Downloaded 824 times

DesasterUK
WC3Mods Donor
WC3Mods Donor
Posts: 223
Joined: Thu Mar 09, 2006 6:05 pm
Location: Germany
Contact:

Post by DesasterUK » Sun Jan 28, 2007 4:54 am

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
Image

mexykanu
Rifleman
Posts: 176
Joined: Sun Oct 22, 2006 8:06 am

Post by mexykanu » Sun Jan 28, 2007 5:21 am

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

DesasterUK
WC3Mods Donor
WC3Mods Donor
Posts: 223
Joined: Thu Mar 09, 2006 6:05 pm
Location: Germany
Contact:

Post by DesasterUK » Sun Jan 28, 2007 5:37 am

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
Image

mexykanu
Rifleman
Posts: 176
Joined: Sun Oct 22, 2006 8:06 am

Post by mexykanu » Sun Jan 28, 2007 7:01 am

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

DesasterUK
WC3Mods Donor
WC3Mods Donor
Posts: 223
Joined: Thu Mar 09, 2006 6:05 pm
Location: Germany
Contact:

Post by DesasterUK » Sun Jan 28, 2007 7:57 am

:lol:
Image

mexykanu
Rifleman
Posts: 176
Joined: Sun Oct 22, 2006 8:06 am

Post by mexykanu » Sun Jan 28, 2007 8:39 am

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..

DesasterUK
WC3Mods Donor
WC3Mods Donor
Posts: 223
Joined: Thu Mar 09, 2006 6:05 pm
Location: Germany
Contact:

Post by DesasterUK » Sun Jan 28, 2007 8:43 am

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?
Image

mexykanu
Rifleman
Posts: 176
Joined: Sun Oct 22, 2006 8:06 am

Post by mexykanu » Sun Jan 28, 2007 9:25 am

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

DesasterUK
WC3Mods Donor
WC3Mods Donor
Posts: 223
Joined: Thu Mar 09, 2006 6:05 pm
Location: Germany
Contact:

Post by DesasterUK » Sun Jan 28, 2007 11:25 am

:?

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
Image

mexykanu
Rifleman
Posts: 176
Joined: Sun Oct 22, 2006 8:06 am

Post by mexykanu » Sun Jan 28, 2007 11:37 am

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

Post Reply