Author Topic: open source gather bot  (Read 10476 times)

0 Members and 1 Guest are viewing this topic.

Offline mar77a

  • Global Moderator
  • Veteran
  • *****
  • Posts: 1295
  • mad
    • random stuffs
open source gather bot
« on: November 26, 2007, 09:43:16 am »
I know it's not great but it works. It's still missing some features, such as voiced gathers and other gadgets but the basics are there and fully functional. The dir index has all the files im working on; some files may be for testing-only purposes, some maybe be useless. Kudos to ramirez for his soldatinfo.h and the help with it.

* FILES *
« Last Edit: November 26, 2007, 09:45:13 am by mar77a »

Offline spkka

  • Camper
  • ***
  • Posts: 469
Re: open source gather bot
« Reply #1 on: November 26, 2007, 11:57:52 am »
:o kewl for releasing it!

Offline Jaska

  • Major(1)
  • Posts: 21
  • Little girls with guns, awww....
    • FinBits
Re: open source gather bot
« Reply #2 on: November 27, 2007, 10:05:27 am »
Thank you so much, this is what my users needs :)

Offline ramirez

  • Retired Soldat Developer
  • Camper
  • ******
  • Posts: 394
    • Soldat Central
Re: open source gather bot
« Reply #3 on: November 27, 2007, 10:39:59 am »
Good shit. Works well in action, I've witnessed it!

Offline Jaska

  • Major(1)
  • Posts: 21
  • Little girls with guns, awww....
    • FinBits
Re: open source gather bot
« Reply #4 on: November 27, 2007, 11:11:25 am »
Hm, tried compiling it on my ubuntu server but it doesnt give any output, well it did gave me an error before I installed mysql++ libs

running ./build.sh should do the compiling or am doing sometgins wrong :S

sorry about this...

Offline mar77a

  • Global Moderator
  • Veteran
  • *****
  • Posts: 1295
  • mad
    • random stuffs
Re: open source gather bot
« Reply #5 on: November 27, 2007, 11:23:28 am »
You don't really need the mysql lib (yet?), so you can use
Code: [Select]
g++ gclass.cpp -o gclass to compile it.

Offline Jaska

  • Major(1)
  • Posts: 21
  • Little girls with guns, awww....
    • FinBits
Re: open source gather bot
« Reply #6 on: November 27, 2007, 11:58:25 am »
Thanks! got it compiled and working THANK YOU SO MUCH!

Offline mar77a

  • Global Moderator
  • Veteran
  • *****
  • Posts: 1295
  • mad
    • random stuffs
Re: open source gather bot
« Reply #7 on: November 27, 2007, 12:01:52 pm »
No problem, where are you using it?

Offline Jaska

  • Major(1)
  • Posts: 21
  • Little girls with guns, awww....
    • FinBits
Re: open source gather bot
« Reply #8 on: November 27, 2007, 02:48:45 pm »
Found a bug. Setting the server
//number of servers:
const unsigned short int    TOTAL = 1;

Commanding bot !sinfo2 or 3 or 4 will make the bot crash, but if its on background it will use your cpu 100% without responding

terminate called after throwing an instance of 'std::out_of_range'
  what():  vector<bool>::_M_range_check
Aborted (core dumped)

Also, I cant get the irc admin using Q-auth to work, or is it supposed to work yet?

Offline mar77a

  • Global Moderator
  • Veteran
  • *****
  • Posts: 1295
  • mad
    • random stuffs
Re: open source gather bot
« Reply #9 on: November 27, 2007, 03:22:04 pm »
Well, you need to tweak it up a bit. you should remove the useless !sinfo commands, as well as others which are server dependant (!playing, etc).

The Q admin thing requires the guy to be +x and authed. Do //mode $me +x to set it and be able to have the bot reckon you as admin.

Offline Rai-Dei

  • Flagrunner
  • ****
  • Posts: 520
Re: open source gather bot
« Reply #10 on: November 27, 2007, 09:19:21 pm »
Great to know you finally released Elizabeth.

Offline Dizzy So 1337

  • Soldier
  • **
  • Posts: 246
Re: open source gather bot
« Reply #11 on: December 02, 2007, 05:51:32 pm »
I r teh happiest boy in all of Soldat today.
xfire - todhostetler
"There's nothing I wouldn't do to win. But I never hurt anyone except to stick a dogskull on a stake."

Offline jrgp

  • Administrator
  • Flamebow Warrior
  • *****
  • Posts: 5037
Re: open source gather bot
« Reply #12 on: December 02, 2007, 11:49:42 pm »
Well, you need to tweak it up a bit. you should remove the useless !sinfo commands, as well as others which are server dependent (!playing, etc).

@Mar77a:
I am only using it to control one server and removed the !playing2/3/4 and the !sinfo2/3/4 commands from the cmds.txt. This didn't do anything whatsoever. running !playing2 in the channel still kills it. Also, once ran, the cmds.txt file is emptied. Is it supposed to do that?

Could you write some manual or readme or faq?
There are other worlds than these

Offline mar77a

  • Global Moderator
  • Veteran
  • *****
  • Posts: 1295
  • mad
    • random stuffs
Re: open source gather bot
« Reply #13 on: December 03, 2007, 07:45:03 am »
The cmnds.txt file is auto-generated each time you run the bot. You shouldn't modify this file, unless your host doesn't have ruby. Make sure you have the commands.rb file in the same directory as the gather bot and that it has +x permissions. If you don't have ruby installed in your host, you can write your own cmds.txt (which is dumped on the irc channel when !help is triggered). Also, make sure you comment or remove the line
Code: [Select]
system("./commands.rb > cmds.txt") (once again, if you don't have ruby).

When I said, 'remove the commands' I meant from the bot itself. Remove the part of the conditional that processes them, until the next command, for example:

Code: [Select]
        }else if(split.size() >= 3 && split[3] == ":!playing" && halted==false){
server[0].fetch_refresh();
irc.msg_chan(string("Server0: "+server[0].playing_info()));
        }else if(split.size() >= 3 && split[3] == ":!playing2" && halted==false){
server[1].fetch_refresh();
            irc.msg_chan(string("Server1: "+server[1].playing_info()));
        }else if(split.size() >= 3 && split[3] == ":!playing3" && halted==false){
server[2].fetch_refresh();
            irc.msg_chan(string("Server2: "+server[2].playing_info()));
        }else if(split.size() >= 3 && split[3] == ":!playing4" && halted==false){
server[3].fetch_refresh();
            irc.msg_chan(string("Server3: "+server[3].playing_info()));

-becomes-

Code: [Select]
        }else if(split.size() >= 3 && split[3] == ":!playing" && halted==false){
server[0].fetch_refresh();
irc.msg_chan(string("Server0: "+server[0].playing_info()));

Offline Iq Unlimited

  • Flagrunner
  • ****
  • Posts: 864
  • mr. foobar2000
Re: open source gather bot
« Reply #14 on: December 03, 2007, 09:42:36 am »
@jrgp I accidently deleted the wrong .rb file. That's why the cmds.txt file got emptied.

Offline Leo

  • Soldat Beta Team
  • Veteran
  • ******
  • Posts: 1011
Re: open source gather bot
« Reply #15 on: December 17, 2007, 07:29:10 am »
I get an error:
In file included from gclass.cpp:3:
gclass.h:22: warning: converting of negative value `-0x000000003' to `short unsigned int'

Offline mar77a

  • Global Moderator
  • Veteran
  • *****
  • Posts: 1295
  • mad
    • random stuffs
Re: open source gather bot
« Reply #16 on: December 17, 2007, 07:41:50 am »
Fixed, just a typo when declaring the variable type. If you don't want to re-download gclass.h, you can change line 22 to:
Code: [Select]
const signed short int ERR_GATHER_RUNNING = -3;

Offline Leo

  • Soldat Beta Team
  • Veteran
  • ******
  • Posts: 1011
Re: open source gather bot
« Reply #17 on: December 17, 2007, 08:05:54 am »
Ok thanks, it worked now. But it got G-lined by qnet :O

Offline mar77a

  • Global Moderator
  • Veteran
  • *****
  • Posts: 1295
  • mad
    • random stuffs
Re: open source gather bot
« Reply #18 on: December 17, 2007, 09:48:34 am »
You can't usually have more than two simultaneous connections from the same user (ident) to Quakenet, when you're using a trust for a box.

Offline chrisgbk

  • Inactive Staff
  • Veteran
  • *****
  • Posts: 1739
Re: open source gather bot
« Reply #19 on: December 17, 2007, 12:38:07 pm »
You can't usually have more than two simultaneous connections from the same user (ident) to Quakenet, when you're using a trust for a box.

You also can't have more than 5 simultaneous connections from a given IP address. (Unless you have a trust)
« Last Edit: December 17, 2007, 12:45:41 pm by chrisgbk »