DeadEd.com
IRC Bots, Java Game Query and Control Libraries, and More ...
Sign Up!
Login
Welcome to DeadEd.com
Monday, August 21 2017 @ 01:24 AM CDT

 Forum Index > Jibble.org > PircBot
 SpeechBot Can't Connect Password channel
 |  Printable Version
By: illzebra (offline) on Tuesday, December 06 2011 @ 01:51 PM CST (Read 10558 times)  
illzebra

I have the speechbot working(www.jibble.org/speechbot/)

but I can't connect it to a server that has a password!

 

I tried just adding my password between the server & channel name but it diddn't work.

How can I edit SpeechBot.java or the command:
 

PHP Formatted Code

java -classpath .;./lib/pircbot.jar;./lib/freetts.jar org.jibble.speechbot.SpeechBot hollowshadow.jtvirc.com #Hollowshadow


so that I can connect.

Please if you can help, I cant figure this out.


Forum Newbie
Newbie

Status: offline

Registered: 12/06/11
Posts: 3

Profile Email    
   
By: illzebra (offline) on Tuesday, December 06 2011 @ 01:54 PM CST  
illzebra

Here is SpeechBot.java

 

PHP Formatted Code

/*
Copyright Paul James Mutton, 2001-2004, http://www.jibble.org/

This file is part of SpeechBot.

This software is dual-licensed, allowing you to choose between the GNU
General Public License (GPL) and the www.jibble.org Commercial License.
Since the GPL may be too restrictive for use in a proprietary application,
a commercial license is also provided. Full license information can be
found at http://www.jibble.org/licenses/

$Author: pjm2 $
$Id: SpeechBot.java,v 1.1 2004/05/15 13:07:51 pjm2 Exp $

*/

package org.jibble.speechbot;

import org.jibble.pircbot.*;
import com.sun.speech.freetts.*;
import com.sun.speech.freetts.audio.*;
import javax.sound.sampled.*;
import java.io.File;

public class SpeechBot extends PircBot {

    private boolean noisy = true;
    private Voice voice;
    private AudioPlayer voicePlayer;
   
    public SpeechBot(String name) {
        setName(name);

        String voiceName = "kevin16";
        VoiceManager voiceManager = VoiceManager.getInstance();
        voice = voiceManager.getVoice(voiceName);

        if (voice == null) {
            System.out.println("Voice not found.");
            System.exit(1);
        }

        voice.allocate();

        voicePlayer = new JavaClipAudioPlayer();
        voicePlayer.setAudioFormat(new AudioFormat(8000, 16, 1, false, true));
    }
   
    // This method is not called from anywhere yet.
    public void exit() {
        voice.deallocate();
    }

    public void onMessage(String channel, String sender, String login, String hostname, String message) {
        message = message.trim();
        if (message.toLowerCase().startsWith("!send ")) {
            String input = message.substring(6);
            String filename = "./archive/SpeechBot-" + System.currentTimeMillis();
            AudioPlayer filePlayer = filePlayer = new SingleFileAudioPlayer(filename,  AudioFileFormat.Type.WAVE);
            filePlayer.setAudioFormat(new AudioFormat(8000, 16, 1, false, true));
            speak(input, filePlayer);
            filePlayer.close();
            dccSendFile(new File(filename + ".wav"), sender, 120000);
        }
        if (message.toLowerCase().startsWith("!say ")) {
            String input = sender + " on " + channel + " says: " + message.substring(5);
            speak(input, voicePlayer);
        }
        else if (noisy) {
            String input = sender + " on " + channel + " says: " + message;
            speak(input, voicePlayer);
        }
    }

    private void speak(String input, AudioPlayer player) {
        voice.setAudioPlayer(player);
        voice.speak(input);
    }

    public static void main(String[] args) throws Exception {
        SpeechBot bot = new SpeechBot("SpeechBot");
        bot.connect(args[0]);
        bot.joinChannel(args[1]);
    }
}
 


Forum Newbie
Newbie

Status: offline

Registered: 12/06/11
Posts: 3

Profile Email    
   
By: illzebra (offline) on Tuesday, December 06 2011 @ 07:19 PM CST  
illzebra

I got it.

 

Here's how i did it:

 

 Changed SpeechBot.java like this:

PHP Formatted Code

    public static void main(String[] args) throws Exception {
        SpeechBot bot = new SpeechBot("SpeechbotName");
        bot.connect("ServerName", Port, "Password");
        bot.joinChannel("#ChannelName");

Then typed in cmd:

 

PHP Formatted Code

java -classpath .;./lib/pircbot.jar;./lib/freetts.jar org.jibble.speechbot.SpeechBot


Forum Newbie
Newbie

Status: offline

Registered: 12/06/11
Posts: 3

Profile Email    
   



 All times are CDT. The time is now 01:24 AM.
Normal Topic Normal Topic
Locked Topic Locked Topic
Sticky Topic Sticky Topic
New Post New Post
Sticky Topic W/ New Post Sticky Topic W/ New Post
Locked Topic W/ New Post Locked Topic W/ New Post
View Anonymous Posts 
Able to Post 
Filtered HTML Allowed 
Censored Content 

My Account





Sign up as a New User
Lost your password?

What's New

Stories

No new stories

Comments last 2 days

No new comments

Files last 14 days

No new files
No new comments

Links last 2 weeks

No new links