Author Topic: Chatbot help?  (Read 1093 times)

There must be a lot of thread's like this but can anyone see the problem with my script rather than just saying it has a few things wrong, and actually point them out?


//Made By TheSolidSnake, 26622
'package chatbot {',
'function clientCmdChatMessage(%a,%b,%c,%fmsg,%cp,%name,%cs,%96fmsg {'
parent::clientCmdChatMessage(All the vars you saw above);if(%msg $= "Hi."){
if (%name $= "TheSolidSnake"){commandtoServer('messageSent',"Gtfo");
    }
}
};
activatePackage(chatbot);

What script? silly modify button

you have ' characters everywhere, get rid of them
you have "%96fmsg" in the argument list, change that to "%msg"

also please work on your indentation

You're missing a closing parenthesis on the function line as well.

Code: [Select]
package chatbot
{
function clientCmdChatMessage(%a,%b,%c,%fmsg,%cp,%name,%cs,%msg)
         {
parent::clientCmdChatMessage(%a,%b,%c,%fmsg,%cp,%name,%cs,%msg);
if(%msg $= "Hi.")
{
if(%name $= "TheSolidSnake"){commandtoServer('messageSent',"Gtfo");
}
}
};
activatePackage(chatbot);
« Last Edit: June 25, 2012, 01:15:00 PM by Eeposs »


Fix your indentation
Here:
Code: [Select]
package chatbot
{
    function clientCmdChatMessage(%a,%b,%c,%fmsg,%cp,%name,%cs,%msg)
    {
        parent::clientCmdChatMessage(%a,%b,%c,%fmsg,%cp,%name,%cs,%msg);
        if(%msg $= "Hi." && %name $= "TheSolidSnake")
            commandtoServer('messageSent',"Gtfo");
    }
};
activatePackage(chatbot);

Fix your indentation
Here:
Code: [Select]
package chatbot
{
    function clientCmdChatMessage(%a,%b,%c,%fmsg,%cp,%name,%cs,%msg)
    {
        parent::clientCmdChatMessage(%a,%b,%c,%fmsg,%cp,%name,%cs,%msg);
        if(%msg $= "Hi." && %name $= "TheSolidSnake")
            commandtoServer('messageSent',"Gtfo");
    }
};
activatePackage(chatbot);


Doesn't work.

Doesn't work.

Either you're executing it wrong, you aren't saying "Hi." or your name isn't "TheSolidSnake".

also, why does everybody use such weird variable names in clientCmdChatMessage

their values are
client, using voice, voice pitch, line to be displayed in chat, clan prefix, name, clan suffix, message

so for instance, you could do
%cl, %voice, %pitch, %line, %pre, %name, %suf, %msg
« Last Edit: June 25, 2012, 03:54:16 PM by Port »

client, using voice, voice pitch, line to be displayed in chat, clan prefix, name, clan suffix, message
Because nobody know what the hell voice or pitch does.

Because nobody know what the hell voice or pitch does.

specifies whether it's using voice chat and the pitch of the sound

specifies whether it's using voice chat and the pitch of the sound
voice chat? Since when does TGE have voice chat support? Or pitch brown townysis support?

voice chat? Since when does TGE have voice chat support? Or pitch brown townysis support?

It was planned.

maissanguy3, read this to learn how to format your code so it's easier on everyone's eyes.

http://forum.blockland.us/index.php?topic=192083.0

Either you're executing it wrong, you aren't saying "Hi." or your name isn't "TheSolidSnake".

I putted the Script inside a folder in add-ons but it says Syntax Error, etc