Page 1 of 1

Auto-connect

Posted: Thu Jun 23, 2005 8:02 pm
by lizardkid
I've been contemplating this for a while, but it's stumped me how to do it.

I'm hoping to have/make a script allowing you to simply put in a console command and an ip or address and it checks every second or so and asks the server the maxplayers and the players in then, if the players in are less than maxplayers then connect, otherwise wait. But i dont know how to make console commands or run scripts from the main menu, heck i dont know how to send a paket to the server asking Maxplayers/players

Any help or is this a fools errand?

Posted: Thu Jun 23, 2005 10:26 pm
by ViPER
hmmm. I dont think you can get a return status from console outside the server without rcon password.

you would only be able to attemp connection.

you might want to check with the fpsadmin forums.

Posted: Thu Jun 23, 2005 10:53 pm
by Elgan
im farily confused. not with .scr mohaa scripting.

but you could probably do it , well could do it with a 3rd part program

Posted: Thu Jun 23, 2005 11:58 pm
by lizardkid
Yes with a 3rd prog yes, but since i'm not up on sending packets with any language and i dont trust my compiler i was hoping to do it with this.

So how would i run a script that checks if i'm connected or connecting and reconnects if i'm not? also how would i run a script when not in a map?

Code: Select all

reconnecter:

while(isConnected != 1)
{
     connect xxx.xxx.xxx : xxxx
     wait 1
}

end

Posted: Fri Jun 24, 2005 1:07 am
by Elgan
the answe to all that is you cant,

Posted: Fri Jun 24, 2005 2:21 am
by lizardkid
*wails piteously*

Alright.

Maybe that can be Elg's new idea :D an autoconnect proggy :D

Posted: Fri Jun 24, 2005 2:24 am
by Elgan
ohh u mean rpoggy? i thoguth u meant in script.

using a program is easy., i did somethign like that a long time ago and wudnt be v.hard

i still wokrin on my admin mod idea.

Phil(sfx) also was wokrin on something to watch a server like u said just last night actualy.

guess it cud be addapted to connect u.

Posted: Fri Jun 24, 2005 4:05 am
by lizardkid
Well at first i meant script, but then you said it couldnt be done.

But i dont know all the basic Sendpacket stuff, heck i cant even get ShellExec to work :'(

Posted: Fri Jun 24, 2005 10:40 am
by Rookie One.pl
I've already pointed a solution to you. Qstat + a simple perl script or a little program and you've got a working solution.

Posted: Fri Jun 24, 2005 11:52 am
by Elgan
lizardkid wrote:Well at first i meant script, but then you said it couldnt be done.

But i dont know all the basic Sendpacket stuff, heck i cant even get ShellExec to work :'(
lol shellexec? didnt i say how?:S check the ms dev help;)

Posted: Fri Jun 24, 2005 8:04 pm
by lizardkid
I've already pointed a solution to you. Qstat + a simple perl script or a little program and you've got a working solution.
Tried Qstat rook, it didnt work. i tried three servers with MOH setting and it failed to read them.

Yes you told me how and i looked up at least three different things i had to do, but apparently the #import wont work and a couple other preprocessor things. i need a diff compiler is all.

Posted: Fri Jun 24, 2005 8:44 pm
by Rookie One.pl
Try qstat -gps SERVER_IP:PORT . Works for me.

What I meant was like:

Code: Select all

SYSTEM("qstat -gps " + serverip + ":" + serverport);
or something. Then parse the program's output.

Posted: Fri Jun 24, 2005 10:20 pm
by lizardkid
Did. Made a new shortcut and called it from cmdprompt and used this line:

<path> -gps 69.93.129.87:12203
<path> -gps mohpub.violentricity.net
<cmdlinepath> -gps 69.93.129.87:12203
<cmdlinepath> -gps mohpub.violentricity.net

Neither worked, as i recall it waited and tried bit, then gave me an error like
"server not responding"
or somesuch.

Posted: Sat Jun 25, 2005 10:37 am
by Rookie One.pl
Read the docs. I know it works, I've been experimenting with it a while ago.