Posts: 1,823
Threads: 20
Joined: Jun 2010
18 Dec 10, 01:43AM
(This post was last modified: 18 Dec 10, 12:47PM by Gibstick.)
CubeScript away! Make a script using "while" that does not crash/hang the client.
Rules
- Script must be in CubeScript
- Script must use "while".
- Script must do something, so while [(= 0 0)] [] does not count.
- Script can do anything that's verifiable. This includes defining aliases, connecting to servers, or just echo.
- Script must not hang the client for more than 10 seconds.
- Script must not crash the client.
- Script must be written for version 1.0 or later.
Deadline is 0:00 UDT January 8th 2011 (midnight before Jan 9). Submit scripts via forum private message.
Oh yeah the prize is GD's recognition of your godlike powers.
Posts: 170
Threads: 24
Joined: Aug 2010
Are multiple entries allowed?
Posts: 1,823
Threads: 20
Joined: Jun 2010
18 Dec 10, 04:58PM
(This post was last modified: 18 Dec 10, 07:45PM by Gibstick.)
Multiple entries are allowed - make it fascinating.
Posts: 3,780
Threads: 33
Joined: Jun 2010
Gibstick Wrote:# Script must not hang the client for more than 10 seconds.
# Script must not crash the client.
AHASUAHASUA I'm automatically disqualified.
Posts: 534
Threads: 21
Joined: Jun 2010
18 Dec 10, 08:58PM
(This post was last modified: 18 Dec 10, 08:58PM by Zarjio.)
while( thisCompetitionMayBeInteresting) {
boolean zarjHasNoKnowledgeOfCubescript = true;
if (zarjHasNoKnowledgeOfCubescript)
thisCompetitionMayBeInteresting = false;
}
zarjDoesNotEnter();
Posts: 3,780
Threads: 33
Joined: Jun 2010
19 Dec 10, 03:44PM
(This post was last modified: 19 Dec 10, 03:46PM by V-Man.)
// wloop -- getting the most out of "while"
alias wloop [
alias $arg1 0
alias cmmd $arg3
while [(checkalias $arg1)] [
cmmd
+= $arg1 1
if (= (getalias $arg1) $arg2) [delalias $arg1; delalias cmmd] []]]
// wloop i 21 [whois $i]
Dang, can I vote for Zarj's?
Edit:
// The backward loop by DES|V-Man
alias bloop [
alias $arg1 (- $arg2 1)
alias cmmd $arg3
while [(checkalias $arg1)] [
cmmd
-= $arg1 1
if (< (getalias $arg1) 0) [delalias $arg1; delalias cmmd] []]]
Just throwing in some variety. ;-)
Posts: 1,331
Threads: 44
Joined: Jun 2010
bind MOUSE2 [
startfov = $fov
if (= (curweapon) 5) [] [ // Avoid screwing up any sniper scope scripts clients may have
while [ (> $fov 75) ] [ fov (- $fov 1) ] // Zoom in with while :)
onrelease [
loop s (- $startfov $fov) [ // Zoom out with loop, couldn't get while to work here :p
if (= $fov $startfov) [] [
fov (+ $fov 1)
]
]
]
]
]
I know it's after the deadline but I was proud that I finally got while to work without bombing my client! :P
Posts: 1,823
Threads: 20
Joined: Jun 2010