Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP fatal error during start #27

Open
tommyken opened this issue Feb 23, 2013 · 19 comments
Open

PHP fatal error during start #27

tommyken opened this issue Feb 23, 2013 · 19 comments

Comments

@tommyken
Copy link

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
Copy link
Collaborator

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

Either pull mine or his code if you want it fixed:
#26
#25

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

@tommyken
Copy link
Author

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
Copy link
Author

nobody ?

@ElvenSpellmaker
Copy link
Collaborator

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

@tommyken
Copy link
Author

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
Copy link
Collaborator

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
Copy link
Author

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
Copy link
Collaborator

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
Copy link
Author

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
Copy link

ghost commented Mar 12, 2013

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
Copy link
Collaborator

@NEXXGEN have you added it to the config file?

@ghost
Copy link

ghost commented Mar 12, 2013

OMG, no!

That was the problem, thank you! facepalm my own

@matejvelikonja
Copy link
Collaborator

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

@ghost
Copy link

ghost commented Mar 12, 2013

I will do :)

@ghost
Copy link

ghost commented Mar 12, 2013

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
Copy link
Collaborator

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

@ghost
Copy link

ghost commented Mar 12, 2013

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
Copy link
Collaborator

I've added PR.
#29

@ghost
Copy link

ghost commented Mar 12, 2013

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants