DeadEd.com
IRC Bots, Java Game Query and Control Libraries, iPhone Apps, and More ...
Sign Up!
Login
Welcome to DeadEd.com
Tuesday, September 07 2010 @ 10:30 AM CDT

 Forum Index > Jibble.org > PircBot
 messaging instead of giving command
 |  Printable Version
By: acetolyne (offline) on Sunday, January 17 2010 @ 07:43 PM CST (Read 484 times)  
acetolyne

hello Ive been looking hard for the answer to my question but cant seem to find it

what Im trying to do is make a simple command that when the word "buzz" is put in the bot sends the line           /sound snd/bell.au

however a problem occurs instead of sending it thru the text area it simply displays it in chat not actually giving the command simply saying it to the channel

heres my coding for the command I have tried sendRawLine and sendMessage Ive tried sendRawLine('channel'',"/sound snd/hello.au"Wink; also replaced

channel with Nickserv and Chanserv still nothing anyone have examples or a site for resources that may help me solve this problem ty all help is much

appriciated

 

 

 

 

          if (message.equalsIgnoreCase("buzz"Wink)

          {
                       

            sendMessage(channel',"/sound snd/hello.au"Wink;

          }

 

ALSO is it possible to search for a word inside of what the user inputs

EXAMPLE when searching for the word buzz  respond if they wrote  "I wonder if I can BUZZ someone right now" make it respond because "buzz" was used inside a sentence?  thx

 


Forum Newbie
Newbie


Status: offline

Registered: 01/17/10
Posts: 2

Profile Email    
   
By: DeadEd (offline) on Monday, January 18 2010 @ 12:31 AM CST  
DeadEd

Hi

I think that there may be a little confusion here - either in what you are doing or what I think you are trying to do - let's see ... Razz

 

Are you expecting your bot to play a sound when you try to make it respond to "/sound snd/hello.au" ?

Remember that this is an IRC API, not an IRC client.  When you use a program such as mIRC and do something like "/j #deaded" it actually parses that user command and sends the correct command to the server with the IRC protocol.  All of these "/" starting "commands" are not actual IRC commands, they are user friendly shortcuts and are implemented by that client.  And for something like playing sounds, that is done on the client anyway.

This means that you can check for "buzz" and then use some Java API to play a sound (as playing a sound on your client has nothing to do with the IRC protocol).  Was this what you are trying to achieve?

 

As for the questions about finding words etc, then yes it is possible.  With PircBot, a lot of the things you deal with are Strings and there are many methods available from the JDKs String class - contains() being one that you could use in this particular case.

 

If you want to see some simple, working, example bot code, then take a look at the PircBot Demos


Forum Moderator
Moderator

Status: offline

Registered: 06/01/04
Posts: 589

Profile Email Website  
   
By: acetolyne (offline) on Monday, January 18 2010 @ 07:45 PM CST  
acetolyne

Sorry for being unclear and ty for responding to my question:

 

 

YOU WROTE

Are you expecting your bot to play a sound when you try to make it respond to "/sound snd/hello.au" ?

Remember that this is an IRC API, not an IRC client.  When you use a program such as mIRC and do something like "/j #deaded" it actually parses that user command and sends the correct command to the server with the IRC protocol.  All of these "/" starting "commands" are not actual IRC commands, they are user friendly shortcuts and are implemented by that client.  And for something like playing sounds, that is done on the client anyway.

 

 

Not expecting the bot to play the sound  "sound snd/bell2.au   is the specific command that does play a sound thu the irc server i use the coding was inside a onMessage(), statement thus when u type buss it sends the command "/sound snd/bell2.au"

 

 

YOU WROTE:

When you use a program such as mIRC and do something like  "/j #deaded" it actually parses that user command and sends the correct command to the server with the IRC protocol

 

 

 

yes this is what I need for it to actual parse the command instead of typing the command to the output screen

seems the Pirc bot sends it to the output screen and does not parse it is there a way to do this without a pre added command like the one above? or is there a way to find this command somehow I have checked all documentation i could find for their commands and nothing like that so ide like a way to do it thru the Pirc bot Sorry for not making it so clear the first time hope it is clear what I am trying to achieve Also thank you for the link to the strings definitions very helpful

 


Forum Newbie
Newbie

Status: offline

Registered: 01/17/10
Posts: 2

Profile Email    
   
By: Bo The Pro (offline) on Wednesday, May 12 2010 @ 12:17 AM CDT  
Bo The Pro

Quote by: acetolyne

hello Ive been looking hard for the answer to my question but cant seem to find it

what Im trying to do is make a simple command that when the word "buzz" is put in the bot sends the line           /sound snd/bell.au

however a problem occurs instead of sending it thru the text area it simply displays it in chat not actually giving the command simply saying it to the channel

heres my coding for the command I have tried sendRawLine and sendMessage Ive tried sendRawLine('channel'',"/sound snd/hello.au"Wink; also replaced

channel with Nickserv and Chanserv still nothing anyone have examples or a site for resources that may help me solve this problem ty all help is much

appriciated

 

 

 

 

          if (message.equalsIgnoreCase("buzz"Wink)

          {
                       

            sendMessage(channel',"/sound snd/hello.au"Wink;

          }

 

ALSO is it possible to search for a word inside of what the user inputs

EXAMPLE when searching for the word buzz  respond if they wrote  "I wonder if I can BUZZ someone right now" make it respond because "buzz" was used inside a sentence?  thx

 

 

you answered, all of your questions in your own post.

 

for starts it sends the message when the word buzz is sent in the message because of this line           if (message.equalsIgnoreCase("buzz"Wink {

so everytime the word "buzz" is stated anything inside {} will be executed. so mainly you would probably want to do ".buzz" "!buzz" "@buzz" or anything along the lines of something that wouldnt normally be placed infront of that.
 

and secondly it is being sent to the channel because of this line    sendMessage(channel',"/sound snd/hello.au"Wink;  is saying that its going to be said in channel, and the message thats going to be said is /sound snd/hello.au.

 

so for example say i want my bot to identify to the server when i say .botidentify

 

i would do 

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

     if (message.equalsIgnoreCase(".botidentify"Wink {

          sendMessage("NickServ", "INDENTIFY", "password"Wink;

     }

}

 

any questions just ask

 


 


Forum Newbie
Newbie

Status: offline

Registered: 05/11/10
Posts: 4

Profile Email    
   



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

Google Links ...

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