|
Post by Qwerty on Dec 1, 2010 5:49:21 GMT
Naturally we must learn from our mistakes and include defusebomb.
|
|
|
Post by Fringe Pioneer on Dec 1, 2010 11:56:09 GMT
Well, this bomb doesn't wait for someone to post, this one gets the banning done and over with and ergo can be immediately undone with the unban command if necessary. In my code, it is equivalent to using the ban command and then following up with the delete command.
If you prefer a different, one-word command, you can suggest one...
|
|
|
Post by ~Memzak~ on Dec 1, 2010 12:28:25 GMT
Awww... Will it still say BOOM?
(It's a bit neater than the old bomb) I'll miss the boom if it doesn't say it.... :C
|
|
|
Post by Fringe Pioneer on Dec 1, 2010 14:05:07 GMT
Actually, the old bomb was much neater, but this one is much safer...
|
|
|
Post by Rabidbadger on Dec 1, 2010 18:31:57 GMT
Would someone explain to me again the purpose of the bomb?
|
|
|
Post by Fringe Pioneer on Dec 1, 2010 19:54:26 GMT
The bomb as I created it bans and deletes all posts by a user simultaneously, as might be most necessary during potential raids. Really, the ban and delete commands could simply be used separately in most cases without any problem...
Also, I think I finally have support for multiple usernames for commands, thereby allowing multiple people to be banned simultaneously, or unbanned simultaneously, et cetera. In order to do this, syntax has to be stricter. No longer can one say "Recruit, ban username and clean my room," or "Recruit, delete all posts that have been made by username," but must stick to the barebone "Recruit, ban username," or "Recruit, ban username and username." I think the tradeoff will be worthwhile, although I need to see if each of the commands already have error checking or if they will merely throw errors back at my code, in which case I need to explicitly indicate what to do in the event that a username doesn't exist...
|
|
|
Post by ~Memzak~ on Dec 2, 2010 14:09:07 GMT
Hehe, coding requires a lot of work and bug-fixing/clever thinking.
So, will you be adding Russian Roulette? (so we can start up the contest again?)
|
|
|
Post by Fringe Pioneer on Dec 2, 2010 14:34:47 GMT
I want to see if I can't get all of the moderator functions finished and successfully compiled/run first. For example, I just now realized that the library's ban command requires a chuser object, not just a mere string. I'm not sure how I will be able to make the command so that typing a username on chat to the bot will give the bot enough information to determine the chuser associated with the specified user, ergo allowing the bot to ban the person...
|
|
|
Post by disabled on Dec 2, 2010 14:43:08 GMT
Hmm, the chatango lib from pastebay seems to be gone. If you share the whole project with all libs, I'll have a look into it.
|
|
|
Post by Fringe Pioneer on Dec 2, 2010 15:09:11 GMT
Attached should be a zipped folder with the chatango.py file, containing all of the classes and functions necessary for the production of a bot, and ImperialRecruit.py, my attempt at a bot. I have made many rather drastic changes to my script, although the chatango.py file should be as I first received it. Also, I thank you in advance for helping me... Attachments:
|
|
|
Post by disabled on Dec 2, 2010 16:08:12 GMT
Holy syntax error Batman! To compare something, use == instead of = and every if and for needs a : at the end. I'll see if I can fix it... *edit* Also iirc, ''' is something like a command. So if you use else constructs, the block comments have to be after the else and not before it (or you have to intend them one level further). like this: if 1: print 1 else: '''the comment goes here''' print 2
|
|
|
Post by ~Memzak~ on Dec 2, 2010 16:26:43 GMT
Sigged.
I've never laughed so much before... xD
|
|
|
Post by disabled on Dec 2, 2010 17:07:57 GMT
This is what I came up with until now. Now Chatango wants me to not post for 10 minutes, so I had to stop. Banning should work, but I didn't get to test it. You can at least have a look at what I did. pastebin.com/5D2SN27UAnd Memzak: You don't happen to know the old Batman and Robin TV series? Robin used to say stuff like that all the time.
|
|
|
Post by disabled on Dec 2, 2010 23:21:07 GMT
Veers, I did some additional coding and bugfixing. Here is the result: pastebin.com/TQezcWQwI also tried to make it more error prone, so when a user is not found it does nothing instead of crashing. But I had to change your messages a bit, so right now no "and" is before the last username anymore. (With only one username that would have been awkward anyways, because it would have been "I banned and username".) If you still want to have it, push the names to a new array and go from there. I also made a few syntax improvements like from "hitList[len(hitlist) - 1]" simply to "hitList[-1]". Python has so many shortcuts, sometimes you gotta use them. And about your \W question, thats a regexp that matches all non-alphanumeric chars. (I think its [^a-zA-z0-9_]) Oh and one important issue that should be looked into, currently the trusted list is all-lowercase is it? And noPunctuation lowers the cases too. We probably shouldn't do that, because if I trust "Somedude", someone could log on as "someDude" and would be in the trusted list...
|
|
|
Post by ~Memzak~ on Dec 3, 2010 5:17:28 GMT
Yes, but I've never seen it posted on a forums before.
|
|
|
Post by Fringe Pioneer on Dec 5, 2010 23:29:59 GMT
Well, after QwertyuiopThePie reserved DBFBot and told me about it, I decided to test the bot. Apparently, I get the following response:
|
|
|
Post by disabled on Dec 5, 2010 23:51:41 GMT
That was the first error I corrected to. But later it turned out, that is actually a legal statement in python3. What Python version do you use? I corrected like 15 "errors" in the chatango lib just to find out it runs fine with python3 without modifications.
|
|
|
Post by Fringe Pioneer on Dec 6, 2010 0:14:12 GMT
Ah, I use Python 2.7...
|
|
|
Post by disabled on Dec 6, 2010 0:20:03 GMT
It was when I started to fix missing imports that I realized there is something wrong with the python version I used... Here is my latest version: pastebin.com/Q970qFLN
|
|
|
Post by disabled on Dec 7, 2010 9:26:58 GMT
I think I fixed banning. Plus all the other fixes from yesterday, plus a few other tiny improvements. pastebin.com/X6UMiA2MFunny fact: If I ban a testuser, I can't speak on any user from the same IP. But the unbanning commands still go through. So if you ban a testuser from your IP via the bot you can't unban him from the same IP, because you can't talk to the channel anymore. But unbanning from the Flash chat still works. Unbanning was never implemented in the chatango.py in the first place. But I was able to snoop the commands from the flash chat. I wasn't able to test it with the bot, because of the funny fact above. As nobody else is on the chat, I can't try it - please do. pastebin.com/px3PZWgAThe bot should be up and running.
|
|
|
Post by Fringe Pioneer on Dec 8, 2010 21:36:26 GMT
I have done a little bit of testing, adding "room.say(chuser[0].displayname)" immediately after "chusers.append(chuser[0])" within the findChusers() method to post the display name of the chuser object that was retrieved from a display name (and ergo see that a chuser object was indeed successfully obtained), and yet I still can't get the bot to perform any of its commands. I'm starting to think that there is a problem with chatango.py, but you managed to get the bot to work, meaning that both chatango.py and ModBot.py worked at one point. Assuming no modifications to chatango.py, that means my unmodified version straight from Megaloler and Guyfox should be functional.
In short, I can't seem to determine the problem with incompetence in executing the moderator methods...
|
|
|
Post by disabled on Dec 8, 2010 23:35:57 GMT
The chatango.py you have definately doesn't support unbanning. I also did some changes to the ban command, but I think it should work without them. The problem was, the find_user function returned chusers with only their username set and the ban function needs more. I think I fixed it. I also added an interactive console, but you can ignore that if you want. pastebin.com/vLc9YSkQHere is my chatango.py: pastebin.com/Zrw2PtnH
|
|
|
Post by Fringe Pioneer on Dec 10, 2010 4:11:27 GMT
I fixed the delete command in chatango.py, placed the commands and the help methods in different files, and now the bot works! ModBot.py - pastebin.com/Zw4XhG3k (expires at 2:59:59 GMT of the next day) chatango2.py - pastebin.com/dtYgXybN (expires at 3:03:47 GMT of the next day) modCmd.py - pastebin.com/VcNSEjjy (expires at 3:07:09 GMT of the next day) botMthd.py - pastebin.com/LY00QxCt (expires at 3:08:38 GMT of the next day)
|
|
|
Post by ~Memzak~ on Dec 10, 2010 10:45:15 GMT
Yay!
I saw him on chat a while ago. Does he only have 5 commands?
Are you planning on adding more?
|
|
|
Post by speedyclock on Jan 8, 2011 21:32:15 GMT
Fridgebot source page posted by GuyFox is outdated.
But i did get it from mega Loler.
Guy fox is also planning to make a comeback with a new bot.
|
|
|
Post by Fringe Pioneer on Jan 9, 2011 4:21:15 GMT
If I'm correct, Pickleman and someone else are working on Java language bots. I hope I can eventually get source code from them so I can see how to make the bot in Java...
|
|
|
Post by speedyclock on Jan 9, 2011 18:35:28 GMT
I'm much more comfortable with non white space sensitive languages. Coding in Python when you get passed the 5000+ Line mark can be a headache. Especially if you have a ton of loops and if commands!
|
|
|
Post by Elmach on Jan 10, 2011 2:57:16 GMT
If I'm correct, Pickleman and someone else are working on Java language bots. I hope I can eventually get source code from them so I can see how to make the bot in Java... I hope I can get source code for Java chatango bots. It will be a lot easier. It would be even easier if someone made it for C++. Would being the key word. I forgot how to program in C++ now. Grr...
|
|
|
Post by imrunningforcash on Mar 16, 2011 23:45:37 GMT
Well, after QwertyuiopThePie reserved DBFBot and told me about it, I decided to test the bot. Apparently, I get the following response:
|
|
|
Post by Fringe Pioneer on Mar 22, 2011 4:31:53 GMT
That was the first error I corrected to. But later it turned out, that is actually a legal statement in python3. What Python version do you use? I corrected like 15 "errors" in the chatango lib just to find out it runs fine with python3 without modifications. That means "use Python 3, not Python 2"...
|
|