Difference between revisions of "Nanobot FAQ"

From Insomnia 24/7 Wiki
Jump to: navigation, search
imported>Wikiadmin
m (I unloaded a module, but I still see some behaviour associated with it!)
imported>Wikiadmin
 
(9 intermediate revisions by the same user not shown)
Line 1: Line 1:
 +
== How do I start the bot? ==
 +
ruby nanobot.rb
 +
See [[Nanobot_manual#Starting_command]] for more info and commandline options.
 +
 +
 
== What command are available? ==
 
== What command are available? ==
A full list of commands may be found here: [[Nanobot_manual#Bot_commands]]
+
A list of commands may be found here: [[Nanobot_manual#Built_in_bot_commands]]
 +
 
  
 
== How do I change the IRC server/bot name etc? ==
 
== How do I change the IRC server/bot name etc? ==
The cofiguration settings can be found here: [[Nanobot_manual#Configuration]]
+
The configuration settings can be found here: [[Nanobot_manual#Configuration]]
 +
 
  
 
== My bot doesn't listen to me, what's going on? ==
 
== My bot doesn't listen to me, what's going on? ==
 
Make sure you have the correct hostmask set in the bot's admin list. (See [[Nanobot_manual#Configuration]] for more information on how.)<br />
 
Make sure you have the correct hostmask set in the bot's admin list. (See [[Nanobot_manual#Configuration]] for more information on how.)<br />
On some networks hostmasks are masked, or a fake hostname may be set once you identify with NickServ.<br />
+
On some networks hostmasks are masked or a fake hostname may be set once you identify with NickServ.<br />
 
If you are IRC operator on the network, keep in mind that things like hostmasks and virtual hostnames may not be shown for you.
 
If you are IRC operator on the network, keep in mind that things like hostmasks and virtual hostnames may not be shown for you.
 +
  
 
== My bot seems to be connecting, but it's not joining channels ==
 
== My bot seems to be connecting, but it's not joining channels ==
 
In some cases IRC networks require you to respond to a PING request before you're allowed to join channels.<br />
 
In some cases IRC networks require you to respond to a PING request before you're allowed to join channels.<br />
You can configure this by changing '''$wait_for_ping = 0;''' to '''$wait_for_ping = 1;''' in the bot's configuration.
+
You can configure this by changing '''@pingwait = false''' to '''@pingwait = true''' in the bot's configuration.
 +
 
  
 
== My bot joins, but it takes really long before it joins any channels ==
 
== My bot joins, but it takes really long before it joins any channels ==
 
The reverse of the question above. It is probably waiting for a ping command, even though it does not need to do so.
 
The reverse of the question above. It is probably waiting for a ping command, even though it does not need to do so.
  
== I tried to load a module, but it says it's not valid perl ==
 
You are possibly missing some libraries the module uses, or it really isn't valid perl.<br />
 
You can check the exact error message by running '''perl -c mymodule.pm''' on your module file.
 
  
== I unloaded a module, but I still see some behaviour associated with it! ==
+
== I tried to load a plugin, but it says "Failed to load plugin: *" ==
Yes, unfortunately, there is no way to truely unload a module in Perl. Even when a module is technically unloaded, it will remain in memory until the bot is restarted. There is no way to fix this, it's just a consequence how Perl handles modules.
+
You are possibly missing some gems the plugin uses. Check to make sure all the requires and includes for the plugin are satisfied.
 +
The error message itself should tell you a fair amount about what exactly is going wrong.
 +
 
 +
 
 +
== I unloaded a module, but I still see some behavior associated with it ==
 +
This should not happen normally... However... This requires a bit of a look at how code is loaded on the fly in Ruby. It simply reads the file, parses the ruby code and adds that to the running process, this means that there is no way to unload code from the process once it's loaded... However!... Since all plugins are normally contained in a class and an instance of that class is what actually runs plugin code, when a plugin is unloaded it is cleared from the hash of plugins that are active and the reference to it is removed at which time the Ruby garbage collector should pick it up... HOWEVER!!!... You can do odd things that cause code to remain accessible. For example if you add code outside of the class definition of your plugin it will be interpreted as belonging to the main body of code and cannot be unloaded in any way. Also things that affect the global execution state will remain after unloading a plugin. Think of things like modifying global variables or function hooks. If you have a construction like this there is simply no way to unload that code from the running process.
  
== I changed a modules function name and reloaded it, but the old function remains available! ==
 
Same answer as the question above. It can not be helped.
 
  
== I need the SSL library to start the bot, even though I do not use SSL to connect to the network. ==
+
== Is there a version without IPv6 or SSL support? ==
The SSL library will still be loaded on start, a version without SSL will be made available at the final release of version 3.
+
No. Older versions of nanobot had these forks but since the normal Ruby sockets support IPv6 it does not make sense to strip that out again. While it would be possible to strip SSL support it is not very practical. Besides that you probably really should use ssl, it won't be a problem to have support for it unless your system does not have any SSL library installed at all.
  
== I need INET6 even though I don't use IPv6 ==
 
The new version uses IO::Socket::INET6 over IO::Socket::INET for IPv6 compatebility.<br />
 
INET6 is backward compatible with IPv4, so you will still be able to use it with the new library. If you do not have IPv6 support (yet), a version using the old INET library will be made available with the final release of version 3.
 
  
 
== My question isn't listed ==
 
== My question isn't listed ==
You can contact us at cool_fire_666@hotmail.com, or on our IRC (irc.insomnia247.nl) in #shells.<br />
+
You can contact us at coolfire@insomnia247.nl, or on our IRC (irc.insomnia247.nl) in #shells.<br />
 
You can also use our [http://www.insomnia247.nl?page=chat Chat page].
 
You can also use our [http://www.insomnia247.nl?page=chat Chat page].

Latest revision as of 18:27, 18 October 2014

How do I start the bot?

ruby nanobot.rb

See Nanobot_manual#Starting_command for more info and commandline options.


What command are available?

A list of commands may be found here: Nanobot_manual#Built_in_bot_commands


How do I change the IRC server/bot name etc?

The configuration settings can be found here: Nanobot_manual#Configuration


My bot doesn't listen to me, what's going on?

Make sure you have the correct hostmask set in the bot's admin list. (See Nanobot_manual#Configuration for more information on how.)
On some networks hostmasks are masked or a fake hostname may be set once you identify with NickServ.
If you are IRC operator on the network, keep in mind that things like hostmasks and virtual hostnames may not be shown for you.


My bot seems to be connecting, but it's not joining channels

In some cases IRC networks require you to respond to a PING request before you're allowed to join channels.
You can configure this by changing @pingwait = false to @pingwait = true in the bot's configuration.


My bot joins, but it takes really long before it joins any channels

The reverse of the question above. It is probably waiting for a ping command, even though it does not need to do so.


I tried to load a plugin, but it says "Failed to load plugin: *"

You are possibly missing some gems the plugin uses. Check to make sure all the requires and includes for the plugin are satisfied. The error message itself should tell you a fair amount about what exactly is going wrong.


I unloaded a module, but I still see some behavior associated with it

This should not happen normally... However... This requires a bit of a look at how code is loaded on the fly in Ruby. It simply reads the file, parses the ruby code and adds that to the running process, this means that there is no way to unload code from the process once it's loaded... However!... Since all plugins are normally contained in a class and an instance of that class is what actually runs plugin code, when a plugin is unloaded it is cleared from the hash of plugins that are active and the reference to it is removed at which time the Ruby garbage collector should pick it up... HOWEVER!!!... You can do odd things that cause code to remain accessible. For example if you add code outside of the class definition of your plugin it will be interpreted as belonging to the main body of code and cannot be unloaded in any way. Also things that affect the global execution state will remain after unloading a plugin. Think of things like modifying global variables or function hooks. If you have a construction like this there is simply no way to unload that code from the running process.


Is there a version without IPv6 or SSL support?

No. Older versions of nanobot had these forks but since the normal Ruby sockets support IPv6 it does not make sense to strip that out again. While it would be possible to strip SSL support it is not very practical. Besides that you probably really should use ssl, it won't be a problem to have support for it unless your system does not have any SSL library installed at all.


My question isn't listed

You can contact us at coolfire@insomnia247.nl, or on our IRC (irc.insomnia247.nl) in #shells.
You can also use our Chat page.