19 Ocak 2006, 14:36 | #1 | |
Çevrimdışı
Kullanıcıların profil bilgileri misafirlere kapatılmıştır.
IF Ticaret Sayısı: (0) | bs_autoassign Modulu beLki işinize yarar cd anope***** cd src/modules pico bs_autoassign.c anopenin ana dizininde ./Config make make install servicesi basdan baslatin sonra servicesden 1 bot yaratin /bs autoassign botnick yazin şifrelenen kanala o bot koruma botu olarak girsin her kanala girer Not: eger yuklenmemisse modul /os modlist de gostermiyorsa moduLu /os modload bs_autoassign yazin kolay gelsin * ChanServ sets mode: +r * ChanServ sets mode: +q Mafya * Sohbet ( Bu forumdaki linkleri ve resimleri görebilmek için en az 25 mesajınız olması gerekir. ) has joined #romeo * Sohbet sets mode: +ao Sohbet Sohbet -ChanServ- Lütfen Dikkat - -ChanServ- Kanal Şifrenizi Lütfen Kimse iLe Paylaşmayiniz - -ChanServ- KanaL Güvenligi için Kanal Modlari iLe Oynamayiniz - -ChanServ- Kanal ile ilgili Bir Sorununuz oLdugunda #Help Kanalina Giriniz Oparatorlerden Yardim aliniz - -ChanServ- Server Yönetimi KaRaYiP.CoM Sizlere HayirLi MuhabbetLer DiLer - #include "module.h" #define AUTHOR "SGR" #define VERSION "1.17" /* ----------------------------------------------------------- * Name: bs_autoassign * Author: SGR < Bu forumdaki linkleri ve resimleri görebilmek için en az 25 mesajınız olması gerekir. > * Date: 21/10/2003 * ----------------------------------------------------------- * Functions: m_bs_autoassign, do_autoassign * Limitations: None Known. * Tested: Ultimate(2.8.x), Unreal(3.2), Viagra. * ----------------------------------------------------------- * This modules has 6 configurable options * * **** <COMEPLETED> ****** * I will endeavour to add a command for services admins to be * able to change the default assigned bot 'on the fly' from * within IRC. I know this is easy todo but i am currently far * to god-dammed lazy to do it. * **** </COMEPLETED> ****** * * Thanks to rob for coding moduleGetLastBuffer() - the * critical function call in this module. * * Change Log: * * 1: Works. * * 2: Added some extra error checking. * * 3: Added 'set bot' and help systems. * * 4: Fixed some typo's. * * 5: Slapped Certus with some IRC slapping fish. * * 6: Added ModuleHELP - thanks rob Bu forumdaki linkleri ve resimleri görebilmek için en az 25 mesajınız olması gerekir. * * 7: Fixed a really freaky bug about changing the autoassign * bot - can't see a reason for how it was caused, but * fixed it nevertheless. There is only too possibilities: * Rob, - for playing with something or PhyPhyt for * playing with RAW. * * 8: Added an extra [totally unnecessary] return as technically * all functions that are not void should end in one. * * 9: Added Support for Anope-1.7.x (revision 370+) * * ----------------------------------------------------------- */ /* ---------------------------------------------------------------------- */ /* START OF CONFIGURATION BLOCK - please read the comments Bu forumdaki linkleri ve resimleri görebilmek için en az 25 mesajınız olması gerekir. */ /* ---------------------------------------------------------------------- */ /* [REQUIRED] If you are using Anope-1.7.x or later, leave this alone. * Otherwise change it to '#undef ANOPE17x' (no quotes). * * THIS IS IMPORTANT * */ #undef ANOPE17x /* Comment out '#define ForceBotJoinONReg' to make the bot obey BSMinUsers when the chan is registered. * i.e. if only one user is in the channel when it is registered the botserv bot will NOT join. If there * are 10 users however and BSMinUsers is set to 2, it will join automatically. If this is left, the bot * will join the channel regardless. */ #define ForceBotJoinONReg #define BotAutoAssignMsg1 "Kayit Ettiginiz Kanala Sistemimiz Tarafından Bir Kanal Koruma Botu Eklenmistir." #define BotAutoAssignMsg2 "Bu Bot Kanalda %d yada daha fazla kisi oldugunda Kanal'a girecektir Sifrelediginiz kanal %s", BSMinUsers, chan #define BotAutoAssignMsg3 "Eger Bu ücretsiz Bot u istemiyorsaniz Asagidaki Komutu Kullanabilirsiniz" #define BotAutoAssignMsg4 "Botu Cikatmak icin /msg %s UNASSIGN %s", s_BotServ, chan #define BotAutoAssignMsg5 "Bot Hakkinda Daha fazla Bilgi icin /msg %s HELP", s_BotServ #define BotAutoAssignMsg6 "Lütfen Dikkat" #define BotAutoAssignMsg7 "Kanal Şifrenizi Lütfen Kimse iLe Paylaşmayiniz" #define BotAutoAssignMsg8 "KanaL Güvenligi için Kanal Modlari iLe Oynamayiniz" #define BotAutoAssignMsg9 "Kanal ile ilgili Bir Sorununuz oLdugunda #Help Kanalina Giriniz Oparatorlerden Yardim aliniz" #define BotAutoAssignMsg10 "Server Yönetimi KaRaYiP.CoM Sizlere HayirLi MuhabbetLer DiLer" /* ---------------------------------------------------------------------- */ /* DO NOT EDIT BELOW THIS LINE UNLESS YOU KNOW WHAT YOU ARE DOING */ /* ---------------------------------------------------------------------- */ static int do_autoassign(User * u, char *chan, char *nick); int m_bs_autoassign(User *u); int m_bs_set_autoassign(User *u); void SGR_Module_Help_BOTSERV_AutoAssign(User *u); int SGR_Module_Help_BOTSERV_AutoAssign_FULL(User *u); char *botobe; char *chanB; int AnopeInit(int argc, char **argv) { int i, count = 0; BotInfo *bi; Command *c; alog("Loading module bs_autoassign.so"); alog("[bs_autoassign] And the bot that will be assigned to all newly registered chans is... *drum roll*"); /* Get the 1st none private bot available and set it as the default auto assign bot. */ for (i = 0; i < 256; i++) { for (bi = botlists[i]; bi; bi = bi->next) { if (!(bi->flags & BI_PRIVATE)) { count++; botobe = bi->nick; alog("[bs_autoassign] ::: %s ", botobe); break; } } /* if we have found the 1st don't bother looping them */ if (botobe != NULL) { break; } } /* carry on */ if (botobe == NULL) { alog("[bs_autoassign] ERROR: no non-oper only %s Bot's available.", s_BotServ); alog("[bs_autoassign] ERROR: NO NEW FEATURES AVAILABLE."); alog("[bs_autoassign] Auto-Unloading (Please create a public bot and re-load)"); return MOD_STOP; } c = createCommand("REGISTER", m_bs_autoassign, NULL,-1,-1,-1,-1,-1); moduleAddCommand(CHANSERV, c, MOD_TAIL); c = createCommand("AUTOASSIGN",m_bs_set_autoassign,is_ services_admin,-1,-1,-1,-1,-1); moduleAddCommand(BOTSERV, c, MOD_HEAD); moduleAddHelp(c,SGR_Module_Help_BOTSERV_AutoAssign _FULL); moduleSetBotHelp(SGR_Module_Help_BOTSERV_AutoAssig n); alog("[bs_autoassign] The following bot will be assigned to all newly registered channels: %s ", botobe); alog("[bs_autoassign] For more info see /msg %s HELP AUTOASSIGN", s_BotServ); alog("[bs_autoassign] Yayness!(tm) - MODULE LOADED AND ACTIVE"); moduleAddAuthor(AUTHOR); moduleAddVersion(VERSION); return MOD_CONT; } void AnopeFini(void) { free(botobe); free(chanB); alog("Unloading module bs_autoassign.so"); } void SGR_Module_Help_BOTSERV_AutoAssign(User *u) { if (is_services_admin(u)) { notice(s_BotServ,u->nick, " AUTOASSIGN Set the auto-assigned bot."); } return; } int SGR_Module_Help_BOTSERV_AutoAssign_FULL(User *u) { if (is_services_admin(u)) { notice(s_BotServ,u->nick, " "); notice(s_BotServ,u->nick, "Syntax: AUTOASSIGN [nick]"); notice(s_BotServ,u->nick, " "); notice(s_BotServ,u->nick, "Use this command without a nick to see the BotServ bot that is"); notice(s_BotServ,u->nick, "currently assigned to all newly registered channels. "); notice(s_BotServ,u->nick, "Should a nick argument be provided, the bot will be changed to"); notice(s_BotServ,u->nick, "the specified bot, poviding the bot exists and is not PRIVATE."); notice(s_BotServ,u->nick, " "); } return MOD_CONT; } int m_bs_set_autoassign(User *u) { char *setnewbot = strtok(NULL, " "); BotInfo *bi; if (!setnewbot) { notice(s_BotServ,u->nick, "The current auto-assgin bot is: %s", botobe); return MOD_CONT; } if ((bi = findbot(setnewbot))) { if (!(bi->flags & BI_PRIVATE)) { notice(s_BotServ,u->nick, "The current auto-assgin bot is now: %s", bi->nick); botobe = bi->nick; #ifndef ANOPE17x wallops(s_BotServ, "%s changed the AutoAssign bot to %s", u->nick, bi->nick); #else anope_cmd_global(s_BotServ, "%s changed the AutoAssign bot to %s", u->nick, bi->nick); #endif return MOD_CONT; } else { notice(s_BotServ,u->nick, "ERROR: %s is private.", setnewbot); return MOD_CONT; } } notice(s_BotServ,u->nick, "ERROR: %s is not on the bot list", setnewbot); return MOD_CONT; } int m_bs_autoassign(User *u) { char *getchan = moduleGetLastBuffer(); char *chanB = strtok(getchan, " "); ChannelInfo *ci; if (!getchan || !chanB) { return MOD_CONT; } /* No chan was registered - syntax error perhaps? */ if (!(ci = cs_findchan(chanB))) { return MOD_CONT; } /* Chan already has a Bot assigned. */ if (ci->bi) { return MOD_CONT; } /* peep is trying to reg a chan thats already registered or the chan is flagged NOBOT*/ if ((ci->botflags & BS_NOBOT) || (!check_access(u, ci, CA_ASSIGN) && !is_services_admin(u))) { return MOD_CONT; } alog("ChanServ: AUTO-ASSIGNING Bot to: %s [Bot: %s] [Founder: %s]", chanB, botobe, u->nick); if (do_autoassign(u, chanB, botobe)) { return MOD_CONT; } else { alog("ChanServ: ERROR AUTO-ASSIGNING Bot to: %s [Bot: %s] [Founder: %s]", chanB, botobe, u->nick); return MOD_CONT; } return MOD_CONT; } /* naffed from botserv.c and modified */ static int do_autoassign(User * u, char *chan, char *nick) { BotInfo *bi; ChannelInfo *ci; if (readonly) { return MOD_CONT; } else if (!chan || !nick) { return MOD_CONT; } else if (!(bi = findbot(nick))) { return MOD_CONT; } else if (bi->flags & BI_PRIVATE && !is_oper(u)) { return MOD_CONT; } else if (!(ci = cs_findchan(chan))) { return MOD_CONT; } else if (ci->flags & CI_VERBOTEN) { return MOD_CONT; } else if ((ci->bi) && (stricmp(ci->bi->nick, nick) == 0)) { return MOD_CONT; } else if ((ci->botflags & BS_NOBOT) || (!check_access(u, ci, CA_ASSIGN) && !is_services_admin(u))) { return MOD_CONT; } else { ci->bi = bi; bi->chancount++; #ifndef ForceBotJoinONReg if (ci->c && ci->c->usercount >= BSMinUsers) { bot_join(ci); } #else if (ci->c && ci->c->usercount >= BSMinUsers) { bot_join(ci); } else { bot_join(ci); send_cmd(ci->bi->nick, "PRIVMSG %s :I have been sucessfully assigned to this channel: %s.", ci->name, ci->name); send_cmd(ci->bi->nick, "PRIVMSG %s :I shall join when there are more than %d users in this channel", ci->name, BSMinUsers); send_cmd(ci->bi->nick, "PART %s", ci->name); } #endif #ifdef BotAutoAssignMsg1 notice(s_ChanServ, u->nick, BotAutoAssignMsg1); #endif #ifdef BotAutoAssignMsg2 notice(s_ChanServ, u->nick, BotAutoAssignMsg2); #endif #ifdef BotAutoAssignMsg3 notice(s_ChanServ, u->nick, BotAutoAssignMsg3); #endif #ifdef BotAutoAssignMsg4 notice(s_ChanServ, u->nick, BotAutoAssignMsg4); #endif #ifdef BotAutoAssignMsg5 notice(s_ChanServ, u->nick, BotAutoAssignMsg5); #endif #ifdef BotAutoAssignMsg6 notice(s_ChanServ, u->nick, BotAutoAssignMsg6); #endif #ifdef BotAutoAssignMsg7 notice(s_ChanServ, u->nick, BotAutoAssignMsg7); #endif #ifdef BotAutoAssignMsg8 notice(s_ChanServ, u->nick, BotAutoAssignMsg8); #endif #ifdef BotAutoAssignMsg9 notice(s_ChanServ, u->nick, BotAutoAssignMsg9); #endif #ifdef BotAutoAssignMsg10 notice(s_ChanServ, u->nick, BotAutoAssignMsg10); #endif notice_lang(s_BotServ, u, BOT_ASSIGN_ASSIGNED, bi->nick, ci->name); } return 1; } | |
|
Etiketler |
belki, bsautoassign, bs_autoassign, isinize, işinize, modulu, yarar |
Konuyu Toplam 1 Üye okuyor. (0 Kayıtlı üye ve 1 Misafir) | |
Seçenekler | |
Stil | |
| |
Benzer Konular | ||||
Konu | Konuyu Başlatan | Forum | Cevaplar | Son Mesaj |
webmasterler shellciler işinize yarar | Site_Polisi | Eggdrop, NeoStats, BNC | 2 | 10 Nisan 2010 21:38 |
Unreal3.2.3 unrealircd.conf editi ben yaptım oldu inşallah işinize yarar | online | Unreal IRCd | 15 | 26 Eylül 2008 12:22 |