Register for your free account! | Forgot your password?

You last visited: Today at 22:22

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



One question (AI-Bot)

Discussion on One question (AI-Bot) within the CO2 Private Server forum part of the Conquer Online 2 category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Sep 2008
Posts: 178
Received Thanks: 62
Question One question (AI-Bot)

Hello, I have this code but not work well ... Someone could help me?

Here is the code:

Code:
 
Random XCoords = new Random();
int FinalX = XCoords.Next(40, 60);

Random YCoords = new Random();
int FinalY = YCoords.Next(40, 61);

Jump((ushort)FinalX, (ushort)FinalY);
And the problem is ... why my bot just jump in rect line like this photo?



Thanks!
.Kob is offline  
Old 03/24/2010, 17:03   #2


 
Korvacs's Avatar
 
elite*gold: 20
Join Date: Mar 2006
Posts: 6,126
Received Thanks: 2,518
When you initialize a random it uses a seed to determine what the next random number will be, this is based on the current time i think for the standard .net random class, so if you initialize them both at roughly the same time then they will both generate a random number which is identical, instead you should define a random number as a static for your entire server to use, that way whenever you use it it will always generate a different number.

Or if you insist on intializing it everytime you move its position just intialize one:

Code:
Random Rand = new Random();
Then

Code:
int X = Rand.Next(40, 60);
int Y = Rand.Next(40, 60);
Korvacs is offline  
Thanks
1 User
Old 03/24/2010, 17:15   #3
 
elite*gold: 0
Join Date: Sep 2008
Posts: 178
Received Thanks: 62
very good explanation, thanks!
.Kob is offline  
Old 03/24/2010, 23:28   #4
 
elite*gold: 0
Join Date: Sep 2008
Posts: 178
Received Thanks: 62
Sorry for double post but is just for bump,

i have another question and i don't want make another trhead.. =).
Is just make sit the bot. I know the Action is 250 but if just type "Action = 250;" he don't sit, i need send the packets really? Can you help me with this? =S Or tell me where is the site where when i press the Site button he work. I don't find that! =S. Sorry for my english >.<'

Thanks guys!
.Kob is offline  
Old 03/25/2010, 01:28   #5


 
Korvacs's Avatar
 
elite*gold: 20
Join Date: Mar 2006
Posts: 6,126
Received Thanks: 2,518
You will need to send the action packet to everyone in the local area.
Korvacs is offline  
Thanks
1 User
Old 03/25/2010, 01:33   #6
 
elite*gold: 0
Join Date: Sep 2008
Posts: 178
Received Thanks: 62
Quote:
Originally Posted by Korvacs View Post
You will need to send the action packet to everyone in the local area.
Ok and how i can do this? =S =S
.Kob is offline  
Old 03/25/2010, 01:41   #7


 
Korvacs's Avatar
 
elite*gold: 20
Join Date: Mar 2006
Posts: 6,126
Received Thanks: 2,518
The same way your sending the jump packet locally.
Korvacs is offline  
Old 03/25/2010, 11:11   #8
 
elite*gold: 0
Join Date: Sep 2008
Posts: 178
Received Thanks: 62
Ok here is all jump packets:

Code:
GC.MyChar.Loc.Jump(BitConverter.ToUInt16(Data, 8), BitConverter.ToUInt16(Data, 10));
^This is just for jump, i don't need this one.


Code:
Game.World.Spawns(GC.MyChar, true);

^Maybe is this but, i tested with command and not work =S



Code:
Game.World.Action(GC.MyChar, Data);

^And here, i think this one is needed but don't work too.

I tested both in the same command too.
But, what is "Data" in the Action packet?

Thanks =]
.Kob is offline  
Old 03/25/2010, 23:59   #9
 
andyd123's Avatar
 
elite*gold: 20
Join Date: Apr 2006
Posts: 1,341
Received Thanks: 886
Data should be "250" or rather the ID of the action you want your bot to express.
andyd123 is offline  
Thanks
1 User
Old 03/26/2010, 12:27   #10
 
elite*gold: 0
Join Date: Sep 2008
Posts: 178
Received Thanks: 62
Thanks andy ... And now whats fail with this code? =S

Code:
byte[] BotAction = new byte[250];
Game.World.Action(MyClient.MyChar, BotAction);
When i use this my client crash.. (Conquer.exe)

I tested this with the bot and not working (client crash when i active that with a command) Then, i tested the code with another command, here is: And crash the client too ...

Code:
if (Cmd[0] == "@testsit")
{
     GC.MyChar.Action = 250;
     [COLOR="Red"]byte[] BotAction = new byte[250];[/COLOR]
     Game.World.Action(GC.MyChar, BotAction);
}
This don't give error in the C# but, i think is this conversion what make the error =S

What fail? o.0
.Kob is offline  
Old 03/26/2010, 13:33   #11


 
Korvacs's Avatar
 
elite*gold: 20
Join Date: Mar 2006
Posts: 6,126
Received Thanks: 2,518
Nono, your sending a packet which is 250 bytes long, you dont want to do that at all....

You would need to send something like this i would think:

Code:
Game.World.Action(GC.MyChar, Packets.GeneralData(GC.MyChar.EntityID, 250, 0, 0, 81).Get);
Korvacs is offline  
Thanks
1 User
Old 03/26/2010, 15:06   #12
 
elite*gold: 0
Join Date: Sep 2008
Posts: 178
Received Thanks: 62
LOL =D I need learn more

And your code work perfectly Korvacs! Thanks again guy!
.Kob is offline  
Old 03/26/2010, 15:25   #13


 
KraHen's Avatar
 
elite*gold: 0
Join Date: Jul 2006
Posts: 2,216
Received Thanks: 794
Btw you shouldn`t just do random coords IMO. Read some articles on AI programming, a random bot is just... a random bot.
KraHen is offline  
Old 03/26/2010, 15:53   #14
 
elite*gold: 0
Join Date: Sep 2008
Posts: 178
Received Thanks: 62
Is just the jump and just when the stamina is going up. Then the bot jump random and if is not in any rage with the enemy, then sit and up the stamina.
When is full stamina he start jump (random but followin the player) and launch FBs or SSs. With diferents dificulties, the bot can never fail a fb obviously ... then i'll maked dificulties and again i puted a random adding or subtracting coords, and the bot fail just for 1 - 4 coords range.
Soz i know my english fail, I'm Spanish
.Kob is offline  
Old 03/26/2010, 16:18   #15


 
KraHen's Avatar
 
elite*gold: 0
Join Date: Jul 2006
Posts: 2,216
Received Thanks: 794
Quote:
Originally Posted by cakobu View Post
Is just the jump and just when the stamina is going up. Then the bot jump random and if is not in any rage with the enemy, then sit and up the stamina.
When is full stamina he start jump (random but followin the player) and launch FBs or SSs. With diferents dificulties, the bot can never fail a fb obviously ... then i'll maked dificulties and again i puted a random adding or subtracting coords, and the bot fail just for 1 - 4 coords range.
Soz i know my english fail, I'm Spanish
Don`t worr I have understood you :P It seems nice, I`d like to see it in action :P
KraHen is offline  
Reply


Similar Threads Similar Threads
[QUESTION]How do i bypass Xtrap for any private server?[QUESTION]
10/12/2009 - Cabal Online - 3 Replies
Exactly what the title says. I keep on getting an xTrap error when i try and load ANY private server that uses XTrap and it's driving me absolutely insane. I cant figure out why it's showing me the error. If anyone has any bypasser for Helix / PaRaDoX or any other server u know that has xTrap can u either PM me the bypass or post it here pls......this is driving me nuts Bump.
[QUESTION]How do i bypass Xtrap for any private server?[QUESTION]
10/02/2009 - Cabal Private Server - 2 Replies
Exactly what the title says. I keep on getting an xTrap error when i try and load ANY private server that uses XTrap and it's driving me absolutely insane. I cant figure out why it's showing me the error. If anyone has any bypasser for Helix / PaRaDoX or any other server u know that has xTrap can u either PM me the bypass or post it here pls......this is driving me nuts



All times are GMT +1. The time now is 22:23.


Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2025 elitepvpers All Rights Reserved.