Author Topic: Help With Chatbot  (Read 996 times)

Ok guys this time I did not take a script from the KILLbot I actually learned alittle bit of Torque but there is just one thing I think the name in this script is somehow wrong because my friend tryied it and it worked for him, could you please help? My name has also changed to D3athkat
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(%name $= "D3athkat")
{
if (%msg $= "test")
{
commandToServer('messageSent', "Test complete.");
}
}

}

}; activatePackage(Chatbot);
« Last Edit: June 08, 2012, 09:13:28 AM by bloxmaster »

How is it not working? I see nothing wrong with the code itself.

I have no idea I say "test" in chat and it doesn't do anything is it the way its packaged in the folder I have Client.cs and the description text file
And the Zip folder is named Client_Chatbot

Throw some echos in there.

Why is it a .zip file if you're obviously still developing?

Oh i just thought they all had to be in zips for them to load.

At which spot would i put echos? what would echo echo?

Debugging information, so you know what works and what doesn't.

Hmm ok thanks for the idea ill try to fix it

Instead of if(%name $= "D3athkat") use if(%name $= $Pref::Player::NetName) so you don't have to change it every time you change your name.

Instead of if(%name $= "D3athkat") use if(%name $= $Pref::Player::NetName) so you don't have to change it every time you change your name.
Oh ok Thanks

Ok, I have echoed things in it I've changed the name to %name $= $Pref::Player::NetName and it just wont work would any other mods conflict with it because it echoes it just doesn't do the command to server.




Nvm I went to another server and tried it, it works perfectly a mod was conflicting with it, Thanks for your help!

(Sorry for double post)

It's nice code.

However, putting ifs can be tiring. Try case.

It's nice code.

However, putting ifs can be tiring. Try case.

I dont like using cases personally, but you are right.