kr0n Posted July 1, 2010 Share Posted July 1, 2010 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 Link to comment Share on other sites More sharing options...
kr0n Posted July 1, 2010 Author Share Posted July 1, 2010 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now