Planetarion Forums

Planetarion Forums (https://pirate.planetarion.com/index.php)
-   Planetarion Discussions (https://pirate.planetarion.com/forumdisplay.php?f=4)
-   -   Galaxy DC Bot (https://pirate.planetarion.com/showthread.php?t=197400)

Devlin 29 Jan 2009 18:48

Galaxy DC Bot
 
I know there are various bots capable of doing this, but I decided to take on the challenge of writing my own. I've decided to put it here for anyone who wants it incase you don't trust alliance bots to not spy on your gal. Plus, I don't see the need in being stingy with it anyways. I've tested it out with 60 calls and it didn't flood out, but I'm not sure how many more than that it can handle without flooding.

I ask only that you don't remove the header at the top that gives me credit for the work. Also, feel free to edit the code to improve or add to it, but if you do so please upload it to a new pastebin and put the code here for others to enjoy your modifications. The bot is fairly basic right now, because I didn't feel like investing too much time in a bot for what will be my last round of PA under this name or any other. It doesn't parse galaxy status pastes, so you have to add calls manually. It also doesn't keep track of ETAs. If anyone feels like undertaking these tasks please feel free, but as mentioned above please share your work with the rest of the community as I have.

It's a mIRC bot, so to install it just press ALT+R in mirc and paste all of the code into the remotes window. Verify you have remotes turned on by doing the command [/remotes on] in a channel or status window. Finally, do the command [/set %chan #yourgalchannel] so the bot knows where to accept commands from After that you can type !help for a list of commands.

Here's the help file so you can get a preview of what it does before trying it:

To add a defcall (arguments in red brackets are required): !addcall [planet #] [attacker coords] [attacker race] (shipclass) (status) (bcalc)
To delete a defcall: !delcall [id#]
To edit a defcall: !editcall [planet|coords|race|class|status|bcalc] [new info]
To list calls: !calls
To reset the defcall system: !resetcalls

mIRC Galaxy DC Bot: http://pastebin.com/m3dabb5bc

PS: Sorry, I have a bad habit of not commenting my code :p

Also, here is my inc reporting script. It works off slash commands rather that functioning as a bot though it wouldnt be hard to turn it into one: http://pastebin.com/m40619adf

DigitalZero 30 Jan 2009 21:25

Re: Galaxy DC Bot
 
Devlin! #1 rule in programming is to COMMENT EVERYTHING :)

Devlin 31 Jan 2009 22:25

Re: Galaxy DC Bot
 
Quote:

Originally Posted by DigitalZero (Post 3164078)
Devlin! #1 rule in programming is to COMMENT EVERYTHING :)

Heh well I didnt plan on having other people looking at the code when I wrote it. It's all very self explanatory to me. But honestly, if you don't understand what the code does you should give up any notion of editing it and just stick to copying and pasting it :p

ellonweb 1 Feb 2009 15:44

Re: Galaxy DC Bot
 
Quote:

Originally Posted by DigitalZero (Post 3164078)
Devlin! #1 rule in programming is to COMMENT EVERYTHING :)

Good code shouldn't need comments.


All times are GMT +1. The time now is 02:31.

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2002 - 2018