SA-MP Forums Archive
A chatbot - 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: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: A chatbot (/showthread.php?tid=94595)



A chatbot - braduz - 30.08.2009

I wasent very spacific in the titile (spelling fail) but what i mean is a bot that talks every so often:
Код:
bob:hey
bob2:2 brb
YOUR BOT NAME HERE: hey why dont u go and jump off a cliff
bob2:bk
bob:wb
bob2:cheese...
bob:...
YOUR BOT NAME HERE: Whas you dropped when you was a child??
(Just an example (whent a bit overboard))


Re: A chatbot - iLinx - 30.08.2009

https://sampwiki.blast.hk/wiki/Random_Messages

you could use this
https://sampwiki.blast.hk/wiki/Scripting...ns_Old#strfind
to check to see if someone says like brb or something


Re: A chatbot - braduz - 30.08.2009

Quote:
Originally Posted by iLinx
https://sampwiki.blast.hk/wiki/Random_Messages

you could use this
https://sampwiki.blast.hk/wiki/Scripting...ns_Old#strfind
to check to see if someone says like brb or something
Im new at this and dont know a lot where to put that


Re: A chatbot - iLinx - 30.08.2009

place the array for your messages and the timer variable before main.
set the timer under ongamemodeinit
forward the message callback before main
create the message callback anywhere you want below main as long as its not inside another callback.

it goes more in depth of what to create in the random messages tutorial.



Re: A chatbot - Sergei - 30.08.2009

You can check this: http://forum.sa-mp.com/index.php?topic=38096.0


Re: A chatbot - braduz - 30.08.2009

Код:
new RandomMSG[][] =
{
  "Wolf bot: Are you stuck? get help (/help) ^^",
  "Wolf bot: This server is english only",
  "Wolf bot: Visit our website www.wolvez.co.cc",
  "Wolf bot: Wanna know who made what? find out (/credits)",
  "Wolf bot: See a cheater? report them (/report)",
  "Wolf bot: The official braduz motto "Immah teh tech wolf round theese areas"
};
SetTimer("SendMSG", 200000, true);
forward SendMSG();
public SendMSG()
{
  
}
new randMSG = random(sizeof(RandomMSG));
SendClientMessageToAll(red, RandomMSG[randMSG]);
Ummm will this work?


Re: A chatbot - Dark_Kostas - 30.08.2009

Do you mean the
Код:
[url]
?? No it wont work. If you want to add announcements follow the tutorial.


Re: A chatbot - braduz - 30.08.2009

Quote:
Originally Posted by Dark_Kostas
Do you mean the
Код:
[url]
?? No it wont work. If you want to add announcements follow the tutorial.
the wiki sa-mp one? -did do


Re: A chatbot - braduz - 31.08.2009

followed mthe announcement one too
you do know i need a chatbot that says a random message every minit or so
btw will this work
Код:
new Announcements[5][128] = { 
  "Wolf bot: Stuck, dont know where to start? (/help)",
  "Wolf bot: test",
  "Wolf bot: Another test",
  "Announcement: Type /commands to view the list of the server commands",
  "Announcement: Type /rules to read the server rules. Make sure to understand 'em!"
};
public GlobalAnnouncement()
{
  switch (Msg)
  {
    case 0: {SendClientMessageToAll(ANNOUNCEMENT,Announcements[0]); Msg++;} 
    case 1: {SendClientMessageToAll(ANNOUNCEMENT,Announcements[1]); Msg++;}
    case 2: {SendClientMessageToAll(ANNOUNCEMENT,Announcements[2]); Msg++;}
    case 3: {SendClientMessageToAll(ANNOUNCEMENT,Announcements[3]); Msg++;}
    case 4: {SendClientMessageToAll(ANNOUNCEMENT,Announcements[4]); Msg = 0;} 
  }
  return 1;