| 
		
	
	
	
		
	Posts: 3,780Threads: 33
 Joined: Jun 2010
 
	
	
		Thanks Kirin! I'll test those tonight. If I find them tools-worthy, do I have your permission to add those to tools.cfg?
 @Bukz: Is the search feature really that popular? :O
 Nice fancification BTW. :D
 
		
	 
	
	
	
		
	Posts: 137Threads: 2
 Joined: Jun 2010
 
	
		
		
		16 Feb 11, 04:34PM 
(This post was last modified: 16 Feb 11, 04:37PM by Kirin.)
		
	 
		V-Man yes ofcourse! :)
 
		
	 
	
	
	
		
	Posts: 3,780Threads: 33
 Joined: Jun 2010
 
	
		
		
		16 Feb 11, 07:48PM 
(This post was last modified: 16 Feb 11, 07:50PM by V-Man.)
		
	 
		macm and I are proud to announce sendalias  -- transmit or receive an alias over in-game chat! Thanks to Bukz and Freddo for help with testing and debugging.
 
Be sure to update your tools.cfg file  to use this! :D
	
		
	 
	
	
	
		
	Posts: 3,780Threads: 33
 Joined: Jun 2010
 
	
		
		
		17 Feb 11, 09:14AM 
(This post was last modified: 17 Feb 11, 06:21PM by V-Man.)
		
	 
		// absval, square, and sqrt -- calculate absolute value, square, and square root -- by V-Manalias absval [if (<f 0 $arg1) [result $arg1] [result (*f $arg1 -1)]]
 // absval (value to calculate absolute value )
 
 alias square [result (*f $arg1 $arg1)]
 
 alias sqrt [
 sqrt_arg = (absval $arg1)
 tmp_sqrt = $sqrt_arg
 if (< $sqrt_arg 1) [
 tmp_sqrt_lo = 0
 tmp_sqrt_hi = 1
 sqrtloop
 ] [
 tmp_sqrt_lo = 1
 tmp_sqrt_hi = $sqrt_arg
 sqrtloop]
 result $tmp_sqrt
 ]
 
 alias sqrtloop [
 if (<f (absval (-f $sqrt_arg (square (getalias tmp_sqrt)))) 0.000001) [] [
 if (>f (square (getalias tmp_sqrt)) $sqrt_arg) [
 tmp_sqrt_hi = $tmp_sqrt
 tmp_sqrt = (average $tmp_sqrt (getalias tmp_sqrt_lo))
 if (&& (!=f $tmp_sqrt $tmp_sqrt_hi) (!=f $tmp_sqrt $tmp_sqrt_lo) (!=f $tmp_sqrt_hi $tmp_sqrt_lo)) [sqrtloop] []
 ] [
 if (<f (square (getalias tmp_sqrt)) $sqrt_arg) [
 tmp_sqrt_lo = $tmp_sqrt
 tmp_sqrt = (average $tmp_sqrt (getalias tmp_sqrt_hi))
 if (&& (!=f $tmp_sqrt $tmp_sqrt_hi) (!=f $tmp_sqrt $tmp_sqrt_lo) (!=f $tmp_sqrt_hi $tmp_sqrt_lo)) [sqrtloop] []
 ] [
 if (=f (square (getalias tmp_sqrt)) $sqrt_arg) [] [echo (c 3)Square root error]]]]]
// convertcnum and whoisline -- automatically stores the last "whois" info in an alias -- by V-Manalias convertcnum [
 delalias tmpcn
 loop co 42 [if (strcmp (at $conline 2) (concatword $co ":")) [tmpcn = $co] []]
 result $tmpcn
 ]
 
 add2conloop [
 if_conline_has "WHOIS" [
 if (= (listlen $conline) 7) [
 alias whoisline (concat (convertcnum) (at $conline 4) (at $conline 6))
 ] [
 alias whoisline (concat (convertcnum) (at $conline 4) (at $conline 7))]] []]
 // whoisline = cn, name, IP
// insertpos -- modify a list by inserting a specified element into a specified point in the list -- by V-Manalias insertpos [
 delalias tmp_list7
 loop inp (listlen $arg1) [
 if (= $arg2 $inp) [
 add2list tmp_list7 $arg3 ; add2list tmp_list7 (at $arg1 $inp)] [
 add2list tmp_list7 (at $arg1 $inp)]
 ]
 result $tmp_list7
 ]
 // insertpos (list) (position) (element to add)
 // echo (insertpos [I really would enjoy playing TOSOK all day long] 3 not)
 
 alias insertstr [
 if (= (findlist $arg1 $arg2) -1) [echo Specified string not found in list!] [
 insertpos $arg1 (+ (findlist $arg1 $arg2) 1) $arg3]
 ]
 // insertstr (list) (element after which to insert new element) (element to add) (next element, if it helps you)
 // echo (insertstr [A good Cuber will die for the team!] will sometimes die)
 // if there are two instances of the reference element, this script uses the first one.
// cconnect -- a way to quickly copy when other players say "connect server.url 28763 password", or to easily tell other players this info -- by V-Man// Users store server info by typing "getserver" when they are in the desired server.
 // The password can be added to the alias by adding it as an argument to "getserver"
 // They can then go to other servers and type "sayserver" to invite other players to that server.
 // The script also recognizes "connect" messages and automatically stores them.
 // The user can access them by typing "cconnect".
 alias connectline []
 
 add2conloop [
 if (strcmp (at $conline 1) "connect") [
 alias connectline (concat (at $conline 2) (at $conline 3) (at $conline 4))
 if (>= (listlen $connectline) 1) [echo (c 2)Connect information has been stored!] []
 ] []]
 
 alias cconnect [
 if (strcmp $connectline "") [
 echo (c 3)No connect information is stored.
 ] [
 connect (at $connectline 0) (at $connectline 1) (at $connectline 2)]
 ]
 
 alias getserver [
 if (strcmp $arg1 "") [
 alias connectline (curserver 5)
 ] [
 alias connectline (concat (curserver 5) $arg1)
 ]
 ]
 
 alias sayserver [say connect $connectline]
 
 // getserver (password)
 // sayserver
// votehandler -- stores the last vote in an alias, allowing you to view or re-call it -- by V-Manalias votehandler [
 if (strcmp $vote_type "load") [alias map_vote (at $conline 6); alias mode_vote (at $conline 9)] []
 if (strcmp $vote_type "kick") [alias player_kbf (findcn (at $conline 6)); alias kb_reason (at $conline 8)] []
 if (strcmp $vote_type "ban") [alias player_kbf (at $conline 6); alias kb_reason (at $conline 8)] []
 if (strcmp $vote_type "shuffle") [] []
 if (strcmp $vote_type "force") [alias player_kbf (findcn (at $conline 6))] []
 if (strcmp $vote_type "set") [alias mmarg (at $conline 7)] []
 ]
 
 add2conloop [
 if_conline_has "called a vote: " [alias vote_is_pending 1; alias who_called (at $conline 0); alias vote_type (at $conline 4); votehandler] []
 if_conline_has "vote passed" [alias vote_is_pending 0] []
 if_conline_has "vote failed" [alias vote_is_pending 0] []
 ]
 
 alias lastvote [
 if (strcmp $vote_type "load") [$mode_vote $map_vote] []
 if (strcmp $vote_type "kick") [kick $player_kbf $kb_reason] []
 if (strcmp $vote_type "ban") [ban $player_kbf $kb_reason] []
 if (strcmp $vote_type "shuffle") [callvote 12] []
 if (strcmp $vote_type "force") [forceteam $player_kbf] []
 if (strcmp $vote_type "set") [
 if (strcmp $mmarg "open") [mastermode 0] []
 if (strcmp $mmarg "private") [mastermode 1] []
 if (strcmp $mmarg "match") [mastermode 2] []
 ] []
 ]
 
 TDM = tdm
 DM = dm
 SURV = lms
 surv = lms
 TSURV = ts
 tsurv = ts
 CTF = ctf
 PF = pf
 BTDM = [votemap 7 $arg1]
 BDM = [votemap 8 $arg1]
 LSS = lss
 OSOK = osok
 TOSOK = tosok
 BOSOK = [votemap 12 $arg1]
 HTF = htf
 TKTF = tktf
 KTF = ktf
 vote_is_pending = 0
O_o spam much V-Man? Gawrsh...
 
Oh BTW, that "convertcnum" and "whoisline" are needed in order for Remote Control  to work...
 
Yeah. Obviously another update to tools.cfg is due... The day after the last one. XD XD XD 
Please PM me with feedback about the Remote Control script if you use it. :D
	 
		
	 
	
	
	
		
	Posts: 137Threads: 2
 Joined: Jun 2010
 
	
		
		
		17 Feb 11, 06:43PM 
(This post was last modified: 17 Feb 11, 07:14PM by Kirin.)
		
	 
		v-man i would recommend you to ditch bisection and use the tangent method to calculate square roots (and generally zeroes of derivable functions) 
here's an implementation
 scroll down for the fixed version :) sry for the inconvenient
it's MUCH faster (MUCH!) 
this calcolates sqrt up to the maximun precision allowed 
also this is not recursive so it's another advantage my implementation has.
	
		
	 
	
	
	
		
	Posts: 3,780Threads: 33
 Joined: Jun 2010
 
	
		
		
		17 Feb 11, 06:54PM 
(This post was last modified: 17 Feb 11, 06:56PM by V-Man.)
		
	 
		I did the first method that came to my head. XDI'll test this version, thanks for showing it to me!
 
 Edit: Can you add decimal-argument capability? Right now the sqrt of 0.5 is 0.25... XD
 
		
	 
	
	
	
		
	Posts: 137Threads: 2
 Joined: Jun 2010
 
	
		
		
		17 Feb 11, 07:01PM 
(This post was last modified: 17 Feb 11, 07:31PM by Kirin.)
		
	 
		let me see what bug i left XD i tested it only for numbers above 1 
and it got to full precision in few steps 
FIXED:
 // absval, square, and sqrt -- calculate absolute value, square, and square root -- by V-Manalias absval [if (<f 0 $arg1) [result $arg1] [result (*f $arg1 -1)]]
 // absval (value to calculate absolute value )
 
 alias square [result (*f $arg1 $arg1)]
 alias sqrt [
 alias x (divf (+f $arg1 1) 2)
 alias sqrt_prec 1e-05
 tmp_iters = 0
 sqrt_perr = (absval (-f (square $arg1) $arg1))
 sqrt_err = (absval (-f (square $x) $arg1))
 while [(|| (<f $sqrt_err $sqrt_perr) (< $tmp_iters 5))] [
 -=f x (divf (-f (square $x) $arg1) (*f 2 $x))
 sqrt_perr = $sqrt_err
 sqrt_err = (absval (-f (square $x) $arg1))
 += tmp_iters 1
 ]
 result $x
 ]
it wasnt converging for numbers below 1 because the initial guess add opposite tendence to the square root. 
now i'm pretty confident it works for every number 
and that it has not got any corner cases
	
		
	 
	
	
	
		
	Posts: 3,780Threads: 33
 Joined: Jun 2010
 
	
		
		
		17 Feb 11, 10:29PM 
(This post was last modified: 17 Feb 11, 10:30PM by V-Man.)
		
	 
		You da man! Can I put it in the next tools update? :D
 Oh and this definitely wins the "while" contest in my book.
 
		
	 
	
	
	
		
	Posts: 1,823Threads: 20
 Joined: Jun 2010
 
	
		
		
		17 Feb 11, 10:31PM 
(This post was last modified: 17 Feb 11, 10:31PM by Gibstick.)
		
	 
		Too late, the contest is closed. The only attention it attracted was stef's.
	 
		
	 
	
	
	
		
	Posts: 3,780Threads: 33
 Joined: Jun 2010
 
	
		
		
		18 Feb 11, 08:20AM 
(This post was last modified: 18 Feb 11, 08:20AM by V-Man.)
		
	 
		D:
	 
		
	 
	
	
	
		
	Posts: 137Threads: 2
 Joined: Jun 2010
 
	
	
		yes V-Man, (btw i already answered this question :D)
	 
		
	 
	
	
	
		
	Posts: 152Threads: 20
 Joined: Jul 2010
 
	
	
		heya script nerds ^^i was wondering if some1 can make me a script or just tell me where to get it which would do:
 count and show you how many times you have hitted your enemy. e.g. i shoot some1 with AR and i see the number of hits in the console? :P
 thank you :)
 
		
	 
	
	
	
		
	Posts: 2,067Threads: 11
 Joined: Jun 2010
 
	
	
		Turn "Hit Sound" on.
 Settings > Gameplay
 
 Unless you want a message spammed in your console.
 
		
	 
	
	
	
		
	Posts: 2,841Threads: 44
 Joined: Jun 2010
 
	
	
		Milandrag: What Orygne mentioned, as well as using /accuracy which also showed how many bullets you have shot in total and how many actually hit.
	 
		
	 
	
	
	
		
	Posts: 3,780Threads: 33
 Joined: Jun 2010
 
	
		
		
		19 Feb 11, 08:18AM 
(This post was last modified: 19 Feb 11, 08:53AM by V-Man.)
		
	 
		Give the devs some overpriced wine to try to get them to code CubeScript access to the accuracy stats and I'll make that script for ya. ;-) 
 
Just in case someone looks here for it, 
Try the new Random Terrain Generator!! ![[Image: rndmap%208%2030%205%2016_small.jpg]](http://baconbukz.co.cc/up/uploads/rndmap%208%2030%205%2016_small.jpg) 
		
	 
	
	
	
		
	Posts: 1,823Threads: 20
 Joined: Jun 2010
 
	
	
		V-Man, make me a script to do something like bs_hypercube.
	 
		
	 
	
	
	
		
	Posts: 865Threads: 35
 Joined: Dec 2010
 
	
	
		you know what would be awesome? a server that made it's own maps, and it would generate different sized/shaped ones depending on how many players are on.
	 
		
	 
	
	
	
		
	Posts: 3,780Threads: 33
 Joined: Jun 2010
 
	
		
		
		19 Feb 11, 09:10PM 
(This post was last modified: 19 Feb 11, 10:21PM by V-Man.)
		
	 
		@Gibstick: Show me bs_hypercube!@Lantry: You could pre-generate a bunch of them, and then use the maprot file to load them into the game for a day or two.
 
 @Everyone who downloaded the terrain generator so far: Sorry, I assumed some of my latest scripts had already been added to tools.cfg. ANOTHER UPDATE TONIGHT! lol
 
		
	 
	
	
	
		
	Posts: 1,823Threads: 20
 Joined: Jun 2010
 
	
	
		I was half kidding when I said that, but you can explore the option if you want for fun. Ask pwnage for bs_hypercube.
	 
		
	 
	
	
	
		
	Posts: 140Threads: 9
 Joined: Jun 2010
 
	
		
		
		20 Feb 11, 05:54AM 
(This post was last modified: 21 Feb 11, 09:28PM by SplatZ.)
		
	 
		update on random map generator to make it work?edit: i guess not, since v-man's offline
 reedit: ty this things awesome! imma make a server with only random generated maps. Itll be a weird server!
 re re edit: maybe not as ac_server still is not working with my server provider. Stupid hazenet!
 
		
	 
	
	
	
		
	Posts: 3,780Threads: 33
 Joined: Jun 2010
 
	
		
		
		20 Feb 11, 08:54AM 
(This post was last modified: 20 Feb 11, 09:49AM by V-Man.)
		
	 
		This update of tools.cfg should do the trick. Sorry for taking so long... XD
 
 
For kicks und giggles:
 
A stopwatch
 delalias swstalias stopwatch [
 if (strcmp $arg1 "start") [alias swst (millis)] [
 if (strcmp $arg1 "time") [if (checkalias swst) [echo (- (millis) $swst)] [stopwatch isn't running!]] [
 if (strcmp $arg1 "clear") [delalias swst] []]]]
A vote detector (and storage unit)
 // votehandler -- stores the last vote in an alias, allowing you to view or re-call it -- by V-Manalias votehandler [
 if (strcmp $vote_type "load") [alias map_vote (at $conline 6); alias mode_vote (at $conline 9)] []
 if (strcmp $vote_type "kick") [alias player_kbf (findcn (at $conline 6)); alias kb_reason (at $conline 8)] []
 if (strcmp $vote_type "ban") [alias player_kbf (at $conline 6); alias kb_reason (at $conline 8)] []
 if (strcmp $vote_type "shuffle") [] []
 if (strcmp $vote_type "force") [alias player_kbf (findcn (at $conline 6))] []
 if (strcmp $vote_type "set") [alias mmarg (at $conline 7)] []]
 
 add2conloop [
 if_conline_has "called a vote: " [alias vote_is_pending 1; alias who_called (at $conline 0); alias vote_type (at $conline 4); votehandler] []
 if_conline_has "vote passed" [alias vote_is_pending 0] []
 if_conline_has "vote failed" [alias vote_is_pending 0] []]
 
 alias lastvote [
 if (strcmp $vote_type "load") [$mode_vote $map_vote] []
 if (strcmp $vote_type "kick") [kick $player_kbf $kb_reason] []
 if (strcmp $vote_type "ban") [ban $player_kbf $kb_reason] []
 if (strcmp $vote_type "shuffle") [callvote 12] []
 if (strcmp $vote_type "force") [forceteam $player_kbf] []
 if (strcmp $vote_type "set") [
 if (strcmp $mmarg "open") [mastermode 0] []
 if (strcmp $mmarg "private") [mastermode 1] []
 if (strcmp $mmarg "match") [mastermode 2] []
 ] []]
 
 TDM = tdm
 DM = dm
 SURV = lms
 surv = lms
 TSURV = ts
 tsurv = ts
 CTF = ctf
 PF = pf
 BTDM = [votemap 7 $arg1]
 BDM = [votemap 8 $arg1]
 LSS = lss
 OSOK = osok
 TOSOK = tosok
 BOSOK = [votemap 12 $arg1]
 HTF = htf
 TKTF = tktf
 KTF = ktf
 vote_is_pending = 0
A "connect" detector
 // cconnect -- a way to coordinate server connection information with other players -- by V-Man// Users store server info by typing "getserver" when they are in the desired server.
 // The password can be added to the alias by adding it as an argument to "getserver"
 // They can then go to other servers and type "sayserver" to invite other players to that server.
 // The script also recognizes "connect" messages and automatically stores them.
 // The user can access them by typing "cconnect".
 alias connectline []
 
 add2conloop [
 if (strcmp (at $conline 1) "connect") [
 alias connectline (concat (at $conline 2) (at $conline 3) (at $conline 4))
 if (>= (listlen $connectline) 1) [echo (c 2)Connect information has been stored!] []] []]
 
 alias cconnect [
 if (strcmp $connectline "") [
 echo (c 3)No connect information is stored.
 ] [
 connect (at $connectline 0) (at $connectline 1) (at $connectline 2)]]
 
 alias getserver [
 if (strcmp $arg1 "") [
 alias connectline (curserver 5)
 ] [
 alias connectline (concat (curserver 5) $arg1)]]
 alias sayserver [say connect $connectline]
 // getserver (password)
 // sayserver
 
		
	 
	
	
	
		
	Posts: 140Threads: 9
 Joined: Jun 2010
 
	
	
		do you think that a server made of completely randomly generated maps would be allowed in the master server? most of the maps have a wqd of way over 5000...
	 
		
	 
	
	
	
		
	Posts: 3,780Threads: 33
 Joined: Jun 2010
 
	
	
		lol,Note that the purpose of the random terrain script is to help inspire mappers.
 
 If enough interest is expressed, I'll consider adding pickup and waterlevel randomization to the script.
 
		
	 
	
	
	
		
	Posts: 3,780Threads: 33
 Joined: Jun 2010
 
	
		
		
		23 Feb 11, 08:45AM 
(This post was last modified: 23 Feb 11, 08:45AM by V-Man.)
		
	 
		If you like spam, you'll love the ping script! // messy way for CubeScript to calculate ping by V-Man// uh, by the way, this is not accurate. XD
 ping = 0
 cwatching = 0
 checkinit watchingfor 0
 
 alias on_nextconline [
 cwatching = 1
 watchingfor = $arg1
 watchcommand = $arg2]
 
 add2conloop [
 if $cwatching [if_conline_has $watchingfor [watchcommand; cwatching = 0] []] []]
 
 recursive findping 10000 [
 if $connected [
 whois (findcn $curname)
 tmp_millis = (millis)
 on_nextconline WHOIS [ping = (div (+ $ping (div (- (millis) $tmp_millis) 2)) 2)]] []]
 
 addcheck_msa findping
I also figured AC needs hotkey compatibility, with common commands and such.
 add2bind LCTRL [ctr = 1; onrelease [ctr = 0]]add2bind RCTRL [ctr = 1; onrelease [ctr = 0]] // either ctrl key works
 add2bind C [if $ctr [if $editing [copy] [copyconline = $cconline]] []] // copies editing selection or the latest console output!
 add2bind V [if $ctr [if $editing [paste] [saycommand (getalias copyconline)]] []] // pastes editing stuff or the console copy!
 add2bind A [if $ctr [if $editing [select 2 2 512 512] []] []] // Select a whole map
 add2bind S [if $ctr [if $editing [if (strcmp (curmap) []) [saycommand "savemap "] [savemap]] []] []] // save the map
 add2bind Z [if $ctr [if $editing [undo] []]] // Ctrl+z! Of course!
 add2bind F [if $ctr [saycommand "docfind "]] // find
 add2bind Q [if $ctr [quit]] // quit
 add2bind P [if $ctr [screenshot]] // print XD
 add2bind O [if $ctr [if $connected [showmenu Gamemode] [showmenu maps]] []] // "open"
 add2conloop [if (strcmp $conline [ ]) [] [cconline = $conline]] // enables copying conline
		
	 
	
	
	
		
	Posts: 3,462Threads: 72
 Joined: Jun 2010
 
	
	
		I'll look at the mac binds soon enough and make it work for mac cmd keys. Notice that this will still work for mac users, just only for the control key (which you are generally not used to).
	 
		
	 
	
	
	
		
	Posts: 574Threads: 83
 Joined: Jun 2010
 
	
		
		
		23 Feb 11, 09:02AM 
(This post was last modified: 23 Feb 11, 09:03AM by DeafieGamer.)
		
	 
		 (21 Aug 10, 09:37AM)Kirin Wrote:  i think that now it's a good idea to add this command:
 
 addtimedloop [millisecs] [alias]
what do u think guys?
 
 GJ Bukz :)
 
 btw bukz
 u can do conline [ ]
 to avoid the spam and this way your scripts will become much more efficient.
 EDIT: took time to do it properly:
 
 //on Tk message script by Bukz. little mod by kirin.if (! (strstr $mapstartalways tkchk)) [add2alias mapstartalways [sleep 1000 [tkchk]]] []
 if (checkalias srymsg) [] [srymsg = "Sorry Mate :("]
 
 tkchk = [
 if (= $connected 1) [ // Only apoligize to real people :p
 if (strstr $conline "you fragged teammate ") [say (concatword % $srymsg);conline [ ]] []
 if (strstr $conline "you gibbed teammate ") [say (concatword % $srymsg);conline [ ]] []
 if (strstr $conline "you splattered teammate ") [say (concatword % $srymsg);conline [ ]] []
 if (strstr $conline "you knifed teammate ") [say (concatword % $srymsg);conline [ ]] []
 if (strstr $conline "you headshotted teammate ") [say (concatword % $srymsg);conline [ ]] []
 ]
 sleep 1 [tkchk]
 ]
 newmenu "sorrymsg"
 menuitemtextinput "message on TeamKill: " "result $srymsg" "srymsg = $arg1"
much simpler and efficient dont ya think?
 
 also i fixed a bug that launched your script repeatdly after rerunning AC
 
 mapstartalways was getting accumulated.
 and i added a default for srymsg.
 
 EDIT..
 fixed another bug for those who call themselfes "teammate"
 
Supposed you want to kick the teamkiller with score of -5 or below?
	 
		
	 
	
	
	
		
	Posts: 3,462Threads: 72
 Joined: Jun 2010
 
	
	
	
		
	Posts: 574Threads: 83
 Joined: Jun 2010
 
	
	
		Supposed that server didnt have teamkill ban option....
	 
		
	 
	
	
	
		
	Posts: 137Threads: 2
 Joined: Jun 2010
 
	
	
	
		
	Posts: 574Threads: 83
 Joined: Jun 2010
 |