ULX

Author Topic: Script for bots to autospawn based on amount of players?  (Read 5834 times)

0 Members and 1 Guest are viewing this topic.

Offline SuperGamerKai

  • Newbie
  • *
  • Posts: 5
  • Karma: 0
  • AKA Th3BlueRose on pretty much everywhere else
    • Social Profiles
Script for bots to autospawn based on amount of players?
« on: September 03, 2019, 01:19:13 AM »
First time posting on this forum, so please go easy on me!

I'm not having any particular issues, rather I am just wondering if there is a script or some way to make it so when there's a certain amount of people on a server, it'd spawn a certain amount of bots and as the server fills up with actual players, it'd kick bots to empty slots for actual players. I'm currently running a TTT server and for some reason, the server only shows up on the browser if there's at least 2-3 players on at the time. Legacy shows the server regardless of how many, but otherwise people do not find the server very often, though maybe it's because the name is a tad uncommon.

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: Script for bots to autospawn based on amount of players?
« Reply #1 on: September 03, 2019, 01:25:08 PM »
There may be something 'out there', but, not here in Ulysses world.
I can say, from what I remember of my first days of Lua (and Gmod's version of it), that this would be a good learning case.
Different ways to do it, but basically, use player spawn hook, count players, add or remove matching bots, add to teams.
There's probably specific teams you may want to move bots to.

Do you know lua at all? Any other scripting languages?
We're not the type to do it outright for those here much, but love helping someone if they have basic attempts.
(If you have one, could move this to dev corner section of the forum)
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline SuperGamerKai

  • Newbie
  • *
  • Posts: 5
  • Karma: 0
  • AKA Th3BlueRose on pretty much everywhere else
    • Social Profiles
Re: Script for bots to autospawn based on amount of players?
« Reply #2 on: September 04, 2019, 01:00:15 PM »
There may be something 'out there', but, not here in Ulysses world.
I can say, from what I remember of my first days of Lua (and Gmod's version of it), that this would be a good learning case.
Different ways to do it, but basically, use player spawn hook, count players, add or remove matching bots, add to teams.
There's probably specific teams you may want to move bots to.

Do you know lua at all? Any other scripting languages?
We're not the type to do it outright for those here much, but love helping someone if they have basic attempts.
(If you have one, could move this to dev corner section of the forum)

I know very little lua/coding from making my server, but that's about it haha. Unfortunately coding is not my forte so if I need to code something for the server I usually rely on the internet or friends

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: Script for bots to autospawn based on amount of players?
« Reply #3 on: September 04, 2019, 02:46:16 PM »
I found this in less than 5 minutes of searching.
https://github.com/Exho1/TTT-Bots
"TTT autospawn bot" was my google search. It linked to (now dead) facepunch release "TTT The Bot project"
I then searched for that, and found that link.
Might be same as some of the readme matches google cached facepunch.
The last update was 4 years ago. That's a long time in Gmod. Something might be broke.

If you spent a bit more time searching, perhaps you could find more.
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline SuperGamerKai

  • Newbie
  • *
  • Posts: 5
  • Karma: 0
  • AKA Th3BlueRose on pretty much everywhere else
    • Social Profiles
Re: Script for bots to autospawn based on amount of players?
« Reply #4 on: September 06, 2019, 05:30:02 AM »
I found this in less than 5 minutes of searching.
https://github.com/Exho1/TTT-Bots
"TTT autospawn bot" was my google search. It linked to (now dead) facepunch release "TTT The Bot project"
I then searched for that, and found that link.
Might be same as some of the readme matches google cached facepunch.
The last update was 4 years ago. That's a long time in Gmod. Something might be broke.

If you spent a bit more time searching, perhaps you could find more.

Interesting. I'll take a look and see if the script still works, I highly doubt it, but maybe I can tweak it a bit with some friends. If not I'll just resort to google searches.
Thanks for helping me out!

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: Script for bots to autospawn based on amount of players?
« Reply #5 on: September 06, 2019, 01:48:06 PM »
You and your friends are welcome to ask thought-out questions regarding bits of code, attempts, and errors in the Developers corner of the forum.
You may also get (slightly) more responsive help from our Discord (see our news release invite).
There's a #lua-questions channel there.

Oh, and I never did acknowledge 'first time' in your first post.
Welcome to Ulysses Mod community.
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming