Getting brick after wrenching? [solved]

Author Topic: Getting brick after wrenching? [solved]  (Read 1606 times)

Alright so I need help figuring out how to accomplish a goal.


I need to apply a trigger to a brick based on the bricks name.

I have figured out two methods,

1) run a continuous loop throughout the server checking all bricks names
2) if there is a callback after you're done eventing a brick, check the name

Is the second one possible, if so what is the callback?
« Last Edit: February 18, 2013, 02:23:43 PM by Yola² »

Package servercmdSetWrenchData(%cl, %data)

%count = mainBrickGroup.getCount();

for ( %i = 0 ; %i < %count ; %i++ )
{
   %group = mainBrickGroup.getObject( %i );

   for ( %j = 0 ; %j < %group.NTNameCount ; %j++ )
   {
      %name = %group.NTName[ %j ];

      // make sure that this is a brick you're looking for here
      // check %name and such, if you don't want it, use continue;

      for ( %k = 0 ; %k < %group.NTObjectCount_[ %name ] ; %k++ )
      {
         %obj = %group.NTObject_[ %name, %k ];

         // do actual code here
         // %name is brick name
         // %obj is brick object
      }
   }
}

Package servercmdSetWrenchData(%cl, %data)
going to use this method, thank you


edit;
so I'm using servercmdSetWrenchData inside a package, and echoing the name of the brick, yet when I parent it it gives me input <0> could not find servercmdSetWrenchData, but it does everything right.

Removing the parent, it breaks the eventing process.
« Last Edit: February 18, 2013, 11:45:08 AM by Yola² »

put the parent after my check, works fine now


stuff no, how do I get the brick ID from the function?  %data doesn't house the brick ID, and %cl is the client ID
« Last Edit: February 18, 2013, 01:02:45 PM by Yola² »


already figured it out and forgot to change name again, but thank you!

If you want this to work after it's loaded from a save, you should package fxDtsBrick::setNTObjectName(%this,%name) instead.