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.
Tremor
Posts: 13
Joined: Wed Aug 10, 2011 5:38 am

Re: Help with Quake Bot

Post by Tremor »

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!
r00k
Posts: 1111
Joined: Sat Nov 13, 2004 10:39 pm

Re: Help with Quake Bot

Post by r00k »

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.
Spike
Posts: 2914
Joined: Fri Nov 05, 2004 3:12 am
Location: UK
Contact:

Re: Help with Quake Bot

Post by Spike »

What's wrong with stuffcmd? :/
Tremor
Posts: 13
Joined: Wed Aug 10, 2011 5:38 am

Re: Help with Quake Bot

Post by Tremor »

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.
r00k
Posts: 1111
Joined: Sat Nov 13, 2004 10:39 pm

Re: Help with Quake Bot

Post by r00k »

Spike wrote:What's wrong with stuffcmd? :/
Difference between reliable and unreliable msg?
Spike
Posts: 2914
Joined: Fri Nov 05, 2004 3:12 am
Location: UK
Contact:

Re: Help with Quake Bot

Post by Spike »

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.
Tremor
Posts: 13
Joined: Wed Aug 10, 2011 5:38 am

Re: Help with Quake Bot

Post by Tremor »

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.
Post Reply