Posts: 119
Threads: 8
Joined: Jun 2010
19 Nov 10, 12:09PM
(This post was last modified: 19 Nov 10, 12:30PM by VallDiGna.)
Is there any way to get the player name giving the client number?
Is there any way to get the Client Number giving the player name?
Thnks
Edit: Founded, /findcn and /findpn
Posts: 1,823
Threads: 20
Joined: Jun 2010
findcn is a marvelous function. You can create kick aliases like /k playername with it.
Posts: 2,387
Threads: 56
Joined: Aug 2010
Posts: 205
Threads: 3
Joined: Jun 2010
21 Nov 10, 10:48PM
(This post was last modified: 21 Nov 10, 11:04PM by macm.)
i made this script to practise with all weapons, it will randomize my main weapon everytime i die.
//made by macm
alias on_death [
if (= $connected 1) [
if (= (alive) 1) [ded = 0; stp = 1] [
if (= $stp 1) [
if (= $ded 1) [] [rndwep1; //you can add anything you like in this line, it will be executed when you die (exp. me "died")
ded = 1] ]
[] ] ] [];
sleep 1 [on_death]
]
add2alias mapstartalways [stp = 0; on_death]
rndwep0 = 0
rndwep = [if (= $rndwep0 1) [rndwep0 = 0; echo "rndwep is now off"] [rndwep0 = 1; echo "rndwep is now on"]]
//this is the random weapon alias
alias rndwep1 [
if (= $rndwep0 1) [
rndwep2 = (rnd 4);
nextprimary (+ $rndwep2 2)
] []
]
type /rndwep ingame to set it on/off.
Posts: 1,823
Threads: 20
Joined: Jun 2010
21 Nov 10, 10:55PM
(This post was last modified: 21 Nov 10, 11:06PM by Gibstick.)
I had experimented with those random weapon scripts before and I also used a bunch of ifs. Then someone told me that this wouldn't be completely random because it could check the value of rndwep2 several times before something matches. With each if (= rndwep2 x), the value of rndwep2 is being randomized. The solution is rndwep2 = (rnd 4)
nextprimary (+ $rndwep2 2)
Posts: 205
Threads: 3
Joined: Jun 2010
Updated, thanks Gibstick :)
Posts: 1,331
Threads: 44
Joined: Jun 2010
23 Nov 10, 02:21PM
(This post was last modified: 25 Nov 10, 01:45AM by Bukz.)
For mappers:
Automatic map backup system with configurable intervals...
Ty V-Man for the updated autosaveinitdelay fix! :D
The available commands are:
/autosavemap
/showmenu autosave
When enabled (/autosavemap 1), by default it will save your map the first time 30 seconds (30,000 milliseconds) after launching the map, you must be in editmode (or in coop mode) for it to save. After that it will save your map in intervals of 150,000 milliseconds, or once every 2 and 1/2 minutes. These values can be tweaked via /showmenu autosave. /autosavemap 0 to disable.
Feedback welcomed. Enjoy!
Posts: 3,462
Threads: 72
Joined: Jun 2010
Posts: 1,331
Threads: 44
Joined: Jun 2010
23 Nov 10, 05:41PM
(This post was last modified: 23 Nov 10, 05:43PM by Bukz.)
hehe, I'm flattered, there is a noob problem that I'm sure V-Man will point out. It doesn't cripple the backup system, but it does kinda ruin autosaveinitdelay... :p
It was a quick write during a break from the stats script... D:
Fixes are welcomed too. :)
Posts: 3,780
Threads: 33
Joined: Jun 2010
Hmm, can't see it...
If you can see it, maybe you should just fix it! :-P
Posts: 170
Threads: 24
Joined: Aug 2010
Posts: 1,331
Threads: 44
Joined: Jun 2010
Using add2alias mapstartalways to set the initial delay won't work, if they want to modify it from the default value via the menu. Not quite sure how to go about fixing actually xD.
Posts: 1,823
Threads: 20
Joined: Jun 2010
25 Nov 10, 12:55AM
(This post was last modified: 25 Nov 10, 01:04AM by Gibstick.)
Remember if you need cubescript help, #cubescript on gamesurge.
Edit: no, this wasn't directed to Bukz, who happens to own the channel.
Posts: 3,780
Threads: 33
Joined: Jun 2010
25 Nov 10, 01:27AM
(This post was last modified: 25 Nov 10, 01:45AM by Bukz.)
Bukz, I found the problem. Saving the whole line into mapstartalways causes the sleep value to only be evaluated once, while putting it into an alias, then putting the alias into mapstartalways will allow it to be determined each time mapstartalways is executed.
Updated automatic map backup
Mod edit:
Updating url with a minor fix in the strstr check for mapstartalways... :P
Posts: 1,331
Threads: 44
Joined: Jun 2010
Link to the raw version so colors are not forked upon copypasta! nub :P
j/k ♥
ty for fixing :D
Posts: 1,331
Threads: 44
Joined: Jun 2010
http://pastebin.com/raw.php?i=ZWjSkQ08
Automatic gamma changing script for all official maps. Use:
to bring up the gamma customization menu. Find the value that you prefer for that map, set it, and forget it! That gamma will be automatically set for that map everytime you play. :)
Posts: 76
Threads: 1
Joined: Jun 2010
or bind MINUS [ gamma (- $gamma 10); echo Gamma ($gamma) ]
bind EQUALS [ gamma (+ $gamma 10); echo Gamma ($gamma) ]
Posts: 3,780
Threads: 33
Joined: Jun 2010
GD (and everyone else), what do you use for scrolling through the text console? Just curious.
Posts: 1,823
Threads: 20
Joined: Jun 2010
//Console-scroller
//by grenadier
alias gn_console 0
bind "F11" [
toggleconsole
if (= $altconsize 0)[
if (= $gn_console 0) [
alias gn_console 2
][
alias gn_console 0
conskip -1000
]
][
if (= $gn_console 0) [
alias gn_console 1
][
if (= $gn_console 1)[
alias gn_console 2
][
alias gn_console 0
conskip -1000
]
]
]
]
bind "MOUSE4" [ if (< $gn_console 2) [universaldelta 1] [conskip 5] ] //conskip 5 and -5 sets how much the console will scroll.
bind "MOUSE5" [ if (< $gn_console 2) [universaldelta -1] [conskip -5] ] //end of console scroller
Posts: 2,136
Threads: 50
Joined: Jun 2010
27 Nov 10, 05:09PM
(This post was last modified: 27 Nov 10, 05:10PM by jamz.)
Scroll wheel, thanks to grenadier.
edit: Gickstib beat me by seconds
Posts: 3,780
Threads: 33
Joined: Jun 2010
OOOOHHHAAAHHHH
Putting it in a domodifier bind would complete my life!
Great!
Thanks for the idea! :D
Posts: 1,823
Threads: 20
Joined: Jun 2010
While we're all here, what's the use of && when it's used in:
bind "F1" [ && (vote 1) [ echo "you voted yes"] ]
Isn't cubescript executed all at once, or does this ensure that it's done at the same time?
Posts: 2,387
Threads: 56
Joined: Aug 2010
The most usefull script in the world.
____________________________
Epic GG :P
alias myname [sleep 500 [name PutYourNameHere]]
alias epicgg [sleep 200 [name Good]; sleep 400 [me "Game !!"]; sleep 600 [myname]]
*I'm learning how to make scripts so be tolerant :)*
Posts: 1,823
Threads: 20
Joined: Jun 2010
27 Nov 10, 06:25PM
(This post was last modified: 27 Nov 10, 06:26PM by Gibstick.)
You can use ($curname).
Posts: 3,780
Threads: 33
Joined: Jun 2010
@Gibstick:
Somehow the (vote 1) statement is only evaluated as "true" (1) if a vote is successfully cast; if you've already voted, or there is no vote pending, the statement evaluates as false. I've also been a bit intrigued by that.
Posts: 890
Threads: 16
Joined: Jun 2010
(27 Nov 10, 05:31PM).ExodusS* Wrote: The most usefull script in the world.
You can simplify that to:
Posts: 1,823
Threads: 20
Joined: Jun 2010
You know what'd be funny?
bind "G" "gg"
alias gg [gg]
Posts: 3,780
Threads: 33
Joined: Jun 2010
lawl.
Put that in this thread.
Posts: 890
Threads: 16
Joined: Jun 2010
For those of you who crash frequently...
/bind w "writecfg; writecfg"
I'm hoping that's a functional workaround for saving your settings in event of a crash. I won't know until I induce one I suppose.
Posts: 3,780
Threads: 33
Joined: Jun 2010
It wouldn't hurt to put it at the end of autoexec.cfg; at least then you aren't writing all the time.
|