super3 / IRC-Bot

A very little basic IRCBot that will get improved over the next time.
http://www.wildphp.com
102 stars 47 forks source link

PHP fatal error during start #27

Open tommyken opened 11 years ago

tommyken commented 11 years ago

Hello, when i tried to php file , i got this error. PHP Fatal error: Call to undefined method Listener\Joins::getKeywors()

Config file is offcourse changed.

Thx

ElvenSpellmaker commented 11 years ago

There is a spelling mistake, which both myself and FutileFreedom have fixed.

Either pull mine or his code if you want it fixed: https://github.com/pogosheep/IRC-Bot/pull/26 https://github.com/pogosheep/IRC-Bot/pull/25

Mine also fixes a few other bugs and oddities and adds a little bit of functionality.

tommyken commented 11 years ago

thank you, it indeed fixes the problem. Now i see how to find it too.

Now i was wondering, how to create in easy way (php file) to add my own script i wanted to say on my bot. thank you...

tommyken commented 11 years ago

nobody ?

ElvenSpellmaker commented 11 years ago

I don't quite get what you mean, explain a bit more please.

tommyken commented 11 years ago

I want to put my own scripts in the php bot. p.e. google What and where do i have to place the 'google.php' where to put '!google' command ?

Or some explain in what orde to place 'commands' scripts

Thx advanced!!

ElvenSpellmaker commented 11 years ago

OK, I understand what you mean now, I did think you meant that but I wanted to check.

OK from the main directory you have the folder Classes, all classes go under here under different folders.

The Command folder stores commands (such as !google), the Listener folder stores listeners (things that monitor different messages such as JOIN and PRIVMSG and need to respond to chat, like a URL title parser for example), and things under Library are to do with the bot itself, the base classes (what each command extends) for Command and Listener are also under here.

Some of my Commands need a Listener AND a Command, so I put them under command and put two classes inside this file under two different namespaces (Command for the command and Listener for the listener).

When you make a command you extend the base class so that it inherits everything to be used. Explore these classes to see what you inherit.

Hope that helps. =)

tommyken commented 11 years ago

this is my code i've used before: http://pastebin.com/eS5bqpbA

now i've this: http://pastebin.com/NK19RWqY

so if i got it right. I've to place this in listener (named horoscoop.php) and also in command ?

Sorry if its hard .

Thx for the help!!

ElvenSpellmaker commented 11 years ago

You'll need to do some clean-up of the variables so that they correspond to the ones that the bot provides.

If you pulled my code then you'll need to check: https://github.com/ElvenSpellmaker/IRC-Bot/blob/master/Classes/Library/IRC/Command/Base.php

Else if you used Pogo's code then you'll need to check: https://github.com/pogosheep/IRC-Bot/blob/master/Classes/Library/IRC/Command/Base.php

Look at how arguments are named, also the command to send to a channel is different to how you have. If you look at one of those it might help.

tommyken commented 11 years ago

i did clean up my file and changed some of arguments and 'send' options, but still don't get this working, It doesn't find/react on my file. I didn't saw it in the 'cmd window'. The others what already has been placed in the folders, those i cansee. But i better gonna quit. Its too difficult for me :( . Too much serperated links, while i thougt two things (1 line to add and a file with code) thx anyway

ghost commented 11 years ago

I have the same problems, I don't get a own script to run. No matter where i put the file, always i get

[ MISSING ] The following, not existing, command was called: "Imdb".

Heres my code of the file in "/Classes/Command" http://pastebin.com/JBTJxi3f

matejvelikonja commented 11 years ago

@NeXxGeN have you added it to the config file?

ghost commented 11 years ago

OMG, no!

That was the problem, thank you! facepalm my own

matejvelikonja commented 11 years ago

@NeXxGeN great to hear that. Make a PR when you finish the command, looks like a very useful one.

ghost commented 11 years ago

I will do :)

ghost commented 11 years ago

Maybe you can help me, but i cant pull a request. There's no button or something else to pull a request. ![Uploading Bildschirmfoto vom 2013-03-12 14:46:44.png . . .]()

matejvelikonja commented 11 years ago

Maybe you should read this first, if it helps https://help.github.com/articles/using-pull-requests

ghost commented 11 years ago

No, it seems I am to dumb. Never mind, here is the source code, do what u want with it: http://pastebin.com/c09qGdP2

matejvelikonja commented 11 years ago

I've added PR. https://github.com/pogosheep/IRC-Bot/pull/29

ghost commented 11 years ago

Thank you, i have to learn more about git, I'm really new to this.