Blockland Forums > Modification Help
My first chat bot (NEED HELP AGAIN)
<< < (2/7) > >>
Headcrab Zombie:
Did you fix %msg being undefined?
I'm not entirely certain but try changing it to %fmsg
I also left out a semicolon, so fix that too.

Additionally, whenever you post in coding help, make sure you look in the console for any errors, because it would have picked that up
PurpleMetro:

--- Quote from: Headcrab Zombie on August 16, 2011, 08:32:48 PM ---Did you fix %msg being undefined?
I'm not entirely certain but try changing it to %fmsg
I also left out a semicolon, so fix that too.

Additionally, whenever you post in coding help, make sure you look in the console for any errors, because it would have picked that up

--- End quote ---
Uhh.. Sorry but I dont get %msg being undefined really...
Placid:
um, is there a reason he has two %fmsg args? i'm fairly certain that he needs to have it as %a, %b, %c, %fmsg, %cp, %name, %cs, %msg and %msg being the message.

that's why your %msg is undefined. derp.


--- Quote from: Headcrab Zombie on August 16, 2011, 08:10:16 PM ---You should try writing code with the brackets on a seperate line, you can see them better and see if your missing something.
The parent::clientCmdChatMessage line is just a function call, it ends in a semicolon and doesn't have brackets.
And lastly, %msg is undefined

--- Code: ---//Secton
//8448
package chatbot
{
function clientCmdChatMessage(%a,%b,%c,%fmsg,%cp,%name,%cs,%fmsg)
        {
parent::clientCmdChatMessage(%a,%b,%c,%fmsg,%cp,%name,%cs,%msg);
                if (%msg $= "testing testing 123")
                {
        if(%name $= "Secton")
                        {
commandToServer('messageSent',"Your testing is win, Secton!");
                        }
                 }
        }
};
ActivatePackage(chatbot);
--- End code ---

--- End quote ---
try this.
PurpleMetro:

--- Quote from: Placid on August 16, 2011, 08:36:01 PM ---um, is there a reason he has two %fmsg args? i'm fairly certain that he needs to have it as %a, %b, %c, %fmsg, %cp, %name, %cs, %msg and %msg being the message.

that's why your %msg is undefined. derp.
try this.

--- End quote ---
Can you put this in code format plz? Sorry I just don't wanna mess my whole script up.
Placid:

--- Quote from: PurpleMetro on August 16, 2011, 08:39:01 PM ---Can you put this in code format plz? Sorry I just don't wanna mess my whole script up.

--- End quote ---
read again.

--- Quote from: Placid on August 16, 2011, 08:36:01 PM ---
--- Quote from: Headcrab Zombie on August 16, 2011, 08:10:16 PM ---
--- Code: ---//Secton
//8448
package chatbot
{
function clientCmdChatMessage(%a,%b,%c,%fmsg,%cp,%name,%cs,%fmsg)
        {
parent::clientCmdChatMessage(%a,%b,%c,%fmsg,%cp,%name,%cs,%msg);
                if (%msg $= "testing testing 123")
                {
        if(%name $= "Secton")
                        {
commandToServer('messageSent',"Your testing is win, Secton!");
                        }
                 }
        }
};
ActivatePackage(chatbot);
--- End code ---

--- End quote ---

--- End quote ---

also next time when you want to test around with something without messing all the rest up, why don't you just make a copy of the file? you're going to learn more from trying to write yourself rather than having others write for you.
Navigation
Message Index
Next page
Previous page

Go to full version