Forum

Help with Quake Bot

Discuss programming topics for any language, any source base. If it is programming related but doesn't fit in one of the below categories, it goes here.

Moderator: InsideQC Admins

Re: Help with Quake Bot

Postby Tremor » Sat Mar 15, 2014 9:34 pm

Ok so I managed to get it working. Turns out, my bot can connect to darkplaces, fte, and manquake and stay connected indefinitely as long as I spam some unreliables. However, and this is where I was messing up, proquake will still disconnect the bot. Unfortunately I don't have the proquake source code to examine, but I did manage to find in my packet captures that proquake sends an impulse 39 reliable message every 5 seconds. I spoke with r00k and he said that this was proquake's way of determining pings and such. He ended up giving me some insight on how Qrack handles this.. Essentially, the bot just needs to send an unreliable with the correct 'action time' in the form of a client movement order with an additional '39' as the impulse number. Upon doing this, my bot has remained connected to all proquake servers without issue.

Now, I just need to build upon this and add some code to handle map changes and afk timelimit disconnects. Thanks for all your help, guys!
Tremor
 
Posts: 13
Joined: Wed Aug 10, 2011 5:38 am

Re: Help with Quake Bot

Postby r00k » Tue Mar 18, 2014 2:03 pm

proquake sends an impulse 39

You are using the word "proquake" in place of the mod 'CRMOD'... ;)

crmod sends a stuffcmd to the client
Code: Select all
                     msg_entity = player;
                     WriteByte (MSG_ONE, SVC_STUFFCMD);
                     WriteString (MSG_ONE, "impulse 39\n");

which sends impulse 39 back to the server to update a timer that is used to determine AFK, or lagged out clients.
r00k
 
Posts: 1108
Joined: Sat Nov 13, 2004 10:39 pm

Re: Help with Quake Bot

Postby Spike » Tue Mar 18, 2014 2:49 pm

What's wrong with stuffcmd? :/
Spike
 
Posts: 2883
Joined: Fri Nov 05, 2004 3:12 am
Location: UK

Re: Help with Quake Bot

Postby Tremor » Tue Mar 18, 2014 5:24 pm

r00k wrote:
proquake sends an impulse 39

You are using the word "proquake" in place of the mod 'CRMOD'... ;)

crmod sends a stuffcmd to the client
Code: Select all
                     msg_entity = player;
                     WriteByte (MSG_ONE, SVC_STUFFCMD);
                     WriteString (MSG_ONE, "impulse 39\n");

which sends impulse 39 back to the server to update a timer that is used to determine AFK, or lagged out clients.


Ok so it's stuffcmd sent by the mod itself, not proquake. I guess I simply associated the problem with proquake because I was getting that stuffcmd when I connected to proquake servers running both crmod and cax. Also, prior to our conversation, I had not realized that some of these server messages required information back. As an example, I can get away with not recognizing the 'bright flash' command that the server sends.
Tremor
 
Posts: 13
Joined: Wed Aug 10, 2011 5:38 am

Re: Help with Quake Bot

Postby r00k » Wed Mar 19, 2014 7:08 am

Spike wrote:What's wrong with stuffcmd? :/

Difference between reliable and unreliable msg?
r00k
 
Posts: 1108
Joined: Sat Nov 13, 2004 10:39 pm

Re: Help with Quake Bot

Postby Spike » Wed Mar 19, 2014 12:41 pm

both the builtin and MSG_ONE are reliable, and sent to one. qc has no unreliable unicast method.
thus the only practical reason to use writebytes for stuffcmds is if you want to write a single char at a time in order to work around the lack of support for strcat.
Spike
 
Posts: 2883
Joined: Fri Nov 05, 2004 3:12 am
Location: UK

Re: Help with Quake Bot

Postby Tremor » Wed Mar 19, 2014 9:50 pm

Interesting. Seems like a decent enough solution and quite self-explanatory.. Pack a byte, append/concat it to the string. I suppose with strcat, you could do it directly.
Tremor
 
Posts: 13
Joined: Wed Aug 10, 2011 5:38 am

Previous

Return to General Programming

Who is online

Users browsing this forum: No registered users and 2 guests