37
« on: January 22, 2011, 10:29:33 PM »
something makes the delay screw up, i'm trying to have it so that if you used the keybind in the last 5 seconds, it displays the next function, but if it hasn't been used in the last 5 seconds, to just display the function it's currently on
i should probably change the top comment too...
//Hug toggle, keybind code ripped from Ephialtes' quicksave, and commandtoserver('unusetool'); was suggested by Ephialtes
//Stolen from Ephialtes who stole from Randy
function AddBind(%division, %name, %command)
{
for(%i=0;%i<$remapCount;%i++)
{
if($remapDivision[%i] $= %division)
{
%foundDiv = 1;
continue;
}
if(%foundDiv && $remapDivision[%i] !$= "")
{
%position = %i;
break;
}
}
if(!%foundDiv)
{
error("Division not found: " @ %division);
return;
}
if(!%position)
{
$remapName[$remapCount] = %name;
$remapCmd[$remapCount] = %command;
$remapCount++;
return;
}
for(%i=$remapCount;%i>%position;%i--)
{
$remapDivision[%i] = $remapDivision[%i - 1];
$remapName[%i] = $remapName[%i - 1];
$remapCmd[%i] = $remapCmd[%i - 1];
}
$remapDivision[%position] = "";
$remapName[%position] = %name;
$remapCmd[%position] = %command;
$remapCount++;
}
if(!$AutoBound)
{
AddBind("Action", "Toggle", "AutoToggle");
AddBind("Action", "On", "AutoOn");
$AutoBound = true;
}
$AutoLast = 0;
function AutoToggle(%i)
{
if(%i)
return;
if($LastAuto == 0)
{
$LastAuto = 1;
$AutoLast = schedule(5000, 0, autolast);
}
else
{
if($Auto >= 9)
$Auto = 1;
else
$Auto++;
$LastAuto = 1;
$AutoLast = schedule(5000, 0, autolast);
cancel($AutoLast);
}
switch($Auto)
{
case 1:
NewChatSO.addLine("<color:ffffff>mousefire(1);");
case 2:
NewChatSO.addLine("<color:ffffff>jet(1);");
case 3:
NewChatSO.addLine("<color:ffffff>jump(1);");
case 4:
NewChatSO.addLine("<color:ffffff>crouch(1);");
case 5:
NewChatSO.addLine("<color:ffffff>autoclicker();");
case 6:
NewChatSO.addLine("<color:ffffff>moveforward(1);");
case 7:
NewChatSO.addLine("<color:ffffff>moveback(1);");
case 8:
NewChatSO.addLine("<color:ffffff>moveright(1);");
case 9:
NewChatSO.addLine("<color:ffffff>moveleft(1);");
}
}
function AutoOn(%i)
{
if(%i)
return;
switch($Auto)
{
case 0:
mousefire(1);
case 1:
mousefire(1);
case 2:
jet(1);
case 3:
jump(1);
case 4:
crouch(1);
case 5:
autoclicker();
case 6:
moveforward(1);
case 7:
moveback(1);
case 8:
moveright(1);
case 9:
moveleft(1);
}
}
function autolast()
{
$quack = 0;
}
function autoclicker()
{
mousefire(1);
schedule(33, 0, mousefire, 0);
$autoclicker = schedule(66, 0, autoclicker, true);
}