Cycle Script

Have a question you need to ask? Need help? Ask here!

Moderator: Core Staff

9mm
CJ Donator
CJ Donator
Posts: 183
Joined: February 14th, 2006, 10:57 pm
Location: USA

Cycle Script

Post by 9mm » March 23rd, 2006, 12:45 am

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

User avatar
Drofder2004
Core Staff
Core Staff
Posts: 13315
Joined: April 13th, 2005, 8:22 pm
Location: UK, London

Post by Drofder2004 » March 23rd, 2006, 1:30 am

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

9mm
CJ Donator
CJ Donator
Posts: 183
Joined: February 14th, 2006, 10:57 pm
Location: USA

Post by 9mm » March 23rd, 2006, 3:29 am

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

User avatar
Nightmare
Core Staff
Core Staff
Posts: 2688
Joined: January 12th, 2006, 10:09 pm
Contact:

Post by Nightmare » March 23rd, 2006, 4:18 am

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:

Code: Select all

name "^1Nightmare"
wait 10
"^2Nightmare"
wait 10
"^1Nightmare"
wait 10
"^2Nightmare"
wait 10
"^1Nightmare"
wait 10
"^2Nightmare"
wait 10
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:

Code: Select all

bind P "exec namer.cfg"
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 ;)
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]

User avatar
Soviet
Core Staff
Core Staff
Posts: 7762
Joined: April 23rd, 2005, 9:12 pm

Post by Soviet » March 23rd, 2006, 4:21 am

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

User avatar
Drofder2004
Core Staff
Core Staff
Posts: 13315
Joined: April 13th, 2005, 8:22 pm
Location: UK, London

Post by Drofder2004 » March 23rd, 2006, 8:14 pm

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
indeed, a script like that would only result in having the same name (your name will always be the last one in the list)

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

9mm
CJ Donator
CJ Donator
Posts: 183
Joined: February 14th, 2006, 10:57 pm
Location: USA

Post by 9mm » March 24th, 2006, 12:57 am

thanks for all the help....

drofder ur script made my cod crash :P

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"

User avatar
Nightmare
Core Staff
Core Staff
Posts: 2688
Joined: January 12th, 2006, 10:09 pm
Contact:

Post by Nightmare » March 24th, 2006, 1:22 am

lol, sometimes drof doesnt know what he is talking about :P
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]

9mm
CJ Donator
CJ Donator
Posts: 183
Joined: February 14th, 2006, 10:57 pm
Location: USA

Post by 9mm » March 24th, 2006, 1:37 am

Soviet talkign about Nightmare wrote:lol, i don't think thats what he was asking for nightmare...
he seems to know more about what is going on than some people :)

User avatar
Soviet
Core Staff
Core Staff
Posts: 7762
Joined: April 23rd, 2005, 9:12 pm

Post by Soviet » March 24th, 2006, 5:21 am

9mm wrote:
Soviet talkign about Nightmare wrote:lol, i don't think thats what he was asking for nightmare...
he seems to know more about what is going on than some people :)
i really truly feel bad about making a meaningless post that can be considered as spam but...OWNED...sorry :roll: :P

User avatar
Nightmare
Core Staff
Core Staff
Posts: 2688
Joined: January 12th, 2006, 10:09 pm
Contact:

Post by Nightmare » March 24th, 2006, 6:19 am

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]

User avatar
Soviet
Core Staff
Core Staff
Posts: 7762
Joined: April 23rd, 2005, 9:12 pm

Post by Soviet » March 24th, 2006, 6:24 am

very true, but it wasn't used at the right time in the right place

User avatar
Drofder2004
Core Staff
Core Staff
Posts: 13315
Joined: April 13th, 2005, 8:22 pm
Location: UK, London

Post by Drofder2004 » March 24th, 2006, 4:59 pm

9mm wrote:thanks for all the help....

drofder ur script made my cod crash :P

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

/me looks around for disagreement...
/me finds nothing and carries on with his life.

:P
Image
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

User avatar
Drofder2004
Core Staff
Core Staff
Posts: 13315
Joined: April 13th, 2005, 8:22 pm
Location: UK, London

Post by Drofder2004 » March 24th, 2006, 5:26 pm

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"
Change <name> and <name2> to your 2 chosen names.

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>"
Basically in the above code...
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 :P
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"
Image
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

leveller
CJ Fan
CJ Fan
Posts: 156
Joined: June 25th, 2005, 12:24 pm

Post by leveller » March 26th, 2006, 1:01 pm

if you only want a name change, and maintain the spaces in your name, you could use this script.

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"




.

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests