Author Topic: I Can't Make It Say Something Repeatly  (Read 402 times)

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: [Select]
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");
}
« Last Edit: June 20, 2011, 02:15:48 AM by clinr121 »

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.

Try this:

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

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.