Tic Tac Toe icon Tic Tac Toe Play Tic Tac Toe with your ARC robot: configurable turn, win and draw scripts, cheat commands and optional speech-recognition control. Try it →
Asked — Edited
Need Help With Plugin

Need Help With Plugin

I need some help with a plugin I am working on. I am new to C# and OOP. Have went thru the Tutorial and the SDK Tutorials also.

User-inserted image

How do I get the values from the form in to my C# code?

 public enum LocationType
            {
                Wall = 255,
                Empty = 0,
                Destination = 254,
                Source = 1
            }
            public struct Location
            {

instead of Wall = 255, how do I get Wall = textBox1.Text. textBox1 being the Textbox name.

Thanks RichardZ


ARC Pro

Upgrade to ARC Pro

Experience early access to the latest features and updates. You'll have everything that is needed to unleash your robot's potential.

Author Avatar
PRO
Synthiam
LinkedIn Thingiverse Twitter YouTube GitHub
#17  

You got it! That's the correct code as posted.

Or since you know the size of the array, you can do this...


VariableManager.CreateVariableArray("$Disp2",0, map.GetLength(0) * map.GetLength(1));

int index = 0;

                for (int x1 = 0; x1 < map.GetLength(0); x1++)
                {
                    for (int y1 = 0; y1 < map.GetLength(1); y1++)
                    {
                        disp = map[x1, y1].ToString();
                        
                        VariableManager.SetVariable("$Disp2", disp, index)

                      index++;
                    }
            
                }