BlobbieScript - Examples

The Traveller
0001 @message->1 = "emote looks around to get her bearings."
0002 @message->2 = "emote pulls out a map, looks at it, and makes a few markings."
0003 @message->3 = "talk" @r "Travelling is fun, I can tell you"
0004 \             "how to get just about anywhere!"
0005
0006 << @message->(1d3)

The Repair Gnome
0001 protect
0002 {
0003    if( !%canSee( @this, @o ) )
0004    {
0005        echoto char @n @I doesn't seem to notice the @O.
0006        break
0007    }
0008    endif
0009
0010    if( !%canSee( @this, @n ) )
0011    {
0012         say Hmmm? Where did this come from?
0013         drop @o
0014         break
0015    }
0016    endif
0017
0018    if( @o->hitpoints >= @o->maxHitpoints ) )
0019    {
0020         talk @n This is already in perfect condition!
0021         give @o @n
0022         drop @o
0023         break
0024    }
0025    endif
0026
0027    @repairCost =
0028    \   @o->sellValue * (@o->maxHitpoints - @o->hitpoints) / @o->maxHitpoints
0029
0030    @repairCost = %asInteger( @repairCost )
0031
0032    if( @n->gold < @repairCost )
0033    {
0034        talk @n You need @repairCost gold pieces to get that fixed.
0035        talk @n Please come back when you have more gold.
0036        give @o @n
0037        drop @o
0038        break
0039    }
0040    endif
0041
0042    @o->hitpoints = @o->maxHitpoints
0043    emote rapidly fiddles with @O, %sexPossess( @this ) hands moving
0044    \   faster than the eye can follow.
0045    say There we go, right as rain!
0046    give @o @n
0047    drop @o
0048
0049    echoto char @n You give @repairCost gold coins to @I.
0050    echoto notc @n gives some gold to @I.
0051
0052    @n->gold = @n->gold - @repairCost
0053    @this->gold = @this->gold + %asInt( @repairCost / 25 )
0054 }
0055 endprotect

Greedy the Giant
0001 if( !%isAwake( @this ) )
0002 {
0003    return
0004 }
0005 endif
0006
0007 foreach( %getRoomObects() as @object )
0008 {
0009    if( %canTake( @object )
0010    \   &&
0011    \   (%isObjectTypeKey( @object )
0012    \    ||
0013    \    %isObjectTypeWand( @object )
0014    \    ||
0015    \    %isObjectTypeStaff( @object )
0016    \    ||
0017    \    %isObjectTypePotion( @object )
0018    \    ||
0019    \    %isObjectTypeScroll( @object )
0020    \    ||
0021    \    %isObjectTypeWeapon( @object )
0022    \    ||
0023    \    %getObjStat( @object, "sellValue" ) >= 50000) )
0024    {
0025        say Oh goodie goodie...
0026        get @object
0027        return
0028    }
0029    endif
0030 }
0031 endwhile