Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define FILTERSCRIPT
- //CONFIGURATION
- new botname[10] = "Anna";//name of your bot.
- #define CHAT_MAX 100//in milliseconds.
- #define SPAM_FILTER_ENABLED//comment to disable
- //END OF CONFIGURATION
- #include <a_samp>
- new name[MAX_PLAYER_NAME];
- new string[80];
- new ChattedRecently;
- //spamfilter and connect part
- #if defined SPAM_FILTER_ENABLED
- new spam[MAX_PLAYERS];
- #endif
- public OnPlayerConnect(playerid)
- {
- GetPlayerName(playerid,name,sizeof(name));
- format(string,sizeof(string),"%s:%s Has joined Us!! welcome him!",botname,name);
- SendClientMessageToAll(0xffffff00, string);
- print(string);
- #if defined SPAM_FILTER_ENABLED
- spam[playerid]=0;
- #endif
- return 1;
- }
- forward resetspam(playerid);
- public resetspam(playerid)
- {
- spam[playerid]=0;
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- GetPlayerName(playerid,name,sizeof(name));
- switch(reason)
- {
- case 0: format(string,sizeof string,"%s:%s Has crashed!! hope he will fix it.",botname,name);
- case 1: format(string,sizeof string,"%s:%s is leaving us, Bye!!",botname,name);
- case 2: format(string,sizeof string,"%s:%s has been kicked/banned, hope he will be a good boy next time",botname,name);
- }
- SendClientMessageToAll(0xFFFFFFAA,string);
- print(string);
- return 1;
- }
- forward chatted();
- public chatted()
- {
- SendClientMessageToAll(0xFFFFFF00, string);
- print(string);
- ChattedRecently = 0;
- return 1;
- }
- ChatBot(playerid, sentenceid)
- {
- GetPlayerName(playerid, name, sizeof(name));
- if(sentenceid == 1 && ChattedRecently == 0)//stupid bot
- {
- new randomchat = random(4);
- switch(randomchat)
- {
- case 0:
- {
- format(string, sizeof(string), "%s:Bots are cool and you know that %s",botname, name);
- }
- case 1:
- {
- format(string, sizeof(string), "%s:don't insult me %s",botname,name);
- }
- case 2:
- {
- format(string, sizeof(string), "%s:im very disappointed of you %s",botname,name);
- }
- case 3:
- {
- format(string, sizeof(string), "%s:I hate you too %s",botname, name);
- }
- }
- SetTimer("chatted",CHAT_MAX,false);
- ChattedRecently = 1;
- }
- if(sentenceid == 2 && ChattedRecently == 0)//botname
- {
- format(string, sizeof(string), "%s:what do you want to say about me?",botname);
- SetTimer("chatted",CHAT_MAX,false);
- ChattedRecently = 1;
- }
- if(sentenceid == 3 && ChattedRecently == 0)//love bot
- {
- format(string, sizeof(string), "%s:I love you too %s!",botname, name);
- SetTimer("chatted",CHAT_MAX,false);
- ChattedRecently = 1;
- }
- if(sentenceid == 4 && ChattedRecently == 0)//hate it eightball
- {
- format(string, sizeof(string), "%s:Because i hate it...",botname);
- SetTimer("chatted",CHAT_MAX,false);
- ChattedRecently = 1;
- }
- if(sentenceid == 5 && ChattedRecently == 0)//yes
- {
- format(string, sizeof(string), "%s:yes.",botname);
- SetTimer("chatted",CHAT_MAX,false);
- ChattedRecently = 1;
- }
- if(sentenceid == 6 && ChattedRecently == 0)//no
- {
- format(string, sizeof(string), "%s:no.",botname);
- SetTimer("chatted",CHAT_MAX,false);
- ChattedRecently = 1;
- }
- if(sentenceid == 7 && ChattedRecently == 0)//maybe
- {
- format(string, sizeof(string), "%s:maybe.",botname);
- SetTimer("chatted",CHAT_MAX,false);
- ChattedRecently = 1;
- }
- if(sentenceid == 8 && ChattedRecently == 0)//never
- {
- format(string, sizeof(string), "%s:never!",botname);
- SetTimer("chatted",CHAT_MAX,false);
- ChattedRecently = 1;
- }
- if(sentenceid == 9 && ChattedRecently == 0)//in the future
- {
- format(string, sizeof(string), "%s:in the future.",botname);
- SetTimer("chatted",CHAT_MAX,false);
- ChattedRecently = 1;
- }
- if(sentenceid == 10 && ChattedRecently == 0)//fuck you bot
- {
- format(string, sizeof(string), "%s:Go fuck yourself, %s",botname , name);
- SetTimer("chatted",CHAT_MAX,false);
- ChattedRecently = 1;
- }
- if(sentenceid == 11 && ChattedRecently == 0)//stupid server
- {
- format(string, sizeof(string), "%s:Hey %s! this server IS cool!",botname, name);
- SetTimer("chatted",CHAT_MAX,false);
- ChattedRecently = 1;
- }
- if(sentenceid == 12 && ChattedRecently == 0)//dont know eightball
- {
- format(string, sizeof(string), "%s:don't know what to say about that.",botname);
- SetTimer("chatted",CHAT_MAX,false);
- ChattedRecently = 1;
- }
- if(sentenceid == 13 && ChattedRecently == 0)//love server
- {
- format(string, sizeof(string), "%s:I agree with you %s",botname , name);
- SetTimer("chatted",CHAT_MAX,false);
- ChattedRecently = 1;
- }
- if(sentenceid == 14 && ChattedRecently == 0)//love it eightball
- {
- format(string, sizeof(string), "%s:i'm loving it",botname);
- SetTimer("chatted",CHAT_MAX,false);
- ChattedRecently = 1;
- }
- if(sentenceid == 15 && ChattedRecently == 0)//Ask niceley!
- {
- format(string, sizeof(string), "%s:im a bot... how should i know.",botname);
- SetTimer("chatted",CHAT_MAX,false);
- ChattedRecently = 1;
- }
- if(sentenceid == 16 && ChattedRecently == 0)//insult geso
- {
- format(string, sizeof(string), "%s:dont insult our admins will ya?",botname);
- SetTimer("chatted",CHAT_MAX,false);
- ChattedRecently = 1;
- }
- if(sentenceid == 17 && ChattedRecently == 0)//agree!
- {
- format(string, sizeof(string), "%s:thank you, %s!",botname , name);
- SetTimer("chatted",CHAT_MAX,false);
- ChattedRecently = 1;
- }
- if(sentenceid == 18 && ChattedRecently == 0)//lol
- {
- new randomchat = random(5);
- switch(randomchat)
- {
- case 0:
- {
- format(string, sizeof(string), "%s:haha...",botname);
- }
- case 1:
- {
- format(string, sizeof(string), "%s:what you're laughing about?",botname);
- }
- case 2:
- {
- format(string, sizeof(string), "%s:LOLcano erupting! everyone into the roflcopters! *soisoisoisoi*",botname);
- }
- case 3:
- {
- format(string, sizeof(string), "%s:omgz0r that's a real fun!",botname);
- }
- case 4:
- {
- format(string, sizeof(string), "%s:fail!",botname);
- }
- }
- SetTimer("chatted",CHAT_MAX,false);
- ChattedRecently = 1;
- }
- if(sentenceid == 19 && ChattedRecently == 0)//happy smiles
- {
- new randomchat = random(5);
- switch(randomchat)
- {
- case 0:
- {
- format(string, sizeof(string), "%s:happy %s is happy me!",botname, name);
- }
- case 1:
- {
- format(string, sizeof(string), "%s:what's so happy?",botname);
- }
- case 2:
- {
- format(string, sizeof(string), "%s:im happy! :D",botname);
- }
- case 3:
- {
- format(string, sizeof(string), "%s:you make me happy! :)",botname);
- }
- case 4:
- {
- format(string, sizeof(string), "%s:do your cheeks hurt from the smiling?",botname);
- }
- }
- SetTimer("chatted",CHAT_MAX,false);
- ChattedRecently = 1;
- }
- if(sentenceid == 20 && ChattedRecently == 0)//sad smiles
- {
- new randomchat = random(5);
- switch(randomchat)
- {
- case 0:
- {
- format(string, sizeof(string), "%s:sad %s is sad me!",botname, name);
- }
- case 1:
- {
- format(string, sizeof(string), "%s:what's so sad?",botname);
- }
- case 2:
- {
- format(string, sizeof(string), "%s:just be happy...",botname);
- }
- case 3:
- {
- format(string, sizeof(string), "%s:you make me sad. :(",botname);
- }
- case 4:
- {
- format(string, sizeof(string), "%s:don't cry...",botname);
- }
- }
- SetTimer("chatted",CHAT_MAX,false);
- ChattedRecently = 1;
- }
- if(sentenceid == 21 && ChattedRecently == 0)//not going to answer that
- {
- format(string, sizeof(string), "%s:i'm not going to answer that question...",botname);
- SetTimer("chatted",CHAT_MAX,false);
- ChattedRecently = 1;
- }
- }
- public OnPlayerText(playerid, text[])
- {
- #if defined SPAM_FILTER_ENABLED
- if(spam[playerid] >= 3)
- {
- new kickmessage[50];
- format(kickmessage, sizeof(kickmessage), "%s has been kicked by %s for Spam!",name,botname);
- SendClientMessageToAll(0xff000000,kickmessage);
- Kick(playerid);
- format(string, sizeof(string), "%s:i kicked him hard... hope he doesn't come back to yell at me.",botname);
- SendClientMessageToAll(0xff000000,string);
- }
- else
- {
- spam[playerid]++;
- SetTimerEx("resetspam", 4000, false, "i", playerid);
- }
- #endif
- if (strfind(text, "bot") != -1||strfind(text, botname) != -1)
- {
- if (strfind(text, "stupid") != -1)//id 1
- {
- if (strfind(text, "not") != -1)
- {
- ChatBot(playerid, 17);
- }
- else
- {
- ChatBot(playerid, 1);
- }
- }
- if (strfind(text, "dumb") != -1)//id 1
- {
- if (strfind(text, "not") != -1)
- {
- ChatBot(playerid, 17);
- }
- else
- {
- ChatBot(playerid, 1);
- }
- }
- if (strfind(text, "asshole") != -1)//id 1
- {
- if (strfind(text, "not") != -1)
- {
- ChatBot(playerid, 17);
- }
- else
- {
- ChatBot(playerid, 1);
- }
- }
- if (strfind(text, "hate") != -1)//id 1
- {
- if (strfind(text, "not") != -1)
- {
- ChatBot(playerid, 17);
- }
- else
- {
- ChatBot(playerid, 1);
- }
- }
- if (strfind(text, "love") != -1)//id 3
- {
- if (strfind(text, "not") != -1)
- {
- ChatBot(playerid, 1);
- }
- else
- {
- ChatBot(playerid, 3);
- }
- }
- if (strfind(text, "adore") != -1)//id 3
- {
- if (strfind(text, "not") != -1)
- {
- ChatBot(playerid, 1);
- }
- else
- {
- ChatBot(playerid, 3);
- }
- }
- if (strfind(text, "crush") != -1)//id 3
- {
- if (strfind(text, "not") != -1)
- {
- ChatBot(playerid, 1);
- }
- else
- {
- ChatBot(playerid, 3);
- }
- }
- if (strfind(text, "like") != -1)//id 3
- {
- if (strfind(text, "not") != -1)
- {
- ChatBot(playerid, 1);
- }
- else
- {
- ChatBot(playerid, 3);
- }
- }
- if (strfind(text, "fuck") != -1)//id 10
- {
- ChatBot(playerid, 10);
- }
- }
- if (strfind(text, "?") != -1)
- {
- if (strfind(text, "will") != -1||strfind(text, "are") != -1)//id 11
- {
- new eightball = random(5);
- switch(eightball)
- {
- case 0:
- {
- ChatBot(playerid, 5);
- }
- case 1:
- {
- ChatBot(playerid, 6);
- }
- case 2:
- {
- ChatBot(playerid, 7);
- }
- case 3:
- {
- ChatBot(playerid, 8);
- }
- case 4:
- {
- ChatBot(playerid, 9);
- }
- }
- }
- if (strfind(text, "why") != -1)//id 11
- {
- new eightball = random(4);
- switch(eightball)
- {
- case 0:
- {
- ChatBot(playerid, 4);
- }
- case 1:
- {
- ChatBot(playerid, 12);
- }
- case 2:
- {
- ChatBot(playerid, 14);
- }
- case 3:
- {
- ChatBot(playerid, 15);
- }
- }
- }
- ChatBot(playerid, 21);
- }
- if (strfind(text, "server") != -1)
- {
- if (strfind(text, "stupid") != -1)//id 11
- {
- ChatBot(playerid, 11);
- }
- if (strfind(text, "hate") != -1)//id 12
- {
- ChatBot(playerid, 11);
- }
- if (strfind(text, "love") != -1)//id 13
- {
- ChatBot(playerid, 13);
- }
- if (strfind(text, "like") != -1)//id 14
- {
- ChatBot(playerid, 13);
- }
- if (strfind(text, "fuck") != -1)//id 15
- {
- ChatBot(playerid, 11);
- }
- }
- if (strfind(text, "geso") != -1)
- {
- if (strfind(text, "stupid") != -1)//id 16
- {
- ChatBot(playerid, 16);
- }
- if (strfind(text, "hate") != -1)//id 16
- {
- ChatBot(playerid, 16);
- }
- if (strfind(text, "fuck") != -1)//id 16
- {
- ChatBot(playerid, 16);
- }
- if (strfind(text, "great") != -1)//id 17
- {
- ChatBot(playerid, 17);
- }
- if (strfind(text, "super") != -1)//id 17
- {
- ChatBot(playerid, 17);
- }
- if (strfind(text, "like") != -1)//id 17
- {
- ChatBot(playerid, 17);
- }
- }
- if (strfind(text, "lol") != -1)//id 18
- {
- ChatBot(playerid, 18);
- }
- if (strfind(text, "hihi") != -1)//id 18
- {
- ChatBot(playerid, 18);
- }
- if (strfind(text, "haha") != -1)//id 18
- {
- ChatBot(playerid, 18);
- }
- if (strfind(text, ":)") != -1)//id 19
- {
- ChatBot(playerid, 19);
- }
- if (strfind(text, ":D") != -1)//id 19
- {
- ChatBot(playerid, 19);
- }
- if (strfind(text, ":-)") != -1)//id 19
- {
- ChatBot(playerid, 19);
- }
- if (strfind(text, "=)") != -1)//id 19
- {
- ChatBot(playerid, 19);
- }
- if (strfind(text, ";)") != -1)//id 19
- {
- ChatBot(playerid, 19);
- }
- if (strfind(text, ":(") != -1)//id 19
- {
- ChatBot(playerid, 20);
- }
- if (strfind(text, ":O") != -1)//id 19
- {
- ChatBot(playerid, 20);
- }
- if (strfind(text, ":-(") != -1)//id 19
- {
- ChatBot(playerid, 20);
- }
- if (strfind(text, "=(") != -1)//id 19
- {
- ChatBot(playerid, 20);
- }
- if (strfind(text, ";(") != -1)//id 19
- {
- ChatBot(playerid, 20);
- }
- return 1;
- }
Add Comment
Please, Sign In to add comment