viruz | 2009-08-02 10:20
skybox-, loadsky- and exec-completion
16
points ]
 (2 votes)
A Script for tab-completion of skyboxes and .cfg-files

Instruction:
1. Put the file in your sauerbraten-folder
2. Put a line "exec treecomplete.cfg" in your autoexec.cfg

What you get: tab-completion for all skyboxes and cfg-files in your sauerbraten folder, even non-default files that are not included in the official release.

greez viruz.

License is the 3-clause FreeBSD license, so do with it what you want.

alias searchfolders ".";
alias skyboxlist "";
alias execlist "";


append = [
	$arg1 = (concat (getalias $arg1) $arg2); 
]
treecomplete = [
	alias tempfolders ""
	looplist i $searchfolders [
		loopfiles f $i "" [
			alias filepath (concatword $i "/" $f)
			filepath = (strreplace $filepath "./" "");
			if (> (strstr $filepath "_ft.") -1) [
				filepath = (strreplace $filepath "packages/" "");
				filepath = (substr $filepath 0 (strstr $filepath "_ft."));
				append skyboxlist $filepath
			] 
			if (> (strstr $filepath ".cfg") -1) [
				append execlist $filepath
			] 
			if (= (strstr $f ".") -1) [
				tempfolders = (concat $tempfolders $filepath);
			] 
		]
	]
	searchfolders = $tempfolders;
	if (= (listlen $searchfolders) 0) [
		listcomplete skybox $skyboxlist
		listcomplete loadsky $skyboxlist
		listcomplete exec $execlist
	] [
		sleep 50 treecomplete
	]
]
treecomplete
treecomplete.cfg (917 bytes)
16
points
 (2 votes)
User login
Created 2012-02-10 07:05
2 hours 10 min ago
Created 2012-02-10 07:02
2 hours 12 min ago
Created 2012-02-10 06:58
2 hours 17 min ago
10
points ]
 (1 vote)
Created 2012-02-07 21:59
2 days 11 hours ago
Created 2012-01-07 16:21
4 weeks 5 days ago
59
points ]
 (6 votes)
Created 2012-02-04 09:29
5 days 23 hours ago
Created 2012-02-09 23:23
9 hours 51 min ago
Created 2012-02-09 20:20
12 hours 54 min ago
50
points ]
 (5 votes)
Created 2010-02-18 22:58
1 year 50 weeks ago
Created 2012-02-05 18:51
4 days 14 hours ago
Greaserpirate
20
points ]
 (3 votes)
Created 2012-01-25 03:18
2 weeks 2 days ago
Chaos
Created 2012-02-02 01:28
1 week 1 day ago
10
points ]
 (1 vote)
Created 2012-02-04 21:45
5 days 11 hours ago
15
points ]
 (2 votes)
Created 2011-10-22 17:57
15 weeks 5 days ago
13
points ]
 (4 votes)
Created 2012-01-15 14:45
3 weeks 4 days ago
Created 2012-02-02 12:37
1 week 20 hours ago
14
points ]
 (2 votes)
Created 2012-02-01 01:19
1 week 2 days ago
Created 2012-01-25 00:02
2 weeks 2 days ago
Created 2012-01-27 20:51
1 week 6 days ago
lopsie4
23
points ]
 (4 votes)
Created 2012-01-25 09:15
2 weeks 1 day ago
Users on Quadropolis
7 guests & 2 users online