![]() |
|
Tutorial Chatango Bot Tutorial - Printable Version +- Sinisterly (https://sinister.ly) +-- Forum: Coding (https://sinister.ly/Forum-Coding) +--- Forum: Python (https://sinister.ly/Forum-Python) +--- Thread: Tutorial Chatango Bot Tutorial (/Thread-Tutorial-Chatango-Bot-Tutorial) |
RE: [Python] Chatango Bot Tutorial - Anizeb - 10-14-2013 Just remembered this was a thing. Another merge? Really? Anyway, I wanted to add some small bot sources, just because. Automated PM Responder Code: wlist,ulist,msg=[""],[],""Brainfuck/HQ9+ Interpreter Bot Requires this BF interpreter and my HQ9+ interpreter. Both of these require the username and password to be filled in, at the bottom. Disclaimer, none of these files are particularly... well done. They're what you get when you haven't slept in days and decided it's a good idea to make something. :l You should really code for ZorkBot, any Pythonista would cry. And if anyone is interested, my ZorkBot is currently running here. (Anons should be enabled.) It's a bot. That lets you play Zork. Mindblowing, right? RE: Chatango Bot Tutorial - Anizeb - 01-02-2014 I'm actually not so sure about this, to be honest. I do know it's possible, but I've been unable to find out how. Sorry, friend. RE: Chatango Bot Tutorial - Equinox - 01-06-2014 (01-02-2014, 06:02 PM)Anizeb Wrote: I'm actually not so sure about this, to be honest. Who're you talkin' to, Zeb? RE: Chatango Bot Tutorial - BreShiE - 01-06-2014 Well as far as I can tell this is 100% his work. Well done OP, a thread worth some +rep. RE: Chatango Bot Tutorial - Anizeb - 01-06-2014 (01-06-2014, 06:43 AM)Duubz Wrote: Who're you talkin' to, Zeb? Someone had posted asking about how to style font in PMs, but their post was deleted for some reason. RE: Chatango Bot Tutorial - Equinox - 01-06-2014 (01-06-2014, 11:52 AM)Anizeb Wrote: Someone had posted asking about how to style font in PMs, but their post was deleted for some reason. Styling the font? onInit is useful. If it's not the initial message they want and just a specific one they should use HTML. EX: Code: room.message("shit here <font color=\"#ff0000\" size=\"9\" face=\"Arial\"> and </font> shit there", True)The "True" part is required. Else there's not really another way to do it unless you define it and use global declaration. RE: Chatango Bot Tutorial - Anizeb - 01-06-2014 Yes, yes, that's all well and good for normal messages. But in the PMs, neither HTML nor the normal font change method will work. I know it's possible, I just never learned how to do it. RE: Chatango Bot Tutorial - Equinox - 01-06-2014 (01-06-2014, 11:57 AM)Anizeb Wrote: Yes, yes, that's all well and good for normal messages. Like when a bot PMs someone? I myself can't exactly say. Maybe we should work on creating our own way : P So here's the breakdown of the idea. Code: def onInit(self):
self.setNameColor("FFFFFF")
self.setFontColor("FFFFFF")
self.setFontFace("Ariel")
self.setFontSize(11)Basically the idea under my belt is to use an "if-else" statement. Code: def onInit(self):
if self.pm.message:
self.setNameColor("FFFFFF")
self.setFontColor("FFFFFF")
self.setFontFace("Ariel")
self.setFontSize(11)
else:
self.setNameColor("FFFFFF")
self.setFontColor("FFFFFF")
self.setFontFace("Ariel")
self.setFontSize(9)That probably won't work, looking at it twice. I can't say for sure though. It's an idea from five seconds. I haven't tested it so... ye. RE: Chatango Bot Tutorial - Anizeb - 01-06-2014 There was a small flaw in ch.py that made it impossible to use certain colors in PMs. I've uploaded the hotfix for it, so all is well now. It'll now use the same font colors as normal. Might add in some stuff to fix up some other issues, but nobody get their hopes up. RE: Chatango Bot Tutorial - Equinox - 01-06-2014 (01-06-2014, 02:12 PM)Anizeb Wrote: There was a small flaw in ch.py that made it impossible to use certain colors in PMs. My hopes are high. Mainly because they just smoked some hope-ijuana. |