Jump to content



Photo

IRC BOT v1.0


  • Please log in to reply
12 replies to this topic

#1 McGod

McGod

    Formerly Chip

  • Active Members
  • PipPipPipPipPipPip
  • 589 posts

Posted 05 July 2007 - 09:05 PM

This is an highly modular IRC bot, it uses a plugin system so that you can easily add/remove features from the bot.

Features:
-Modular Plugin system
-Uses SQLite
-Comes with an auth system
-Automatically joins channels on connection

Plugin System

The plugin system uses a trigger system utlizing Call to allow a modular system.
For Example:
A message comes in from a channel.

The bot will loop through an array ($Plugin) which will have all the plugin's info (Name, ver, Desc, Prefix) it will take the prefix's and call Prefix_OnMsg with the info like user, channel, msg etc..

A template plugin:

AutoIt         
_TempPlugin() Func _TempPlugin()     If IsDeclared("Plugin") = 0 Then Exit     Local $i = UBound($Plugin)     ReDim $Plugin[$i][4]     $Plugin[$i - 1][0] = "Temp";Name of your plugin     $Plugin[$i - 1][1] = "v1.0";Current version     $Plugin[$i - 1][2] = "A plugin template";Description of plugin     $Plugin[$i - 1][3] = "Temp";Plugin prefix (Temp_onload) etc.. EndFunc   ;==>_TempPlugin ;=================================================== ;Function Name: Temp_onload () ;Use: Fires on bot startup. ;Variables: None ;=================================================== Func Temp_onload(); EndFunc   ;==>Temp_onload ;=================================================== ;Function Name: Temp_OnMsg ($user, $chan, $msg) ;Use: Fires on a channel or private message ;Variables: $user - Username of the person who said the message ;            $chan - Channel or username of where the message was said ;            $msg - Message that was said ;=================================================== Func Temp_OnMsg($user, $chan, $msg); EndFunc   ;==>Temp_OnMsg ;=================================================== ;Function Name: Temp_OnJoin($user, $chan) ;Use: Fires when you or someone joins a channel ;Variables: $user - User who has joined such channel ;            $chan - The channel which the bot/user has joined ;=================================================== Func Temp_OnJoin($user, $chan); EndFunc   ;==>Temp_OnJoin ;=================================================== ;Function Name: Temp_OnPart($user, $chan) ;Use: Fires when someone leaves the channel ;Variables: $user - User who has left the channel ;            $chan - The channel which the user has left ;=================================================== Func Temp_OnPart($user, $chan); EndFunc   ;==>Temp_OnPart ;=================================================== ;Function Name: Temp_OnQuit($user, $reason) ;Use: Firess when someone has quit from the server. ;Variables: $user - User who has left the server ;            $reason - Reason why user has left ;=================================================== Func Temp_OnQuit($user, $reason); EndFunc   ;==>Temp_OnQuit ;=================================================== ;Function Name: Temp_OnMode($chan, $user, $mode) ;Use: Fires when a user/channel mode has occured. ;Variables: $chan - Channel/User where the mode has occured ;            $user - User that executed the mode ;            $mode - The mode the user has executed ;=================================================== Func Temp_OnMode($chan, $user, $mode); EndFunc   ;==>Temp_OnMode ;=================================================== ;Function Name: Temp_OnKick($chan, $kicker, $user, $reason) ;Use: Fires when someone gets kicked from a channel. ;Variables: $chan - Channel were the user was kicked ;            $kicker - User who kicked the person ;            $user - User who was kicked ;            $reason - Why the user was kicked ;=================================================== Func Temp_OnKick($chan, $kicker, $user, $reason) EndFunc   ;==>Temp_OnKick ;=================================================== ;Function Name: Temp_OnNick($user, $newnick) ;Use: Fires when a user has changed their nick ;Variables: $user - User who had changed their nick ;            $newnick - Users new nick name ;=================================================== Func Temp_OnNick($user, $newnick); EndFunc   ;==>Temp_OnNick ;=================================================== ;Function Name: Temp_OnTopic($user, $chan, $topic) ;Use: Fires when the topic in a channel is changed. ;Variables: $user - User who changed the topic ;            $chan - The channel were the topic was changed ;            $topic - The new topic in the channel ;=================================================== Func Temp_OnTopic($user, $chan, $topic); EndFunc   ;==>Temp_OnTopic ;=================================================== ;Function Name: Temp_OnInvite($inviter, $user, $chan) ;Use: Fires when the bot/user is invited into a channel ;Variables: $inviter - User who invited the user into the channel ;            $user - The user who was invited ;            $chan - The channel the user was invited to ;=================================================== Func Temp_OnInvite($inviter, $user, $chan); EndFunc   ;==>Temp_OnInvite ;=================================================== ;Function Name: Temp_OnConnect($host, $port) ;Use: Fires on connection to server ;Variables: $host - The host name where the bot connected. ;            $port - The port of the where the bot connected. ;=================================================== Func Temp_OnConnect($host, $port); EndFunc   ;==>Temp_OnConnect ;=================================================== ;Function Name: Temp_OnPing($ping) ;Use: Fires on Ping recieved ;Variables: $ping - The message that you need to send back. ;=================================================== Func Temp_OnPing($ping); EndFunc   ;==>Temp_OnPing ;=================================================== ;MISC INTERNAL FUNCTIONS ;=================================================== ;=================================================== ;Function Name: ChanSend($chan, $msg) ;Use: To send a message to a channel ;Variables: $chan - The channel/user you want to send a message to ;            $msg - The message you want to send ;~~MISC NOTES~~ ; - Bold variable ; - Underline variable ; - Color variable use it with a number from 1-15 to change color of text. ;0 white        8 yellow ;    1 black        9 lightgreen ;    2 blue        10 cyan ;    3 green        11 lightcyan ;    4 lightred    12 lightblue ;    5 brown        13 pink ;    6 purple    14 grey ;    7 orange    15 lightgrey ;=================================================== ;=================================================== ;Function Name: JoinChannel($chan) ;Use: To join a channel ;Variables: $chan - The Channel you want to join ;=================================================== ;=================================================== ;Function Name: _Query($sSQL) ;Use: To return the first return of a sqlite query. ;Variables: $sSQL - The query you wish to use ;=================================================== ;=================================================== ;Function Name: _SQLExec($sSQL) ;Use: Executes a SQLite database command. ;Variables: $sSQL - The command you wish to send. ;=================================================== ;=================================================== ;Function Name: _Log($msg) ;Use: To add to the log file ;Variables: $msg - The message you want to add to the log. ;===================================================

Download

Download v1.0



Plugins

[left]Register.au3 - v1.0 - Allows you to give access, login etc. - Auth_
Download - Comes with v1.0





Edited by Chip, 05 July 2007 - 09:06 PM.






#2 Mast3rpyr0

Mast3rpyr0

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 419 posts

Posted 06 July 2007 - 04:43 AM

Error line 244

#3 James

James

    jbrooksuk

  • MVPs
  • 9,470 posts

Posted 06 July 2007 - 06:54 AM

Its a UDF, you need to create the GUI yourself.

#4 BullGates

BullGates

    Wayfarer

  • Active Members
  • Pip
  • 77 posts

Posted 08 July 2007 - 02:30 PM

Hello, the download link is unavailable, can you provide another download location? Thanks.

#5 BullGates

BullGates

    Wayfarer

  • Active Members
  • Pip
  • 77 posts

Posted 21 July 2007 - 10:01 PM

I could now download it, thanks for such a nice script.

#6 Skizmata

Skizmata

    Prodigy

  • Active Members
  • PipPipPip
  • 169 posts

Posted 23 July 2007 - 11:44 AM

@Jaenster I would love to try out your bot I am trying to learn about TCPSend and this looks like a great example. Unfortunately your script as been stricken by a bug in these forums and I'm too much of a noob to fix it myself. Would it be possible for you to give me a download link to dump it to one of those code clipboard sites (which i cant remember the name of any of them).

Thanks! I look forward to your response.
AutoIt changed my life.

#7 Delta

Delta

    Oh Dear...

  • Active Members
  • PipPipPipPipPipPip
  • 609 posts

Posted 06 August 2007 - 09:24 PM

I really hate bumping old topics but does anyone have another download location for this?
Please stop confusing "how to" with "how do"

#8 DeFirence

DeFirence

    Seeker

  • Active Members
  • 42 posts

Posted 08 January 2008 - 01:01 AM

I myself have made a few IRC bots and other bots in AutoIt and would be interested to look at this bots code and maybe get some nice ideas.

If anyone could reupload or provide a link for this it would be really great.

DeFirence

#9 Apzo

Apzo

    Adventurer

  • Active Members
  • PipPip
  • 117 posts

Posted 08 January 2008 - 12:44 PM

Here is the file, I've downloaded it a while ago :
http://dilatt.free.fr/au3/IRC%20Bot.zip

I think it won't work with the lattest au3 version : this one requires sqlite3.dll for example.
I don't have the time to rewrite it, if someone is interested....

Have fun and let us know about any improvement :P

[EDIT]
OK, the sqlite3.dll is easy to remove, just put comments before the dll load lines.
Some global vars has been defined inside a func, move them on top and that's OK.

The PluginOpen() func has been removed :) so the md5 funcs are not working.
If someone know another MD5HASH func, let us know !
[/EDIT]

Apzo.

Edited by Apzo, 08 January 2008 - 01:30 PM.


#10 DeFirence

DeFirence

    Seeker

  • Active Members
  • 42 posts

Posted 08 January 2008 - 01:36 PM

Here is the file, I've downloaded it a while ago :
http://dilatt.free.fr/au3/IRC%20Bot.zip

I think it won't work with the lattest au3 version : this one requires sqlite3.dll for example.
I don't have the time to rewrite it, if someone is interested....

Have fun and let us know about any improvement :P

[EDIT]
OK, the sqlite3.dll is easy to remove, just put comments before the dll load lines.
Some global vars has been defined inside a func, move them on top and that's OK.

The PluginOpen() func has been removed :) so the md5 funcs are not working.
If someone know another MD5HASH func, let us know !
[/EDIT]

Apzo.

That link is dead too :blink:

#11 Apzo

Apzo

    Adventurer

  • Active Members
  • PipPip
  • 117 posts

Posted 08 January 2008 - 04:29 PM

:) I just used it, it works...
Try http://dilatt.free.fr/au3/ you will see the directory content...

Apzo.

That link is dead too :P



#12 NeoFoX

NeoFoX

    Adventurer

  • Active Members
  • PipPip
  • 141 posts

Posted 13 February 2008 - 03:41 PM

Well.. I wanted to test this one..

But mine isn't working (not on Vista or XP).. I think it has something to do with the SQL, because in the log file i'm getting this.

2008-02-13 16:11:24 : SQLite Exec->Ret Value: 0->Error Msg: not an error->Query : DELETE FROM IRC_ChanSession
2008-02-13 16:11:24 : SQLite Exec->Ret Value: 0->Error Msg: not an error->Query : DELETE FROM IRC_UserSession
2008-02-13 16:11:24 : SQLite Exec->Ret Value: 0->Error Msg: not an error->Query : UPDATE IRC_Users SET login = '0'

And ff I remove all the functions which has something of a query in it... than it works.

Do you know what the problem is? I'm trying to create an IRC bot myself (off course via AutoIT)

--- The Neo and Only --- --Projects---Image to Text converterText to ASCII converter


#13 10031992

10031992

    Adventurer

  • Active Members
  • PipPip
  • 132 posts

Posted 25 June 2009 - 01:12 AM

link Register.au3 Expired
ERROR

Upload Please
--------------------------------------------------------------------------------------------------------------------------------------------

Posted Image

Autoit Support Forum in Portuguese | AutoitBrasil.com

My Script :Simples Login for Program




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users