Poll

How did i do on this thing?

Great! I'd like another tutorial.
Good.
A little lengthy. Can you tone it down?
Too loud! Be more to the point.
Too soft! Make the statements more solid.
Too short. Can you go more in-depth?
Horrible! Why would i need to know any of this?
The worst tutorial i've seen yet. You must work on this.
Too show-offy. Use better words.
Too boring. Needs more fun to it.
I don't really know...
The current options cannot describe my opinion.

Author Topic: Guide to Scripting/Chatbot Tutorial 2.0 -For the inexperienced.  (Read 22713 times)

@ Bold: That's not nessicarily true, but it is in 99% of cases.

@ Italics: .cs stands for common script.
.cs is Visual C# Source Code File
or CLEO Custom Script
Thats what i found form a Google Search

.cs is Visual C# Source Code File
or CLEO Custom Script
Thats what i found form a Google Search
Or, in Torque, common script.

This be getting close to 5th page.

forget chat bots and forget this topic. >:(

forget chat bots and forget this topic. >:(
Clientsided chatbots are quite annoying, yes.

:U

Quote
function clientCmdChatMessage(%a,%b,%c,%fmsg,%cp,%name,%cs,%msg) {
parent::clientCmdChatMessage(%a,%b,%c,%fmsg,%cp,%name,%cs,%msg)
  if (%msg $= "Hi") {

commandToServer('messageSent',"Hello!");

}
}

function clientCmdChatMessage(%a,%b,%c,%fmsg,%cp,%name,%cs,%msg) {
parent::clientCmdChatMessage(%a,%b,%c,%fmsg,%cp,%name,%cs,%msg)
  if (%msg $= "Pen0r") {

commandToServer('messageSent',"stop being gay");

}
}
};
Do i need to change the name of the function for it to work? or what? D:::

No you need to fix syntax errors.

You also can't put the same function twice in a package.

Quote
package cakes {
function FirstMessage(%a,%b,%c,%fmsg,%cp,%name,%cs,%msg) {
parent::FirstMessage(%a,%b,%c,%fmsg,%cp,%name,%cs,%msg)
  if (%msg $= "Hi") {

commandToServer('messageSent',"Hello!");

}
}
};

function SecondMessage(%a,%b,%c,%fmsg,%cp,%name,%cs,%msg) {
parent::SecondMessage(%a,%b,%c,%fmsg,%cp,%name,%cs,%msg)
  if (%msg $= "Pen0r") {

commandToServer('messageSent',"stop being gay");

}
}
};

activatePackage(cakes);
?

you need a semicolon  ;   after each parent::  line.

otherwise you will get syntax errors

Hm, I seem to get no syntax errors but it does not seem to respond to the messages as i say them
Quote
package cakes {
function FirstMessage(%a,%b,%c,%fmsg,%cp,%name,%cs,%msg) {
parent::FirstMessage(%a,%b,%c,%fmsg,%cp,%name,%cs,%msg);
  if (%msg $= "Hi") {

commandToServer('messageSent',"Hello!");

}
}


function SecondMessage(%a,%b,%c,%fmsg,%cp,%name,%cs,%msg) {
parent::SecondMessage(%a,%b,%c,%fmsg,%cp,%name,%cs,%msg);
  if (%msg $= "Sup") {

commandToServer('messageSent',"Yo");

}
}
};

activatePackage(cakes);
« Last Edit: February 14, 2011, 05:35:37 PM by alex dude »

Hm, I seem to get no syntax errors but it does not seem to respond to the messages as i say them

You do not need to have two parents Whoa, that came out wrong. Fix: You do not need to have two Parent structures, or two Functions, in the package. Just multiple If structures. Also, the parent and function should be clientCmdChatMessage or whatever, not whatever you want.
Code: [Select]
package blah {
function clientCmdChatMessage(stuff) {
parent::blablabla;
if(%msg $= "Hi") {
event 1
}

if (%msg $= "Haider") {
event 2
}
}
};
activatePackage(blah);

You do not need to have two parents Whoa, that came out wrong. Fix: You do not need to have two Parent structures, or two Functions, in the package. Just multiple If structures. Also, the parent and function should be clientCmdChatMessage or whatever, not whatever you want.
Ah, thanks; I understand now.