Heh, Scriz heres the easy way ^_^
function BashFlagProtect(%client, %msg)
{
for(%word=0; %word <= 5; %word++)
%Word[%word] = getWord(%msg, %word);
if(String::findSubStr(%msg, "You are ready to bash!") != -1)
{
ClearBludgeCycle();
$a = 1;
$b = 99;
$BashFlagActive = "true";
BludgeCheck();
}
if($BashFlagActive == "true")
{
if(String::findSubStr(%msg, "You bashed") != -1)
{
$BashFlagActive = "false";
}
else if(String::findSubStr(%msg, "You try to hit") != -1)
{
$BashFlagActive = "false";
}
}
if(String::findSubStr(%msg, "!list") != -1)
{
if((%word[0] == "[GLBL]") || (%word[0] == "[ZONE]") || (%word[0] == "You"))
{
if((%word[1] == $PCFG::Name) || (%word[1] == "say,"))
{
$a = 1;
BludgeCheck();
}
}
}
}
function nextWeapon()
{
if($BashFlagActive == "true")
{
$BCTotal = $BludgeCycleTotal - 1;
if($b >= $BCTotal)
{
$b = 1;
use($BludgeCycle[$b]);
}
else
{
$b++;
use($BludgeCycle[$b]);
}
}
else
{
remoteEval(2048,nextWeapon);
}
}
function prevWeapon()
{
if($BashFlagActive == "true")
{
if($b <= 1)
{
$b = $BludgeCycleTotal;
}
else
{
$b--;
use($BludgeCycle[$b]);
}
}
else
{
remoteEval(2048,prevWeapon);
}
}
function BludgeCheck()
{
for(%i = 1; $BludgeList[%i] != ""; %i++)
{
if(getItemCount($BludgeList[%i]))
%best = $BludgeList[%i];
BludgeCycleWeap(%best);
}
if(!BludgeSwitch(%best))
{
//moo
}
}
function BludgeSwitch(%weapon)
{
if(%weapon == "")
return false;
use(%weapon);
return true;
}
function BludgeCycleWeap(%best)
{
if(%best != "")
{
$c = $a - 1;
if($BludgeCycle[$c] == %best)
{
return;
}
else
{
$BludgeCycle[$a] = %best;
$a++;
}
}
$BludgeCycleTotal = $a;
}
function ClearBludgeCycle()
{
for(%i=1; %i<=10; %i++)
{
$BludgeCycle[%i] = "";
}
$BludgeCycle[0] = "SafeZone";
}
%i = 0;
$BludgeList[%i++] = "Club";
$BludgeList[%i++] = "Quarter Staff";
$BludgeList[%i++] = "Bone Club";
$BludgeList[%i++] = "Spiked Club";
$BludgeList[%i++] = "Mace";
$BludgeList[%i++] = "Hammer Pick";
$BludgeList[%i++] = "Spiked Bone Club";
$BludgeList[%i++] = "Long Staff";
$BludgeList[%i++] = "War Hammer";
$BludgeList[%i++] = "Justice Staff";
$BludgeList[%i++] = "War Maul";
$BashFlagActive = "false";
Event::Attach(eventClientMessage, BashFlagProtect);