Difference between revisions of "Nanobot FAQ"

From Insomnia 24/7 Wiki
Jump to: navigation, search
imported>Wikiadmin
imported>Wikiadmin
Line 29: Line 29:
 
== I unloaded a module, but I still see some behavior associated with it ==
 
== 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.
 
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. ==
 
The SSL library will still be loaded on start, a version without SSL can be found [http://www.insomnia247.nl/projects/nanobot-no_ssl.pl here].
 
 
 
 
== 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 is available [http://www.insomnia247.nl/projects/nanobot-no_ipv6.pl here].
 
 
  
  
 
== Is there a version without IPv6 or SSL support? ==
 
== Is there a version without IPv6 or SSL support? ==
Yes, it's [http://www.insomnia247.nl/projects/nanobot-no_ssl-no_ipv6.pl here].
+
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.
 
 
A link to versions without just SSL or IPv6 can be found in the two questions above.
 
 
 
  
  
 
== 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].

Revision as of 08:49, 22 August 2014

What command are available?

A list of commands may be found here: Nanobot_manual#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.