What's new
  • Visit Rebornbuddy
  • Visit Resources
  • Visit API Documentation
  • Visit Downloads
  • Visit Portal
  • Visit Panda Profiles
  • Visit LLamamMagic

Battlefield Objectives

jrox

New Member
Joined
May 7, 2010
Messages
31
Reaction score
0
Hi All,

Working on a plugin to improve my bots performance in battlegrounds.

I wrote an AV bot a few years ago using innerspace that would read the status of the battleground objectives to decide where to go.

Trying to recreate that, but getting caught on the first step... reading the status of the battleground objectives.

First attempt was to look into the Battlegrounds.LandMarks object, but that didn't seem to help at all (lists landmarks in winters' grasp).

Then I went for the information using LUA.

Wrote this little bit of code, but can't seem to get anything back.

Code:
        public void PvPReport(int i)
        {
            
            Lua.DoString("flagX, flagY, flagName = GetBattlefieldFlagPosition("+i+");");
            int flagX = Lua.GetLocalizedInt32("flagX", Me.BaseAddress);
            int flagY = Lua.GetLocalizedInt32("flagY", Me.BaseAddress);
            string flagName = Lua.GetLocalizedText("flagName", Me.BaseAddress);
            
            slog("PVP report for object "+i+" -- Name: " + flagName + " x: " + flagX + " y: " + flagY);
            
            Thread.Sleep(100);
        }

Always returns:
PVP report for object 1 -- Name: nil x: 0 y: 0

I don't know how the GetLocalizedText function works or why it needs Me.BaseAddress or even if that's the correct thing to put in there... I copied that from custom class.

Also I can't be sure if the lua is correct, is there an easy way to test lua script in game?

Any insight would be appreciated!

J
 
Back
Top