Blockland Forums > Modification Help
1024 byte scripting contest
DrenDran:
I seriously have no idea what to make.
He's a script that adds a key bind for walking continuously:
--- Code: ---$awkd = true;
$awing = false;
function autowalk()
{
if($awkd)
$awing = !$awing;
if($awing)
moveforward(1);
else
moveforward(0);
$awkd = !$awkd;
}
$remapDivision[$remapCount] = "Movement";
$remapName[$remapCount] = "AutoWalking";
$remapCmd[$remapCount] = "autowalk";
$remapCount++;
--- End code ---
305 bytes, could compress to below 300 if I wanted to.
I was just about to post a topic for the 417 byte version that has been actually tested to work, this one should work, but hasn't been tested.
Truce:
Contest runs until Saturday (I'll be fair on timezones) so you've got time to think of something.
Bauklotz:
--- Quote from: DrenDran on January 17, 2011, 05:52:02 PM ---
--- Code: ---$awkd = true;
$awing = false;
function autowalk()
{
if($awkd)
$awing = !$awing;
if($awing)
moveforward(1);
else
moveforward(0);
$awkd = !$awkd;
}
$remapDivision[$remapCount] = "Movement";
$remapName[$remapCount] = "AutoWalking";
$remapCmd[$remapCount] = "autowalk";
$remapCount++;
--- End code ---
--- End quote ---
--- Code: ---function autoWalk(%val) {
if(%val)
moveForward(!$mvForwardAction);
}
$remapDivision[$remapCount] = "Movement";
$remapName[$remapCount] = "AutoWalking";
$remapCmd[$remapCount] = "autoWalk";
$remapCount++;
--- End code ---
--- Code: ---function aw(%a){if(%a)moveForward(!$mvForwardAction);}$remapDivision[$remapCount]="Move";$remapName[$remapCount]="AutoMove";$remapCmd[$remapCount]="aw";$remapCount++;
--- End code ---
Destiny/Zack0Wack0:
--- Quote from: Bauklotz on January 19, 2011, 05:09:04 AM ---
--- Code: ---function aw(%a){if(%a)moveForward(!$mvForwardAction);}$remapDivision[$remapCount]="Move";$remapName[$remapCount]="AutoMove";$remapCmd[$remapCount]="aw";$remapCount++;
--- End code ---
--- End quote ---
--- Code: ---function z(%a){if(%a)moveForward(!$mvForwardAction);}%c=$remapCount;$remapDivision[%c]="Move";$remapName[%c]="AutoMove";$remapCmd[%c]="z";$remapCount++;
--- End code ---
DrenDran:
I think Flaw/bauklotz version removed consideration for the fact that the keybind triggers the function on key press and release.