You should be using functions to reduce code repetition.
This entire script uses functions yet is simply what should be perhaps three-four functions in 16 separate ones, repeating the exact same code -several- times.
Combine all rightarm() etc function into a venomSelect() function Combine all rightarmAttack() etc functions into a general combination() function Combine all keyCountern() functions into one keyCounter() function Combine all KeyCounterResetn() functions into one keyCounterReset() function
Basically I couldn't decide where to throw the initalization of the variable for the keyCounter at. and I think I might could take out some of the stuff if I added in something like
You can just put it in a seperate script. You could have "Attack variables" and put all your variables in there, and then "Attack functions" and put the functions down there.
That's another thing, there's absolutely no reason to be defining your vtab Table 4 times, just throw it in a "vtab Table" script
Also instead of having a complex toggle for your shield attacks, just have each key/alias that toggles change a shieldAttack variable that you feed into the combination function in your attack keybinds.
So: F6 keyCounter(6) combination("left leg", venomSelect(), shieldAttack)
Where venomSelect returns a venom name to be used by combination and shield attack would be "drive" or "smash" and modified by whatever toggle you pressed last.
Comments
- Limb Counter - Fracture Relapsing -
"Honestly, I just love that it counts limbs." - Mizik Corten
This entire script uses functions yet is simply what should be perhaps three-four functions in 16 separate ones, repeating the exact same code -several- times.
Combine all rightarm() etc function into a venomSelect() function
Combine all rightarmAttack() etc functions into a general combination() function
Combine all keyCountern() functions into one keyCounter() function
Combine all KeyCounterResetn() functions into one keyCounterReset() function
function keyCounterFunction(num)
keyCounter(num) = keyCounter(num) + 1
if keyCounter(num) > 5
then keyCounter(num) = 1
end
return keyCounter(num)
end
with the variable being
keyCounter = {}
and to call it in the keypad+4
I'd do something like
keyCounterFunction(4)
leftLeg()
LeftLegAttack()
right.
keypad+4
keyCounterFunction(4)
leftLeg()
leftLegAttack()
limbAttack = "left leg"
and follow through for the rest of the limbs
then I'd be able to cut down all of these leftLeg rightLeg ect attack functions into:
function limbAttack()
if shieldAttack then
sendAll("clearqueue all",
"queue add eqbal combination " .. target .. " slice " ..limbAttack.. " " ..venom.. " " ..shieldAttack)
else
sendAll("clearqueue all",
"queue add eqbal combination " .. target .. " slice " ..venom.. "smash")
end
end
You could have "Attack variables" and put all your variables in there, and then "Attack functions" and put the functions down there.
That's another thing, there's absolutely no reason to be defining your vtab Table 4 times, just throw it in a "vtab Table" script
So:
F6
keyCounter(6)
combination("left leg", venomSelect(), shieldAttack)
Where venomSelect returns a venom name to be used by combination and shield attack would be "drive" or "smash" and modified by whatever toggle you pressed last.