[wadrobotframework-public:21] Cleanness, part 2 : idea

0 views
Skip to first unread message

Wadael

unread,
Apr 18, 2010, 5:38:46 PM4/18/10
to WadRobotFramework-public
Well,

I'm thinking that this idea of cleaning a command from the blip after
execution is equivalent to replacing it with some empty string.

Would you see some use of making a command replaced by something
"computed".

Could be through inheritance at the worker level, I have to check
about class type detection at runtime in GAE
(option 2 is delegating some work from WithWorkersRobots to a Worker
meta class.)

Example:
Typing
I have {my:account} credits on my bank account.
would transform into
I have 34 000 000 credits on my bank account.
(after clicking done)

Useful ? Useless ? Must-have evolution ?


Don't be shy, tell the world what you think ! :)


Jérôme



--
Subscription settings: http://groups.google.com/group/wadrobotframework-public/subscribe?hl=en-GB

Wadael

unread,
Apr 21, 2010, 8:07:49 PM4/21/10
to WadRobotFramework-public
It is implemented.
Not yet released but implemented nevertheless.

See a demo of it at
http://jeromeb.free.fr/wadrobotframework/videos/advancedrobots/replace_command.htm

This vid is veeerrryyyy sluggish, bad settings I must confess.
Do manual fast forward so not to waste your time.

Jérôme
> Subscription settings:http://groups.google.com/group/wadrobotframework-public/subscribe?hl=...

Wadael

unread,
Apr 21, 2010, 8:10:22 PM4/21/10
to WadRobotFramework-public
Here is the source code of the robot

public class AdvReplacerRobot extends WithWorkersRobot {

public AdvReplacerRobot(){
super();
/* One should add his/hers workers here. */
addRobotWorker(new LengthWorker() );
addRobotWorker(new WaveInformationWorker() );
}

@Override
public String getRobotIdentifier() {
// TODO return a string or this will not compile
// for example :
return "rplc";

/* an identifier is for identifying an advanced robot in a
conversation, ba*ecause there can be more than one
TIP: make it short !
*/

}

@Override
protected String getRobotSelfIntroduction() {
/* TODO Return the text the robot will blip when it is added to a
conversation */

// example :
return super.getRobotSelfIntroduction() + " Mr Waver, I am a
replacer tests robot.";

// will return Bonjour! Hello ! Namaste ! Salam ! buna ziua ! Mr
Waver, I am an advanced robot, what about you ?
}

@Override
protected String getDisplayName() {
// TODO
// EXAMPLES return "MYROBOTWithWorkers (" + super.getDisplayName()
+")";
//
return "AdvReplacer";
}


and now the code of the LengthWorker


public class LengthWorker implements RobotWorker {
@Override
public String getInstruction() {
return "len";
}

@Override
public String getDescription() {
return "Displays the length of the blip ";
}

@Override
public boolean doWork(EventMessageBundle bun, Blip bli, Event
eve,String params)
{
return true;
}

@Override
public boolean areCommandsToClean() {
return false;
}

@Override
public String getReplacingValue(Command c, EventMessageBundle bundle,
Blip blip, Event event) {
return "" + (BlipUtils.getEventBlipText(event).length() - ( 3+
c.getAcronym().length() + c.getInstruction().length())) ;
Reply all
Reply to author
Forward
0 new messages