Poll

Who is the best scripter that can teach me?

Danny Boy
Truce
Xalos
jes00

Author Topic: My chatbot is not working  (Read 8161 times)

It's %msg. I guarantee. Don't waste your time bout this.
K then, poll locked, though I still need to find a way to activate the chatbot.
« Last Edit: March 09, 2012, 06:47:26 PM by Deoxys And One Noob »

K then, poll locked, though I still need to find a way to activate the chatbot.

Try saying "NoobBot".


use switch() not if()

use switch() not if()

OK.

Congrats, this was a EPIC FAIL.

Script:

//Made by Deoxys & One Noob, BLID 30436
package chatbot
{
   function clientCmdChatMessage(%a,%b,%c,%fmsg,%cp,%name,%cs,%fmsg)
   {
      parent::clientCmdChatMessage(%a,%b,%c,%fmsg,%cp,%name,%cs,%fmsg);
      switch(%msg $= "NoobBot")
      {
         switch(%name $= "Deoxys & One Noob")
         {
            commandToServer('messageSent', "What a cool chatbot!");
            }
      }
   }
};
activatePackage(chatbot);

Description.txt:

"NoobBot, Deoxys & One Noobs cool chatbot"

Anything wrong?


« Last Edit: March 09, 2012, 11:18:59 PM by Deoxys And One Noob »

Description.txt:

"NoobBot, Deoxys & One Noobs cool chatbot"

description.txt

Quote
Title: NoobBot
Author: Deoxys & One Noob
« Last Edit: March 10, 2012, 12:01:03 AM by Port »

package chatbot
{
   function clientCmdChatMessage(%a,%b,%c,%fmsg,%cp,%name,%cs,%msg)
   {
      parent::clientCmdChatMessage(%a,%b,%c,%fmsg,%cp,%name,%cs,%msg);
      switch(%msg $= "NoobBot" && %name $= "Deoxys & One Noob")
      {
            commandToServer('messageSent', "What a cool chatbot!");
      }
   }
};
activatePackage(chatbot);

Should work now

No, that still shouldn't work.

Code: [Select]
package chatbot
{
function clientCmdChatMessage( %cl, %voice, %pitch, %line, %pre, %name, %suf, %msg )
{
parent::clientCmdChatMessage( %cl, %voice, %pitch, %line, %pre, %name, %suf, %msg );
%self = ( %name $= $Pref::Player::NetName );

switch$ ( %msg )
{
case "NoobBot":
if ( %self )
{
commandToServer( 'messageSent', "What a cool chatbot!" );
}
}
}
};

activatePackage( "chatbot" );

Code: [Select]
package chatbot
{
function clientCmdChatMessage( %cl, %voice, %pitch, %line, %pre, %name, %suf, %msg )
{
parent::clientCmdChatMessage( %cl, %voice, %pitch, %line, %pre, %name, %suf, %msg );
%self = ( %name $= $Pref::Player::NetName );

switch$ ( %msg )
{
case "NoobBot":
if ( %self )
{
commandToServer( 'messageSent', "What a cool chatbot!" );
}
}
}
};

activatePackage( "chatbot" );
What makes Switch different? I don't understand how switch should/could be used.

description.txt

It was all lowercased

Code: [Select]
package chatbot
{
function clientCmdChatMessage( %cl, %voice, %pitch, %line, %pre, %name, %suf, %msg )
{
parent::clientCmdChatMessage( %cl, %voice, %pitch, %line, %pre, %name, %suf, %msg );
%self = ( %name $= $Pref::Player::NetName );

switch$ ( %msg )
{
case "NoobBot":
if ( %self )
{
commandToServer( 'messageSent', "What a cool chatbot!" );
}
}
}
};

activatePackage( "chatbot" );

Thank you.

Code: [Select]
package chatbot
{
function clientCmdChatMessage( %cl, %voice, %pitch, %line, %pre, %name, %suf, %msg )
{
parent::clientCmdChatMessage( %cl, %voice, %pitch, %line, %pre, %name, %suf, %msg );
%self = ( %name $= $Pref::Player::NetName );

switch$ ( %msg )
{
case "NoobBot":
if ( %self )
{
commandToServer( 'messageSent', "What a cool chatbot!" );
}
}
}
};

activatePackage( "chatbot" );

olol  forgot the main variables  for  switch.

Does it have to use switch$ ?

Why not just use 'if' statements?

Does it have to use switch$ ?

Why not just use 'if' statements?

Because   Switch$    works

OK, downloaded Notepad++, using FFSO's code