AssaultCube - Forum
Scripts - Printable Version

+- AssaultCube - Forum (https://forum.cubers.net)
+-- Forum: AssaultCube (https://forum.cubers.net/forum-3.html)
+--- Forum: Mapping and Modding (https://forum.cubers.net/forum-11.html)
+--- Thread: Scripts (/thread-38.html)

Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41


RE: Scripts - MacAdresS - 09 Jul 10

//-- rolldie command to see who goes first in matches
alias rolldie [ if (&& (> (listlen $arg1) 0) (> (listlen $arg2) 0) ) [dieteams1 = $arg1; dieteams2 = $arg2] [dieteams1 = CLA; dieteams2 = RVSF]; if (rnd 2) [dieteams = $dieteams1] [dieteams = $dieteams2]; sleep 100 [say Random Die Roll - team $dieteams was chosen!]]

by DES|R4zor


RE: Scripts - Luc@s - 09 Jul 10

For noobs coop editing official maps on public servers :
alias lol [
    newmap;
    sleep 100 [ lol ]
]
:D


RE: Scripts - Gibstick - 09 Jul 10

R4zor, you wouldn't believe how efficient it is.


RE: Scripts - Matasar - 09 Jul 10

Ragequit with style..i need that =)


RE: Scripts - DrauL - 09 Jul 10

Simple slap script i wanted to make:

slap = [say slaps ($arg1) with a rusty salmon]

Thanks to R4 for putting up with me and making it :D


RE: Scripts - Gibstick - 09 Jul 10

In 1.1 you'll be able to do the /me command, so
slap = [me slaps ($arg1) with a disco stick]



RE: Scripts - V-Man - 09 Jul 10

The rolldie command:
rnd 2 will produce either 0, 1, or 2. The context "if (rnd 2)" makes it interpreted as either 1 or 0. When a number greater than 1 is put to a binary test, it is called "1". "if (rnd 2)" is generating such a binary test, but producing 3 possible numbers.
Whatever is picked as $arg1 will be selected 66% of the time, while the second argument will only be picked 33% of the time. Test it!


RE: Scripts - R4zor - 10 Jul 10

I got RVSF 15+ times with (rnd 1) - how can we solve that


RE: Scripts - #M|A#Wolf - 10 Jul 10

Raise the probabilities for CLA?


RE: Scripts - DrauL - 10 Jul 10

(09 Jul 10, 04:09PM)Gibstick Wrote: In 1.1 you'll be able to do the /me command, so
slap = [me slaps ($arg1) with a disco stick]

LoL, ty ruining it xD


RE: Scripts - Gibstick - 10 Jul 10

rvsforcla = [rnd 8]
rolldie = [ if (< (rvsforcla) 4) [say "Die roll - RVSF was chosen!] [say "Die roll - CLA was chosen!] ]
Fixed uneveness. Again. lol


RE: Scripts - R4zor - 10 Jul 10

Good thinking; lets add it in soo.

//-- rolldie command to see who goes first in matches
teamchoice = [rnd 8]
alias rolldie [ if (&& (> (listlen $arg1) 0) (> (listlen $arg2) 0) ) [dieteams1 = $arg1; dieteams2 = $arg2] [dieteams1 = CLA; dieteams2 = RVSF]; if (<= (teamchoice) 3) [dieteams = $dieteams1] [dieteams = $dieteams2]; sleep 100 [say Random Die Roll - team $dieteams was chosen!]]



RE: Scripts - DrauL - 10 Jul 10

Nuke script for those MW2 fans wanting to disconnect in style:

nuke = [say "Tactical Nuke Incoming!"; sleep 200 [say "5"]; sleep 1200 [say "4"]; sleep 2400 [say "3"]; sleep 3400 [say "2"]; sleep 4400 [say "1"]; sleep 4600 [disconnect] ]

Just type /nuke


RE: Scripts - flowtron - 10 Jul 10

why do you delay additional 200 millis from #3 onwards? And then only 200 before "0"?
If you're going to count seconds then that'd be 1000 millis, or just go with 500 - but changing pace?!?! Are you a drummer? (haha, old musician joke).
nuke = [
  tic = 500
  cnt = 5
  say "..until we meet again.."
  sleep (* (+ $cnt 2) $tic) disconnect
  loop w $cnt [ sleep (* (+ $w 1) $tic) (concat say (- $cnt $w)) ]
]



RE: Scripts - Mr.Floppy - 10 Jul 10

(10 Jul 10, 02:41PM)flowtron Wrote: If you're going to count seconds then that'd be 1000 millis, or just go with 500 - but changing pace?!?! Are you a drummer? (haha, old musician joke).

Haha! Yep... that's a drummer's work. :)


RE: Scripts - V-Man - 10 Jul 10

@Gibstick:
D:
I just realized, I made a really lame mistake.
(rnd 2) produces a random number between 0 and 2, including 0 but not including 2. This means it will only produce 1 or 0.
So... Your original script has no problems -- only my judgment.
XD sorry.


RE: Scripts - Gibstick - 10 Jul 10

NOOB!


RE: Scripts - Ronald_Reagan - 10 Jul 10

(01 Jul 10, 06:48PM)DES|V-Man Wrote: Rave - Changes light levels and fog colors to simulate a rave atmosphere!

I downloaded this script awhile back, and I have been messing around with it. I saw your music commmand, I looked through the reference (looked=used the find command) for the command music, it I didn't see the command. Is there a description for it?
More about the script, in the music command, it has a argument for command,
(music [$musicpath] [ms length] [command])
What does this do? I'm not quite sure how to use this.


RE: Scripts - DrauL - 11 Jul 10

(10 Jul 10, 02:41PM)flowtron Wrote: why do you delay additional 200 millis from #3 onwards? And then only 200 before "0"?
If you're going to count seconds then that'd be 1000 millis, or just go with 500 - but changing pace?!?! Are you a drummer? (haha, old musician joke).
nuke = [
  tic = 500
  cnt = 5
  say "..until we meet again.."
  sleep (* (+ $cnt 2) $tic) disconnect
  loop w $cnt [ sleep (* (+ $w 1) $tic) (concat say (- $cnt $w)) ]
]

I enjoy my crappyness.


RE: Scripts - Mael - 11 Jul 10

[Image: cannotredefine.jpg]

Any way around this "cannot redefine" stuff? I've been staring at the docs for an hour or so and can't figure it out. I'd like to be able to execute one command only when I'm on CLA team and another only if I'm dead.


RE: Scripts - DrauL - 11 Jul 10

Post the scripts that your trying to use here.


RE: Scripts - Mael - 11 Jul 10

R4zor helped me with it and I'm no longer getting that message, however the script is still not working properly.

infection = [say "Infection mode enabled"; if (&& (= (curteam) 0) (= (alive) 0)) [changeteam]]

The script is supposed to changeteam if a player is on CLA team and dead. It does that when I enter /infection but it needs to do it automatically and I need a way to loop it so it executes once every second or so.


RE: Scripts - Gibstick - 11 Jul 10

infecloop = [sleep 1000 (infection)]
infection = [say "Infection mode enabled"; if (&& (= (curteam) 0) (= (alive) 0)) [changeteam] []; infecloop]
This'll slow down the game.


RE: Scripts - R4zor - 11 Jul 10

infect = [if (> (listlen $arg1) 0) [alias infectmode $arg1]]
infectmode = 0
infection = [if (&& (= (curteam) 0) (= (alive) 0)) [changeteam; say "Infection mode enabled"]]
start_intermission = [saycommand /infect; echo "Will the next game be Infection? 1 for yes, 0 for no"]
bind MOUSE1 [if (= $infectmode 1) [infection]; attack]



RE: Scripts - V-Man - 12 Jul 10

(10 Jul 10, 07:38PM)Ronald_Reagan Wrote: (Rave)
More about the script, in the music command, it has a argument for command,
(music [$musicpath] [ms length] [command])
What does this do? I'm not quite sure how to use this.

"[$musicpath]" should contain the path to a music file (ogg or wav) of your choosing (e.g., packages\audio\songs\Ronald_Reagan);
"[ms length]" is how long you want the song to play for, in milliseconds;
"[command]" is what (if anything) you want to happen when the song finishes playing.


RE: Scripts - Ronald_Reagan - 12 Jul 10

Ok, thanks, I wasn't sure what that [command] was there for, I caught the rest.
Edit; then why is
music [packages/audio/songs/ac.ogg] [8400]
returning saying it "could not open music packages/audio/songs/ac.ogg" I tried it with the extension and with out the extension.


RE: Scripts - V-Man - 12 Jul 10

:/
I know it's given me trouble in the past, but I can't remember exactly why.
Definitely leave out the ".ogg" part.
I believe (now that I'm actually using some brain cells) that the path should start in the "songs" folder.
so:
music [ac] [8400]
should work. The path argument gets complicated if you try to play songs outside of the "songs" folder. (Look at my Assault Your Ears download for comparison).


RE: Scripts - Ronald_Reagan - 12 Jul 10

That makes sense in a very confusing way. But you were right.
Btw, broken link for me.


RE: Scripts - bballn45 - 12 Jul 10

Can someone tell me the sniper script. Were after shooting it pulls out your pistol automatically?


RE: Scripts - #M|A#Wolf - 12 Jul 10

That's not allowed ;)