The problem is pretty simple.(imo...)
-- not real code --
set cmd "vstr something; bind KEY echo test; echo test2";
-- end of unreal code --
will only bind "echo test" to KEY. "echo test2" will be execed the moment you do vstr cmd
so what you would need is
bind CTRL "+vstr walk_on walk_off"; //note that bindings should also be included in quotation marks
set walk_on "+speed;bind MOUSE4 vstr turn"; //moved all the stuff to be bound to MOUSE4 in a own cmd, so you can rebind this all at runtime
set nothing ""; //yes. nothing. better to start lines / cmds with a vstr nothing than a +/- action, because the action might not work then
set walk_off "vstr nothing; unbind MOUSE4"; //i dont think you need the -speed here.
set turn "vstr nothing; cl_yawspeed 22500; +left; wait 2; -left; cl_yawspeed 140";
Anyway, always check your line ending and make sure that you dont use ; in a comment, because that works as an excape sequence
Next big thing is the wait 'time'. (in combination with cl_yawspeed.)
I use a cl_yawspeed of 56000 and a wait of 1. works perfectly for me (at 126 fps)
If you have no problems with the bind directly bound to MOUSE4 your wait time isn't a problem.
Otherwise you will have to try out, since
wait N; //waits N frames
Increasing yawspeed will allow you to lower the wait value (faster input, since you cant do anything but look while WAIT)
But this will also decrease precision, so you don't do an exact 180 deg turn.
Still one question remains.....
why do you do that thing with a while keypressed on CTRL?
i mean just telling from the code you dont use any other binds on MOUSE4 (because you unbind it)
that script with +vstr is fun but not very reliable.
Hope this helps,
Iye
This post has been edited by Iye: 28 September 2013 - 01:20 AM