What's new
  • Visit Rebornbuddy
  • Visit Panda Profiles
  • Visit LLamamMagic
  • Visit Resources
  • Visit Downloads
  • Visit Portal
RebornBuddy Forums

Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

C# coding question string format

dbrous

New Member
Joined
Feb 6, 2012
Messages
78
I'm playing around with a PB profile, i've been hitting my head against this problem and can't find a solution for it. It's due to the lack of sleep and coding experience. I hope someone can help me with this, i'm guessing it should take seconds if you're familiar with c#.

This macro allows me to right click an item in (bag slot 0, item slot 1):

/use 0 1

I created a custom action in pb:

Lua.DoString("RunMacroText(\"/use 0 1\")");

The above is working. However, i wish to substitute 0 and 1 with variables say for example:
int bag
int slot

How would i write the Lua.DoString with variables instead of constants?

Thank you in advance
 
This probably won't work, I have not messed with lua stuff before.

PHP:
public void UseItem(int slot, int item)
     {
         Lua.DoString(string.Format("RunMacroText(\"use {0} {1}\")", Lua.Escape(slot), Lua.Escape(item)));         
     }
 
Back
Top