[wadrobotframework-public:25] 5th of May : Cinco de Mayo : New Type

0 views
Skip to first unread message

Wadael

unread,
May 5, 2010, 6:28:49 PM5/5/10
to WadRobotFramework-public
Hi all,

I've added a new type of simple robot, it's an appender robot that
will only react to events initiated by preset users.
Implementation was fairly simple.
Hope it will be useful / give ideas.

Names may change !

Here is an example :


public class LORRobot extends LimitedObedienceBlipAppenderRobot {

public LORRobot() {
ArrayList<String> l = new ArrayList<String>();
l.add("Y...@googlewave.com");
setAuthorisedUsers(l);
}

/* (non-Javadoc)
* @see
org.wadael.waverobot.template.BlipAppenderRobot#getTextToAppend(java.lang.String)
*/
@Override
protected String getTextToAppend(String textOfTheBlipToReactFrom) {
// Example :
return "*2*" + textOfTheBlipToReactFrom + "**" ;
}


@Override
protected String getRobotSelfIntroduction() {
// EXAMPLE
return "I only obey to " + getAuthorisedUsers();
}


/*
* ------------------------------ Profile methods
------------------------------
*/
@Override
protected String getRobotName() {
return "LOR" ;
}

/**
* Returns WRF's default picture.
*/
@Override
protected String getRobotAvatarUrl() {
return "http://wadael.appspot.com/wrf/avatar.jpg";
}
}

What's next for this is to make it available for BlipModifierRobots,
Advanced robots (with live adding/removing authorised users) and
handling groups


Jérôme

Reply all
Reply to author
Forward
0 new messages