SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help > Help Archive

 
 
Thread Tools Display Modes
Old 16/11/2010, 01:27 PM   #1
Lookin
Gangsta
 
Lookin's Avatar
 
Join Date: May 2010
Location: Wai O Taiki Bay, Aotearoa
Posts: 623
Reputation: 14
Default chatbot help

i currently downloaded a chatbot and discovered that it doesn't kick in

pawn Code:
#include <a_samp>

#define MAX_MESSAGES 100

#define BOTTIMER 50000 // 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] = "Lookinbot"; // 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[][] =
{
    "Hey,",
    "Sup, ",
    "Hiya, ",
    "Wasssup, "
};

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

    AddRandomMessage("Hey");
    AddRandomMessage("the pcrp forums are good looking!");
    AddRandomMessage("I'm a chatbot");
    AddRandomMessage("Lookin Updates the server once a week");
    AddRandomMessage("OMG ITS AN INFERNUS!");
    AddRandomMessage("I'm in love with this server");
    AddRandomMessage("Stop Using Hacks you noob");
    AddRandomMessage("Don't Make me Ban you");
    AddRandomMessage("Try /help people");
    AddRandomMessage("Go to the forums to check out our VIP privlages");
    AddRandomMessage("I wouldnt if I were you!");
    print("LookinBot Loaded");
    return 1;
}

public OnPlayerConnect(playerid)
{
    SendBotMessage("Welcome to 'My Server' Please Read the /rules or ill rape you.");
    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(playerid));
            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(playerid));
            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, "Ha", true) || !strcmp(text, "lol", true) || !strcmp(text, "rofl", true) || !strcmp(text, "lmao", true))
    {
        SendPlayerMessageToAll(playerid, text);
        SendBotMessage("ROFL!");
        return 0;
    }

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

    if(!strcmp(text, "me?", true))
    {
        SendPlayerMessageToAll(playerid, text);
        SendBotMessage("Yes you");
        return 0;
    }
   
    if(!strcmp(text, "fuck", true) || !strcmp(text, "bitch", true) || !strcmp(text, "dick", true) || !strcmp(text, "slut", true))
    {
        SendPlayerMessageToAll(playerid, text);
        SendBotMessage("Watch the Mouth! :)");
        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;
}

anyone got any idea's why?
__________________

Now Recruiting! Go to http://www.pgclan.org/





Lookin is offline  
Old 16/11/2010, 09:33 PM   #2
Blt950
Huge Clucker
 
Blt950's Avatar
 
Join Date: Jan 2008
Location: Bergen, Norway
Posts: 371
Reputation: 1
Default Re: chatbot help

What do you mean that it doesn't kick in?
Doesn't it work? Does it error when compleing? What happens?

What kind of problem are you looking for?
__________________



HeartBit Roleplay - Roleplay in the Wild West

Blt950 is offline  
Old 16/11/2010, 10:16 PM   #3
Lookin
Gangsta
 
Lookin's Avatar
 
Join Date: May 2010
Location: Wai O Taiki Bay, Aotearoa
Posts: 623
Reputation: 14
Default Re: chatbot help

it doesn't work it compiles fine when i put it in my server it doesn't load (in game) but my console says its loaded
__________________

Now Recruiting! Go to http://www.pgclan.org/





Lookin is offline  
Old 21/11/2010, 06:55 AM   #4
Lookin
Gangsta
 
Lookin's Avatar
 
Join Date: May 2010
Location: Wai O Taiki Bay, Aotearoa
Posts: 623
Reputation: 14
Default Re: chatbot help

could it be the fact i have 3 textdraws and my lookinsamaw script in there?
__________________

Now Recruiting! Go to http://www.pgclan.org/





Lookin is offline  
Old 21/11/2010, 07:03 AM   #5
Grim_
High-roller
 
Grim_'s Avatar
 
Join Date: Sep 2008
Location: United States
Posts: 2,882
Reputation: 109
Default Re: chatbot help

Do you mean none of the messages send, or only some, like the bot's?

Also make sure you are staying in the server long enough to let the messages be sent.
Grim_ is offline  
Old 21/11/2010, 07:08 AM   #6
Lookin
Gangsta
 
Lookin's Avatar
 
Join Date: May 2010
Location: Wai O Taiki Bay, Aotearoa
Posts: 623
Reputation: 14
Default Re: chatbot help

yeah its not sending any messages what so ever and yeah i am the last time i stayed for an hour waiting xD

This forum requires that you wait 120 seconds between posts. Please try again in 47 seconds.
__________________

Now Recruiting! Go to http://www.pgclan.org/





Lookin is offline  
Old 21/11/2010, 07:11 AM   #7
Grim_
High-roller
 
Grim_'s Avatar
 
Join Date: Sep 2008
Location: United States
Posts: 2,882
Reputation: 109
Default Re: chatbot help

You are 100% positive the filterscript is completely loaded? Show me the server log text when you start the server.

You could also try removing all other filterscripts but that one, and see if it works (If there are any others).

This forum requires that you wait 120 seconds between posts. Please try again in 26 seconds.
Grim_ is offline  
Old 21/11/2010, 07:14 AM   #8
Lookin
Gangsta
 
Lookin's Avatar
 
Join Date: May 2010
Location: Wai O Taiki Bay, Aotearoa
Posts: 623
Reputation: 14
Default Re: chatbot help

Quote:
Originally Posted by Grim_ View Post
You are 100% positive the filterscript is completely loaded? Show me the server log text when you start the server.

You could also try removing all other filterscripts but that one, and see if it works (If there are any others).

This forum requires that you wait 120 seconds between posts. Please try again in 26 seconds.
Code:
SA-MP Dedicated Server
----------------------
v0.3b R2, (C)2005-2010 SA-MP Team

[20:22:03] 
[20:22:03] Server Plugins
[20:22:03] --------------
[20:22:03]  Loaded 0 plugins.

[20:22:03] 
[20:22:03] Filter Scripts
[20:22:03] ---------------
[20:22:03]   Loading filter script 'LookinBot.amx'...
[20:22:03] LookinBot Loaded
[20:22:03]   Loaded 1 filter scripts.

[20:22:03] Total vehicles from files: 0
[20:22:03] 
---------------------------------------
[20:22:03] Running Grand Larceny - by the SA-MP team

[20:22:03] ---------------------------------------

[20:22:03] Number of vehicle models: 0
tryed using the gamemode grandlarc just in case it was my gamemode
__________________

Now Recruiting! Go to http://www.pgclan.org/





Lookin is offline  
Old 21/11/2010, 07:15 AM   #9
Grim_
High-roller
 
Grim_'s Avatar
 
Join Date: Sep 2008
Location: United States
Posts: 2,882
Reputation: 109
Default Re: chatbot help

Alright, thanks for showing.

I'll take the filterscript myself and mess around with it for awhile until I can get it working. Please also note it is 2:26 AM here, so I might fall asleep before even copying and pasting it =P
Grim_ is offline  
Old 21/11/2010, 07:17 AM   #10
Lookin
Gangsta
 
Lookin's Avatar
 
Join Date: May 2010
Location: Wai O Taiki Bay, Aotearoa
Posts: 623
Reputation: 14
Default Re: chatbot help

thats fine mate i appreciate the help and your a lot like me stay up all night n sleep all day =D
__________________

Now Recruiting! Go to http://www.pgclan.org/





Lookin is offline  
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[FilterScript] [FS]Real ChatBot(Messages with 2 Colors) d0 Filterscripts 24 31/01/2013 11:49 AM
A chatbot braduz Help Archive 8 31/08/2009 10:10 AM


All times are GMT. The time now is 06:12 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.