Official Everybody Edits Forums

Do you think I could just leave this part blank and it'd be okay? We're just going to replace the whole thing with a header image anyway, right?

You are not logged in.

#1 2015-04-18 19:15:24

SirJosh3917
Formerly ninjasupeatsninja
From: USA
Joined: 2015-04-05
Posts: 2,095

[Question] Make a bot follow you?

I really want to know how to make a bot follow a player.
Only when the player moves/jumps.
Here is what your dealing with:

        public static Connection con1;
        public static Client client1;
        static void onMessage(object sender, PlayerIOClient.Message m)
        {
            switch (m.Type)
            {
                case "init":
                    con1.Send("init2");
                    break;
                case "add":
                    if (m.GetString(1) == "ninjasupeatsninja")
                    {
                        ownerid = m.GetInt(0);
                    }
                    break;
                case "god":
                    if (m.GetInt(0) == ownerid)
                    {
                        con1.Send("god", m.GetBoolean(1));
                    }
                    break;
                case "m":
                    if (m.GetInt(0) == ownerid)
                    {
                        /*
                         *  Here is where you can code where the bot moves. 
                         */
                    }
                    break;
            }
        }

Here is everything i am "using"

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Threading;
using PlayerIOClient;

This is what your dealing with:
*A v2.0.50727 PlayerIOClient
*Connection is con1
*I am using a switch (m.Type)
*I already have the god-mode thing programmed, so you dont have to worry about that.

Please tell me how to make this happen.
If you need more pieces of code, please ask for them.

Thank you. //forums.everybodyedits.com/img/smilies/smile

Offline

#2 2015-04-18 19:39:47, last edited by realmaster42 (2015-04-18 19:40:28)

realmaster42
Formerly marcoantonimsantos
From: ̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍
Joined: 2015-02-20
Posts: 1,380
Website

Re: [Question] Make a bot follow you?

        public static Connection con1;
        public static Client client1;
        static void onMessage(object sender, PlayerIOClient.Message m)
        {
            switch (m.Type)
            {
                case "m":
                    if (m.GetInt(0) == ownerid)
                    {
                        int X = Convert.ToInt32(Convert.ToDouble(m[1]) / 16);
                        int Y = Convert.ToInt32(Convert.ToDouble(m[2]) / 16);
                        int m1 = Convert.ToInt32(Convert.ToDecimal(m[1]) / 16);
                        int m2 = Convert.ToInt32(Convert.ToDecimal(m[2]) / 16);
                        int m5 = Convert.ToInt32(Math.Round(Convert.ToDecimal(m[5]), 0));
                        int m6 = Convert.ToInt32(Math.Round(Convert.ToDecimal(m[6]), 0));
                        int xp = m1 + m5;
                        int yp = m2 + m6;
                        
                                    ThreadPool.QueueUserWorkItem(delegate
                                    {
                                        con.Send("m", m.GetDouble(1), m.GetDouble(2), m.GetDouble(3), m.GetDouble(4), m.GetDouble(5), m.GetDouble(6), m.GetDouble(7), m.GetDouble(8), m.GetInt(9), m.GetBoolean(10));
                                        Thread.Sleep(125);
                                    });
                       }
                    break;
            }
        }

http://i.imgur.com/bjvgH5L.png?1

Offline

#3 2015-06-10 22:01:38

SirJosh3917
Formerly ninjasupeatsninja
From: USA
Joined: 2015-04-05
Posts: 2,095

Re: [Question] Make a bot follow you?

marcoantonimsantos wrote:
        public static Connection con1;
        public static Client client1;
        static void onMessage(object sender, PlayerIOClient.Message m)
        {
            switch (m.Type)
            {
                case "m":
                    if (m.GetInt(0) == ownerid)
                    {
                        int X = Convert.ToInt32(Convert.ToDouble(m[1]) / 16);
                        int Y = Convert.ToInt32(Convert.ToDouble(m[2]) / 16);
                        int m1 = Convert.ToInt32(Convert.ToDecimal(m[1]) / 16);
                        int m2 = Convert.ToInt32(Convert.ToDecimal(m[2]) / 16);
                        int m5 = Convert.ToInt32(Math.Round(Convert.ToDecimal(m[5]), 0));
                        int m6 = Convert.ToInt32(Math.Round(Convert.ToDecimal(m[6]), 0));
                        int xp = m1 + m5;
                        int yp = m2 + m6;
                        
                                    ThreadPool.QueueUserWorkItem(delegate
                                    {
                                        con.Send("m", m.GetDouble(1), m.GetDouble(2), m.GetDouble(3), m.GetDouble(4), m.GetDouble(5), m.GetDouble(6), m.GetDouble(7), m.GetDouble(8), m.GetInt(9), m.GetBoolean(10));
                                        Thread.Sleep(125);
                                    });
                       }
                    break;
            }
        }

i've forgot to thank you btw //forums.everybodyedits.com/img/smilies/tongue

Offline

Wooted by:

#4 2015-06-11 17:06:41, last edited by Jesse (2015-06-11 17:09:38)

Jesse
Member
From: Antartica?
Joined: 2015-02-16
Posts: 69
Website

Re: [Question] Make a bot follow you?

Or just use this short code..

connection.Send("m", m[1], m[2], m[3], m[4], m[5], m[6], m[7], m[8], m[9], m[10]);


Thanks a lot, Sensei1, for drawing this amazing avatar for me <3

Sig.php

Offline

Wooted by: (3)

#5 2015-06-11 20:42:56

realmaster42
Formerly marcoantonimsantos
From: ̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍
Joined: 2015-02-20
Posts: 1,380
Website

Re: [Question] Make a bot follow you?

Jesse wrote:

Or just use this short code..

connection.Send("m", m[1], m[2], m[3], m[4], m[5], m[6], m[7], m[8], m[9], m[10]);

4-5

we are on

6-11


http://i.imgur.com/bjvgH5L.png?1

Offline

#6 2015-06-12 22:59:14

Gooberg
Member
From: Andromeda Galaxy
Joined: 2015-02-26
Posts: 81

Re: [Question] Make a bot follow you?

o_o  I am a beginning programmer, I am creating my first bot...
The only thing here I know, is the definition of "connection"


Owner of GooCrew
GooCrew Worlds:
GooCrew Art World

Offline

#7 2015-06-12 23:06:58

SirJosh3917
Formerly ninjasupeatsninja
From: USA
Joined: 2015-04-05
Posts: 2,095

Re: [Question] Make a bot follow you?

gooberg123 wrote:

o_o  I am a beginning programmer, I am creating my first bot...
The only thing here I know, is the definition of "connection"

i can be deh person who will help u

Offline

#8 2015-06-13 07:20:31

DarkDragon4900
Member
Joined: 2015-03-17
Posts: 251

Re: [Question] Make a bot follow you?

ninjasupeatsninja wrote:
gooberg123 wrote:

o_o  I am a beginning programmer, I am creating my first bot...
The only thing here I know, is the definition of "connection"

i can be deh person who will help u

Been there, done that.
Trust me, you'll regret it.

Offline

Wooted by: (2)
DarkDragon49001434176431511857

Board footer

Powered by FluxBB

[ Started around 1732798881.5502 - Generated in 0.392 seconds, 13 queries executed - Memory usage: 1.54 MiB (Peak: 1.71 MiB) ]