Jump to content

script help request


Phobia

Recommended Posts

i am trying to figure out how to toggle (key or key combo) (on off) a sub routine that loops indefinitely, but am completely lost... any help please

 

another way of saying it is, i want when i press a key for a script loop to activate and when I press that key again for it to terminate..again thanks

Link to comment
Share on other sites

i am trying to figure out how to toggle (key or key combo) (on off) a sub routine that loops indefinitely, but am completely lost... any help please

 

another way of saying it is, i want when i press a key for a script loop to activate and when I press that key again for it to terminate..again thanks

 

What i understand is that you want,

for example

f12 - Start recording 

f12-stop recording 

 

like that ? 

  • Like 1
Link to comment
Share on other sites

similar yes...more like (pardon my lack of programming knowledge)

 

if g has been pressed odd number of times

then start loop "a"

if g has been pressed even number of times

then end loop "a"

else quit

  

loop "a"

       say this is a test

       wait 50

       say this is a test

 

 

so the end result would be if I press g it would spam "this is a test" until i press g again

 

 

sorry if that is unclear..my scripting/programming knowledge is less than 0

  • Like 1
Link to comment
Share on other sites

similar yes...more like (pardon my lack of programming knowledge)

 

if g has been pressed odd number of times

then start loop "a"

if g has been pressed even number of times

then end loop "a"

else quit

  

loop "a"

       say this is a test

       wait 50

       say this is a test

 

 

so the end result would be if I press g it would spam "this is a test" until i press g again

 

 

sorry if that is unclear..my scripting/programming knowledge is less than 0

 

sorry m8 but i thought i could help :P

but looks like some Pro is needed here, but spamming at any server is not allowed, even on etpro i mean like before you can create a whole picture on console :P but not now 

Ask Aniky maybe

  • Like 1
Link to comment
Share on other sites

  • Platinum VIP

think you can use simple recursion in ET configs so Id try something like 

 


bind [key] "vstr loop"

set loop "say

"this is a test1"; wait 50; 

"this is a test2"; wait 50;

"this is a test3"; wait 50;

"this is a test4"; wait 50;

vstr loop"

  • Like 1
Link to comment
Share on other sites

i think that is closer..but it only does the "loop" once..and really it is treating it like a user definable var, so you could include a call function at the end of the var to call the var again..but i don't know a way to end it:)  ex.

 

set loopa "+attack;wait 50;-attack;wait 50;vstr loopa"

bind "P" "vstr loopa"

Link to comment
Share on other sites

like this
 
//chrosshairtoggle
set cht1 "echo ^6switch; cg_crosshaircolor "magenta"; set chtoggle vstr cht2" 
set cht2 "echo ^6switch1; cg_crosshaircolor "red"; set chtoggle vstr cht3"
set cht3 "echo ^6switch2; cg_crosshaircolor "cyan"; set chtoggle vstr cht4"
set cht4 "echo ^6switch3; cg_crosshaircolor "white"; set chtoggle vstr cht1"

set chtoggle "vstr cht1" 

bind downARROW "vstr chtoggle"

 

 

 

  • Like 1
Link to comment
Share on other sites

It would be helpful to tell at least what exactly are u trying to configure, is it a callvote script, is it a animation script or what?

  • Like 2
Link to comment
Share on other sites

i was hoping to learn how to do it instead of just asking someone to hand it to me on a silver platter:) but I am trying to make a nade spam script for noq 2 where you don't have to reload or worry about ammo

Link to comment
Share on other sites

  • Platinum VIP

Bla bla bla nade spam script bla bla reload blaa

Ok, so im a little confused, how does one reload a grenade? Most of them are for 1time use

  • Like 1
Link to comment
Share on other sites

i like the "quote" :)

when you expend all 5 or so grenades in noq#2 it automatically reloads (instantly) to 4 or so grenades...

guns are treated the same, so every gun becomes a machine gun:)

Link to comment
Share on other sites

i like the "quote" :)

when you expend all 5 or so grenades in noq#2 it automatically reloads (instantly) to 4 or so grenades...

guns are treated the same, so every gun becomes a machine gun:)

 

Option 1: Ok after numerous testing I found a solution. I managed to script according to what you requested. I even tested it on F|A NQ 2 as you wanted. However, it cannot do it infinitely. I can script it to do infinitely however, there would be a serious bug whereby you cannot execute any other commands or stop it (eg. /quit, /reconnect, or pressing any other key would not work). In short, you will be stuck throwing grenades as long as you ET.exe is running until you manually close ET.exe using the Task Manager (CTRL ALT DELETE). Note: This script can auto throw grenades as many times as you set it to be. For example if you set it to 5 times, it will auto throw grenades 5 times. You will not be able to move when auto throwing grenades.

 

Option 2: A third party application to help do it for you. There could be a way for a third party application to be coded such that it does what you desired. However, whether it is legal a not, in other words, considered to be not a cheat or a cheat is up to the server admins to decide hence, it is a grey area. It may be categorised the same way as how some use third party et spawn timer but that depends on what the server admins consider it to be. Maybe some admins or members can give their input on whether such a program is considered a cheat or not a cheat. For Option 2, one can do it infinitely and can move around while doing it. I do not have such a program but in theory it should be possible.

 

The best option is to use option 1 which is entirely using the game itself without any third party tools hence, there is no grey area. However, option 1 won't be able to do it infinitely.

 

If you want Option 1, I can post the code here and teach you how to edit it to your liking. You can reply to this topic to tell me your decision though I most likely won't help you with Option 2 as it is a grey area unless server admins or other experienced users give their inputs on whether this is legal like et spawn timers or et dynamite counters or considered a cheat.

Edited by blackknight8653
  • Like 1
Link to comment
Share on other sites

 you will be stuck throwing grenades as long as you ET.exe is running until you manually close ET.exe using the Task Manager (CTRL ALT DELETE). Note: This script can auto throw grenades as many times as you set it to be. For example if you set it to 5 times, it will auto throw grenades 5 times.

yeah:) i ran into that /quit wouldn't work..but I was able to press the esc button and then mouse to the quit button...option II scares me:)

so if you would be willing to let me see how to put a ''counter'' on the loop that would be great(actually I would like to see all of it lol)..and ofc thanks everyone..the amount of help here really has blown me away!

Link to comment
Share on other sites

yeah:) i ran into that /quit wouldn't work..but I was able to press the esc button and then mouse to the quit button...option II scares me:)

so if you would be willing to let me see how to put a ''counter'' on the loop that would be great(actually I would like to see all of it lol)..and ofc thanks everyone..the amount of help here really has blown me away!

Ok it is not really a counter but you can create a separate script to make it to a counter but that I will leave it to another time as I have to do another separate script to compliment this script. I will most likely update this topic with a separate counter when I have time. Maybe you can tell me your desired values like, throw 10 times, throw 20 times, throw 30 times, etc. Though it will be very tedious. I will think of a separate solution for that if possible.

 

The script below is tested in F|A NQ 2. You need not switch to grenade manually before starting the script. The script auto switches to grenade when started.

 

Below would be for those looking at Option 1:

 

CAUTION: DO NOT change the value of the wait. I have tweaked it such that you will not throw too fast which may case a bug resulting in no grenades being thrown. Leave the values for wait as it is.

 

If you want to throw it another 5 times after the first 5 times ended, just press LEFTARROW again.

 

You can see that I leave a credit there. Sorry I just did it for fun. If you want to, you can leave the credit there as a form of appreciation. :) You can also like my post. :)

//Auto Throw Grenades Bug Fixed (Throws Grenade 5 Times) [Press LEFTARROW to start the script]
set throw1 "echo ^2Throw ^31; wait 100; +attack; wait 100; -attack; wait 200; vstr throw2;
set throw2 "echo ^2Throw ^32; wait 100; +attack; wait 100; -attack; wait 200; vstr throw3;
set throw3 "echo ^2Throw ^33; wait 100; +attack; wait 100; -attack; wait 200; vstr throw4;
set throw4 "echo ^2Throw ^34; wait 100; +attack; wait 100; -attack; wait 200; vstr throw5;
set throw5 "echo ^2Throw ^35; wait 100; +attack; wait 100; -attack; wait 200; vstr stop;
set stop "echo ^2Auto Throw ^3Stop; -attack;"set autothrow "vstr throw1"
bind LEFTARROW "echo ^2Auto Throw Script by blackknight8653 ^3Start; weaponbank 4; vstr autothrow;"

FAQ

 

Question: How do I change the number of times I want to throw? (eg. I want to auto throw grenades 6 times instead of 5 times.)

Answer: In the above script I have shown, focus on this line "set throw5 "echo ^2Throw ^35; wait 100; +attack; wait 100; -attack; wait 200; vstr stop;". Copy that line and paste it at a new line below it. Replace "throw 5" with "throw 6" and replace "stop" at the line which you copied to "throw6". It may be hard to understand my explanation but I believe if you look at the new code below you would understand what I was trying to convey.

 

In other words, your new code will be as shown:

//Auto Throw Grenades Bug Fixed (Throws Grenade 6 Times) [Press LEFTARROW to start the script]
set throw1 "echo ^2Throw ^31; wait 100; +attack; wait 100; -attack; wait 200; vstr throw2;
set throw2 "echo ^2Throw ^32; wait 100; +attack; wait 100; -attack; wait 200; vstr throw3;
set throw3 "echo ^2Throw ^33; wait 100; +attack; wait 100; -attack; wait 200; vstr throw4;
set throw4 "echo ^2Throw ^34; wait 100; +attack; wait 100; -attack; wait 200; vstr throw5;
set throw5 "echo ^2Throw ^35; wait 100; +attack; wait 100; -attack; wait 200; vstr throw6;
set throw6 "echo ^2Throw ^36; wait 100; +attack; wait 100; -attack; wait 200; vstr stop;
set stop "echo ^2Auto Throw ^3Stop; -attack;"set autothrow "vstr throw1"
bind LEFTARROW "echo ^2Auto Throw Script by blackknight8653 ^3Start; weaponbank 4; vstr autothrow;"

You can repeat this as many times as you want until you reach a particular number of throws which you desire.

 

Question: Can I auto throw infinitely until I decided to stop it?

Answer: If you are using the code I created above, the short answer is no or at least I am unable to think of a solution to it. The issue is not because it is unable to throw infinitely but due to the fact that it will cause you unable to move and also unable to do any other commands or binds such as /quit, /reconnect, etc. In other words, you will be stuck unable to leave the game. It would also cause other potential issues which I would not elaborate here as it is not important. The only option to leave the game if you use the infinite throw method is that you have to go to your Task Manager by going (CTRL + ALT + DELETE) and end the ET.exe process. There is no way to stop the throwing without exiting ET.exe hence, due to this reason, this method is NOT RECOMMENDED.

 

However, for those who are curious of the method to throw infinitely I will post the code for educational purposes:

//Auto Throw Grenades with Known Bug (Throws Grenade Infinitely) [Press LEFTARROW to start the script]
set autoinfinitethrow "echo ^2Infinite Throw; wait 100; +attack; wait 100; -attack; wait 200; vstr autoinfinitethrow;
set autothrow "vstr autoinfinitethrow"
bind LEFTARROW "echo ^2Infinite Auto Throw Script by blackknight8653 ^3Start; weaponbank 4; vstr autothrow;"

For those who are not sure on how to use the script, I will upload the script I used here later with instructions on how to use as currently I have something to attend to.

 

If you discover any bugs or have any questions regarding the script, you can reply to this topic. Thank you. :)

Edited by blackknight8653
  • Like 3
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.