Auto-connect

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
lizardkid
Windows Zealot
Posts: 3672
Joined: Fri Mar 19, 2004 7:16 pm
Location: Helena MT

Auto-connect

Post 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?
Moderator

۞
Abyssus pro sapientia
Olympus pro Ignarus
۞

AND STUFF™ © 2006
User avatar
ViPER
General
Posts: 1058
Joined: Fri Jan 14, 2005 5:48 pm
Location: California
Contact:

Post 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.
Elgan
Site Admin
Posts: 890
Joined: Tue Apr 13, 2004 10:43 pm
Location: uk
Contact:

Post 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
lizardkid
Windows Zealot
Posts: 3672
Joined: Fri Mar 19, 2004 7:16 pm
Location: Helena MT

Post 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
Moderator

۞
Abyssus pro sapientia
Olympus pro Ignarus
۞

AND STUFF™ © 2006
Elgan
Site Admin
Posts: 890
Joined: Tue Apr 13, 2004 10:43 pm
Location: uk
Contact:

Post by Elgan »

the answe to all that is you cant,
lizardkid
Windows Zealot
Posts: 3672
Joined: Fri Mar 19, 2004 7:16 pm
Location: Helena MT

Post by lizardkid »

*wails piteously*

Alright.

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

۞
Abyssus pro sapientia
Olympus pro Ignarus
۞

AND STUFF™ © 2006
Elgan
Site Admin
Posts: 890
Joined: Tue Apr 13, 2004 10:43 pm
Location: uk
Contact:

Post 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.
lizardkid
Windows Zealot
Posts: 3672
Joined: Fri Mar 19, 2004 7:16 pm
Location: Helena MT

Post 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 :'(
Moderator

۞
Abyssus pro sapientia
Olympus pro Ignarus
۞

AND STUFF™ © 2006
Rookie One.pl
Site Admin
Posts: 2752
Joined: Fri Jan 31, 2003 7:49 pm
Location: Nowa Wies Tworoska, Poland
Contact:

Post 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.
Admin
Image
Image
Honour guide me.

here's my stuff - inequation.org | here's where I work - thefarm51.com
Elgan
Site Admin
Posts: 890
Joined: Tue Apr 13, 2004 10:43 pm
Location: uk
Contact:

Post 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;)
lizardkid
Windows Zealot
Posts: 3672
Joined: Fri Mar 19, 2004 7:16 pm
Location: Helena MT

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

۞
Abyssus pro sapientia
Olympus pro Ignarus
۞

AND STUFF™ © 2006
Rookie One.pl
Site Admin
Posts: 2752
Joined: Fri Jan 31, 2003 7:49 pm
Location: Nowa Wies Tworoska, Poland
Contact:

Post 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.
Admin
Image
Image
Honour guide me.

here's my stuff - inequation.org | here's where I work - thefarm51.com
lizardkid
Windows Zealot
Posts: 3672
Joined: Fri Mar 19, 2004 7:16 pm
Location: Helena MT

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

۞
Abyssus pro sapientia
Olympus pro Ignarus
۞

AND STUFF™ © 2006
Rookie One.pl
Site Admin
Posts: 2752
Joined: Fri Jan 31, 2003 7:49 pm
Location: Nowa Wies Tworoska, Poland
Contact:

Post by Rookie One.pl »

Read the docs. I know it works, I've been experimenting with it a while ago.
Admin
Image
Image
Honour guide me.

here's my stuff - inequation.org | here's where I work - thefarm51.com
Post Reply