Forum

ASSIST, AMERICA'S ARMY COMMUNITY - RELIVE THE GLORY DAYS OF AMERICA'S ARMY 2.5

Author Topic: Admin forceclassing with scripts  (Read 9218 times)

0 Members and 1 Guest are viewing this topic.

Offline ronski

Admin forceclassing with scripts
« on: Monday, September 07, 2015, 04:43:10 AM »
I have a few questions about executing script files in game. I have few scripts and I would be interested to create some too. 

1) Im running intel mac, am I able to run these scripts from my computer? To which folder I need to add my scripts? All I can find is ~/Library/Application Support/25Assist/ and that doesn't seem to be the right place. I know where to put these on windows.

2) Am I able to run scripts from the game-server if I upload them over there, so all serveradmins could use same scripts without downloading them to their own computer?

3) Forceclassing someone "randomly" seems to be happening by players id, is there a way to forceclass some decent slot? Is there a way to exec some uscript function which sorts out slots and returns id's of players from slots that I want to know? Some might already figure out what Im trying to search for..

Offline teddy_grizzly_bear

  • Used to be known as nobody
  • Administrator
  • Epic Poster
  • *
  • Posts: 5,765
  • what are you looking at?
    • View Profile
  • AA: teddy_grizzIy_bear
Re: Admin forceclassing with scripts
« Reply #1 on: Monday, September 07, 2015, 05:06:38 AM »
1)
While I don't have a mac, according to this, the address is correct. You should have an armyops folder in there where the AA files are.

2)
I'm unaware as to how this would work. As far as I know, most of the time people run the scripts from their own computer.

3)
Yes, all of it does happen through the player ID usually.
I'm pretty sure ELiZ made this work already. Try "afc random". I'm fairly certain I saw the code for this somewhere, but can't find it explicitly so I'm not sure if it works, ELiZ can comment I suppose.
If it doesn't this is a good suggestion:
If you place an executable in the System folder, it's the job of the assist client to make it disappear.

Making an app that would create random.txt regularly without being itself in the System folder is childplay. and average coder could do that in 5 minutes.
You can make an extremely easy piece of code that makes a new random.txt every now and then (a minute or two to make sure you get a new set every round) where everyone gets a random weapon. The only problem with this would be that it would still rely on the IDs and spam all the IDs which makes the server and/or client freeze for a second or so.
<image removed due to imgur stuff - probably for the best>

"Mathematics may be defined as the subject in which we never know what we are talking about, nor whether what we are saying is true." Bertrand Russell

Offline ronski

Re: Admin forceclassing with scripts
« Reply #2 on: Monday, September 07, 2015, 05:24:39 AM »
1)
While I don't have a mac, according to this, the address is correct. You should have an armyops folder in there where the AA files are.

2)
I'm unaware as to how this would work. As far as I know, most of the time people run the scripts from their own computer.

3)
Yes, all of it does happen through the player ID usually.
I'm pretty sure ELiZ made this work already. Try "afc random". I'm fairly certain I saw the code for this somewhere, but can't find it explicitly so I'm not sure if it works, ELiZ can comment I suppose.
If it doesn't this is a good suggestion:You can make an extremely easy piece of code that makes a new random.txt every now and then (a minute or two to make sure you get a new set every round) where everyone gets a random weapon. The only problem with this would be that it would still rely on the IDs and spam all the IDs which makes the server and/or client freeze for a second or so.

Thank you Teddy for all of these. So it's technically impossible to check out what player-id is on which slot?

Offline teddy_grizzly_bear

  • Used to be known as nobody
  • Administrator
  • Epic Poster
  • *
  • Posts: 5,765
  • what are you looking at?
    • View Profile
  • AA: teddy_grizzIy_bear
Re: Admin forceclassing with scripts
« Reply #3 on: Monday, September 07, 2015, 06:38:48 AM »
No, it's not technically impossible, I do believe the afc script does just that.
I'm not 100% sure whether the "afc random" works, though.
<image removed due to imgur stuff - probably for the best>

"Mathematics may be defined as the subject in which we never know what we are talking about, nor whether what we are saying is true." Bertrand Russell

Offline ronski

Re: Admin forceclassing with scripts
« Reply #4 on: Monday, September 07, 2015, 06:50:22 AM »
No, it's not technically impossible, I do believe the afc script does just that.
I'm not 100% sure whether the "afc random" works, though.
Im interested in to sneak out the player id's and force class random or certain weapon for everyone except one slot, which would be the VIP :) So technically I need the player id of VIP and just leave that id out of the loop :)

Offline Bart!

Re: Admin forceclassing with scripts
« Reply #5 on: Monday, September 07, 2015, 11:51:49 AM »
type playerlist in console

see their slot nr.
However, this slot nr changes for every new connection to the server
1st player on the server is slot 1
but when he reconnects, he will be slot2.
When another joins, he will be slot 3

If the server is running for weeks, you might be slot 7692...

Offline ronski

Re: Admin forceclassing with scripts
« Reply #6 on: Monday, September 07, 2015, 11:57:41 AM »
Let's try this way: Is it possible to read which player id is playing on certain slot. For example am I able to find player id of Vip automatically with uscript? Then I could iterate through all id's from 1 to 2000 and give all id's some weapon except the id who is playing as vip.

Offline teddy_grizzly_bear

  • Used to be known as nobody
  • Administrator
  • Epic Poster
  • *
  • Posts: 5,765
  • what are you looking at?
    • View Profile
  • AA: teddy_grizzIy_bear
Re: Admin forceclassing with scripts
« Reply #7 on: Monday, September 07, 2015, 15:58:31 PM »
I'm fairly certain it's possible with uscript, but I don't know how easy it would be and I'm not sure we have someone who would be willing to work on it.

Another possibility is that you know what the ID of the VIP is (having someone trusted on VIP who is always VIP) and just manually skip that ID (i.e make a program that I quoted about with this little addition).
« Last Edit: Monday, September 07, 2015, 16:02:28 PM by teddy_grizzly_bear »
<image removed due to imgur stuff - probably for the best>

"Mathematics may be defined as the subject in which we never know what we are talking about, nor whether what we are saying is true." Bertrand Russell

Offline ronski

Re: Admin forceclassing with scripts
« Reply #8 on: Monday, September 07, 2015, 16:30:28 PM »
I'm fairly certain it's possible with uscript, but I don't know how easy it would be and I'm not sure we have someone who would be willing to work on it.

Another possibility is that you know what the ID of the VIP is (having someone trusted on VIP who is always VIP) and just manually skip that ID (i.e make a program that I quoted about with this little addition).

Oooh thats clever! Shit that's worth of trying!

Offline teddy_grizzly_bear

  • Used to be known as nobody
  • Administrator
  • Epic Poster
  • *
  • Posts: 5,765
  • what are you looking at?
    • View Profile
  • AA: teddy_grizzIy_bear
Re: Admin forceclassing with scripts
« Reply #9 on: Monday, September 07, 2015, 18:05:06 PM »
And since you need to give manual input anyway, you could also add the minimum and maximum value for the ID to skip a lot of the lines the script would have. The max should be a couple dozens higher than the current, just in case, though.
<image removed due to imgur stuff - probably for the best>

"Mathematics may be defined as the subject in which we never know what we are talking about, nor whether what we are saying is true." Bertrand Russell

Offline ronski

Re: Admin forceclassing with scripts
« Reply #10 on: Tuesday, September 08, 2015, 06:54:47 AM »
I made a AFC Generator, that allows you to write totally random forceclass scripts or you can give every player the same weapon and if you want you can leave VIP out of the loop:

AFC Generator

To be able to use the script: type playerlist on console in game. Check out what is the lowest Player ID and if you don't want to force class VIP, check his PLayer ID too. The generator makes 2000 rows of afc rules. We need to know what is the lowest player ID on server, then we can generate enough rows starting from his ID, so it doesn't matter will server be restarted once a day / week / month / year etc. It still works. 

Now it's quite clumsy since it's made with .php, you need to generate the script in browser and copy paste the script to your .txt file. Im looking forward to do the same with javascript so all you'd need to do is save afc-generator.html file to armyops/System -folder, run the file in browser and the generator would update your .txt which includes generated scripts.

Offline teddy_grizzly_bear

  • Used to be known as nobody
  • Administrator
  • Epic Poster
  • *
  • Posts: 5,765
  • what are you looking at?
    • View Profile
  • AA: teddy_grizzIy_bear
Re: Admin forceclassing with scripts
« Reply #11 on: Tuesday, September 08, 2015, 07:07:11 AM »
You could do the same with any programming language, I imagine it's no more than a dozen or 2 lines if code.
<image removed due to imgur stuff - probably for the best>

"Mathematics may be defined as the subject in which we never know what we are talking about, nor whether what we are saying is true." Bertrand Russell

Offline ronski

Re: Admin forceclassing with scripts
« Reply #12 on: Tuesday, September 08, 2015, 07:13:03 AM »
You could do the same with any programming language, I imagine it's no more than a dozen or 2 lines if code.
Yea it could be done, internet-world is the one Im familiar with, so that's why I chose php to create the first version of it.

Offline teddy_grizzly_bear

  • Used to be known as nobody
  • Administrator
  • Epic Poster
  • *
  • Posts: 5,765
  • what are you looking at?
    • View Profile
  • AA: teddy_grizzIy_bear
Re: Admin forceclassing with scripts
« Reply #13 on: Tuesday, September 08, 2015, 08:01:22 AM »
A simple (or simple enough I suppose) python version that can be run from the terminal using python:
Code: [Select]
import random
classes=["r", "m", "m4a1auto","ar", "g","at4",
         "s82", "s24", "spr", "m9","b","sf","ak",
         "ak74su", "gp", "rpg","rpk", "svd","mos",
         "v", "sl", "ft", "rct", "d", "bdm"]

try:
vipID=int(float(raw_input("VIP ID\n")))
except ValueError:
vipID=0
to_fc=raw_input("Which class would you like?\n")
if to_fc in classes:
classes=[to_fc]
else:
print "Random of classes:", classes
try:
minID=int(float(raw_input("Minimum ID\n")))
except ValueError:
minID=0

writestr=""
for id in range(minID, minID+250):
    if id != vipID:
writestr+="admin forceclass "+str(id)+" "+classes[random.randint(0,len(classes)-1)]+"\n"
f=open("now.txt",'w')
f.write(writestr)
f.close()
<image removed due to imgur stuff - probably for the best>

"Mathematics may be defined as the subject in which we never know what we are talking about, nor whether what we are saying is true." Bertrand Russell

Offline ronski

Re: Admin forceclassing with scripts
« Reply #14 on: Tuesday, September 08, 2015, 08:20:24 AM »
A simple (or simple enough I suppose) python version that can be run from the terminal using python:
Code: [Select]
import random
classes=["r", "m", "m4a1auto","ar", "g","at4",
         "s82", "s24", "spr", "m9","b","sf","ak",
         "ak74su", "gp", "rpg","rpk", "svd","mos",
         "v", "sl", "ft", "rct", "d", "bdm"]

try:
vipID=int(float(raw_input("VIP ID\n")))
except ValueError:
vipID=0
to_fc=raw_input("Which class would you like?\n")
if to_fc in classes:
classes=[to_fc]
else:
print "Random of classes:", classes
try:
minID=int(float(raw_input("Minimum ID\n")))
except ValueError:
minID=0

writestr=""
for id in range(minID, minID+250):
    if id != vipID:
writestr+="admin forceclass "+str(id)+" "+classes[random.randint(0,len(classes)-1)]+"\n"
f=open("now.txt",'w')
f.write(writestr)
f.close()
Which is easier then, run python in terminal or just copy paste the code from browser to .txt file :)
Didn't think at all that writing to .txt file with javascript is not going to work. Javascript inside browser can't access to filesystem, it's a security risk. It could be done with Microsofts activeXobjects but since Im on mac, I hate even thinking about doing windows-only stuff :D

With HTML5 Blob object you'd be able to create downloadable .txt files, but it'd be still too clumsy. With PHP it would be so easy to open - read - write and save files, but to be able to handle .php you'd need to run apache on your computer..

 

Download Assist

×

Download Game Client

Important: Battletracker no longer exists. However, old Battletracker accounts may still work. You can create a new 25Assist account here

Download Server Manager