Author Topic: Whats wrong with this script?  (Read 4457 times)

Thank you, it works now!
Now I just need find an existing tutorial for autogreet...

Thank you, it works now!
Now I just need find an existing tutorial for autogreet...
He's a pointer. People hate chatbots and you'll probably be banned if you have an auto greet.

He's a pointer. People hate chatbots and you'll probably be banned if you have an auto greet.
This is for my server.

This is for my server.
You only want a server sided greet mod? Or do you want the whole thing server sided?

You only want a server sided greet mod? Or do you want the whole thing server sided?
Entire thing.
Im making it server sided, but I want a greet mod for it.
See, im making a dedi, and I wont always be on, so Im making a chatbot to have me log in to the server, let myself go afk, and have that take care of questions, greeting, organization.

On second thought, Ill just make it look like im saying something in the join description.

What would be a variable to detect a server name when your in it?
« Last Edit: August 16, 2013, 04:28:37 PM by Gsterman »

Could someone fix this please? I tried for a while and couldn't get it to work correctly.
Code: [Select]
if(firstWord(%msg) $= "commandhere"){
commandToServer('commandSent,"Chatbot: "@restWords(%msg));
}

Entire thing.
Im making it server sided, but I want a greet mod for it.
See, im making a dedi, and I wont always be on, so Im making a chatbot to have me log in to the server, let myself go afk, and have that take care of questions, greeting, organization.
You can still do this server sidedly

You can still do this server sidedly
I know, but I don't want to go to some server and screw it up.
Though, until I make it server sided, it uses VERY specific commands.

I think you should probably learn more about coding before you attempt to something that is a bit difficult as from what I see you don't really seem to understand what you are doing, no offense

I think you should probably learn more about coding before you attempt to something that is a bit difficult as from what I see you don't really seem to understand what you are doing, no offense
Yeah, this was more of a test to learn how to do stuff.
I agree though. I found some good tutorials a while back.

Could someone fix this please? I tried for a while and couldn't get it to work correctly.
Code: [Select]
if(firstWord(%msg) $= "commandhere"){
commandToServer('commandSent,"Chatbot: "@restWords(%msg));
}
In commandToServer('commandSent,"Chatbot: "@restWords(%msg)); you need to put a ' at the end of 'commandSent (which should be messageSent).

In commandToServer('commandSent,"Chatbot: "@restWords(%msg)); you need to put a ' at the end of 'commandSent (which should be messageSent).
Tried that, script ran successfully. Nothing happened though.
For note, this is what im talking about
Code: [Select]
if(firstWord(%msg) $= "MBAnno:"){
commandToServer('messageSent',"MagicBot: "@restWords(%msg));
}

Tried that, script ran successfully. Nothing happened though.
For note, this is what im talking about
Code: [Select]
if(firstWord(%msg) $= "MBAnno:"){
commandToServer('messageSent',"MagicBot: "@restWords(%msg));
}
Post the whole script.

Post the whole script.
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 $= "MB>Index"){
commandToServer('messageSent',"MagicBot: Commands, Rules, News");
}
if(%msg $= "MB>Commands"){
commandToServer('messageSent',"MagicBot: MBAnno:restwords");
}
if(firstWord(%msg) $= "MBAnno:"){
commandToServer('messageSent',"MagicBot: "@restWords(%msg));
}
}
};
activatepackage(chatbot);