Author Topic: Scripting Help  (Read 1216 times)

I am trying to learn to script and understand a few basics. But I was just wandering how I could type a message into the game and have another message come up with a name. For instance:
Me: Hello all
Bot: Hello
if you catch my drift.
Thanks in advance

To do this, you have to package the funcdion serverCmdMessageSent.
Code: [Select]
package sillyMsgSentEdit
{
  function serverCmdMessageSent(%client, %text)
  {
   if(%text $= "The Game")
   {
    messageAll('',"\c3Bot\c6: The game is stupid.");
   }
   parent::serverCmdMessageSent(%client, %text);
  }
};
activatePackage(sillyMsgSentEdit);

Not sure of this, as I myself have been experimenting with this lately.
Another example:

Code: [Select]
package changethegame
{
function serverCmdMessageSent(%client, %text)
{
if(%text $= "the game")
{
messageAll('',"\c7"@%client.clanPrefix@"\c3"@%client.name@"\c7"@%client.clanSuffix@"\c6: porkchop sandwitches");
}
Parent::serverCmdMessageSent(%client, %text);
}
};
activatepackage(changethegame);

I got BSoD while typing this and it restored itself after startup.

Wow.

Thank you so much... One issue thou I was using the first one and... The bot commented before me lol

Tom

The reason it's doing that is because the parent was called after the bot message was sent.

The reason it's doing that is because the parent was called after the bot message was sent.
i was ninja'd


You can "fix" it by putting the Parent::serverCmdMessageSent(%client, %text); before all that stuff.
« Last Edit: July 16, 2010, 10:28:56 PM by otto-san »

thanks for all your help I have a final question before I lock this. How does one "USE" schedules inside of a package.

Edit: failed at spelling use how clumsy...
« Last Edit: July 17, 2010, 10:03:52 PM by nanoviro »

thanks for all your help I have a final question before I lock this. How does one you schedules inside of a package.
After 2 minutes of trying to decipher that sentence, I failed.

something like this

schedule(1000,0,commandtoserver,'messagesent',"i was the turkey all along");

Thanks for your help Locking...