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

 Forum Index > Jibble.org > PircBot
 PircBot bot.sendMessage(channel,message) doesnt work!
 |  Printable Version
By: jojobro (offline) on Friday, February 24 2012 @ 10:52 PM CST (Read 10832 times)  
jojobro

Hi i am new to PircBot and i need some quick help, for some reason my bot.sendMessage(channel,"message"Wink; doesnt send a message to the irc client (Mirc) if i send a message in Mirc it pops up (the message) in my java program, but if i try to send a message to the Mirc it doesnt work :/ please help Sad

 

here is my code so if anything is wrong here

?

import java.io.IOException;

import java.util.ArrayList;

import java.util.List;

import java.util.Properties;

 

import org.jibble.pircbot.DccChat;

import org.jibble.pircbot.InputThread;

import org.jibble.pircbot.PircBot;

 

public class IRC extends PircBot 

{

 

/**

* @param args

*/

public IRC(String host, String channel) 

{

if(!isConnected())

{

startconnection(host,channel);

} else

{

System.out.println("ignoreing cuz already connected!"Wink;

}

}

 

public void startconnection(String host, String channel) 

{

System.out.println("started connection with irc"Wink;

mchannel = channel;

mhost = host;

setAutoNickChange(true);

setName(TeamAV.mc.thePlayer.username);

try 

{

connect(host);

joinChannel(channel);

} catch(Exception e) 

{

e.printStackTrace();

}

}

 

    public void onMessage(String channel, String sender,String login, String hostname, String message)

    {

    //read the message

}

 

public void leaveserver(PircBot bot, String channel, String sender, String message) 

{

bot.quitServer("Bye bye!"Wink;

}

public static void sendMessage(PircBot bot,String message)

{

bot.sendMessage(mchannel, message);

}

public static String mchannel = "";

public static String mhost = "";

}

 


Forum Newbie
Newbie


Status: offline

Registered: 02/24/12
Posts: 1

Profile Email    
   



 All times are CDT. The time is now 01:26 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