Blockland Forums > Modification Help

I Can't Make It Say Something Repeatly

Pages: (1/1)

clinr121:

This is my announcer (as newsbot) need to be fixed cause when i enter
Announce("TXT"); ill say txt once but if it repeats its blank, how do i get this right.

edit: fixed by greek2me, thank you greek2me

Heres my code


--- Code: ---function announce(%msg)
{
cancel($Announcertimer);
commandtoserver('messagesent',"[NewsBot]: " SPC %msg);
$annoucetimer = schedule(100000,0,announce,%msg);
}

function announceon()
{
activatepackage("Client_announce");
echo("its on");
}

function announceoff()
{
deactivatepackage("Client_announce");
echo("its off");
}
--- End code ---


MegaScientifical:

1: Clientside bot will get you banned.
2: There's no packages in that to activate.
3: You didn't include the message in the schedule.

Greek2me:

Try this:


--- Code: ---function announce(%msg)
{
cancel($announceTimer);
commandtoserver('messagesent',"[NewsBot]: " SPC %msg);
$announceTimer = schedule(100000,0,announce,%msg);
}
--- End code ---

Notice how I added %msg to the schedule. Before the message it displayed was blank because you didn't include that argument. I also added cancel(blah). This prevents your schedule loop from constantly building up because the schedule wasn't deleted.

clinr121:

thx

Pages: (1/1)

Go to full version