ID:160021
 
Hi guys, just another question.
How do you stop someone from holding a macro and letting them use the verb like a spam?

'Coz I have Meditate as a macro, and when they hold 'm' it lets them spam it, even when it has an if(!usr.meditating)

thanks guys.
The problem is in your code then, post the snippet and we'll help.
Uncheck the repeat option from that macro.

Of course, if you do not have control_freak set to 1, they can still modify their local skin copy and check repeat again.

If you have a stat gain at the beginning, move it after a delay. If it is looped and you do not want the loop to stack up, specify the value to something unique, such as:
mob/verb/Meditate()
src << "Start meditating f00!"
var/start = world.time // Sets the unique identifier to the world.time value (amount of time since world started)
src.meditate = start

while(1)
sleep(rand(100,1000)) // Random delay
if(start != src.meditate) // If the values do not match, something is wrong... so:
break // Breaks/stops this loop.
src << "You feel more stupid as people walk by you, staring." // This would not happen if the loop was broken

src << "You finally stop acting like you were meditating."
In response to Andre-g1
It's preset using a script file
macro//define these as Macros:
M return "Meditate"



    player
verb
Meditate()
set hidden = 1
if(!src.onshikai && !src.onbankai)
if (!usr.medding)
if(!usr.doin)
usr<<output("<font color=green>You started meditating","default.Battle")
if(src.quest == "Starting")
src.quest = "Sparr"
spawn(10)
alert(src,"Great. Now you're fully awake, why not stretch out a bit? Click the S key to Spar yourself.")
src.icon_state = "meditate"
src.canmove = 0
src.medding = 1
src.doin = 1
while(src.medding)
sleep(200)
src.credits += 1
sleep(300)
src.maxrei += 1
else
usr<<output("<font color=green>You stopped meditating","default.Battle")
src.icon_state = ""
src.canmove = 1
src.medding = 0
src.doin = 0
else
usr <<"Please revert from shikai/bankai first."