Server Help Forum Index Server Help
Community forums for Subgame, ASSS, and bots
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   StatisticsStatistics   RegisterRegister 
 ProfileProfile   Login to check your private messagesLogin to check your private messages   LoginLogin (SSL) 

Server Help | ASSS Wiki (0) | Shanky.com
TWBot Coding Help.

 
Post new topic   Reply to topic Printable version
 View previous topic  MERVbot vs TWcore Post :: Post Monitor.dll and another question  View next topic  
Author Message
BDwinsAlt
Agurus's Posse


Age:34
Gender:Gender:Male
Joined: Jun 16 2003
Posts: 1145
Location: Alabama
Offline

PostPosted: Mon Jul 11, 2005 6:05 pm    Post subject: TWBot Coding Help. Reply to topic Reply with quote

Well i just have a few questions, first of all...
If i have this:

public void handleCommand( String name, String message, String playerName ){
if( message.startsWith( "!ban ")){
m_botAction.sendUnfilteredPrivateMessage( playerName, "*kill 283892" );
}
}

How can i get this to work? It does not do anything when i type !ban in game. No errors are reported when i compile the coding either.

Also, how can i get the bot to send someone text from a txt or cfg?

Like !staff and you read from a file and send the text from there.

would it be something like:

...} else if( message.startsWith( "!staff" )){
m_botAction.send[w/e goes in here]
}
}
Back to top
View users profile Send private message Add User to Ignore List Send email Visit posters website AIM Address Yahoo Messenger MSN Messenger
Contempt+
Server Help Squatter


Age:36
Gender:Gender:Male
Joined: May 15 2005
Posts: 682
Location: Home
Offline

PostPosted: Mon Jul 11, 2005 9:12 pm    Post subject: Reply to topic Reply with quote

Just incode the !staff in a merv bot. Instead of writing it in java.
_________________
SSE Network Administrator
Back to top
View users profile Send private message Add User to Ignore List Visit posters website AIM Address
BDwinsAlt
Agurus's Posse


Age:34
Gender:Gender:Male
Joined: Jun 16 2003
Posts: 1145
Location: Alabama
Offline

PostPosted: Mon Jul 11, 2005 9:19 pm    Post subject: Reply to topic Reply with quote

LOL! Nah serciously you guys know how?
Back to top
View users profile Send private message Add User to Ignore List Send email Visit posters website AIM Address Yahoo Messenger MSN Messenger
D1st0rt
Miss Directed Wannabe


Age:37
Gender:Gender:Male
Joined: Aug 31 2003
Posts: 2247
Location: Blacksburg, VA
Offline

PostPosted: Sat Jul 16, 2005 4:00 pm    Post subject: Reply to topic Reply with quote

Check out the stuff here for basics on how I structure commands in my bots when not using the command interpreter.

Code: Show/Hide
public void handleCommand( String name, String message, String playerName )
{
    if( message.startsWith( "!ban "))   
        m_botAction.sendUnfilteredPrivateMessage( playerName, "*kill 283892" );
}


When I see this, I wonder if your handleCommand method ever gets called because I have never seen one that takes three parameters. How did you obtain the value to pass as playerName? It's also possible that the name is invalid so it gets sent to nobody. What I would do (haven't tested this) is more along these lines:
Code: Show/Hide
public void handleCommand( String name, String message)
{
    if( message.startsWith( "!ban "))   
       if(message.length() > 5)
       {
           Player p = m_botAction.getPlayer(message.substring(5));
           if(p != null)
              m_botAction.sendUnfilteredPrivateMessage(p.getPlayerID(), "*kill 283892");
           else
               m_botAction.sendPrivateMessage(name, "Invalid Player");
       }       
}


Hope this helps.
_________________

Back to top
View users profile Send private message Add User to Ignore List Visit posters website
BDwinsAlt
Agurus's Posse


Age:34
Gender:Gender:Male
Joined: Jun 16 2003
Posts: 1145
Location: Alabama
Offline

PostPosted: Mon Jul 18, 2005 4:36 pm    Post subject: Reply to topic Reply with quote

Hey man you rock. You gave me a straight up awnser instead of something like "Make a new Bot". There are nice people on here! icon_smile.gif
Back to top
View users profile Send private message Add User to Ignore List Send email Visit posters website AIM Address Yahoo Messenger MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    Server Help Forum Index -> Bot Questions All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum
View online users | View Statistics | View Ignored List


Software by php BB © php BB Group
Server Load: 109 page(s) served in previous 5 minutes.

phpBB Created this page in 0.560920 seconds : 29 queries executed (77.2%): GZIP compression disabled