Viewing topic:My IRC Bot,
Page: 1
Topic post 05-06-2008 - 22:35
Well, after your great tutorial Jim, i successfully got a stable irc bot going.
Yet, the quit command, i don't want open to everyone.

How would i allow only the owner to do so?

Following your tutorial, would it be $ex[0]. To check the nicknam?
Topic post 06-06-2008 - 09:05
Hey Hoona, welcome to CM

Check out this topic:

http://www.combined-minds.net/forum/topic/59/The_big_and_general_IRC_Bot_topic!/

Here you can see the little snippet that actracts the username and hostname. I recommend using this way to check if the user is your (so store your host in $adminHost, and on the quit command check if the $hostname variable is the same as $adminHost)

Should be quite easy
Topic post 06-06-2008 - 16:50
Jim, just wondering, you said you would be willing to email me a script or something. Are you still willing to do it?
Topic post 06-06-2008 - 23:37
Yeah, sorry Xnigma. I will mail it to you once i get my HDD back from a friend. I don't have it here on my hard disk.

Topic post 07-06-2008 - 01:30
Oh, okay, thanks.
Topic post 15-06-2008 - 23:56
Hey again,,

code
1
2
3
4

 
	if ($command == ":!talk") {
	   fputs($socket, "PRIVMSG ".$ex[4]." :".$ex[5]."nr");
	}
 


I have that in my php irc bot.
WHat i am doing is, making it join a channel, that only the bot and i can join.
Then i get it to join other channels, if i wish to make the bot talk, i use the command above.

Except one problem that i encounter.
It only gets the 5th paremeter.

So if i put,
!talk #combined-minds hello there.

It will only print out in the channel, hello,

How could i make it print out everything after the #channel part.?

THanks.
Topic post 16-06-2008 - 07:35
Hey Hoona,
You have to save everything from a specific point using a while loop:


/**
* Create a "say" line, this will make a variable with only the text of a user in it
*/
$c=3;
$say_raw = "";
while (isset($ex[$c])){
$say_raw .= $ex[$c]." ";
$c++;
}

You can use $c to say you want to start with the word you like. This should work like a charm
Topic post 16-06-2008 - 17:44
I don't get it.
Topic post 16-06-2008 - 21:15
It saved everything from up to ex3 into a new variable named $say_raw. Please try to understand before posting that kind of replies.
Topic post 17-06-2008 - 18:31
Errr, don't talk like that you fricking big headed cunt.

Look, it took me nearlly 10 minutes to try and figure out what it did, if someone doesn't get something. Are they just meant to leave it out or something?

Next time, think before saying, Try and understand before those replies or whatever you tried to say.

Topic post 17-06-2008 - 22:29
Saying "I dont get it" isn't realy the reply I would wait for. Say what you don't understand, tell me where it goes wrong. That way I can do something, like this you are just assuming I will fix everything for you.

You started calling me a big headed cunt right after I told you the truth, so this is my reply

That first line is useless for you since I don't accept such behavior from people I'm helping out. You are immidiatly banned from the website unless you say sorry via email or something.
Topic post 18-06-2008 - 00:52
Jim is right. Oh and btw - you got owned!
Topic post 11-07-2008 - 20:35
RealShadow, to make some one feel badly by ganging up on them by saying owned is not a good way, please keep it clean.

©Copyrights Combined Minds. All rights reserved 2006 - 2008 : Disclaimer
Realized by www.Minna-Media.com