SA-MP Forums Archive
[FilterScript] [FS] Chat Bot - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Filterscripts (https://sampforum.blast.hk/forumdisplay.php?fid=17)
+--- Thread: [FilterScript] [FS] Chat Bot (/showthread.php?tid=153614)

Pages: 1 2


[FS] Chat Bot - Shadow_ - 09.06.2010

[FS] Chat Bot


Basic Chat Bot ive been working on, it can give random messages, give messages on stuff like OnPlayerConnect and also when a person talks it can talk back to them, for example when you say "Hi" The bot will say "Wassup 'YOUR NAME'" Stuff like that, very easy to edit, Updates will come.

Download


Credits to - Shadow for creating it and Pandabear for helping.

Have Fun,

Shadow-


Re: [FS] Chat Bot - [L3th4l] - 09.06.2010

Quote:

Please Read the /rules or ill rape you.

Ha!! Nice


Re: [FS] Chat Bot - andreyeu2007 - 10.06.2010

Nice


Re: [FS] Chat Bot - Flake. - 10.06.2010

pictures maybe?


Re: [FS] Chat Bot - dcmd_crash - 10.06.2010

Quote:
Originally Posted by Flake
pictures maybe?
Pictures of what? Explained pretty well ...


Re: [FS] Chat Bot - LasVegasMafiaStoriesRP - 10.06.2010

Nice FS!


Re: [FS] Chat Bot - Shadow_ - 10.06.2010

Quote:
Originally Posted by Flake
pictures maybe?
I'm not going to get you any pictures... The Bot looks like a normal player and you can edit it to say whatever you want it too, and it can detect text of other players then you can decide what the bot would say in return.


Re: [FS] Chat Bot - Crasher33 - 10.06.2010

Nice script, but any problems,
I changed this script to:

Quote:

/*
Shadow- : Chat Bot, Version 1
Credits to - Pandabear for helping me with minor bugs.
*/


#include <a_samp>

#define MAX_MESSAGES 100

#define BOTTIMER 999999 // This will set the Timer Length (Miliseconds) For the Random Messages

#define COLOR_BOT 0xFF00FFFF // This will set the Bot's Color (Pink by Default)

new BotName[24] = "Draugas_Robotas"; // This will set the Bot's Name
new RandomMessages = 1; // 1 = On - 0 = Off ( 0 = only SendBotMessage() without RandomMessage - 1 = Everything will work)
new Max_Msg;
new BotMsg[MAX_PLAYERS][128];

forward Random(playerid);

new RandomMsg[][] =
{
"nebepasipisesnaxuijaude,"
};

public OnFilterScriptInit()
{
if(RandomMessages == 1)
{
SetTimer("SendRandomMessage",BOTTIMER,1);
}

AddRandomMessage("x x x xx x ");
AddRandomMessage("x x xx x x");
AddRandomMessage("x x x x x x");

print("Shadow's Chatbot Loaded");
return 1;
}

public OnPlayerConnect(playerid)
{
return 1;
}

forward SendRandomMessage();
public SendRandomMessage()
{
for(new playerid=0;playerid<MAX_PLAYERS;playerid++)
{
if(IsPlayerConnected(playerid)==1 && GetPlayerColor(playerid) != 0)
{
new pName[18];
format(pName,sizeof(pName),"%s",PlayerName(playeri d));
new ColorSave = GetPlayerColor(playerid);
SetPlayerColor(playerid,COLOR_BOT);
SetPlayerName(playerid,BotName);
SendPlayerMessageToAll(playerid,BotMsg[random(Max_Msg)]);
SetPlayerColor(playerid,ColorSave);
SetPlayerName(playerid,pName);
return 1;
}
}
return 1;
}

forward SendBotMessage(msg[]);
public SendBotMessage(msg[])
{
for(new playerid=0;playerid<MAX_PLAYERS;playerid++)
{
if(IsPlayerConnected(playerid)==1 && GetPlayerColor(playerid) != 0)
{
new pName[18];
format(pName,sizeof(pName),"%s",PlayerName(playeri d));
new ColorSave = GetPlayerColor(playerid);
SetPlayerColor(playerid,COLOR_BOT);
SetPlayerName(playerid,BotName);
SendPlayerMessageToAll(playerid,msg);
SetPlayerColor(playerid,ColorSave);
SetPlayerName(playerid,pName);
return 1;
}
}
return 1;
}

stock AddRandomMessage(msg[])
{
format(BotMsg[Max_Msg],128,"%s",msg);
Max_Msg++;
return 1;
}

stock PlayerName(playerid)
{
new pName2[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName2, MAX_PLAYER_NAME);
return pName2;
}

public OnPlayerText(playerid, text[])
{
if(!strcmp(text, "", true) || !strcmp(text, "", true) || !strcmp(text, "", true) || !strcmp(text, "", true))
{
SendPlayerMessageToAll(playerid, text);
return 0;
}

if(!strcmp(text, "", true) || !strcmp(text, "", true) || !strcmp(text, "", true) || !strcmp(text, "", true))
{
SendPlayerMessageToAll(playerid, text);
Random(playerid);
return 0;
}

return 1;
}

public Random(playerid)
{
new str[128];
new randMSG = random(sizeof(RandomMsg));
format(str, sizeof(str), "%s %s", RandomMsg[randMSG], PlayerName(playerid));
SendBotMessage(str);
return 1;
}

1. Now don't working team, gang and admins chats ( ! text ; @ text ; # text).
2. Don't show in chat the player ID after his nickname.


Re: [FS] Chat Bot - Shadow_ - 10.06.2010

What are you talking about? You need to add

SendPlayerMessageToAll(playerid, text); Before any chat or within your chats.


Re: [FS] Chat Bot - Kar - 19.06.2010

np


Re: [FS] Chat Bot - Shadow_ - 20.06.2010

Erm, Im not talking about SendClientMessageToAll

I'm Talking about SendPlayerMessageToAll and in that you do need to put playerid so please find out what your talking about before you tell me in wrong. thanks.


Re: [FS] Chat Bot - Niixie - 21.06.2010

Very basic, but its good. Maybe if you make a toggle command?
-Its also not very hard to make


Re: [FS] Chat Bot - Shadow_ - 21.06.2010

What do you want to toggle?


Re: [FS] Chat Bot - Astralis - 21.06.2010

Quote:
Originally Posted by [MWR
Niixie ]
Very basic, but its good. Maybe if you make a toggle command?
-Its also not very hard to make
Would be good idea


Re: [FS] Chat Bot - Shadow_ - 21.06.2010

What do you want me to toggle? the bot all together? inwhich you could just do /rcon unloadfs ShadBot


Re: [FS] Chat Bot - ~Ricky~ - 21.06.2010

nice


Re: [FS] Chat Bot - Ghost_BB - 21.06.2010

Does samo forums go with IRC ? just asking

btw nice :P


Re: [FS] Chat Bot - Jeffry - 11.07.2010

This is so brilliant. I wanted to make something like this for my server, but I thought it's only possible with NPC's. Now this one is great. Awesome Idea, with SetName to BotName and back to normal name.

Keep it up.

Iґll create a script for my server, using this. Credits for the idea + functions for you then.


Re: [FS] Chat Bot - markokk888 - 11.07.2010

nice fs


Re: [FS] Chat Bot - iZN - 12.07.2010

Nice, i maybe use it on my server.