Cycle Script
Moderator: Core Staff
Cycle Script
I was wondering if any of you know how to make a cycle script so I can have one key cycle through three different functions cos right now I only know how to have it toggle between two functions but I want to use it to switch my names but I have 3 not 2…
Thanks
9mm
Thanks
9mm
-
- Core Staff
- Posts: 13315
- Joined: April 13th, 2005, 8:22 pm
- Location: UK, London
Yep there is a way of doing it, I use it all the time 
/bind n toggle name <name> <name2> <etc>
You may need to use quotations but, not sure.

/bind n toggle name <name> <name2> <etc>
You may need to use quotations but, not sure.

Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010
thanks it works great to change my name.....but do you knwo how i can edit this script to cycle through things because with this you can change more than just you name....because i used it to exec another file which then changes all my bind to fit that new name
if i cant get this i will use the name thing that you gave me which is very nice.....thanks
set first_command <first command>
set second_command <second command>
set first_toggle "vstr first_command;set current_command vstr second_toggle"
set second_toggle "vstr second_command;set current_command vstr first_toggle"
seta current_command "vstr first_toggle"
bind F9 "vstr current_command"
if i cant get this i will use the name thing that you gave me which is very nice.....thanks
What I use is alot simpler:
Open a notepad and name it namer
open it up and type in for example for my name to change from red to green:
The wait 10 is making it wait every 10 milliseconds, so that script is one second long, but you can make it as long as you want.
Now, save and close and now change the .txt to .cfg so it should be "namer.cfg"
Now open your Multiplayer Config and add this to the end of the config:
You can change the P to anything you want. Watch out tho when you activate it you are frozen until the bind ends, so dont make it to long or press is by accident.
Well enjoy the script, I use it all the time
Open a notepad and name it namer
open it up and type in for example for my name to change from red to green:
Code: Select all
name "^1Nightmare"
wait 10
"^2Nightmare"
wait 10
"^1Nightmare"
wait 10
"^2Nightmare"
wait 10
"^1Nightmare"
wait 10
"^2Nightmare"
wait 10
Now, save and close and now change the .txt to .cfg so it should be "namer.cfg"
Now open your Multiplayer Config and add this to the end of the config:
Code: Select all
bind P "exec namer.cfg"
Well enjoy the script, I use it all the time

Last edited by Nightmare on March 23rd, 2006, 10:17 pm, edited 1 time in total.
Coding is Poetry. Mapping is Art.
"Cause im the sexiest mapper ever...except for nm, that sexy man" - Soviet
-=[CoDJumper.com Movies]=-
[Ambush] || [Backlot] || [Bloc] || [Bog] || [Broadcast] || [Chinatown] || [Countdown]
[Crash] || [Creek] || [Crossfire] || [District] || [Downpour] || [Killhouse] || [Overgrown]
[Pipeline] || [Shipment & Wetwork] || [Showdown] || [Strike] || [Vacant]
"Cause im the sexiest mapper ever...except for nm, that sexy man" - Soviet
-=[CoDJumper.com Movies]=-
[Ambush] || [Backlot] || [Bloc] || [Bog] || [Broadcast] || [Chinatown] || [Countdown]
[Crash] || [Creek] || [Crossfire] || [District] || [Downpour] || [Killhouse] || [Overgrown]
[Pipeline] || [Shipment & Wetwork] || [Showdown] || [Strike] || [Vacant]
-
- Core Staff
- Posts: 13315
- Joined: April 13th, 2005, 8:22 pm
- Location: UK, London
indeed, a script like that would only result in having the same name (your name will always be the last one in the list)Soviet wrote:lol, i don't think thats what he was asking for nightmare...i used to be able to do something similar in SoF2 but unfortunately i forgot and it would probably be slightly different
I'm rusty with vstr scripts but this is my guess...
Code: Select all
set name1 <name1>
set name2 <name2>
set name3 <name>
set first_toggle "vstr name1; vstr second_toggle"
set second_toggle "vstr name2; vstr third_toggle"
set third_toggle "vstr name3; vstr first_toggle"
bind F9 "vstr current_command"

Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010
thanks for all the help....
drofder ur script made my cod crash
but after working with it i can up with
drofder ur script made my cod crash

but after working with it i can up with
set first_command exec name1
set second_command exec name2
set third_command exec name3
set first_toggle "vstr first_command;set current_command vstr second_toggle"
set second_toggle "vstr second_command;set current_command vstr third_toggle"
set third_toggle "vstr third_command;set current_command vstr first_toggle"
seta current_command "vstr first_toggle"
bind F9 "vstr current_command"
lol, sometimes drof doesnt know what he is talking about 

Coding is Poetry. Mapping is Art.
"Cause im the sexiest mapper ever...except for nm, that sexy man" - Soviet
-=[CoDJumper.com Movies]=-
[Ambush] || [Backlot] || [Bloc] || [Bog] || [Broadcast] || [Chinatown] || [Countdown]
[Crash] || [Creek] || [Crossfire] || [District] || [Downpour] || [Killhouse] || [Overgrown]
[Pipeline] || [Shipment & Wetwork] || [Showdown] || [Strike] || [Vacant]
"Cause im the sexiest mapper ever...except for nm, that sexy man" - Soviet
-=[CoDJumper.com Movies]=-
[Ambush] || [Backlot] || [Bloc] || [Bog] || [Broadcast] || [Chinatown] || [Countdown]
[Crash] || [Creek] || [Crossfire] || [District] || [Downpour] || [Killhouse] || [Overgrown]
[Pipeline] || [Shipment & Wetwork] || [Showdown] || [Strike] || [Vacant]
lol, who knows. Maybe someone will find that post helpful.
Coding is Poetry. Mapping is Art.
"Cause im the sexiest mapper ever...except for nm, that sexy man" - Soviet
-=[CoDJumper.com Movies]=-
[Ambush] || [Backlot] || [Bloc] || [Bog] || [Broadcast] || [Chinatown] || [Countdown]
[Crash] || [Creek] || [Crossfire] || [District] || [Downpour] || [Killhouse] || [Overgrown]
[Pipeline] || [Shipment & Wetwork] || [Showdown] || [Strike] || [Vacant]
"Cause im the sexiest mapper ever...except for nm, that sexy man" - Soviet
-=[CoDJumper.com Movies]=-
[Ambush] || [Backlot] || [Bloc] || [Bog] || [Broadcast] || [Chinatown] || [Countdown]
[Crash] || [Creek] || [Crossfire] || [District] || [Downpour] || [Killhouse] || [Overgrown]
[Pipeline] || [Shipment & Wetwork] || [Showdown] || [Strike] || [Vacant]
-
- Core Staff
- Posts: 13315
- Joined: April 13th, 2005, 8:22 pm
- Location: UK, London
Ok give me 2 minutes and I will have the answer. My previous answer is off the top of my head and was more help than anyone else here gave you...9mm wrote:thanks for all the help....
drofder ur script made my cod crash
but after working with it i can up with
set first_command exec name1
set second_command exec name2
set third_command exec name3
set first_toggle "vstr first_command;set current_command vstr second_toggle"
set second_toggle "vstr second_command;set current_command vstr third_toggle"
set third_toggle "vstr third_command;set current_command vstr first_toggle"
seta current_command "vstr first_toggle"
bind F9 "vstr current_command"
/me looks around for disagreement...
/me finds nothing and carries on with his life.


Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010
-
- Core Staff
- Posts: 13315
- Joined: April 13th, 2005, 8:22 pm
- Location: UK, London
Code: Select all
set namechange1 "name <name>; set nametoggle vstr namechange2"
set namechange2 "name <name2>; set nametoggle vstr namechange1"
set nametoggle "vstr namechange1"
bind n "vstr nametoggle"
Guarenteed working as I just tested it.
To add more name you need to change more lines.
Code: Select all
set <variable#1> "<command> <value>; set <togglename> vstr <next variable>"
set <variable#2> "<command> <value>; set <togglename> vstr <next variable>"
set <variable#3> "<command> <value>; set <togglename> vstr <next variable>"
set <variable#4> "<command> <value>; set <togglename> vstr <next variable>"
set <variable#5> "<command> <value>; set <togglename> vstr <next variable>"
set <togglename> "vstr <variable#1>"
bind n "vstr <togglename>"
To make a new line, simply copy and paste the previous line and change the vairable number (e.g to <variable#6>)
The <command> is basically what you want it to do (can be anything, sensitivity, name)
The <value> is just the value you give to the command (e.g name Drofder, or Sensitivity 5)
You must change all instances of <togglename> to anything you wish (e.g nametoggle or sensitivitychange).
Now is the hardest part, which is extremely simple

Changing the <next variable>. Basicall line 1 will equal <variable#2>. Line 2 will equal <variable#3> etc until you get to the final line which will equal <variable#1> to complete the loop.
Code: Select all
set variable1 "name ^7Drofder; set namechange vstr variable2"
set variable2 "name ^1Drofder; set namechange vstr variable3"
set variable3 "name ^2Drofder; set namechange vstr variable4"
set variable4 "name ^3Drofder; set namechange vstr variable5"
set variable5 "name ^4Drofder; set namechange vstr variable6"
set variable6 "name ^5Drofder; set namechange vstr variable7"
set variable7 "name ^6Drofder; set namechange vstr variable1"
set namechange "vstr variable1"
bind n "vstr namechange"

Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010
if you only want a name change, and maintain the spaces in your name, you could use this script.
eg
.
Code: Select all
set <variable#1> "<value>"
set <variable#2> "<value>"
set <variable#3> "<value>"
set <variable#10> "setfromcvar <value> <variable#1>;set <togglename> vstr <next variable>"
set <variable#11> "setfromcvar <value> <variable#2>;set <togglename> vstr <next variable>"
set <variable#12> "setfromcvar <value> <variable#3>;set <togglename> vstr <first variable>"
set <togglename> "vstr <variable#10>"
bind n "vstr <togglename>"
eg
Code: Select all
set var0 "^3[^4~^1L^5eveller^4~^3]"
set var1 "^3S^2u^1m^7o ^6L^4o^5c^9o"
set var2 "^2~^1N^7D^4O^2~ ^7Po^1st^7man"
set var3 "^1New ^7Dutch ^4Order"
set var10 "setfromcvar name var0;set var20 vstr var11"
set var11 "setfromcvar name var1;set var20 vstr var12"
set var12 "setfromcvar name var2;set var20 vstr var13"
set var13 "setfromcvar name var3;set var20 vstr var10"
set var20 "vstr var10"
.
Who is online
Users browsing this forum: No registered users and 3 guests