[RP] [Jammy] Bot Fix + Bot Deloading

Status
Not open for further replies.

Ari

Member
Sep 29, 2010
320
48
These fixes will include:
stop bots appearing more than once
bot deloading

1. Go into virtualRoom

2. Find:
Code:
internal void loadBots()
        {
            DataColumn dCol;
            using (DatabaseClient dbClient = Eucalypt.dbManager.GetClient())
            {
                dCol = dbClient.getColumn("SELECT id FROM roombots WHERE roomid = '" + this.roomID + "'");
            }
            int[] IDs = dataHandling.dColToArray(dCol, null);
            for (int i = 0; i < IDs.Length; i++)
            {
                virtualBot roomBot = new virtualBot(IDs[i], getFreeRoomIdentifier(), this);
                roomBot.H = sqFLOORHEIGHT[roomBot.X, roomBot.Y];
                sqUNIT[roomBot.X, roomBot.Y] = true;

                _Bots.Add(roomBot.roomUID, roomBot);
                sendData(@"@\" + roomBot.detailsString);
                sendData("@b" + roomBot.statusString);
            }
        }

3. Replace with:
Code:
internal void loadBots()
        {
            DataColumn dCol;
            using (DatabaseClient dbClient = Eucalypt.dbManager.GetClient())
            {
                dCol = dbClient.getColumn("SELECT id FROM roombots WHERE roomid = '" + this.roomID + "'");
            }
            int[] IDs = dataHandling.dColToArray(dCol, null);
            for (int i = 0; i < IDs.Length; i++)
            {
                if (!_Bot.ContainsKey(IDs[i]))
                {
                virtualBot roomBot = new virtualBot(IDs[i], getFreeRoomIdentifier(), this);
                roomBot.H = sqFLOORHEIGHT[roomBot.X, roomBot.Y];
                sqUNIT[roomBot.X, roomBot.Y] = true;

                _Bots.Add(roomBot.roomUID, roomBot);
                _Bot.Add(roomBot.ID, roomBot);
                sendData(@"@\" + roomBot.detailsString);
                sendData("@b" + roomBot.statusString);
                }
            }
        }

4. Add under that:
Code:
        internal void deloadBot(string Name)
        {
            virtualBot roomBot = botManager.getBot(Name);
            using (DatabaseClient dbClient = Eucalypt.dbManager.GetClient())
                dbClient.runQuery("UPDATE roombots SET roomid = '0' WHERE id = '" + roomBot.ID + "'");
            roomBot.Poof();
            _Bots.Remove(roomBot.roomUID);
            _Bot.Remove(roomBot.ID);
            sqUNIT[roomBot.X, roomBot.Y] = false;
            sendData("@]" + roomBot.roomUID);
        }
 

TisRyno

New Member
Jul 10, 2011
5
4
This is actually an attempt to replicate the source of UKRP after Jammy has printscreened the source while on teamviewer and attempted to replicate it's uses for bots.

Jammy has now hereby been dismissed from the UKRP team.
 

Cablink

http://www.vroleplay.net - join now!
Feb 4, 2011
382
27
This is actually an attempt to replicate the source of UKRP after Jammy has printscreened the source while on teamviewer and attempted to replicate it's uses for bots.

Jammy has now hereby been dismissed from the UKRP team.
I really dont think anybody cares, he doesnt care him self probably.
 

Ari

Member
Sep 29, 2010
320
48
This won't even work unless you have the botManager system which highly fails as me and ryno discovered mod close thread please
 
Status
Not open for further replies.

Users who are viewing this thread

Top